/* ============================================================
   Audio Lens — Claude theme tokens
   Warm paper canvas, Claude clay/coral primary, warm ink,
   editorial serif display.
   ============================================================ */

:root {
  /* ── Surfaces (light) ───────────────────────────────── */
  --bg:        #F4F1E9;          /* warm paper canvas */
  --panel:     #EBE6D9;          /* sunken panels / asides */
  --surface:   #FDFCF8;          /* cards, raised panels, top bar */
  --surface-2: #FFFFFF;          /* hover-elevated cards */
  --overlay:   rgba(41,38,31,0.45);

  /* ── Ink (warm) ──────────────────────────────────────── */
  --text:      #29261F;
  --text-2:    #453F34;
  --muted:     #7C7466;
  --subtle:    #A99F8E;

  /* ── Brand: Claude clay / coral ──────────────────────── */
  --accent:    #D97757;
  --accent-h:  #C15F3C;
  --accent-2:  #A24A2B;
  --accent-bg: rgba(217,119,87,0.10);
  --accent-bd: rgba(217,119,87,0.26);

  /* ── AI / secondary: muted heather ───────────────────── */
  --ai:        #7C6CA6;
  --ai-h:      #665592;
  --ai-bg:     rgba(124,108,166,0.10);
  --ai-bd:     rgba(124,108,166,0.24);

  /* ── Semantic ───────────────────────────────────────────── */
  --success:   #5E8A57;
  --warn:      #C08A2E;
  --danger:    #BC4B3A;

  /* ── Lines ──────────────────────────────────────────────── */
  --border:    #E0D9C9;
  --border-2:  #EBE6D8;
  --hairline:  rgba(41,38,31,0.06);

  /* ── Shape ──────────────────────────────────────────────── */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* ── Elevation (warm) ───────────────────────────────────── */
  --shadow-1: 0 1px 2px rgba(41,38,31,0.05), 0 1px 1px rgba(41,38,31,0.03);
  --shadow-2: 0 4px 14px rgba(41,38,31,0.07), 0 1px 3px rgba(41,38,31,0.05);
  --shadow-3: 0 16px 40px rgba(41,38,31,0.14), 0 4px 10px rgba(41,38,31,0.07);

  /* ── Type — editorial serif display ─────────────────────── */
  --font-sans:    "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Newsreader", "Iowan Old Style", ui-serif, Georgia, serif;
  --font-serif:   "Newsreader", "Iowan Old Style", ui-serif, Georgia, serif;
  --font-mono:    "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* ── Layout ─────────────────────────────────────────────── */
  --content-max: 1480px;
  --gutter: 28px;

  /* ── Login art ──────────────────────────────────────────── */
  --login-grad: linear-gradient(160deg, #F5EFE3 0%, #F0E7D5 55%, #EADCC5 100%);
  --login-wm:   #D3B48C;
  --accent-glow: rgba(217,119,87,0.30);
}

/* ============================================================
   Dark mode — warm near-black, lifted clay.
   ============================================================ */
html[data-theme="dark"] {
  --bg:        #1A1712;
  --panel:     #221E18;
  --surface:   #2A251E;
  --surface-2: #332D24;
  --overlay:   rgba(0,0,0,0.6);

  --text:      #F1EBDD;
  --text-2:    #DBD2C0;
  --muted:     #9C917D;
  --subtle:    #6E6555;

  --accent:    #E08966;
  --accent-h:  #C96E48;
  --accent-2:  #F0A98A;
  --accent-bg: rgba(224,137,102,0.14);
  --accent-bd: rgba(224,137,102,0.34);

  --ai:        #A692CE;
  --ai-h:      #BBA9DC;
  --ai-bg:     rgba(166,146,206,0.14);
  --ai-bd:     rgba(166,146,206,0.30);

  --success:   #82AE72;
  --warn:      #D8A85B;
  --danger:    #D9705C;

  --border:    #3B342A;
  --border-2:  #2C271F;
  --hairline:  rgba(241,235,221,0.06);

  --shadow-1: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-2: 0 4px 14px rgba(0,0,0,0.45);
  --shadow-3: 0 16px 40px rgba(0,0,0,0.6);

  --login-grad: linear-gradient(155deg, #2A211A 0%, var(--bg) 70%);
  --login-wm:   #E08966;
  --accent-glow: rgba(224,137,102,0.36);
}

/* ============================================================
   Base styles & components
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

::selection { background: var(--accent-bg); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; border: 2px solid transparent; }

/* ── Type ────────────────────────────────────────────────── */
.serif { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.021em; }
.mono  { font-family: var(--font-mono); font-feature-settings: "ss01"; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.024em; line-height: 1.14; margin: 0; }
h1 { font-size: 32px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p  { margin: 0; }

a { color: inherit; text-decoration: none; }

[x-cloak] { display: none !important; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.06s ease;
  user-select: none;
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px var(--accent-glow), 0 2px 8px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-h); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--hairline); border-color: var(--muted); }

.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--hairline); border-color: var(--muted); }

