/* ==========================================================================
   LUMEN · panels — login sheet, admin console, uploader, toasts, dialogs
   ========================================================================== */

/* --------------------------------------------------------------------------
   modal scaffold
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 5, 9, 0.42);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  backdrop-filter: blur(30px) saturate(125%);
  animation: overlay-in var(--dur-3) var(--ease-out);
}
.modal__panel {
  position: relative;
  width: min(440px, 100%);
  padding: 30px 28px 26px;
  border-radius: clamp(28px, 3vw, 44px);
  corner-shape: squircle;
  background: rgba(255, 255, 255, var(--glass-alpha, 0.05));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(185%);
  backdrop-filter: blur(var(--glass-blur)) saturate(185%);
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: modal-in var(--dur-4) var(--ease-spring);
  overflow: hidden;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}
.modal__panel::after {
  /* a soft light pooling at the top of the glass */
  content: "";
  position: absolute;
  inset: -40% 10% auto;
  height: 70%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 255, 255, 0.14), transparent 70%);
  pointer-events: none;
}
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}
.modal__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 18px;
  corner-shape: squircle;
  color: #fff;
  background: conic-gradient(
    from 200deg,
    hsl(var(--accent-h) 100% 66%),
    hsl(calc(var(--accent-h) + 48) 100% 70%),
    hsl(calc(var(--accent-h) - 42) 100% 62%),
    hsl(var(--accent-h) 100% 66%)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 8px rgba(0, 0, 0, 0.25), 0 14px 30px -12px var(--accent-glow);
}
.modal__icon .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.modal h2 {
  font-size: 23px;
  font-weight: 660;
  letter-spacing: -0.02em;
}
.modal p.sub {
  margin-top: 6px;
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.6;
}
.modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}
.modal__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}
.modal__hint .icon {
  width: 13px;
  height: 13px;
  color: hsl(var(--accent-h) 100% 74%);
}
.modal__hint b {
  color: var(--text-1);
  font-weight: 620;
  font-family: var(--font-mono);
  font-size: 11px;
}
.formerror {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: #ff9b93;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height var(--dur-3) var(--ease-out), opacity var(--dur-2);
}
.formerror.is-on {
  max-height: 40px;
  opacity: 1;
}
.formerror .icon {
  width: 13px;
  height: 13px;
}
.modal__panel.is-shaking {
  animation: shake 420ms var(--ease-out);
}
@keyframes shake {
  20% {
    transform: translateX(-9px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(3px);
  }
}
.modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  font-size: 11px;
  color: var(--text-4);
}

/* dialog (confirm / rename) ------------------------------------------------- */
.dialog {
  width: min(400px, 100%);
  padding: 24px;
}
.dialog__actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.dialog__actions .btn {
  flex: 1;
}

/* --------------------------------------------------------------------------
   toast
   -------------------------------------------------------------------------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  transform: translateX(-50%);
  pointer-events: none;
  width: min(440px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 10px 16px 10px 12px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 540;
  color: var(--text-1);
  background: rgba(22, 22, 30, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  animation: toast-in var(--dur-3) var(--ease-spring);
  pointer-events: auto;
}
.toast.is-out {
  animation: toast-out var(--dur-2) var(--ease-out) forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.toast__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
  color: #0b1a12;
  background: #6ee7a8;
}
.toast__icon .icon {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}
.toast--info .toast__icon {
  background: hsl(var(--accent-h) 100% 70%);
  color: #06121f;
}
.toast--warn .toast__icon {
  background: #ffce6b;
  color: #221600;
}
.toast--error .toast__icon {
  background: #ff8b83;
  color: #240504;
}

/* ==========================================================================
   admin console
   ========================================================================== */
