/* ============================================================
 * open.drop — style.css
 * Standalone design tokens, lifted from homepage/lib/design/louie.css.
 * No wallpaper, no horizontal nav links — just the M3 dark surface
 * with the same coral accent and Material-3 radii / spacing.
 * ============================================================ */

/* ─── Design tokens (mirror of homepage) ─── */
:root {
  --bg: #1f1f1e;
  --surface: #2a2a29;
  --surface-high: #333332;
  --border: #3a3a39;
  --outline: #4a4a49;
  --text: #e8e8e8;
  --muted: #a1a1a0;
  --accent: #d97757;
  --accent-dim: rgba(217, 119, 87, 0.15);
  --accent-on: #ffb49d;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-card-hover: 0 24px 64px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'JetBrains Mono', 'HarmonyOS Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 24px 48px;
  position: relative;
  z-index: 1;
}

/* Background: flat surface only.
 *
 * Earlier versions tried a radial coral glow for depth, but at 8-bit
 * colour depth any dark radial gradient on a near-black background
 * shows visible concentric ring banding. Adding more colour stops
 * doesn't help (the bands just become more, smaller bands), and even
 * a 60-px blur + noise dithering wasn't enough to push it below the
 * perception threshold on every display.
 *
 * Simpler and 100% banding-free: drop the gradient. The brand logo
 * and the coral CTAs supply enough warmth without an ambient glow.
 *
 * A very faint tileable noise stays on body::after so the surface
 * isn't a single solid colour — that subtle texture also masks any
 * tiny LCD-driven gradient in the surrounding chrome. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============================================================
 * Navbar — minimal, no wallpaper strip, no dropdown
 * ============================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: rgba(31, 31, 30, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(58, 58, 57, 0.6);
}

#brand {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: background 0.2s ease;
}
#brand:hover { background: rgba(255, 255, 255, 0.08); }
#brand .b-static { color: var(--text); }
#brand .b-page   { color: rgba(232, 232, 232, 0.6); font-weight: 500; }
.b-dot {
  background: linear-gradient(90deg, #d97757, #ffb49d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

#back-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}
#back-home:hover { background: rgba(255, 255, 255, 0.10); color: var(--text); }
#back-home svg { width: 18px; height: 18px; }

#lang-toggle {
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}
#lang-toggle:hover { background: rgba(255, 255, 255, 0.10); color: var(--text); }

@media (max-width: 600px) {
  #lang-toggle { width: 40px; padding: 0; gap: 0; justify-content: center; letter-spacing: 0; }
  #lang-toggle #lang-label { display: none; }
}

/* ============================================================
 * Ripple — same effect used on homepage
 * ============================================================ */
.ripple-surface { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 600ms linear;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.18);
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ============================================================
 * Stages — only the active one is visible
 * ============================================================ */
