/* GAT design system: one neutral palette, one accent, light and dark. Every page links this file.
   Tokens first, then base, then components (alphabetical), then page layouts. */

:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --surface-3: #e9e9ed;
  --border: #e4e4e8;
  --border-strong: #d1d1d8;
  --text: #0f1115;
  --text-2: #4a4f5a;
  --text-3: #80858f;
  --accent: #2f5bea;          /* GMS blue, refined */
  --accent-hover: #2149cf;
  --accent-soft: #eef2fe;
  --accent-text: #2149cf;
  --ai: #6d4aff;              /* used only for AI features */
  --ai-soft: #f2efff;
  --ok: #138a52;
  --ok-soft: #e8f6ee;
  --warn: #a15c00;
  --warn-soft: #fdf3e2;
  --danger: #c4321f;
  --danger-soft: #fdecea;
  --highlight: #fff4c2;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 18, 24, 0.05);
  --shadow: 0 1px 2px rgba(16, 18, 24, 0.04), 0 4px 16px rgba(16, 18, 24, 0.06);
  --shadow-lg: 0 8px 40px rgba(16, 18, 24, 0.14);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e11;
    --surface: #15171b;
    --surface-2: #1c1f24;
    --surface-3: #262a31;
    --border: #262a31;
    --border-strong: #353a43;
    --text: #eceef2;
    --text-2: #a9aeb8;
    --text-3: #727884;
    --accent: #5b82ff;
    --accent-hover: #7896ff;
    --accent-soft: #18213d;
    --accent-text: #8fa8ff;
    --ai: #9b85ff;
    --ai-soft: #211c3d;
    --ok: #3ccb84;
    --ok-soft: #102a1d;
    --warn: #f0b04a;
    --warn-soft: #2e2210;
    --danger: #ff7a68;
    --danger-soft: #34160f;
    --highlight: #3a3212;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- components ---------- */

/* Avatar + account menu */
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.menu-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); text-align: left; cursor: pointer; text-decoration: none;
}
.menu-item:hover { background: var(--surface-2); text-decoration: none; }

/* Badges (status pills) */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.busy { background: var(--accent-soft); color: var(--accent-text); }
.badge.busy::before { animation: pulse 1.2s ease-in-out infinite; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.ai { background: var(--ai-soft); color: var(--ai); }
@keyframes pulse { 50% { opacity: 0.25; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.1s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ai { background: var(--ai); border-color: var(--ai); color: #fff; }
.btn.ai:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 30px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-body { padding: 18px 20px 20px; }

/* Citations in answers: small numbered chips */
a.cite {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin: 0 1px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-text);
  font-size: 11px; font-weight: 600; line-height: 1; vertical-align: 2px; text-decoration: none;
}
a.cite:hover { background: var(--accent); color: #fff; }

/* Chips (suggestions, filters) */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 13px; cursor: pointer; text-align: left;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }

/* Dropzone (file pickers) */
.dropzone {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone .dz-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border);
}
.dropzone .dz-title { font-weight: 550; }
#cdd_name::-webkit-calendar-picker-indicator { display: none !important; }
.dropzone .dz-hint { color: var(--text-3); font-size: 12.5px; }
.dropzone.filled { border-style: solid; background: var(--surface); }
.file-list { display: grid; gap: 6px; margin-top: 8px; }
.file-list:empty { display: none; }
.file-pill {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.file-pill .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pill .size { color: var(--text-3); font-size: 12px; }

/* Empty states */
.empty { display: grid; justify-items: center; gap: 8px; padding: 44px 20px; text-align: center; color: var(--text-2); }
.empty .empty-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-3); margin-bottom: 4px;
}
.empty .empty-icon svg.i { width: 22px; height: 22px; }
.empty strong { color: var(--text); font-weight: 600; }

/* Form fields */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 550; color: var(--text); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.lg { height: 48px; font-size: 15px; padding: 0 16px; border-radius: var(--radius); }
.input[type=date], .input[type=time] { padding-right: 8px; }
.row { display: grid; gap: 12px; grid-template-columns: 1.3fr 1fr 1fr; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr 1fr; } .row > :first-child { grid-column: 1 / -1; } }