.btn-quiet {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-quiet:hover { background: var(--hairline); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }

.btn-ai {
  background: var(--ai);
  color: #fff;
}
.btn-ai:hover { background: var(--ai-h); }

.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-sm svg { width: 13px; height: 13px; }

.btn-lg { padding: 13px 22px; font-size: 14.5px; }

/* ── Input ───────────────────────────────────────────────── */
.field {
  position: relative;
}
.field .lead {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.field .lead svg { width: 16px; height: 16px; display: block; }

.input, .textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}
.input.with-lead { padding-left: 38px; }
.input::placeholder, .textarea::placeholder { color: var(--subtle); }
.input:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
  background: var(--surface);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.55; }

.field-label {
  display: block;
  font-size: 12px; color: var(--text-2); font-weight: 500;
  margin-bottom: 6px;
}

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

.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 600;
  color: var(--muted);
}

.hairline { height: 1px; background: var(--border-2); width: 100%; }

/* ── Badge / chip ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--accent-bg);
  color: var(--accent-2);
  border: 1px solid var(--accent-bd);
}
html[data-theme="dark"] .badge { color: var(--accent-2); }

.badge-neutral {
  background: var(--hairline);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}

.badge-ai {
  background: var(--ai-bg);
  color: var(--ai);
  border: 1px solid var(--ai-bd);
}

.badge-success {
  background: rgba(79,124,90,0.10);
  color: var(--success);
  border: 1px solid rgba(79,124,90,0.25);
}

.badge-warn {
  background: rgba(192,138,46,0.10);
  color: var(--warn);
  border: 1px solid rgba(192,138,46,0.25);
}

.dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 99px;
  background: currentColor;
}

/* ── Tag (interactive) ───────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 400;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: var(--font-sans);
}
.tag:hover { color: var(--text); border-color: var(--muted); }
.tag.is-active {
  background: var(--accent-bg);
  color: var(--accent-2);
  border-color: var(--accent-bd);
}
html[data-theme="dark"] .tag.is-active { color: var(--accent-2); }

/* ── App shell / top nav ─────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topnav {
  display: flex; align-items: center; gap: 28px;
  padding: 0 28px;
  height: 64px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}

.tn-brand {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.tn-logo {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-1);
  background-image: url("/assets/al-monogram.png");
  background-size: 94% 94%;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #D97757;
  border: 1px solid rgba(121,55,28,.30);
  overflow: hidden;
}
.tn-title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}

.tn-nav { display: flex; align-items: center; gap: 4px; }

.tn-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}
.tn-link:hover { background: var(--hairline); color: var(--text); }
.tn-link.is-active {
  background: var(--accent-bg);
  color: var(--accent-2);
  border-color: var(--accent-bd);
}
.tn-link.is-active .tn-ico { color: var(--accent); opacity: 1; }
.tn-ico { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.72; color: currentColor; display: inline-flex; }
.tn-ico svg { width: 100%; height: 100%; }

.tn-spacer { flex: 1; }
.tn-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.tn-language { position: relative; flex-shrink: 0; }
.tn-language-button {
  height: 32px;
  min-width: 56px;
  padding: 0 9px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: color .14s, border-color .14s, background .14s;
}
.tn-language-button:hover,
.tn-language-button[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--accent-bd);
  background: var(--accent-bg);
}
.tn-language-chevron { width: 12px; height: 12px; display: inline-flex; }
.tn-language-chevron svg { width: 100%; height: 100%; }
.tn-language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 174px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  z-index: 35;
}
.tn-language-menu.is-open { display: flex; }
.tn-language-option {
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
}
.tn-language-option:hover { background: var(--hairline); color: var(--text); }
.tn-language-option.is-active { background: var(--accent-bg); color: var(--accent-2); }

.tn-user { position: relative; cursor: pointer; flex-shrink: 0; }
.sb-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--accent-bg);
  color: var(--accent-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
  border: 1px solid var(--accent-bd);
}
.tn-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
}
.tn-menu.is-open { display: flex; }
.tn-menu-name { font-size: 13px; color: var(--text); font-weight: 500; }
.tn-menu-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.tn-menu-link:hover { background: var(--hairline); color: var(--text); }
.sb-ico { width: 16px; height: 16px; display: inline-flex; color: currentColor; }
.sb-ico svg { width: 100%; height: 100%; }

/* ── Topbar (per-page header) ───────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-2);
  background: var(--bg);
  min-height: 70px;
}
.topbar .grow { flex: 1; min-width: 0; }
.topbar h1.page-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
}
.topbar .crumbs {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
}
.topbar .crumbs a:hover { color: var(--text); }

/* Theme toggle */
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.14s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }
.theme-toggle svg { width: 16px; height: 16px; }