.console {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-top: 14px;
  animation: view-in var(--dur-4) var(--ease-out);
  /* clear glass has no body to hold the type, so a soft text shadow does the
     legibility work without re-introducing a fog */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: clamp(24px, 2.4vw, 38px);
  corner-shape: squircle;
}
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar__avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  corner-shape: squircle;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(
    150deg,
    hsl(var(--accent-h) 100% 62%),
    hsl(calc(var(--accent-h) + 60) 95% 58%)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 16px -8px var(--accent-glow);
}
.sidebar__who {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.sidebar__who b {
  font-size: var(--fs-xs);
  font-weight: 620;
}
.sidebar__who span {
  font-size: 10px;
  color: var(--text-4);
}
.snav {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 540;
  color: var(--text-3);
  transition: background var(--dur-2), color var(--dur-2);
  text-align: left;
  width: 100%;
}
.snav .icon {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}
.snav:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-1);
}
.snav[aria-current="page"] {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.snav[aria-current="page"] .icon {
  opacity: 1;
  color: hsl(var(--accent-h) 100% 74%);
}
.sidebar__foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel {
  padding: 22px;
  border-radius: clamp(24px, 2.6vw, 40px);
  corner-shape: squircle;
  min-height: 420px;
}

/* console surfaces use the same clear glass as every other pane — one flat
   material, no dark body, no perimeter border */
.console .sidebar.glass,
.console .panel.glass {
  background: rgba(255, 255, 255, var(--glass-alpha, 0.05));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}
.panel__head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.panel__head h2 {
  font-size: 20px;
  font-weight: 660;
  letter-spacing: -0.02em;
}
.panel__head p {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.panel__head-actions {
  display: flex;
  gap: 7px;
  margin-left: auto;
}
.panel__section {
  margin-top: 26px;
}
.panel__section > h3 {
  font-size: var(--fs-micro);
  font-weight: 640;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 12px;
}

/* stat cards ------------------------------------------------------------ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px;
}
.statcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 20px 17px;
  border-radius: clamp(20px, 1.8vw, 30px);
  corner-shape: squircle;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.04)
  );
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.statcard::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--accent-h) 100% 62% / 0.22), transparent 70%);
}
.statcard__k {
  font-size: var(--fs-micro);
  font-weight: 580;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.statcard__v {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 27px;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.16;
  font-variant-numeric: tabular-nums;
}
.statcard__v small {
  font-size: 12px;
  font-weight: 560;
  color: var(--text-3);
  letter-spacing: 0;
}
.statcard__d {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: #9ff0c0;
}
.statcard__d .icon {
  width: 11px;
  height: 11px;
}
.statcard__d.is-down {
  color: #ffb3ad;
}

/* distribution bars ----------------------------------------------------- */
.bars {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.bar {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-xs);
}
.bar__k {
  color: var(--text-3);
}
.bar__track {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.bar__fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    hsl(var(--accent-h) 100% 62% / 0.9),
    hsl(calc(var(--accent-h) + 50) 100% 68% / 0.9)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: width var(--dur-4) var(--ease-out);
}
.bar__v {
  text-align: right;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

/* storage ring ---------------------------------------------------------- */
.storage {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border-radius: clamp(20px, 1.8vw, 30px);
  corner-shape: squircle;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ring {
  --p: 42;
  position: relative;
  width: 82px;
  height: 82px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(
    hsl(var(--accent-h) 100% 64%) calc(var(--p) * 1%),
    rgba(255, 255, 255, 0.1) 0
  );
  display: grid;
  place-items: center;
}
.ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: rgba(18, 18, 24, 0.92);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}
.ring b {
  position: relative;
  font-size: 15px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}
.storage__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.storage__meta b {
  color: var(--text-1);
  font-size: var(--fs-h3);
  font-weight: 640;
  letter-spacing: -0.01em;
}

/* content table --------------------------------------------------------- */
.rowlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rowitem {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 104px 84px 76px auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background var(--dur-2), border-color var(--dur-2);
  font-size: var(--fs-xs);
}
.rowitem:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.12);
}
.rowitem__thumb {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  corner-shape: squircle;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.3);
}
.rowitem__main {
  min-width: 0;
}
.rowitem__name {
  font-size: var(--fs-sm);
  font-weight: 560;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rowitem__sub {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 10.5px;
  color: var(--text-4);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.rowitem__cell {
  color: var(--text-3);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rowitem__actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex: none;
}
.rowitem__actions .icon-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border-color: transparent;
}
.rowitem__actions .icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* appearance controls --------------------------------------------------- */
.control {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 18px;
  border-radius: clamp(18px, 1.6vw, 26px);
  corner-shape: squircle;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.control__row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.control__label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.control__label b {
  font-size: var(--fs-xs);
  font-weight: 580;
  color: var(--text-1);
}
.control__label span {
  font-size: 10.5px;
  color: var(--text-4);
}
.control__value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.controlgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 9px;
}
.wp {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  corner-shape: squircle;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
.wp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-3) var(--ease-out);
}
/* hover must not move the element: the hit-box would leave the cursor */
.wp:hover {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.wp:hover img {
  transform: scale(1.06);
}
.wp[aria-pressed="true"] {
  border-color: hsl(var(--accent-h) 100% 74%);
  box-shadow: 0 0 0 2px hsl(var(--accent-h) 100% 62% / 0.6),
    0 12px 26px -12px var(--accent-glow);
}
.wp__check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: hsl(var(--accent-h) 100% 60%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-spring);
}
.wp[aria-pressed="true"] .wp__check {
  opacity: 1;
  transform: none;
}
.wp__check .icon {
  width: 11px;
  height: 11px;
  stroke-width: 3;
}
.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform var(--dur-2) var(--ease-spring), border-color var(--dur-2);
}
.swatch:hover {
  transform: scale(1.08);
}
.swatch[aria-pressed="true"] {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* settings list --------------------------------------------------------- */
.settingrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.settingrow:last-child {
  border-bottom: 0;
}
.settingrow__main {
  min-width: 0;
  flex: 1;
}
.settingrow__main b {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 560;
}
.settingrow__main span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-4);
  line-height: 1.5;
}
.codebox {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  overflow-x: auto;
  white-space: pre;
}

