/* Copyright (c) 2026 IASK Solutions LLC. All rights reserved.
 * Undercover Drop — Core styles
 */
/* ── Custom Properties ────────────────────────────────────────────────────────── */
:root {
  /* Palette */
  --bg:           #0F1117;
  --bg-2:         #12141D;
  --surface:      #1A1D27;
  --surface-2:   #1E2230;
  --surface-hover:#2A3040;
  --border:       #2A2D3A;
  --border-soft:  #232738;
  --primary:      #7C3AED;
  --primary-hover:#6D28D9;
  --primary-glow: rgba(124, 58, 237, 0.25);
  --primary-glow-2: rgba(124, 58, 237, 0.08);
  --success:      #10B981;
  --success-light: rgba(16, 185, 129, 0.12);
  --warning:      #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.12);
  --error:        #EF4444;
  --error-light:  rgba(239, 68, 68, 0.12);
  --text:         #F1F5F9;
  --text-2:       #CBD5E1;
  --text-muted:   #94A3B8;
  --muted:        #475569;

  /* Spacing & shape */
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --radius-xl:    24px;

  /* Typography */
  --font:         ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Liberation Mono', monospace;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:    0 10px 40px rgba(0,0,0,0.6);
  --shadow-glow:  0 0 24px var(--primary-glow);
}

/* ── Reset ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

.adv-chevron.expanded { transform: rotate(180deg); }
.strength-fill.strength-score-0 { width: 0; background: #EF4444; }
.strength-fill.strength-score-1 { width: 25%; background: #EF4444; }
.strength-fill.strength-score-2 { width: 50%; background: #F59E0B; }
.strength-fill.strength-score-3 { width: 75%; background: #10B981; }
.strength-fill.strength-score-4 { width: 100%; background: #059669; }
.strength-label.strength-score-0,
.strength-label.strength-score-1 { color: #EF4444; }
.strength-label.strength-score-2 { color: #F59E0B; }
.strength-label.strength-score-3 { color: #10B981; }
.strength-label.strength-score-4 { color: #059669; }
.pass-warning.pass-warning-error { color: #EF4444; }
.pass-warning.pass-warning-caution { color: #F59E0B; }

::selection { background: var(--primary); color: #fff; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; display: block; }

/* ── Typography ──────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p  { color: var(--text-muted); }

.mono { font-family: var(--font-mono); }

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: 480px; }
.container.wide   { max-width: 960px; }

.hidden,
[hidden] {
  display: none !important;
}

.text-center { text-align: center; }
.text-left { text-align: left; }

.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-2 { margin-bottom: 2px; }
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-28 { margin-bottom: 28px; }
.mb-48 { margin-bottom: 48px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.m-0 { margin: 0; }

.max-w-400 { max-width: 400px; }
.max-w-480 { max-width: 480px; }
.max-w-520 { max-width: 520px; }
.max-w-560 { max-width: 560px; }
.max-w-600 { max-width: 600px; }
.max-w-620 { max-width: 620px; }
.max-w-820 { max-width: 820px; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.align-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.relative { position: relative; }
.inline-block { display: inline-block; }
.full-width { width: 100%; }
.grid { display: grid; }

.surface-panel {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 20px;
}

.muted-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.flash-container { padding-top: 18px; }

.icon-sm {
  width: 12px;
  height: 12px;
}

.icon-inline {
  display: inline;
  vertical-align: middle;
}

.btn-icon-tight {
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-tight svg {
  width: 12px;
  height: 12px;
}

/* ── Navbar ──────────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.navbar-logo:hover { text-decoration: none; color: var(--text); }
.navbar-logo svg { color: var(--primary); }
.navbar-logo .logo-text { background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.navbar-actions { display: flex; gap: 8px; align-items: center; }
.navbar-user {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-right: 8px;
}
.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.navbar-toggle svg {
  width: 18px;
  height: 18px;
}
.navbar-toggle[aria-expanded="true"] {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 130ms ease;
  text-decoration: none;
  white-space: nowrap;
  min-height: 38px;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 0 var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  text-decoration: none;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 8px 12px;
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.btn-danger {
  background: var(--error-light);
  color: var(--error);
  border-color: transparent;
}
.btn-danger:hover {
  background: var(--error);
  color: #fff;
  text-decoration: none;
}

.btn-icon {
  padding: 7px;
  min-height: auto;
  min-width: 32px;
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 6px 12px; min-height: 32px; font-size: 0.82rem; }
.btn-lg { padding: 13px 28px; min-height: 48px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

/* ── Form Elements ──────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-2);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  min-height: 40px;
  -webkit-appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-glow-2);
}
.form-input.error { border-color: var(--error); }
.form-input::placeholder { color: var(--muted); }

.form-error {
  font-size: 0.82rem;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint { font-size: 0.8rem; color: var(--muted); }
.label-opt { color: var(--muted); font-weight: 500; }

.caps-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #F59E0B;
}
.caps-note[hidden] { display: none; }
.caps-note span { font-size: 0.95rem; line-height: 1; }
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.checkbox-row input { margin-top: 2px; }

/* Password toggle */
.password-wrap { position: relative; }
.password-wrap .form-input { padding-right: 46px; }
.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.password-generate {
  white-space: nowrap;
  min-height: 40px;
}
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 120ms;
}
.password-toggle:hover { color: var(--text-muted); }
.password-toggle svg { width: 18px; height: 18px; }