/* Page content area */
.page {
  padding: 28px 28px 60px;
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}
.page-narrow { max-width: 880px; }
.page-wide { max-width: none; }

/* ── Empty / loading states ──────────────────────────────── */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 40px; gap: 14px;
  color: var(--muted);
  text-align: center;
}
.empty .empty-ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--hairline);
  display: flex; align-items: center; justify-content: center;
}
.empty .empty-ico svg { width: 22px; height: 22px; }
.empty h3 { font-size: 16px; color: var(--text); }

/* ── Skeleton ─────────────────────────────────────────────── */
@keyframes shimmer { 0% { background-position: -200px 0;} 100% { background-position: calc(200px + 100%) 0; } }
.skeleton {
  background: linear-gradient(90deg, var(--hairline) 0%, var(--border-2) 50%, var(--hairline) 100%);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-sm);
}

/* ── Utility ──────────────────────────────────────────────── */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.muted { color: var(--muted); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fade-in { animation: fadeUp 0.28s cubic-bezier(.2,.6,.2,1) forwards; }
@keyframes fadeUp { from { transform: translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .9s linear infinite; }

/* ── Drag-drop dropzone ──────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--r-xl);
  padding: 56px 32px;
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: all 0.16s ease;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.dropzone:hover { border-color: var(--accent); background: var(--surface-2); }
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-bg); }
.dropzone-ico {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--accent-bd);
}
.dropzone-ico svg { width: 26px; height: 26px; }

/* ── Item card (history/recents) ─────────────────────────── */
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  cursor: pointer;
  transition: all 0.14s ease;
  position: relative;
  overflow: hidden;
}
.item-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: transparent;
  transition: background 0.14s ease;
}
.item-card:hover { border-color: var(--muted); box-shadow: var(--shadow-2); }
.item-card:hover::before { background: var(--accent); }
.item-card .item-type {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-bg); color: var(--accent);
  border: 1px solid var(--accent-bd);
  flex-shrink: 0;
}
.item-card .item-type.is-video {
  background: var(--ai-bg);
  color: var(--ai);
  border-color: var(--ai-bd);
}
.item-card .item-type svg { width: 17px; height: 17px; }

/* ── Progress bars ───────────────────────────────────────── */
.progress-track { background: var(--border); border-radius: 99px; height: 4px; overflow: hidden; position: relative; }
.progress-fill  { height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s ease; }

/* ── AI Chat ─────────────────────────────────────────────── */
.bubble {
  max-width: 640px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
}
.bubble.user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  margin-left: auto;
}
.bubble.ai {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.bubble.ai p { margin: 0 0 8px; }
.bubble.ai p:last-child { margin-bottom: 0; }

.suggestion {
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.14s;
  font-family: var(--font-sans);
}
.suggestion:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

/* Scope-picker option row */
.scope-opt {
  width: 100%; text-align: left;
  padding: 7px 9px;
  border: none; background: transparent;
  font-family: var(--font-sans); font-size: 12.5px;
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  color: var(--text);
}
.scope-opt:hover { background: var(--hairline); }
.scope-opt:disabled { opacity: 0.5; cursor: default; }
.scope-opt:disabled:hover { background: transparent; }

/* ============================================================
   Folders — cards, modal, menu, multi-select
   ============================================================ */

.al-modal-scrim {
  position: fixed; inset: 0; z-index: 200;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeUp 0.18s ease forwards;
}
.al-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  width: 100%; max-width: 420px;
  padding: 22px;
}
.al-field-label {
  display: block;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em;
  font-weight: 600; color: var(--muted);
  margin-bottom: 8px;
}
.al-swatch {
  width: 30px; height: 30px;
  border-radius: var(--r-pill);
  border: none; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.1s ease;
}
.al-swatch:hover { transform: scale(1.08); }
.al-swatch.is-active { transform: scale(1.04); }