.stage {
  display: none;
  width: 100%;
  max-width: 560px;
  flex-direction: column;
  align-items: center;
  animation: stageIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.stage.is-active { display: flex; }

@keyframes stageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
 * Landing — brand hero + CTA stack
 * ============================================================ */
.brand-hero {
  text-align: center;
  margin-bottom: 56px;
}
.logo {
  width: 96px; height: 96px;
  margin: 0 auto 18px;
  filter: drop-shadow(0 12px 32px rgba(217, 119, 87, 0.25));
}
.logo svg { width: 100%; height: 100%; display: block; border-radius: 22px; }

.wordmark {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  line-height: 1;
}
.wordmark .w-light  { color: var(--text); }
.wordmark .w-accent { color: var(--accent); font-weight: 600; }
.wordmark .w-dot    {
  background: linear-gradient(90deg, #d97757, #ffb49d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.tagline {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* CTA stack — two centered buttons */
.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 280px;
  position: relative;
}

.cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.cta:hover { transform: translateY(-1px); }
.cta:active { transform: translateY(0); }

.cta-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(217, 119, 87, 0.32);
}
.cta-primary:hover {
  background: #e98363;
  box-shadow: 0 12px 32px rgba(217, 119, 87, 0.42);
}

.cta-outline {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
}
.cta-outline:hover { background: var(--surface-high); color: var(--accent-on); }

/* Send hint — sits to the RIGHT of the send button so the chip row
 * (文件 / 文本 / 文件夹) is reachable without overlapping the receive button.
 * A pseudo-element bridges the 16-px gap so the cursor can travel from
 * the button into the hint without the hover state dropping. */
.cta-with-hint { position: relative; width: 100%; }

.cta-hint {
  position: absolute;
  top: 50%;
  left: calc(100% + 16px);
  transform: translate(-8px, -50%);
  width: 320px;
  max-width: calc(100vw - 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
  text-align: left;
}
.cta-hint::before {
  /* Transparent bridge across the 16-px gap so :hover doesn't flicker. */
  content: "";
  position: absolute;
  left: -20px;
  top: 0; bottom: 0;
  width: 22px;
}
.cta-with-hint:hover .cta-hint,
.cta-hint:hover,
.cta-hint.is-open {
  opacity: 1;
  transform: translate(0, -50%);
  pointer-events: auto;
}

/* On narrow viewports the right side has no room — fall back to below. */
@media (max-width: 900px) {
  .cta-hint {
    top: calc(100% + 12px);
    left: 50%;
    transform: translate(-50%, -8px);
  }
  .cta-hint::before {
    left: 0; right: 0; width: auto;
    top: -20px; bottom: auto; height: 22px;
  }
  .cta-with-hint:hover .cta-hint,
  .cta-hint:hover,
  .cta-hint.is-open {
    transform: translate(-50%, 0);
  }
}
.cta-hint ul {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}
.cta-hint li { margin-bottom: 4px; line-height: 1.6; }
.cta-hint kbd {
  background: var(--surface-high);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}
.hint-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.hint-chip {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}
.hint-chip:hover { background: var(--surface-high); color: var(--text); }
.hint-chip svg { width: 14px; height: 14px; }

/* ============================================================
 * Cards — used by send/receive sub-states
 * ============================================================ */
.card {
  display: none;
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-card);
  animation: cardIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.stage .card[data-substate].is-active { display: block; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.card-close:hover { background: var(--surface-high); color: var(--text); }
.card-close svg { width: 18px; height: 18px; }

.card h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
}
.card-sub {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.05em;
}

.card-cta { margin-top: 8px; }

/* ============================================================
 * Send — file list, config grid
 * ============================================================ */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 20px;
}
.file-list:empty { display: none; }

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.file-row .file-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent-on);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.file-row .file-name {
  flex: 1;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-row .file-size {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.file-row .file-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  transition: background 0.2s ease, color 0.2s ease;
}
.file-row .file-remove:hover { background: var(--surface-high); color: var(--text); }
.file-row .file-remove svg { width: 14px; height: 14px; }

.config-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.config-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease;
}
.config-row:focus-within { border-color: var(--accent); }

.config-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  flex-shrink: 0;          /* keep label intact when input gets wide content */
  /* No min-width — labels size to their own content so the input starts
   * right after the label instead of being shoved into the row's right half. */
}
.config-label svg { width: 14px; height: 14px; flex-shrink: 0; }

.config-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
}
.config-row input::placeholder { color: rgba(161, 161, 160, 0.5); }
.config-row input[type=number] { max-width: 80px; }

/* ============================================================
 * Uploading — progress display
 * ============================================================ */
.progress-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 8px;
}
.progress-pct {
  font-size: 56px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.progress-pct-unit {
  font-size: 22px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}
.progress-bytes {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 20px;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-on));
  border-radius: 4px;
  transition: width 0.18s ease;
}

/* ============================================================
 * Success — pickup code reveal
 * ============================================================ */