@media (max-width: 720px) {
  .password-row {
    grid-template-columns: 1fr;
  }
  .password-generate {
    width: 100%;
  }
}

/* ── Alerts ──────────────────────────────────────────────────────────────────── */
.alerts { display: flex; flex-direction: column; gap: 8px; }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  animation: slideDown 200ms ease;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); color: var(--success); border-color: var(--success); }
.alert-error   { background: var(--error-light);   color: var(--error);   border-color: var(--error); }
.alert-warning { background: var(--warning-light);  color: var(--warning);  border-color: var(--warning); }
.alert-info    { background: var(--primary-glow-2);color: var(--primary);  border-color: var(--primary); }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  font-size: 0.875rem;
  margin-bottom: 12px;
}
.flash-success { background: var(--success-light); color: var(--success); border-color: var(--success); }
.flash-error { background: var(--error-light); color: var(--error); border-color: var(--error); }
.flash-warning { background: var(--warning-light); color: var(--warning); border-color: var(--warning); }

/* ── Mode Tabs ──────────────────────────────────────────────────────────────── */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
.mode-tab {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  cursor: pointer;
  transition: all 150ms ease;
  background: var(--bg-2);
  text-align: center;
  position: relative;
}
.mode-tab:hover { border-color: var(--primary); background: var(--primary-glow-2); }
.mode-tab.active { border-color: var(--primary); background: var(--primary-glow-2); }
.mode-tab .tab-icon { margin-bottom: 10px; color: var(--primary); }
.tab-icon-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab-icon-flow svg { width: 27px; height: 27px; }
.tab-icon-arrow,
.tab-icon-flow .tab-icon-arrow { width: 15px; height: 15px; opacity: 0.5; }
.mode-tab .tab-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 3px; }
.mode-tab .tab-desc  { font-size: 0.78rem; color: var(--text-muted); }
.mode-tab .tab-badge {
  position: absolute; top: -7px; right: -7px;
  background: var(--primary); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  display: none;
}
.mode-tab.active .tab-badge { display: block; }
.mode-tab input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

/* ── Dropzone ─────────────────────────────────────────────────────────────────── */
.dropzone {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 150ms ease;
  background: var(--bg-2);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-glow-2);
}
.dropzone .dz-icon { margin-bottom: 14px; color: var(--muted); }
.dropzone.drag-over .dz-icon { color: var(--primary); }
.dropzone .dz-text { color: var(--text-muted); font-size: 0.875rem; }
.dropzone .dz-text a { cursor: pointer; }
.dropzone .dz-file-name { margin-top: 10px; font-weight: 600; font-size: 0.9rem; color: var(--text); font-family: var(--font-mono); }
.dropzone .dz-file-size { font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }
.dropzone input[type="file"] { display: none; }
.dropzone .dz-clear { display: inline-block; margin-top: 10px; font-size: 0.8rem; color: var(--error); cursor: pointer; font-weight: 600; }

/* ── Expiry Picker ───────────────────────────────────────────────────────────── */
.expiry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.expiry-pill {
  padding: 7px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms;
  background: var(--bg-2);
  color: var(--text-muted);
}
.expiry-pill:hover { border-color: var(--primary); color: var(--primary); }
.expiry-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.expiry-pill input { display: none; }

/* ── Result Box ──────────────────────────────────────────────────────────────── */
.result-box {
  background: var(--success-light);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 20px;
  animation: slideDown 200ms ease;
}
.result-box .result-title {
  font-weight: 700;
  color: var(--success);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}
.result-box .result-url {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 8px;
}
.result-box .result-url code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

/* ── Loading Spinner ─────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 550ms linear infinite;
}
.spinner.purple {
  border-color: rgba(124,58,237,0.25);
  border-top-color: var(--primary);
}

/* ── Auth Pages ──────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(ellipse at top, #13151F 0%, var(--bg) 70%);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .auth-sub { margin-bottom: 28px; }
.auth-card .form-group { margin-bottom: 14px; }
.auth-card .btn { margin-top: 6px; }
.auth-card .auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.auth-card.compact { max-width: 520px; }
.auth-card.medium { max-width: 560px; }
.auth-card.wide { max-width: 620px; }

/* ── Dashboard Layout ───────────────────────────────────────────────────────── */
.dashboard-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 58px);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-soft);
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
}

.sidebar-section { padding: 0 12px; margin-bottom: 6px; }

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 120ms ease;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  user-select: none;
}
.sidebar-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar-item.active { background: var(--primary-glow-2); color: var(--primary); }
.sidebar-item.active svg { color: var(--primary); }
.sidebar-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-item .item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-item .item-count {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 24px;
  text-align: center;
  transition: all 120ms;
}
.sidebar-item.active .item-count { background: var(--primary-glow-2); color: var(--primary); }

.sidebar-item .item-actions {
  display: none;
  gap: 2px;
  align-items: center;
}
.sidebar-item:hover .item-actions { display: flex; }
.sidebar-item:hover .item-count { display: none; }
.folder-danger-btn { color: var(--error); }

