:root {
  --bg: #0c0a14;
  --bg2: #100d1c;
  --ink: #f2f0fa;
  --muted: #a29fb8;
  --dim: #726f88;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --v1: #7c5cff;
  --v2: #2dd4bf;
  --blue: #4f7cff;
  --card: rgba(255, 255, 255, 0.035);
  --card2: rgba(255, 255, 255, 0.06);
  --glass: rgba(24, 20, 40, 0.55);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #60a5fa;
  --nav-bg: rgba(12, 10, 20, 0.7);
}
:root[data-theme="light"] {
  --bg: #f6f5fb;
  --bg2: #ffffff;
  --ink: #1d1a33;
  --muted: #52506a;
  --dim: #7d7a93;
  --line: rgba(25, 20, 50, 0.10);
  --line2: rgba(25, 20, 50, 0.18);
  --card: rgba(25, 20, 50, 0.045);
  --card2: rgba(25, 20, 50, 0.07);
  --glass: rgba(255, 255, 255, 0.65);
  --nav-bg: rgba(255, 255, 255, 0.75);
}
:root[data-theme="light"] .bg-aura { opacity: .45; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.font-display { font-family: "Plus Jakarta Sans", "Inter", sans-serif; }
a { color: inherit; }

.bg-aura {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(55% 45% at 12% -5%, rgba(124, 92, 255, 0.22) 0%, rgba(124, 92, 255, 0) 60%),
    radial-gradient(50% 40% at 95% 0%, rgba(45, 212, 191, 0.16) 0%, rgba(45, 212, 191, 0) 55%),
    linear-gradient(180deg, var(--bg), var(--bg2) 70%);
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(14px);
  background: var(--nav-bg); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 14px; padding: 13px 20px; max-width: 1080px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #fff;
  font-family: "Plus Jakarta Sans"; font-weight: 800; font-size: 1rem; letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--v1), var(--v2)); box-shadow: 0 8px 20px -8px rgba(124, 92, 255, .7); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: "Plus Jakarta Sans"; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand-sub { font-size: .68rem; color: var(--muted); letter-spacing: .02em; }