/* ==========================================================================
   uploader
   ========================================================================== */
.uploadwrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 20px;
  animation: view-in var(--dur-4) var(--ease-out);
}
.uploadhead {
  position: relative;
  text-align: center;
  margin-bottom: 22px;
  padding: 10px 22px 14px;
  border-radius: var(--r-lg);
  background: radial-gradient(120% 130% at 50% 0%, rgba(8, 9, 14, 0.52), rgba(8, 9, 14, 0.16) 70%, transparent);
}
.uploadhead h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.uploadhead p {
  margin-top: 8px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  min-height: 118px;
  border-radius: clamp(26px, 2.8vw, 44px);
  corner-shape: squircle;
  border: 1.5px dashed rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, var(--glass-alpha, 0.05));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  cursor: pointer;
  transition: border-color var(--dur-2), background var(--dur-2);
  overflow: hidden;
}
@media (hover: hover) {
  .dropzone:hover {
    border-color: rgba(255, 255, 255, 0.46);
    background: rgba(255, 255, 255, calc(var(--glass-alpha, 0.05) + 0.03));
  }
  }
}
.dropzone.is-over {
  border-color: hsl(var(--accent-h) 100% 70%);
  border-style: solid;
  background: hsl(var(--accent-h) 100% 60% / 0.12);
  transform: scale(1.006);
}
.dropzone__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  corner-shape: squircle;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 18px 40px -20px rgba(0, 0, 0, 0.8);
}
.dropzone__icon .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.6;
}
.dropzone__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  text-align: left;
}
.dropzone b {
  font-size: var(--fs-h3);
  font-weight: 620;
}
.dropzone span {
  font-size: var(--fs-xs);
  color: var(--text-3);
  line-height: 1.6;
}
.dropzone__formats {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
  max-width: 264px;
}
.dropzone__formats .badge {
  height: 20px;
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   host panel: file list + per-file editor + every link format
   -------------------------------------------------------------------------- */
.hostgrid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
  align-items: start;
  animation: view-in var(--dur-3) var(--ease-out);
}
.hostlist {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 640px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}
.hostrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px 8px 8px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-2), background var(--dur-2);
}
@media (hover: hover) {
  .hostrow:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
  }
}
.hostrow.is-active {
  border-color: hsl(var(--accent-h) 100% 70% / 0.6);
  background: hsl(var(--accent-h) 100% 62% / 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.hostrow__thumb {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 11px;
  corner-shape: squircle;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.hostrow__thumb img,
.hostrow__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hostrow__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.34);
}
.hostrow__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.hostrow__name {
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hostrow__meta {
  font-size: 10px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hostrow__state {
  font-size: 9.5px;
  font-weight: 620;
  letter-spacing: 0.03em;
  color: var(--text-4);
}
.hostrow__state.is-done {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #9ff0c0;
}
.hostrow__track {
  display: block;
  height: 3px;
  margin-top: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}
.hostrow__bar {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, hsl(var(--accent-h) 100% 66%), hsl(var(--accent-h) 100% 78%));
  transition: width 140ms linear;
}
.hostrow__x {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--text-4);
  transition: color var(--dur-2), background var(--dur-2);
}
.hostrow__x:hover {
  color: #fff;
  background: rgba(255, 90, 90, 0.26);
}

.hostpanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: clamp(24px, 2.6vw, 40px);
  corner-shape: squircle;
  background: rgba(255, 255, 255, var(--glass-alpha, 0.05));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  min-width: 0;
}
.hostpanel__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.hostpanel__head b {
  font-size: var(--fs-h3);
  font-weight: 640;
  letter-spacing: -0.01em;
}
.hostpanel__sub {
  font-size: 10.5px;
  color: var(--text-4);
}
.hostpanel__head .spacer {
  flex: 1;
}