.sidebar-item .rename-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font);
  padding: 2px 6px;
  outline: none;
  min-width: 0;
}

.new-folder-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms;
  background: none;
  border: 1px dashed var(--border);
  color: var(--muted);
  width: calc(100% - 24px);
  margin: 4px 12px 0;
  text-align: left;
  font-family: var(--font);
}
.new-folder-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow-2); }
.new-folder-btn svg { width: 14px; height: 14px; }
.sidebar-form {
  padding: 6px 8px;
}
.sidebar-form-input {
  min-height: 34px;
  font-size: 0.85rem;
  padding: 6px 10px;
}

/* ── Dashboard Main ──────────────────────────────────────────────────────────── */
.dashboard-main {
  flex: 1;
  padding: 32px 36px;
  min-width: 0;
}

.page-header { margin-bottom: 28px; }
.page-header h1 { margin-bottom: 4px; }
.page-header p { font-size: 0.875rem; }

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* ── Files Table ────────────────────────────────────────────────────────────── */
.files-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.recipient-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.recipient-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 12px;
}

.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(124, 58, 237, 0.4);
  background: rgba(124, 58, 237, 0.12);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.recipient-note-input {
  min-height: 92px;
  resize: vertical;
}

.recipient-warning {
  color: #f5b257;
  font-size: 0.82rem;
}

.share-confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}

.share-confirm-dialog {
  width: min(100%, 460px);
}

.share-confirm-list {
  margin: 16px 0;
  padding-left: 20px;
  color: var(--text-2);
}

.share-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.recipient-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #f8d38f;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.recipient-manage-panel,
.review-link-box,
.manage-recipient-box {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px;
}

.recipient-manage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recipient-manage-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.recipient-manage-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.review-page-card {
  margin: 32px 0;
}

.review-link-box code {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .recipient-entry-row,
  .share-confirm-actions {
    grid-template-columns: 1fr;
  }
}

/* ── Dashboard Redesign ───────────────────────────────────────────────────── */
.dashboard-v2 {
  background:
    radial-gradient(circle at 30% 0%, rgba(124, 58, 237, 0.08), transparent 34%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

.dashboard-v2 .dashboard-main {
  padding: 18px 24px 36px;
}

.dashboard-command-bar {
  position: sticky;
  top: 58px;
  z-index: 120;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  margin: -18px -24px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(18, 20, 29, 0.92);
  backdrop-filter: blur(16px);
}

.command-group,
.selection-commands,
.view-toggle,
.command-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.command-group,
.selection-commands {
  flex-wrap: wrap;
  min-width: 0;
}

.command-spacer { flex: 1; }

.command-separator {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.command-button,
.command-icon,
.view-toggle button,
.link-button,
.new-folder-link {
  border: 0;
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, transform 90ms ease;
}

.command-button {
  min-height: 36px;
  padding: 0 13px;
}

.command-button:hover,
.command-icon:hover {
  background: var(--surface-hover);
  color: var(--text);
  text-decoration: none;
}

.link-button:hover,
.new-folder-link:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

.command-button:active:not(:disabled) {
  transform: translateY(1px);
}

.command-button:disabled {
  opacity: 0.6;
  color: var(--text-muted);
  cursor: not-allowed;
}

.command-button:disabled:hover {
  background: var(--surface-2);
  color: var(--text-2);
}

.primary-command,
.primary-command:disabled:hover {
  background: var(--primary);
  color: #fff;
}

.primary-command:hover {
  background: var(--primary-hover);
  color: #fff;
}

.danger-command:not(:disabled) {
  background: var(--error-light);
  color: #FCA5A5;
}

.danger-command:not(:disabled):hover {
  background: var(--error);
  color: #fff;
}

.danger-text {
  color: var(--error);
}

.command-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
}

.command-icon svg { width: 17px; height: 17px; }

.command-dropdown-wrap {
  position: relative;
}

.command-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 650;
}

.command-dropdown button,
.command-dropdown a,
.context-menu button,
.context-menu a,
.context-label {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
  text-decoration: none;
}

.command-dropdown button:hover,
.command-dropdown a:hover,
.context-menu button:hover,
.context-menu a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.context-menu button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.context-menu .danger { color: var(--error); }
.context-label { color: var(--muted); cursor: default; }

.dashboard-search-input {
  width: clamp(150px, 18vw, 260px);
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}

.view-toggle {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 3px;
  background: var(--surface-2);
}

.view-toggle button {
  border: 0;
  min-height: 28px;
  padding: 0 12px;
  background: transparent;
}

.view-toggle button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.view-toggle button.active,
.view-toggle button.active:hover {
  background: var(--primary);
  color: #fff;
}

.dashboard-selection-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(124, 58, 237, 0.34);
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.1);
  color: var(--text-2);
  font-size: 0.88rem;
}

.link-button,
.new-folder-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
}

.breadcrumb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.dashboard-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
}