.pickup-code {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-align: center;
  color: var(--text);
  padding: 12px 0 8px;
  text-indent: 0.32em;
  user-select: all;
}
.success-hint {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.04em;
}
.success-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}
.link-action {
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}
.link-action:hover { background: rgba(255, 255, 255, 0.06); color: var(--accent-on); }
.link-action svg { width: 14px; height: 14px; }

.qr-panel {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}
.qr-panel canvas {
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

.cost-notice {
  margin: 16px 0 0;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--accent-on);
  background: var(--accent-dim);
  border: 1px solid rgba(217, 119, 87, 0.28);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* ============================================================
 * Receive — code digit inputs
 * ============================================================ */
.code-input-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 480px) {
  .code-input-row { gap: 6px; }
}

.code-digit {
  width: 48px;
  height: 64px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
@media (max-width: 480px) {
  .code-digit { width: 42px; height: 56px; font-size: 24px; }
}
.code-digit:focus {
  border-color: var(--accent);
  background: var(--surface);
}
.code-digit.is-filled { border-color: var(--accent); }

.code-error {
  margin: 0 0 12px;
  font-size: 13px;
  color: #ff8a76;
  text-align: center;
  letter-spacing: 0.02em;
}

.code-password-row { margin-bottom: 16px; }

/* ============================================================
 * Drop overlay — appears when user drags files onto the window
 * ============================================================ */
#drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(31, 31, 30, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
}
#drop-overlay.is-active { display: flex; }
.drop-overlay-inner {
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  padding: 64px 96px;
  text-align: center;
  background: var(--accent-dim);
  color: var(--accent-on);
}
.drop-overlay-inner svg { color: var(--accent); margin-bottom: 12px; }
.drop-overlay-inner p {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ============================================================
 * Footer
 * ============================================================ */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px 24px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  border-top: 1px solid var(--border);
}

/* ============================================================
 * Toast — copy/QR feedback
 * ============================================================ */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  background: var(--surface-high);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
}
#toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
 * open.drop additions — brand · hamburger · login · my-files
 * ============================================================ */

/* Brand block: small cloud icon + wordmark + subtitle */
#brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}
.brand-icon { width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; }
.brand-text {
  display: inline-flex;
  align-items: baseline;
}
.brand-sub {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
}
@media (max-width: 600px) {
  .brand-sub { display: none; }
  #brand { gap: 8px; padding: 8px 6px; }
}

/* "我的文件" quick link (visible only when signed in) */
.nav-link-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-link-btn:hover { background: rgba(255, 255, 255, 0.10); }
.nav-link-btn svg { width: 14px; height: 14px; opacity: 0.8; color: var(--accent); }
@media (max-width: 600px) { .nav-link-btn span { display: none; } }

/* Generic 40-px round icon button — used by #menu-btn and #lang-toggle */
.icon-btn,
#menu-btn,
#lang-toggle {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  width: 40px; height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}
.icon-btn:hover,
#menu-btn:hover,
#lang-toggle:hover { background: rgba(255, 255, 255, 0.10); }
#lang-toggle svg { color: var(--accent); }
#lang-toggle:hover svg { color: var(--accent-on); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#nav-menu {
  position: fixed;
  top: 56px;
  right: 24px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 6px;
  min-width: 200px;
  animation: cardIn 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-menu-item {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease;
}
.nav-menu-item:hover { background: var(--surface-high); }
.nav-menu-item svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.nav-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}
.nav-menu-meta {
  padding: 8px 12px 4px;
  margin-top: 2px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 600px) {
  #nav-menu { right: 12px; }
}

/* Login modal — the `hidden` attribute must beat `display:flex` */
[hidden] { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-card);
  animation: cardIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-card h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
}
.modal-card .card-sub { margin-bottom: 18px; }
.modal-card .config-row { margin-bottom: 10px; }

/* Inline form errors (login + upload) */
.card-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: rgba(255, 138, 118, 0.08);
  border: 1px solid rgba(255, 138, 118, 0.30);
  color: #ff8a76;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
}