.hostchips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.hostchip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px 0 3px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  font-size: 10.5px;
  color: var(--text-3);
  max-width: 190px;
  cursor: pointer;
  transition: border-color var(--dur-2), background var(--dur-2), color var(--dur-2);
}
.hostchip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.hostchip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hostchip.is-active {
  color: #fff;
  border-color: hsl(var(--accent-h) 100% 72% / 0.7);
  background: hsl(var(--accent-h) 100% 62% / 0.2);
}
.hostchip__ok {
  display: grid;
  place-items: center;
  color: #9ff0c0;
}
.hostchip__ok .icon {
  width: 11px;
  height: 11px;
}

.hostedit {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.hostedit__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.hostedit__field span {
  font-size: 9.5px;
  font-weight: 620;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-4);
}
.hostedit__field input {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  font-size: var(--fs-xs);
  outline: 0;
  transition: border-color var(--dur-2), background var(--dur-2);
}
.hostedit__field input:focus {
  border-color: hsl(var(--accent-h) 100% 70% / 0.55);
  background: rgba(0, 0, 0, 0.34);
}
.hostmeta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--text-4);
}
.hostmeta > span + span::before {
  content: "·";
  margin-right: 8px;
  opacity: 0.6;
}
.hostlinks-empty {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 11px;
  color: var(--text-4);
}
.hostfoot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.hostfoot .spacer {
  flex: 1;
}
.hostfoot .btn.is-done,
.hostfoot .btn.is-done:disabled {
  color: #9ff0c0;
  opacity: 1;
  cursor: default;
  background: linear-gradient(180deg, rgba(52, 199, 122, 0.2), rgba(30, 130, 80, 0.16));
}
.uploadfoot__summary {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.uploadfoot__summary b {
  color: var(--text-1);
}
.hostempty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 20px;
  color: var(--text-4);
  font-size: var(--fs-xs);
}
.hostempty b {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.uploadhint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-4);
  justify-content: center;
}

/* gate ------------------------------------------------------------------ */
.gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  margin: 8vh auto 0;
  padding: 40px 32px;
  text-align: center;
  border-radius: var(--r-2xl);
  corner-shape: squircle;
  background: rgba(255, 255, 255, var(--glass-alpha, 0.05));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  animation: view-in var(--dur-4) var(--ease-out);
}
.gate__icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  corner-shape: squircle;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.gate__icon .icon {
  width: 26px;
  height: 26px;
}
.gate h2 {
  font-size: 22px;
  font-weight: 660;
  letter-spacing: -0.02em;
}
.gate p {
  max-width: 34ch;
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.7;
}

/* responsive ------------------------------------------------------------- */
@media (max-width: 1080px) {
  .console {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px;
    gap: 2px;
  }
  .sidebar::-webkit-scrollbar {
    display: none;
  }
  .sidebar__user {
    display: none;
  }
  /* keep the footer nav (返回图库 / 退出登录) reachable on small screens */
  .sidebar__foot {
    display: flex;
    flex-direction: row;
    margin: 0 0 0 6px;
    padding: 0 0 0 6px;
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    gap: 2px;
  }
  .snav {
    width: auto;
    white-space: nowrap;
    flex: none;
  }
}
@media (max-width: 940px) {
  .hostgrid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hostlist {
    flex-direction: row;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 4px;
  }
  .hostrow {
    flex: none;
    width: 220px;
  }
}
@media (max-width: 700px) {
  /* stack the nav as wrapped pills instead of a horizontal scroller, so every
     section stays tappable without swiping a hidden overflow area */
  .sidebar {
    flex-wrap: wrap;
    overflow: visible;
    margin-top: 4px;
    border-radius: clamp(20px, 5vw, 28px);
    padding: 8px;
    gap: 4px;
  }
  .sidebar__foot {
    flex: 1 0 100%;
    padding: 6px 0 0;
    margin: 4px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .snav {
    flex: 1 1 auto;
    justify-content: center;
  }
  .rowitem {
    grid-template-columns: 44px minmax(0, 1fr) 40px;
  }
  .rowitem__cell {
    display: none;
  }
  .panel {
    padding: 16px;
  }
  .dropzone {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
  }
  .dropzone__formats {
    margin-left: 0;
    justify-content: flex-start;
    max-width: none;
  }
  .hostedit {
    flex-wrap: wrap;
  }
  .hostedit__field {
    flex: 1 1 140px;
  }
  .hostpanel {
    padding: 13px;
  }
  .uploadhead h1 {
    font-size: 25px;
  }
  .modal__panel {
    padding: 24px 20px 22px;
  }
}