.breadcrumb-crumb {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.breadcrumb-crumb.current {
  color: var(--text);
  cursor: default;
}

.breadcrumb-sep,
.breadcrumb-count {
  color: var(--muted);
  font-size: 0.84rem;
}

.folder-tree {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.folder-tree-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 28px;
  align-items: center;
  min-height: 32px;
  padding-left: 0;
  border-radius: var(--radius-sm);
}

.folder-tree-row:hover,
.folder-tree-row.active {
  background: var(--surface-2);
}

.folder-tree-row.active .folder-tree-main {
  color: var(--primary);
}

.folder-chevron,
.folder-options,
.folder-tree-main {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
}

.folder-chevron {
  padding: 0;
  color: var(--muted);
}

.folder-chevron.expanded {
  transform: rotate(90deg);
}

.folder-tree-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 2px;
  text-align: left;
}

.folder-tree-main svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.folder-tree-main span:first-of-type {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.folder-options {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.folder-tree-row:hover .folder-options { display: inline-flex; }
.folder-options svg { width: 14px; height: 14px; }
.folder-tree-row.tree-depth-2 { padding-left: 18px; }
.folder-tree-row.tree-depth-3 { padding-left: 36px; }
.folder-tree-row.tree-depth-4 { padding-left: 54px; }
.folder-tree-row.tree-depth-5 { padding-left: 72px; }
.folder-tree-row.tree-depth-6 { padding-left: 90px; }
.folder-tree-row.tree-depth-7 { padding-left: 108px; }
.folder-tree-row.tree-depth-8 { padding-left: 126px; }
.folder-tree-row.tree-depth-9 { padding-left: 144px; }
.folder-tree-row.tree-depth-10 { padding-left: 162px; }
.folder-tree-row.tree-depth-11 { padding-left: 180px; }
.folder-tree-row.tree-depth-12 { padding-left: 198px; }

.new-folder-link {
  margin: 10px 8px 0;
  font-weight: 700;
  text-align: left;
}

.sidebar-divider {
  height: 1px;
  margin: 16px 8px 10px;
  background: var(--border-soft);
}

.future-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--muted);
  font-size: 0.68rem;
}

.sidebar-item-disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.dashboard-list-wrap {
  border-radius: var(--radius-lg);
}

.select-col { width: 42px; text-align: center; }
.icon-col { width: 54px; color: var(--text-muted); }
.drag-col {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drag-col svg { width: 18px; height: 18px; }
.drag-handle {
  color: var(--muted);
  opacity: 0;
}
.dashboard-item-row:hover .drag-handle { opacity: 1; }

/* Folders read clearly as folders: accent-coloured, slightly larger icon. */
.folder-row .icon-col svg {
  color: var(--primary);
  width: 20px;
  height: 20px;
}
.file-row .icon-col svg {
  color: var(--text-muted);
}
.folder-card .card-art svg {
  color: var(--primary);
}
.folder-row .filename,
.folder-card strong {
  font-weight: 650;
}

.dashboard-item-row {
  cursor: default;
}

.dashboard-item-row.selected,
.file-card.selected {
  background: rgba(124, 58, 237, 0.12);
  outline: 1px solid rgba(124, 58, 237, 0.45);
}

.dashboard-item-row.suspended-item {
  background: rgba(239, 68, 68, 0.08);
}

.visibility-glyph {
  display: inline-flex;
  min-width: 22px;
  margin-right: 4px;
}

.folder-count-pill,
.extension-badge,
.micro-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.7rem;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--muted);
}

.micro-badge.danger {
  color: var(--error);
  background: var(--error-light);
  border-color: transparent;
}

.download-warning,
.expiring-soon {
  color: var(--warning);
}

.download-limit-reached {
  color: var(--error);
  font-weight: 700;
}

.sortable-heading {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.file-card {
  position: relative;
  min-height: 144px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.file-card:hover {
  border-color: var(--primary);
}

.file-card input[type="checkbox"] {
  position: absolute;
  top: 10px;
  left: 10px;
  opacity: 0;
}

.file-card:hover input[type="checkbox"],
.file-card.selected input[type="checkbox"] {
  opacity: 1;
}

.card-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  opacity: 0;
}

.file-card:hover .card-menu,
.file-card.selected .card-menu {
  opacity: 1;
}

.card-menu svg { width: 14px; height: 14px; }

.card-art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  color: var(--primary);
}

.card-art svg {
  width: 42px;
  height: 42px;
}

.card-art .extension-badge,
.card-art .folder-count-pill {
  position: absolute;
  right: 12px;
  bottom: 52px;
}

.file-card strong,
.file-card span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-card strong {
  color: var(--text-2);
  font-size: 0.86rem;
}

.file-card > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.file-card.suspended-item {
  border-color: var(--error);
}

.suspended-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 6px;
  text-align: center;
  color: var(--error);
  background: var(--error-light);
  font-size: 0.75rem;
  font-weight: 700;
}

.dashboard-empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: rgba(30, 34, 48, 0.58);
}

.empty-illustration {
  display: inline-flex;
  gap: 10px;
  color: var(--primary);
}