.al-menu {
  position: absolute; top: calc(100% + 6px);
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  width: 240px; padding: 5px;
  animation: fadeUp 0.14s ease forwards;
}
.al-menu-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em;
  font-weight: 600; color: var(--subtle);
  padding: 7px 9px 5px;
}
.al-menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: left;
  padding: 8px 9px;
  border: none; background: transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-sans); font-size: 13px; color: var(--text);
  cursor: pointer;
}
.al-menu-item:hover { background: var(--hairline); }
.al-menu-item:disabled { opacity: 0.5; cursor: default; }
.al-menu-item:disabled:hover { background: transparent; }
.al-menu-sep { height: 1px; background: var(--border-2); margin: 5px 4px; }

.folder-glyph {
  color: #fff;
  background-image: linear-gradient(140deg, rgba(255,255,255,0.28), rgba(0,0,0,0.12));
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.folder-glyph svg { width: 50%; height: 50%; }

.folder-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.folder-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 16px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 22px;
  min-height: 148px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
  overflow: hidden;
  isolation: isolate;
}
.folder-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(130% 90% at 100% 0%, var(--fc-accent, transparent), transparent 58%);
  opacity: 0.14;
}
.folder-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-3);
  transform: translateY(-3px);
}
.folder-card:hover::before { opacity: 0.22; }
.folder-card.is-drop {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.folder-card .fc-name {
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  line-height: 1.25; color: var(--text); letter-spacing: -0.01em;
}
.folder-card .fc-meta {
  font-size: 12px; color: var(--muted); margin-top: 3px;
  font-family: var(--font-mono);
}
.folder-card.new-card {
  border-style: dashed;
  align-items: center; justify-content: center;
  color: var(--muted);
  flex-direction: row; gap: 8px;
  min-height: 148px;
}
.folder-card.new-card::before { display: none; }
.folder-card.new-card:hover { color: var(--accent); border-color: var(--accent); box-shadow: none; transform: none; }

/* ── Row checkbox + selection ───────────────────────────── */
.row-check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: all 0.12s ease;
  color: transparent;
  padding: 0;
}
.row-check:hover { border-color: var(--muted); }
.row-check.is-on {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.row-check svg { width: 12px; height: 12px; }
.hist-row.is-selected { background: var(--accent-bg) !important; }

/* ── Bulk action bar ────────────────────────────────────── */
.bulk-bar {
  position: sticky; top: 78px; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-pill);
  padding: 8px 10px 8px 18px;
  box-shadow: var(--shadow-3);
  margin-bottom: 16px;
  animation: fadeUp 0.18s ease forwards;
}
html[data-theme="dark"] .bulk-bar { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.bulk-bar .bulk-count { font-size: 13px; font-weight: 500; white-space: nowrap; }
.bulk-bar .bulk-spacer { flex: 1; }
.bulk-bar .btn-bulk {
  background: rgba(255,255,255,0.14); color: inherit; border: none;
}
.bulk-bar .btn-bulk:hover { background: rgba(255,255,255,0.24); }
html[data-theme="dark"] .bulk-bar .btn-bulk { background: var(--hairline); }
html[data-theme="dark"] .bulk-bar .btn-bulk:hover { background: var(--border-2); }

/* ── Folder badge on a row ──────────────────────────────── */
.folder-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 2px 9px 2px 7px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.folder-chip .fc-dot { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 300;
  padding: 11px 18px;
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-3);
  display: flex; align-items: center; gap: 6px;
  max-width: min(90vw, 560px);
}

/* ── Modal overlay (generic) ─────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}

/* ── Responsive topnav ──────────────────────────────────── */
@media (max-width: 1180px) {
  .topnav { gap: 18px; }
}
@media (max-width: 820px) {
  .topnav { padding: 0 16px; gap: 12px; }
  .tn-link { padding: 8px; }
  .tn-link > span.tn-label { display: none; }
}
@media (max-width: 620px) {
  .tn-title { display: none; }
  .topnav { gap: 8px; }
}