.nav-spacer { flex: 1; }
.btn { border: 1px solid var(--line2); background: var(--card2); color: var(--ink); font-weight: 600;
  font-size: .85rem; border-radius: 11px; padding: 8px 14px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: #6d5cff; color: #fff; }
.btn-primary { border: none; color: #fff; background: linear-gradient(135deg, var(--v1), #6d5cff);
  box-shadow: 0 10px 22px -12px rgba(124, 92, 255, .8); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { border-color: rgba(248, 113, 113, .4); color: #fca5a5; }
.btn-danger:hover { border-color: var(--bad); color: #fff; background: rgba(248, 113, 113, .12); }

/* hero */
.hero { padding: 54px 20px 10px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: #c4b5fd;
  background: rgba(124, 92, 255, .14); border: 1px solid rgba(124, 92, 255, .28); padding: 6px 13px; border-radius: 999px; }
.hero-title { font-family: "Plus Jakarta Sans"; font-weight: 800; letter-spacing: -.03em; line-height: 1.03;
  font-size: clamp(2.1rem, 6vw, 3.7rem); margin: 18px 0 0; }
.grad { background: linear-gradient(110deg, var(--v1) 8%, var(--blue) 48%, var(--v2) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--muted); font-size: 1.02rem; max-width: 560px; margin: 15px auto 0; line-height: 1.5; }

/* submit panel */
.panel { margin: 26px auto 0; max-width: 720px; background: var(--glass); border: 1px solid var(--line2);
  border-radius: 18px; padding: 12px; box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .7); backdrop-filter: blur(10px); }
.submit-row { display: flex; gap: 10px; }
.submit-row input { flex: 1; min-width: 0; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 15px;
  font-size: 15px; background: rgba(0, 0, 0, .28); color: var(--ink); transition: .15s; }
.submit-row input::placeholder { color: var(--dim); }
.submit-row input:focus { outline: none; border-color: var(--v1); box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); }

/* ---- upload ---- */
.or-row { display: flex; align-items: center; gap: 12px; margin: 12px 2px; }
.or-line { flex: 1; height: 1px; background: var(--line2); }
.or-txt { color: var(--dim); font-size: .74rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
#upl-row .btn { white-space: nowrap; }
.upl-progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 0 2px; }
.upl-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.upl-fill { height: 100%; width: 0%; border-radius: 999px; transition: width .25s;
  background: linear-gradient(90deg, var(--v1), var(--v2)); }

.notice { margin: 16px auto 0; max-width: 720px; border-radius: 12px; padding: 11px 15px; font-size: .85rem;
  border: 1px solid; display: flex; gap: 9px; align-items: flex-start; }
.notice.warn { color: #fde68a; background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .28); }
.notice.info { color: #bfdbfe; background: rgba(96, 165, 250, .07); border-color: rgba(96, 165, 250, .24); }

/* cards / list */
.section-title { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; margin: 40px 4px 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid { grid-template-columns: 1fr 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 17px;
  cursor: pointer; transition: .18s; display: flex; flex-direction: column; gap: 8px; }
.card:hover { border-color: #3a2f66; background: var(--card2); transform: translateY(-2px);
  box-shadow: 0 22px 44px -28px rgba(0, 0, 0, .8); }
.card-title { font-family: "Plus Jakarta Sans"; font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.card-meta { color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.card-foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; flex-wrap: wrap; }

.badge { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 6px; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.queued { color: #cbd5e1; background: rgba(203, 213, 225, .1); }
.badge.processing { color: var(--warn); background: rgba(251, 191, 36, .12); }
.badge.processing .dot { animation: pulse 1.1s infinite; }
.badge.done { color: var(--ok); background: rgba(52, 211, 153, .13); }
.badge.error { color: var(--bad); background: rgba(248, 113, 113, .13); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.step { color: var(--dim); font-size: .78rem; }
.empty { text-align: center; color: var(--muted); padding: 50px 0; }

/* detail */
.detail-head { margin: 30px 0 8px; }
.back { color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 600; }
.back:hover { color: var(--v1); }
.detail-title { font-family: "Plus Jakarta Sans"; font-weight: 800; font-size: clamp(1.5rem, 4vw, 2.2rem);
  letter-spacing: -.02em; margin: 12px 0 6px; line-height: 1.12; }
.title-edit { border: none; background: none; color: var(--dim); cursor: pointer; font-size: 1.05rem;
  padding: 4px 7px; border-radius: 8px; vertical-align: middle; margin-left: 6px; transition: .15s; }
.title-edit:hover { color: var(--v1); background: rgba(124, 92, 255, .12); }
.title-input { width: 100%; max-width: 720px; border: 1px solid var(--v1); border-radius: 12px; padding: 10px 14px;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif; font-weight: 800; font-size: clamp(1.1rem, 3vw, 1.6rem);
  letter-spacing: -.02em; background: rgba(0, 0, 0, .3); color: var(--ink);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); }
.title-input:focus { outline: none; }
.detail-meta { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px 16px; }

.block { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-top: 18px; }
.block h2 { font-family: "Plus Jakarta Sans"; font-weight: 700; font-size: 1.05rem; margin: 0 0 12px;
  display: flex; align-items: center; gap: 9px; }
.block h2 .ic { font-size: 1.1rem; }
.tldr-summary { font-size: 1.05rem; line-height: 1.5; color: #e6e3f5; }
.bullets { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.bullets li { position: relative; padding-left: 20px; color: #d4d1e6; line-height: 1.45; font-size: .94rem; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--v1), var(--v2)); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .8rem; font-weight: 600; color: #c4b5fd; background: rgba(124, 92, 255, .1);
  border: 1px solid rgba(124, 92, 255, .22); padding: 5px 12px; border-radius: 999px; }

.speaker-row { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.speaker-row:first-of-type { border-top: none; }
.sp-tag { flex-shrink: 0; font-weight: 700; font-size: .82rem; padding: 4px 10px; border-radius: 8px;
  height: fit-content; }
.sp-body { flex: 1; }
.sp-body .st { color: var(--ink); font-weight: 600; font-size: .9rem; }
.sp-body .ss { color: var(--muted); font-size: .88rem; line-height: 1.45; margin-top: 3px; }
.sp-tag a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sp-edit-btn { margin-left: auto; font-size: .74rem; padding: 5px 11px; }

/* speaker edit form */
.sp-form { display: flex; flex-direction: column; gap: 10px; }
.sp-form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sp-form-row .sp-tag { min-width: 92px; text-align: center; }
.sp-form-row input { flex: 1; min-width: 130px; border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px;
  font-size: .9rem; background: rgba(0, 0, 0, .28); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.sp-form-row input:focus { outline: none; border-color: var(--v1); box-shadow: 0 0 0 3px rgba(124, 92, 255, .16); }
.sp-form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* export */
.export-row { display: flex; gap: 10px; flex-wrap: wrap; }
.export-row .btn { text-decoration: none; }

/* ---- tags ---- */
.tags-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 0; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700;
  color: #c4b5fd; background: rgba(124, 92, 255, .12); border: 1px solid rgba(124, 92, 255, .26);
  padding: 4px 6px 4px 11px; border-radius: 999px; }
.tag-chip a { color: inherit; text-decoration: none; }
.tag-chip a:hover { text-decoration: underline; }
.tag-chip.small { padding: 3px 9px; font-size: .7rem; }
.tag-x { border: none; background: none; color: var(--dim); cursor: pointer; font-size: .95rem; line-height: 1;
  padding: 0 4px; border-radius: 50%; }
.tag-x:hover { color: var(--bad); }
.tag-add input { width: 90px; border: 1px dashed var(--line2); border-radius: 999px; padding: 5px 12px;
  font-size: .78rem; font-weight: 700; background: transparent; color: var(--ink); }
.tag-add input:focus { outline: none; border-color: var(--v1); }

/* ---- markdown doc rendering ---- */
.md-doc { line-height: 1.55; font-size: .93rem; color: #d9d6ea; }
.md-doc p { margin: 8px 0; }
.md-doc .md-h { font-family: "Plus Jakarta Sans"; letter-spacing: -.01em; margin: 20px 0 8px; }
.md-doc h2.md-h { font-size: 1.3rem; }
.md-doc h3.md-h { font-size: 1.05rem; color: #cfc9e8; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.md-doc h4.md-h { font-size: .95rem; }
.md-doc ul, .md-doc ol { margin: 8px 0; padding-left: 22px; }
.md-doc li { margin: 4px 0; }
.md-doc code { background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .85em; }
.md-doc a { color: var(--info); }
.md-doc blockquote { border-left: 3px solid var(--v1); margin: 10px 0; padding: 4px 0 4px 14px; color: #cfc9e8; font-style: italic; }
.md-doc hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.md-fm { background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin-bottom: 14px; overflow-x: auto; }
.md-fm pre { font-size: .78rem; color: var(--muted); line-height: 1.5; }

/* obsidian-style callouts */
.callout { border: 1px solid var(--line2); border-left-width: 4px; border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.callout-title, .callout summary { font-weight: 700; font-size: .88rem; cursor: default; }
.callout summary { cursor: pointer; }
.callout-body { margin-top: 6px; font-size: .9rem; line-height: 1.5; color: #cfc9e8; }
.callout-success { border-left-color: var(--ok); background: rgba(52, 211, 153, .06); }
.callout-success .callout-title, .callout-success summary { color: var(--ok); }
.callout-failure, .callout-danger { border-left-color: var(--bad); background: rgba(248, 113, 113, .06); }
.callout-failure .callout-title, .callout-failure summary { color: var(--bad); }
.callout-warning { border-left-color: var(--warn); background: rgba(251, 191, 36, .06); }
.callout-warning .callout-title, .callout-warning summary { color: var(--warn); }
.callout-note, .callout-info { border-left-color: var(--info); background: rgba(96, 165, 250, .05); }
.callout-note .callout-title, .callout-note summary { color: var(--info); }

/* knowledge base */
.kb-space-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.kb-space-row:first-of-type { border-top: none; }
.kb-space-row a { color: var(--ink); font-weight: 600; text-decoration: none; }
.kb-space-row a:hover { color: var(--v1); }
.nav-kb { text-decoration: none; font-size: .82rem; }
.kb-updated { color: var(--dim); font-size: .74rem; font-weight: 500; margin-left: 12px; }
.meta-link { color: var(--info); text-decoration: none; font-weight: 600; }
.meta-link:hover { text-decoration: underline; }

/* KB citations */
.cite { display: inline-flex; align-items: center; gap: 0; vertical-align: baseline; margin: 0 2px; }
.cite-play { border: 1px solid rgba(45, 212, 191, .35); background: rgba(45, 212, 191, .1); color: var(--v2);
  font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 8px;
  border-radius: 999px 0 0 999px; cursor: pointer; transition: .15s; line-height: 1.3; }
.cite-play:hover { background: rgba(45, 212, 191, .22); }
.cite-open { border: 1px solid rgba(45, 212, 191, .35); border-left: none; background: rgba(45, 212, 191, .05);
  color: var(--v2); font-size: .72rem; padding: 2px 7px; border-radius: 0 999px 999px 0; text-decoration: none; line-height: 1.3; }
.cite-open:hover { background: rgba(45, 212, 191, .18); }
a.cite-src { border: 1px solid rgba(45, 212, 191, .35); background: rgba(45, 212, 191, .07); color: var(--v2);
  font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-decoration: none; }
a.cite-src:hover { background: rgba(45, 212, 191, .18); }
.mini-title { color: var(--muted); font-size: .78rem; font-weight: 600; margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }
.stat-tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; text-align: center; }
.stat-tile .stat-n { font-family: "Plus Jakarta Sans"; font-weight: 800; font-size: 2rem; line-height: 1;
  background: linear-gradient(120deg, var(--v1), var(--v2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-tile .stat-l { margin-top: 7px; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat-tile .stat-sub { margin-top: 4px; font-size: .8rem; color: var(--dim); }

/* toast */
#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 90;
  background: rgba(20, 17, 34, .96); border: 1px solid var(--line2); color: var(--ink); font-size: .88rem; font-weight: 600;
  padding: 11px 18px; border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.quote { border-left: 3px solid var(--v1); padding: 4px 0 4px 14px; margin: 14px 0; cursor: pointer; }
.quote:hover .qt { color: #fff; }
.quote .qt { font-size: 1rem; line-height: 1.5; color: #e6e3f5; font-style: italic; }
.quote .qm { color: var(--muted); font-size: .8rem; margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }
.ts { color: var(--v2); font-variant-numeric: tabular-nums; font-weight: 600; }

.claim { padding: 14px 0; border-top: 1px solid var(--line); }
.claim:first-of-type { border-top: none; }
.claim-top { display: flex; gap: 10px; align-items: flex-start; }
.verdict { flex-shrink: 0; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.verdict.accurate { color: var(--ok); background: rgba(52, 211, 153, .13); }
.verdict.inaccurate { color: var(--bad); background: rgba(248, 113, 113, .13); }
.verdict.misleading { color: var(--warn); background: rgba(251, 191, 36, .13); }
.verdict.unverifiable { color: #cbd5e1; background: rgba(203, 213, 225, .1); }
.claim-text { font-weight: 600; color: var(--ink); line-height: 1.4; }
.claim-exp { color: var(--muted); font-size: .9rem; line-height: 1.45; margin-top: 6px; }
.claim-src { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.claim-src a { color: var(--info); font-size: .8rem; text-decoration: none; word-break: break-all; }
.claim-src a:hover { text-decoration: underline; }
.unverified { color: var(--warn); font-size: .78rem; margin-top: 6px; }

/* transcript */
.tr-wrap { position: relative; }
.transcript { display: flex; flex-direction: column; gap: 3px; max-height: 620px; overflow-y: auto; padding-right: 6px; position: relative; }
/* Reading mode: karaoke follow-along — current line lit, the rest receded. */
.transcript.reading .utt { opacity: .45; transition: opacity .25s; }
.transcript.reading .utt:hover { opacity: .85; }
.transcript.reading .utt.active { opacity: 1; background: rgba(124, 92, 255, .16); box-shadow: inset 3px 0 0 #7c5cff; }
.transcript.reading .utt.active .u-tx { color: #fff; }
.read-resume { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 5; box-shadow: 0 4px 16px rgba(0, 0, 0, .55); }

/* members (Discord-gated) */
.members-gate, .members-welcome { max-width: 560px; margin: 40px auto; text-align: center; }
.members-gate h1, .members-welcome h1 { font-size: 1.6rem; margin: 10px 0 8px; }
.members-gate p, .members-welcome p { color: var(--dim); line-height: 1.5; }
.members-badge { font-size: 2.6rem; }
.members-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.members-welcome { text-align: left; }
.btn-discord { display: inline-block; margin-top: 18px; background: #5865f2; border-color: #5865f2; color: #fff; padding: 11px 20px; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; }
.utt { display: flex; gap: 12px; padding: 7px 9px; border-radius: 9px; cursor: pointer; transition: background .12s; }
.utt:hover { background: var(--card); }
.utt.active { background: rgba(124, 92, 255, .12); }
.utt .u-ts { flex-shrink: 0; color: var(--dim); font-size: .78rem; font-variant-numeric: tabular-nums; padding-top: 2px; width: 44px; }
.utt .u-body { flex: 1; }
.utt .u-sp { font-weight: 700; font-size: .82rem; }
.utt .u-tx { color: #d4d1e6; line-height: 1.45; font-size: .92rem; }

/* ---- chat ---- */
.chat-clear { margin-left: auto; font-size: .74rem; padding: 5px 11px; }
.chat-msgs { display: flex; flex-direction: column; gap: 10px; max-height: 440px; overflow-y: auto; padding: 4px 2px 10px; }
.chat-empty { color: var(--dim); font-size: .88rem; padding: 12px 4px; }
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.chat-bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: .92rem; line-height: 1.5; }
.chat-msg.user .chat-bubble { background: linear-gradient(135deg, var(--v1), #6d5cff); color: #fff;
  border-bottom-right-radius: 5px; }
.chat-msg.assistant .chat-bubble { background: var(--card2); border: 1px solid var(--line);
  color: #e6e3f5; border-bottom-left-radius: 5px; }
.chat-bubble ul { margin: 6px 0; padding-left: 20px; }
.chat-bubble li { margin: 3px 0; }
.chat-bubble code { background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; font-size: .85em; }
.chat-bubble .ts-link { color: var(--v2); font-weight: 600; text-decoration: none; cursor: pointer;
  font-variant-numeric: tabular-nums; }
.chat-bubble .ts-link:hover { text-decoration: underline; }
.chat-input-row { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.chat-input-row textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--line2); border-radius: 12px;
  padding: 11px 14px; font-size: .92rem; font-family: inherit; line-height: 1.45; background: rgba(0, 0, 0, .28);
  color: var(--ink); transition: border-color .15s, box-shadow .15s; max-height: 140px; }
.chat-input-row textarea::placeholder { color: var(--dim); }
.chat-input-row textarea:focus { outline: none; border-color: var(--v1); box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); }

/* player */
.player-bar { position: sticky; bottom: 0; z-index: 30; margin-top: 22px;
  background: rgba(16, 13, 28, 0.92); border: 1px solid var(--line2); border-radius: 14px; padding: 10px 14px;
  backdrop-filter: blur(12px); box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, .8); }
.player-bar audio { width: 100%; height: 40px; }

/* login */
.login-wrap { min-height: 80vh; display: grid; place-items: center; padding: 40px 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--glass); border: 1px solid var(--line2);
  border-radius: 20px; padding: 30px 26px; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8); backdrop-filter: blur(10px); }
.login-card h1 { font-family: "Plus Jakarta Sans"; font-weight: 800; font-size: 1.5rem; margin: 14px 0 4px; letter-spacing: -.02em; }
.login-card p { color: var(--muted); font-size: .9rem; margin: 0 0 20px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input { width: 100%; border: 1px solid var(--line2); border-radius: 11px; padding: 11px 14px; font-size: 15px;
  background: rgba(0, 0, 0, .3); color: var(--ink); }
.field input:focus { outline: none; border-color: var(--v1); box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); }
.err { color: var(--bad); font-size: .85rem; margin-top: 10px; min-height: 18px; }

.footer { color: var(--dim); font-size: .8rem; padding: 40px 0 60px; text-align: center; line-height: 2; }
.footer a { color: var(--dim); text-decoration: none; font-weight: 600; }
.footer a:hover { color: var(--ink); }

/* ---- suggestion dialog ---- */
#fb-dlg { background: var(--bg2); color: var(--ink); border: 1px solid var(--line2);
  border-radius: 14px; padding: 20px; width: min(440px, 92vw); }
#fb-dlg::backdrop { background: rgba(0,0,0,.6); }
#fb-dlg h3 { margin: 0 0 12px; }
#fb-dlg form { display: flex; flex-direction: column; gap: 10px; }
#fb-dlg textarea, #fb-dlg input { background: var(--card); color: inherit;
  border: 1px solid var(--line2, #333); border-radius: 8px; padding: 10px; font: inherit; resize: vertical; }
#fb-dlg .fb-row { display: flex; gap: 10px; justify-content: flex-end; }
#fb-dlg .fb-close { position: absolute; top: 10px; right: 10px; background: none; border: none;
  color: var(--dim); font-size: 1rem; cursor: pointer; padding: 6px; line-height: 1; }
#fb-dlg .fb-close:hover { color: var(--ink); }
#fb-dlg { position: relative; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line2);
  border-top-color: var(--v1); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.cost { color: var(--dim); font-size: .78rem; }