.empty-illustration svg {
  width: 42px;
  height: 42px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.details-pane {
  position: sticky;
  top: 58px;
  width: 340px;
  height: calc(100vh - 58px);
  flex: 0 0 340px;
  overflow-y: auto;
  border-left: 1px solid var(--border-soft);
  background: rgba(26, 29, 39, 0.98);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 180ms ease;
}

.details-close {
  float: right;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.details-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.details-hero svg {
  width: 34px;
  height: 34px;
  color: var(--primary);
}

.details-hero h2 {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.details-list {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0 0 18px;
}

.details-list dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.details-list dd {
  margin: 0;
  color: var(--text-2);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.details-actions {
  display: grid;
  gap: 9px;
}

.details-actions .btn {
  justify-content: center;
}

.visibility-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  padding: 4px 8px;
  cursor: pointer;
}

.details-visibility-menu {
  position: static;
  margin: -8px 0 14px 112px;
}

.details-list dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.meta-edit-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.76rem;
  padding: 2px 9px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.meta-edit-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow-2);
}

.details-recipient-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.details-recipient-panel h3 {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.suspended-message {
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: var(--radius-md);
  color: var(--error);
  background: var(--error-light);
  font-size: 0.85rem;
}

.modal-backdrop,
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(5, 7, 12, 0.7);
}

.modal-dialog {
  width: min(94vw, 520px);
  margin: 8vh auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.modal-subtext {
  color: var(--muted);
  font-size: 0.86rem;
}

.move-tree {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 6px;
  background: var(--bg-2);
}

.move-tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
}

.move-tree-row.active,
.move-tree-row:hover {
  background: var(--primary-glow-2);
  color: var(--primary);
}

.move-tree-row svg {
  width: 16px;
  height: 16px;
}
.move-tree-row.tree-depth-1 { padding-left: 26px; }
.move-tree-row.tree-depth-2 { padding-left: 42px; }
.move-tree-row.tree-depth-3 { padding-left: 58px; }
.move-tree-row.tree-depth-4 { padding-left: 74px; }
.move-tree-row.tree-depth-5 { padding-left: 90px; }
.move-tree-row.tree-depth-6 { padding-left: 106px; }
.move-tree-row.tree-depth-7 { padding-left: 122px; }
.move-tree-row.tree-depth-8 { padding-left: 138px; }
.move-tree-row.tree-depth-9 { padding-left: 154px; }
.move-tree-row.tree-depth-10 { padding-left: 170px; }
.move-tree-row.tree-depth-11 { padding-left: 186px; }
.move-tree-row.tree-depth-12 { padding-left: 202px; }

.move-modal-new {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.name-modal {
  width: min(94vw, 420px);
}

.name-modal .form-input {
  width: 100%;
  margin-top: 14px;
}

.delete-modal {
  width: min(94vw, 460px);
}

.delete-modal-checkbox {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}

.dashboard-toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  display: grid;
  gap: 10px;
}

.dashboard-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
  max-width: 380px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--shadow-lg);
}

.dashboard-toast.error {
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--error);
}

.dashboard-drag-overlay[hidden] {
  display: none;
}

.dashboard-drag-overlay {
  position: fixed;
  inset: 72px 18px 18px;
  z-index: 850;
  display: grid;
  place-items: center;
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  background: rgba(15, 17, 23, 0.82);
  color: var(--text);
  text-align: center;
  backdrop-filter: blur(10px);
}

.dashboard-drag-overlay strong,
.dashboard-drag-overlay span {
  display: block;
}

.dashboard-drag-overlay strong {
  font-size: 1.3rem;
}

.dashboard-drag-overlay span {
  margin-top: 6px;
  color: var(--muted);
}