/* Success share URL line, under the QR/copy actions */
.success-share {
  margin: 16px 0 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
  user-select: all;
}

/* My files — wider card and parcel rows */
.card-wide { max-width: 640px; }
.parcel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}
.parcel-list:empty { display: none; }

.parcel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.parcel-row-main { flex: 1; min-width: 0; }
.parcel-code-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  letter-spacing: 0.12em;
}
.parcel-lock { font-size: 14px; opacity: 0.8; }
.parcel-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.parcel-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.parcel-delete:hover {
  background: rgba(255, 138, 118, 0.10);
  color: #ff8a76;
  border-color: rgba(255, 138, 118, 0.40);
}
.parcel-delete svg { width: 12px; height: 12px; }

/* ============================================================
 * Text-send / text-receive modals
 * ============================================================ */
.text-modal-card { max-width: 560px; }
.text-area {
  width: 100%;
  min-height: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-family: 'JetBrains Mono', 'HarmonyOS Sans', 'PingFang SC', 'Microsoft YaHei', monospace, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}
.text-area:focus           { border-color: var(--accent); }
.text-area::placeholder    { color: rgba(161, 161, 160, 0.5); }
.text-area[readonly]       { background: var(--bg); cursor: text; }

/* ============================================================
 * Admin panel
 * ============================================================ */
.admin-stage { display: none; width: 100%; max-width: 1100px; }
.admin-stage.is-active { display: block; }

.admin-card { max-width: 420px; margin: 0 auto; }
.admin-card code {
  background: var(--surface-high);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.admin-badge {
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-on);
  background: var(--accent-dim);
  border: 1px solid rgba(217, 119, 87, 0.35);
  border-radius: var(--radius-full);
}

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.admin-tab {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 18px;
  cursor: pointer;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: relative;
  overflow: hidden;
  transition: color 0.2s ease, background 0.2s ease;
}
.admin-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.admin-tab.is-active {
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-color: var(--surface);
  margin-bottom: -1px;
}

.admin-panel { display: none; padding: 8px 4px 24px; }
.admin-panel.is-active { display: block; }
.admin-panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
}
.stat-card-wide { grid-column: 1 / -1; }
.stat-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.stat-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.stat-card .progress-bar { margin-top: 12px; }

.admin-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: auto;
  margin-top: 16px;
  background: var(--surface);
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table th {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--surface-high);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td.mono { font-family: 'JetBrains Mono', monospace; }
.admin-table td.expired { color: #ff8a76; }
.admin-table td.muted, .admin-table .muted { color: var(--muted); }

.row-action {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  padding: 5px 10px;
  margin-right: 6px;
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.row-action:hover { background: var(--surface-high); color: var(--text); }
.row-action.danger:hover {
  background: rgba(255, 138, 118, 0.10);
  color: #ff8a76;
  border-color: rgba(255, 138, 118, 0.40);
}

/* Long-term account badge + "never expires" cell */
.perm-badge {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-on);
  background: var(--accent-dim);
  border: 1px solid rgba(217, 119, 87, 0.35);
  border-radius: var(--radius-full);
  vertical-align: middle;
}
.never-expires { color: var(--accent-on); font-style: italic; }

/* ============================================================
 * Small-screen polish
 * ============================================================ */
@media (max-width: 600px) {
  main { padding: 88px 16px 32px; }
  .wordmark { font-size: 36px; }
  .card { padding: 32px 22px 22px; }
  .pickup-code { font-size: 32px; letter-spacing: 0.24em; text-indent: 0.24em; }
  .progress-pct { font-size: 48px; }
  #navbar { padding: 0 14px; }
  .nav-gauge { padding: 4px 6px; }
  .nav-btn { padding: 9px 10px; }
  .nav-btn span { display: none; }
  #auth-menu { right: 14px; }
}