/* Progress bar */
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 0.2s linear; }
.progress.indeterminate > i { width: 35%; animation: slide 1.1s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* Segmented control */
.segmented { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button {
  height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: none;
  color: var(--text-2); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.segmented button[aria-checked=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Spinner */
.spinner {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; opacity: 0.8;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loading rows */
.skeleton { border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: var(--radius); background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg); font-size: 13.5px;
  animation: toast-in 0.25s var(--ease);
}
.toast.bad { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Tooltip-ish keyboard hint */
kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px;
  font: 11px var(--mono); color: var(--text-3); background: var(--surface);
}

/* ---------- app shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1200px; margin: 0 auto; height: 56px; padding: 0 20px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: -0.01em; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--text); color: var(--bg);
}
.brand-mark svg { width: 16px; height: 16px; }
.brand small { font-weight: 500; color: var(--text-3); font-size: 12.5px; }
.tabs { display: flex; gap: 2px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: 8px; color: var(--text-2); font-weight: 500; text-decoration: none;
}
.tab:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.tab[aria-current=page] { color: var(--text); background: var(--surface-3); }
.topbar .spacer { flex: 1; }
body:has(.topbar) { min-height: 100vh; display: flex; flex-direction: column; }
.page { max-width: 1200px; width: 100%; margin: 0 auto; padding: 28px 20px 64px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin-top: 4px; color: var(--text-2); }
.footer-note { max-width: 1200px; margin: 0 auto; padding: 0 20px 28px; color: var(--text-3); font-size: 12.5px; }
.footer-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 720px) {
  .topbar-inner { gap: 12px; padding: 0 14px; }
  .brand small { display: none; }
  /* a backdrop-filter would make the fixed tab bar position itself inside the header, so phones get a solid header */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  /* phones: the tabs become an app-style bottom bar with labels */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; justify-content: space-around; gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--border);
    backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  }
  .tab { flex: 1; flex-direction: column; gap: 2px; height: 48px; justify-content: center; font-size: 11px; border-radius: 10px; }
  .tab svg.i { width: 20px; height: 20px; }
  .tab[aria-current=page] { background: none; color: var(--accent-text); }
  body:has(.tabs) { padding-bottom: 68px; }
  .toasts { bottom: 84px; }
  .ask-dock { bottom: 68px; }
  .ask-wrap { min-height: calc(100vh - 56px - 20px - 68px); }
  .page { padding: 20px 14px 48px; }
}

/* ---------- Transcribe view ---------- */
.transcribe-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .transcribe-grid { grid-template-columns: 1fr; } }
.upload-form { display: grid; gap: 16px; }
.upload-card { position: sticky; top: 76px; }
@media (max-width: 960px) { .upload-card { position: static; } }
.upload-status { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-text); font-size: 13px; }
.list-tools { display: flex; gap: 8px; align-items: center; }
.list-tools .input { height: 32px; width: 200px; }
.sub-list { display: grid; }
.sub {
  display: grid; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border);
  animation: fade-in 0.25s var(--ease);
}
.sub:first-child { border-top: 0; }
@keyframes fade-in { from { opacity: 0; } }
.sub-top { display: flex; align-items: flex-start; gap: 12px; }
.sub-title { font-weight: 600; font-size: 14.5px; }
.sub-meta { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.sub-top .badge { margin-left: auto; }
.downloads { display: flex; flex-wrap: wrap; gap: 6px; }
.dl {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 500; text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.dl:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }
.dl svg.i { color: var(--text-3); }
.dl.ai svg.i { color: var(--ai); }
.dl .ext { color: var(--text-3); font-size: 11px; font-weight: 500; }
.group-name { font-size: 12px; color: var(--text-3); margin-bottom: -4px; }
.dl.ai.action { border-color: color-mix(in srgb, var(--ai) 35%, var(--border)); color: var(--ai); cursor: pointer; background: var(--ai-soft); }
.dl.ai.action:hover { border-color: var(--ai); }
.dl.ai.action svg.i { color: var(--ai); }
.dl.ai.busy { color: var(--ai); background: var(--ai-soft); border-color: transparent; }
.sub .menu-panel { left: 0; right: auto; min-width: 270px; }
.ai-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--ai-soft); }
.ai-row .ai-text { flex: 1; min-width: 180px; font-size: 13px; color: var(--text-2); }
.ai-row .ai-text strong { color: var(--text); font-weight: 600; }
.sub-note { font-size: 12.5px; color: var(--text-2); }
.sub-note.bad { color: var(--danger); }