.drop-target {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.shortcut-help {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 500;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  font-weight: 800;
  cursor: pointer;
}

.shortcut-sheet {
  position: fixed;
  right: 18px;
  bottom: 132px;
  z-index: 850;
  width: min(92vw, 360px);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.shortcut-close {
  float: right;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
}

.shortcut-sheet dl {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.shortcut-sheet dt {
  color: var(--primary);
  font-weight: 800;
}

.shortcut-sheet dd {
  margin: 0;
  color: var(--text-2);
}

.mobile-only { display: none; }

@keyframes slideInRight {
  from { transform: translateX(18px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 980px) {
  .dashboard-command-bar {
    flex-wrap: wrap;
  }

  .command-spacer {
    display: none;
  }

  .command-search {
    order: 2;
    flex: 1 1 100%;
  }

  .dashboard-search-input {
    flex: 1;
    width: auto;
  }
}

@media (max-width: 720px) {
  .mobile-only { display: inline-flex; }

  .dashboard-v2 {
    flex-direction: column;
  }

  .dashboard-v2 .dashboard-main {
    padding: 16px;
  }

  .dashboard-command-bar {
    top: 58px;
    margin: -16px -16px 14px;
  }

  .dashboard-sidebar {
    position: fixed;
    top: 58px;
    bottom: 0;
    left: 0;
    z-index: 760;
    width: min(86vw, 280px);
    height: auto;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.sidebar-open .dashboard-sidebar {
    transform: translateX(0);
  }

  .details-pane {
    position: fixed;
    inset: 58px 0 0;
    z-index: 780;
    width: auto;
    height: auto;
    padding: 20px;
  }

  .optional-col {
    display: none;
  }

  .file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-commands {
    order: 3;
    flex: 1 1 100%;
  }

  .breadcrumb-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .move-modal-new {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* The navbar wraps and grows taller than 58px below 640px, so drop
     sticky behaviour and shift the sidebar/details overlays to the top
     of the viewport to avoid overlap with the wrapped navbar. */
  .dashboard-command-bar {
    position: static;
  }
  .dashboard-sidebar,
  .details-pane {
    top: 0;
  }
  .details-pane {
    inset: 0;
  }
}
.files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.files-table th {
  text-align: left;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
}
.files-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.files-table tr:last-child td { border-bottom: none; }
.files-table tbody tr { transition: background 100ms ease; }
.files-table tbody tr:hover { background: var(--surface-2); }
.files-table .filename {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-2);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-table .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.files-table .meta-sub.error {
  color: var(--error);
  font-size: 0.75em;
}
.files-table-actions-col {
  width: 44px;
}
.files-table .badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border-soft);
}
.files-table .badge.expired { background: var(--error-light); color: var(--error); border-color: transparent; }

/* Post-expiry grace state: distinct amber "warning" treatment. */
.badge.grace,
.files-table .badge.grace {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(245, 158, 11, 0.14);
  color: #F59E0B;
  border: 1px solid transparent;
}

.grace-message {
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.08);
  color: #F59E0B;
  font-size: 0.85rem;
}

/* ── File Action Menu ────────────────────────────────────────────────────────── */
.file-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 120ms ease;
  position: relative;
}
.file-action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow-2); }
.file-action-btn svg { width: 14px; height: 14px; }
.action-cell {
  position: relative;
}
.dashboard-delete-form {
  margin: 0;
}

.action-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 500;
  overflow: hidden;
  animation: fadeDown 140ms ease;
}
.action-menu-top-left { top: 12px; left: 12px; }
.action-menu-top-right { top: 12px; right: 12px; }
.action-menu-bottom-left { bottom: 12px; left: 12px; }
.action-menu-bottom-right { right: 12px; bottom: 12px; }
.action-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background 80ms;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}
.action-menu-item:hover { background: var(--surface-2); color: var(--text); }
.action-menu-item.danger { color: var(--error); }
.action-menu-item.danger:hover { background: var(--error-light); }
.action-menu-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.action-menu-sep { height: 1px; background: var(--border-soft); margin: 4px 0; }

.action-submenu { position: relative; }
.action-submenu .submenu-trigger { justify-content: space-between; }
.action-submenu .submenu-trigger::after { content: '›'; font-size: 1rem; margin-left: auto; }

.submenu {
  position: absolute;
  left: calc(100% + 2px);
  top: -1px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 60;
  overflow: hidden;
  animation: fadeDown 120ms ease;
}
.submenu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 0.85rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background 80ms;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  white-space: nowrap;
}
.submenu-item:hover { background: var(--surface-2); color: var(--text); }
.submenu-item.folder-icon { color: var(--warning); }

/* ── Rename Input ────────────────────────────────────────────────────────────── */
.inline-rename {
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  padding: 4px 8px;
  outline: none;
  width: 100%;
  box-shadow: 0 0 0 3px var(--primary-glow-2);
}

/* ── Empty State ─────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state.compact {
  padding: 48px 24px;
}
.empty-state svg { margin: 0 auto 18px; color: var(--muted); }
.empty-state h3 { margin-bottom: 8px; color: var(--text-2); font-size: 1.05rem; }
.empty-state p { font-size: 0.875rem; margin-bottom: 22px; }

/* ── Download Page ───────────────────────────────────────────────────────────── */
.download-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(ellipse at top, #13151F 0%, var(--bg) 70%);
}
.download-card { width: 100%; max-width: 480px; text-align: center; }
.download-card .file-icon { margin: 0 auto 18px; color: var(--primary); }
.download-card .file-meta { margin: 8px 0 24px; color: var(--text-muted); font-size: 0.875rem; }
.download-card .file-meta span { margin: 0 6px; color: var(--border); }
.download-card .form-group { margin-bottom: 14px; text-align: left; }
.download-file-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.download-file-name {
  font-size: 1.1rem;
  margin-bottom: 2px;
}
.download-file-meta {
  font-size: 0.82rem;
  margin: 0;
}
.download-file-separator {
  margin: 0 6px;
  color: var(--border);
}
.download-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Landing Page ───────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 60px 0 48px;
}
.hero-glow {
  width: 72px;
  height: 72px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  box-shadow: var(--shadow-glow);
}
.hero-icon-inner {
  width: 56px;
  height: 56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.hero-icon-inner svg { width: 28px; height: 28px; }
.hero h1 { margin-bottom: 12px; }
.hero p { font-size: 1rem; max-width: 460px; margin: 0 auto; line-height: 1.7; }

.how-it-works { padding: 48px 0; }
.how-it-works h2 { text-align: center; margin-bottom: 32px; font-size: 1.35rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { text-align: center; }
.step-num {
  width: 34px; height: 34px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem;
  margin: 0 auto 12px;
}
.step h3 { font-size: 0.925rem; margin-bottom: 6px; }
.step p { font-size: 0.825rem; color: var(--text-muted); }

.main-form { padding: 0 0 56px; }
.main-form .card { margin-bottom: 24px; }
.main-form-section { margin-top: 20px; }
.home-form-group-spacer { margin-top: 14px; }
.confirm-group-spacer { margin-top: 12px; }
.action-btn-row { margin-top: 24px; }
.result-text {
  font-size: 0.875rem;
  margin-top: 6px;
  color: var(--success);
}

.cloud-auth-bar {
  background: var(--warning-light);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--warning);
  text-align: center;
  margin-bottom: 12px;
  display: none;
}
.cloud-auth-bar.visible { display: block; }

/* ── Footer ───────────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); text-decoration: none; }

/* ── Animations ──────────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Advanced Options ───────────────────────────────────────────────────────── */
.adv-toggle-row { display: flex; justify-content: flex-start; margin-top: 14px; margin-bottom: 2px; }
.adv-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none;
  font-size: 0.85rem; font-weight: 700;
  color: #818cf8; cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all 150ms ease;
  font-family: var(--font);
  border: 1.5px solid rgba(129, 140, 248, 0.4);
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.2), inset 0 0 8px rgba(129, 140, 248, 0.05);
}
.adv-toggle-btn:hover {
  color: #a5b4fc;
  border-color: rgba(129, 140, 248, 0.7);
  box-shadow: 0 0 20px rgba(129, 140, 248, 0.4), inset 0 0 12px rgba(129, 140, 248, 0.1);
}
.adv-chevron { transition: transform 200ms ease; }

.adv-panel {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 10px;
  animation: slideDown 180ms ease;
}

/* ── Passphrase Strength ─────────────────────────────────────────────────────── */
.pass-strength { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.strength-bar { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 2px; transition: width 200ms ease, background 200ms ease; width: 0%; }
.strength-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; min-width: 40px; }

.pass-warning {
  display: flex; align-items: center; gap: 7px;
  margin-top: 8px; padding: 8px 12px;
  background: var(--warning-light);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 500;
  color: var(--warning);
}

.label-opt { font-weight: 400; color: var(--muted); font-size: 0.85em; margin-left: 4px; }

/* ── Error Banner ────────────────────────────────────────────────────────────── */
.error-banner {
  background: var(--error-light);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--error);
  font-size: 0.875rem;
  display: none;
  margin-top: 12px;
}
.error-banner.visible { display: block; }

/* ── Pricing Page ───────────────────────────────────────────────────────────── */
.pricing-page {
  padding-top: 48px;
  padding-bottom: 64px;
}
.pricing-hero {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
}
.pricing-hero h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}
.pricing-hero p,
.pricing-card p,
.pricing-footnote {
  color: var(--text-muted);
}
.pricing-hero p {
  font-size: 1.05rem;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
  justify-content: center;
  gap: 24px;
  max-width: 820px;
  margin: 0 auto;
}
.pricing-card {
  display: flex;
  flex-direction: column;
}
.pricing-card-body {
  margin-bottom: 20px;
}
.pricing-card-body.support {
  margin-top: 8px;
}
.pricing-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.pricing-badge.free {
  background: var(--primary);
  color: #fff;
}
.pricing-support-card {
  position: relative;
}
.pricing-support-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 100px;
  letter-spacing: 0.05em;
}
.pricing-card h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.pricing-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex: 1;
}
.pricing-feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.pricing-footnote-wrap {
  max-width: 520px;
  margin: 40px auto 0;
  text-align: center;
}
.pricing-footnote {
  font-size: 0.85rem;
}

/* ── FAQ Page ───────────────────────────────────────────────────────────────── */
.faq-header {
  padding: 64px 0 48px;
  text-align: center;
}
.faq-header h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #F1F5F9 0%, #7C3AED 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.faq-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}
.faq-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 48px;
}
.faq-toc a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 150ms ease;
}
.faq-toc a:hover {
  background: var(--primary-glow-2);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}
.faq-category-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.faq-section {
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  overflow: hidden;
}
.faq-section.expanded {
  border-color: var(--border);
}
.faq-q {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  transition: background 130ms ease;
}
.faq-q:hover {
  background: var(--surface-2);
}
.faq-q svg {
  flex-shrink: 0;
  color: var(--primary);
}
.faq-q .chevron {
  margin-left: auto;
  color: var(--muted);
  transition: transform 200ms ease;
  flex-shrink: 0;
}
.faq-section.expanded .faq-q .chevron {
  transform: rotate(180deg);
  color: var(--primary);
}
.faq-a {
  display: none;
  padding: 0 22px 20px 56px;
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.7;
}
.faq-section.expanded .faq-a {
  display: block;
}
.faq-a p {
  color: var(--text-2);
  margin-bottom: 10px;
}
.faq-a p:last-child { margin-bottom: 0; }
.faq-a ul {
  padding-left: 20px;
  margin-bottom: 10px;
}
.faq-a ul li {
  color: var(--text-2);
  margin-bottom: 4px;
}
.faq-a strong { color: var(--text); font-weight: 600; }
.faq-a code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--primary);
}
.faq-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 40px 0;
}
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.privacy-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.privacy-card .privacy-icon {
  font-size: 1.4rem;
  margin-bottom: 8px;
}
.privacy-card h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.privacy-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}
.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--success-light);
  border: 1px solid var(--success);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 10px 0;
}
.step-list {
  counter-reset: steps;
  padding: 0;
  list-style: none;
}
.step-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--text-2);
  font-size: 0.9rem;
}
.step-list li::before {
  counter-increment: steps;
  content: counter(steps);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 1px;
}
.faq-privacy-note { margin-top: 16px; }