/* ---------- Ask view ---------- */
.ask-wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 56px - 28px); }
/* empty conversation: title and suggestions centred above the box */
.ask-empty { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 12px; }
/* the question box stays pinned to the bottom of the window, like a chat app */
.ask-dock { position: sticky; bottom: 0; z-index: 5; margin-top: auto; padding: 14px 0 16px; background: linear-gradient(to bottom, transparent, var(--bg) 22px); }
.link-btn { border: 0; background: none; padding: 0; color: var(--text-2); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--text); }
body.ask-mode .footer-note { display: none; }
body.ask-mode .page { padding-bottom: 0; }
.ask-hero { text-align: center; padding: 28px 0 22px; }
.ask-hero h1 { font-size: 30px; font-weight: 680; letter-spacing: -0.025em; }
.ask-hero p { margin-top: 8px; color: var(--text-2); }
.ask-box {
  position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px;
  border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ask-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.ask-box textarea {
  flex: 1; min-height: 40px; max-height: 180px; padding: 9px 0; border: 0; resize: none; outline: none;
  background: transparent; font-size: 15px; line-height: 1.45;
}
.ask-box .btn { flex: none; border-radius: 10px; }
.ask-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.thread { display: grid; gap: 18px; padding-top: 4px; }
.thread:empty { display: none; }
.qa { display: grid; gap: 10px; animation: fade-in 0.3s var(--ease); scroll-margin-top: 76px; }
.q { justify-self: end; max-width: 85%; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--surface-3); font-weight: 500; }
.a { padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); line-height: 1.65; font-size: 14.5px; }
.a p { margin: 0 0 12px; }
.a ul { margin: 0 0 12px; padding-left: 20px; }
.a li { margin: 3px 0; }
.a li.nested { margin-left: 20px; list-style: circle; }
.a > :last-child { margin-bottom: 0; }
.a .a-group { font-weight: 600; margin: 16px 0 4px; }
.a .a-group:first-child { margin-top: 0; }
.a-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--text-3); font-size: 12.5px; }
.a-head .badge { height: 20px; }
.a-working { display: grid; gap: 10px; }
.a-working .step { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; }
.a-working .step.done { color: var(--text-3); }
.a-working .step.done .dot { background: var(--ok); }
.a-working .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex: none; }
.a-working .step.now .dot { background: var(--accent); animation: pulse 1s infinite; }
.sources { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.sources h3 { color: var(--text-3); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.source { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--text-2); text-decoration: none; padding: 2px 0; }
.source:hover { color: var(--text); text-decoration: none; }
.source .n { flex: none; min-width: 18px; height: 18px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.sources .more { justify-self: start; margin-top: 2px; }
.source .when { color: var(--text-3); margin-left: auto; white-space: nowrap; font-size: 12px; }
.a-foot { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--text-3); font-size: 12px; }
.a-foot .spacer { flex: 1; }

/* ---------- Library view ---------- */
.lib-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.lib-tools .search { position: relative; flex: 1; min-width: 220px; }
.lib-tools .search svg.i { position: absolute; left: 12px; top: 11px; color: var(--text-3); }
.lib-tools .search .input { padding-left: 36px; }
.lib-tools select.input { width: 240px; flex: none; }
@media (max-width: 600px) { .lib-tools select.input { width: 100%; } }
.month { margin: 22px 0 8px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.month:first-child { margin-top: 0; }
.lib-list { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.lib-item { display: grid; grid-template-columns: 88px 1fr auto; gap: 16px; align-items: start; padding: 14px 18px; background: var(--surface); color: var(--text); text-decoration: none; }
.lib-item:hover { background: var(--surface-2); text-decoration: none; }
.lib-date { color: var(--text-3); font-size: 12.5px; padding-top: 1px; }
.lib-name { font-weight: 600; }
.lib-sum { color: var(--text-2); font-size: 13px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-item svg.i { color: var(--text-3); margin-top: 2px; }
@media (max-width: 600px) { .lib-item { grid-template-columns: 1fr auto; gap: 2px 12px; } .lib-date { grid-column: 1 / -1; padding: 0; } }
mark { background: var(--highlight); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Meeting reader ---------- */
.reader { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 960px) { .reader { grid-template-columns: 1fr; } }
.reader aside { position: sticky; top: 76px; display: grid; gap: 14px; max-height: calc(100vh - 96px); overflow: auto; padding-bottom: 8px; }
@media (max-width: 960px) { .reader aside { position: static; max-height: none; } }
.aside-card { padding: 16px; }
.aside-card h3 { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.toc { display: grid; gap: 1px; }
.toc a { display: flex; gap: 10px; padding: 5px 8px; margin: 0 -8px; border-radius: 6px; color: var(--text-2); font-size: 13px; text-decoration: none; }
.toc a:hover { background: var(--surface-2); color: var(--text); }
.toc .t { color: var(--text-3); font: 12px var(--mono); flex: none; width: 52px; padding-top: 1px; }
.who-list { display: grid; gap: 8px; font-size: 13px; }
.who-list .who-row { display: flex; gap: 10px; align-items: baseline; }
.speaker-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.speakers-raw { white-space: pre-wrap; font-size: 13px; color: var(--text-2); }
.reader-tools { position: sticky; top: 56px; z-index: 10; display: flex; gap: 10px; align-items: center; padding: 12px 0; background: var(--bg); }
.reader-tools .search { position: relative; flex: 1; }
.reader-tools .search svg.i { position: absolute; left: 12px; top: 11px; color: var(--text-3); }
.reader-tools .search .input { padding-left: 36px; }
.transcript { padding: 6px 0; }
.line {
  display: grid; grid-template-columns: 64px 90px minmax(0, 1fr); gap: 12px;
  padding: 7px 20px; scroll-margin-top: 130px; border-left: 3px solid transparent;
}
.line:hover { background: var(--surface-2); }
.line .at { color: var(--text-3); font: 12px var(--mono); padding-top: 3px; text-decoration: none; }
.line .at:hover { color: var(--accent-text); }
.line .who { align-self: start; display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; font-weight: 500; padding-top: 1px; white-space: nowrap; }
.line .text { line-height: 1.6; }
.line.cited { background: var(--highlight); border-left-color: var(--warn); }
.line.same-speaker .who { visibility: hidden; }
@media (max-width: 600px) { .line { grid-template-columns: 56px 1fr; padding: 7px 14px; } .line .text { grid-column: 1 / -1; } }

/* ---------- Login ---------- */
.auth {
  min-height: 100vh; display: grid; grid-template-rows: 1fr auto; place-items: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%; max-width: 400px; padding: 32px;
  border-radius: 20px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid color-mix(in srgb, #fff 40%, transparent);
  box-shadow: 0 24px 80px rgba(5, 12, 30, 0.35);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.auth-card .brand { margin-bottom: 28px; }
.auth-card h1 { font-size: 24px; }
.auth-card .lead { margin: 6px 0 24px; color: var(--text-2); }
.auth-card form { display: grid; gap: 14px; }
.auth-card .error { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 13px; margin-bottom: 14px; }
.auth-card .switch { margin-top: 18px; font-size: 13px; color: var(--text-2); text-align: center; }
.code-input { letter-spacing: 0.5em; text-align: center; font: 600 22px var(--mono); height: 54px; }
.auth-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding-top: 24px; color: rgba(255, 255, 255, 0.85); font-size: 12px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.auth-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