/* ── Account Security ───────────────────────────────────────────────────────── */
.account-section-title {
  font-weight: 600;
}
.account-section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.account-status-enabled {
  color: var(--success);
}
.account-status-disabled {
  color: var(--muted);
}
.account-back-link {
  margin-top: 20px;
}

/* ── Recovery Codes / 2FA ──────────────────────────────────────────────────── */
.recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}
.recovery-code {
  display: block;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.auth-hero-icon {
  text-align: center;
  margin-bottom: 20px;
}
.auth-heading-center,
.auth-sub-center {
  text-align: center;
}
.qr-panel {
  text-align: center;
  margin: 24px 0;
}
.qr-frame {
  display: inline-block;
  padding: 16px;
  background: white;
  border-radius: 12px;
}
.qr-svg-wrap {
  width: 180px;
  height: 180px;
}
.manual-key {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.manual-key code {
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ── Error Pages ────────────────────────────────────────────────────────────── */
.error-page {
  min-height: calc(100vh - 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}
.error-card {
  max-width: 560px;
  text-align: center;
}
.error-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 6px 16px;
  margin-bottom: 16px;
  border-radius: 100px;
  background: var(--primary-glow-2);
  border: 1px solid var(--border);
  color: var(--primary);
  font-weight: 700;
}
.error-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ── Footer ───────────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); text-decoration: none; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border-soft); padding: 16px 0; }
  .dashboard-main { padding: 24px 20px; }
  .container { padding: 0 16px; }
  .card { padding: 20px; }
  .steps { grid-template-columns: 1fr; gap: 20px; }
  .hero { padding: 40px 0 32px; }
  .mode-tabs { grid-template-columns: 1fr; }
  .files-table { font-size: 0.82rem; }
  .files-table th, .files-table td { padding: 10px 12px; }
  .page-header { padding: 24px 0 20px; }
}

@media (max-width: 640px) {
  .navbar-inner {
    min-height: 58px;
    height: auto;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 12px;
  }
  .navbar-toggle {
    display: inline-flex;
  }
  .navbar-actions {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 10px;
  }
  .navbar-actions.is-open {
    display: flex;
  }
  .navbar-actions .btn,
  .navbar-actions .navbar-user {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .navbar-user {
    padding-right: 0;
  }
  .faq-a {
    padding-left: 22px;
  }
  .download-file-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .recovery-grid {
    grid-template-columns: 1fr;
  }
  .pricing-page {
    padding-top: 32px;
  }
}

@media (max-width: 480px) {
  .expiry-grid { grid-template-columns: 1fr; }
  .btn-lg { padding: 12px 20px; min-height: 48px; }
  .mode-tab {
    padding: 16px 12px;
  }
  .mode-tab .tab-title,
  .mode-tab .tab-desc {
    overflow-wrap: anywhere;
  }
  .result-box .result-url {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── Premium Footer Layout ── */
.footer-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
}
.footer-brand {
  max-width: 480px;
}
.footer-logo {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 8px;
  display: inline-block;
}
.footer-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  text-decoration: none;
  font-size: 0.85rem;
}
.footer-bottom {
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Legal Page Content ── */
.text-content-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 16px;
}
.legal-header {
  text-align: center;
  margin-bottom: 32px;
}
.legal-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.legal-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.legal-card {
  padding: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.legal-section {
  margin-bottom: 24px;
}
.legal-section:last-child {
  margin-bottom: 0;
}
.legal-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}
.legal-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--text-2);
}
.legal-section p {
  color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.6;
}
.legal-section ul {
  margin-left: 20px;
  margin-bottom: 12px;
  color: var(--text-2);
}
.legal-section ul li {
  margin-bottom: 6px;
}
.legal-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 24px 0;
}
.legal-alert {
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin: 16px 0;
  line-height: 1.5;
}
.legal-alert.warning {
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
  color: var(--text-2);
}
.legal-agent { margin-top: 15px; }
.legal-contact-link { color: inherit; text-decoration: underline; }
.legal-note { margin-top: 15px; font-size: 0.9rem; color: var(--text-muted); }

.clipboard-fallback {
  position: fixed;
  left: -9999px;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
  .legal-card {
    padding: 20px;
  }
}

/* ── Upload progress panel ──────────────────────────────────────────────── */
.upload-progress {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.up-stage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--text);
}

.up-spinner {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: up-spin 0.8s linear infinite;
}

@keyframes up-spin { to { transform: rotate(360deg); } }

.up-bar {
  position: relative;
  height: 6px;
  margin: 12px 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.up-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-glow-2), var(--primary), var(--primary-glow-2));
  animation: up-indeterminate 1.15s ease-in-out infinite;
}

@keyframes up-indeterminate {
  from { left: -40%; }
  to { left: 100%; }
}

.up-detail {
  min-height: 1em;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .up-spinner { animation: none; }
  .up-bar-fill { left: 0; width: 100%; animation: none; }
}
