@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  font-family: "DM Sans", sans-serif;
  --bg: #0d1017;
  --panel: #151923;
  --panel-2: #1b202c;
  --line: #2a3040;
  --text: #f3f5f7;
  --muted: #8d95a5;
  --acid: #d8ff45;
  --violet: #8b7dff;
  --coral: #ff746c;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; }
.topbar { height: 76px; padding: 0 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 32px; position: sticky; top: 0; background: rgba(13,16,23,.94); backdrop-filter: blur(18px); z-index: 10; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; min-width: 210px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: var(--acid); color: #10130b; border-radius: 11px; font: 700 21px "Space Grotesk"; transform: rotate(-4deg); }
.brand strong, .brand small { display: block; }.brand strong { font: 700 16px "Space Grotesk"; }.brand small { color: var(--muted); font-size: 11px; margin-top: 1px; }
.main-nav { display: flex; gap: 4px; margin-right: auto; }.main-nav button, .connection-tools button { background: none; border: 0; cursor: pointer; }
.main-nav button { padding: 10px 14px; color: var(--muted); border-radius: 9px; }.main-nav button:hover, .main-nav button.active { color: var(--text); background: var(--panel-2); }
.connection-tools { display: flex; align-items: center; gap: 12px; }.connection { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; text-transform: capitalize; }.connection i { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }.connection[data-state="live"] i { background: var(--acid); box-shadow: 0 0 14px rgba(216,255,69,.5); }
.audio-toggle { padding: 10px 14px; border-radius: 10px !important; background: var(--acid) !important; color: #10130b !important; font-weight: 700 !important; }.audio-toggle.ready { background: var(--panel-2) !important; color: var(--acid) !important; }
.board-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; min-height: calc(100vh - 76px); }.catalog { padding: 52px clamp(24px,5vw,76px); }.catalog-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 38px; }
.eyebrow { margin: 0 0 8px; color: var(--acid); text-transform: uppercase; letter-spacing: .16em; font-size: 10px; font-weight: 700; }.catalog h1, .page-title h1 { font: 700 clamp(38px,5vw,68px)/.95 "Space Grotesk"; letter-spacing: -.055em; margin: 0; }.search input, .import-card input { border: 1px solid var(--line); background: var(--panel); color: var(--text); outline: none; border-radius: 12px; }.search input { width: min(330px,35vw); padding: 14px 18px; }.search input:focus, .import-card input:focus { border-color: var(--violet); }
/* The card *is* the queue button. Interrupting the room is the rarer and ruder thing
   to want, so it is a deliberate second target rather than the one a stray tap hits. */
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 14px; }
.sound-card { position: relative; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); transition: transform .16s,border-color .16s; }
.sound-card:hover { transform: translateY(-3px); border-color: #454e65; }
.sound-card.starred { border-color: #5a5330; }
.play-face { width: 100%; min-height: 150px; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; text-align: left; cursor: pointer; border: 0; background: radial-gradient(circle at 85% 5%,rgba(139,125,255,.22),transparent 40%), var(--panel); }
.sound-card.starred .play-face { background: radial-gradient(circle at 85% 5%,rgba(216,255,69,.14),transparent 45%), var(--panel); }
.play-face strong { font: 600 17px/1.15 "Space Grotesk"; }
.play-face small { margin-top: 7px; color: var(--muted); font-size: 11px; }
.play-face small em { font-style: normal; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.card-tags .tag { padding: 1px 6px; font-size: 10px; }

/* The star sits above the card's own click target, so it must stop the event. */
.star { position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(13,16,23,.55); color: var(--muted); font-size: 14px; cursor: pointer; opacity: 0; transition: opacity .14s, color .14s; }
.sound-card:hover .star, .star.on, .star:focus-visible { opacity: 1; }
.star:hover { color: var(--acid); }
.star.on { color: var(--acid); }

.sound-meta { height: 42px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 14px; color: var(--muted); font-size: 11px; }
.hint-queue { color: #5c6478; font-size: 10px; }
.sound-meta button.now { border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; background: none; color: var(--muted); cursor: pointer; font-size: 10px; }
.sound-meta button.now:hover { color: var(--text); border-color: #454e65; background: var(--panel-2); }
.queue-panel { border-left: 1px solid var(--line); background: #10141c; padding: 28px; }.now-playing { min-height: 240px; border-radius: 18px; padding: 24px; background: linear-gradient(145deg,#262139,#161b25 65%); display: flex; flex-direction: column; }.now-playing strong { font: 600 26px/1.05 "Space Grotesk"; margin-top: auto; }.now-playing span { color: var(--muted); font-size: 12px; margin-top: 8px; }.stop-button { margin-top: 20px; padding: 10px; border: 1px solid #554454; border-radius: 10px; background: rgba(255,116,108,.08); cursor: pointer; }.queue-head { display: flex; justify-content: space-between; align-items: end; margin: 32px 0 16px; }.queue-head h2 { margin: 0; font: 600 22px "Space Grotesk"; }.queue-head button { border: 0; background: none; color: var(--muted); cursor: pointer; }.queue-list { list-style: none; padding: 0; margin: 0; }.queue-list li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }.queue-list span { color: var(--muted); font-size: 11px; }.queue-list strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.queue-list em { color: var(--muted); font-size: 11px; font-style: normal; display: flex; align-items: center; gap: 5px; }
/* A sound a script queued is not the same event as one a person pressed. */
.queue-list em i.via { font-style: normal; font-size: 9px; letter-spacing: .06em; color: var(--violet); border: 1px solid rgba(139,125,255,.35); border-radius: 4px; padding: 0 4px; }
.queue-empty { color: var(--muted); font-size: 12px; margin: 14px 0 0; }

/* Who is in the room. `listening` is the load-bearing bit: a member who has not
   unlocked audio is present but deaf, and the room needs to see that. */
.room-panel { margin-top: 28px; border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--panel); }
.room-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.room-head h2 { margin: 0; font: 600 18px "Space Grotesk"; }
.room-count { color: var(--acid); font-size: 11px; white-space: nowrap; }
.room-count.muted { color: var(--muted); }
.member-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 2px; }
.member { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; }
.member-avatar { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font: 600 11px "Space Grotesk"; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); }
.member.listening .member-avatar { color: #111; background: var(--acid); border-color: var(--acid); }
.member-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-name em { color: var(--muted); font-size: 11px; font-style: normal; }
.member-state { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.member.listening .member-state { color: var(--acid); letter-spacing: 0; font-size: 13px; }

/* The librarian's review queue. The model proposes; a human decides. The design
   leans on that: the diff is the content, and an unsure proposal says so loudly. */
.pill { margin-left: 6px; padding: 1px 6px; border-radius: 9px; font-size: 10px; font-weight: 700; color: #111; background: var(--acid); }
button.primary { border: 0; border-radius: 10px; padding: 11px 18px; background: var(--acid); color: #111; font-weight: 700; cursor: pointer; }
button.primary:disabled { opacity: .45; cursor: not-allowed; }
/* `.panel` is declared later in this file and also sets flex-direction, so an equal
   specificity selector would lose to it. Qualify with .panel to win. */
.panel.librarian-bar { flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.librarian-bar strong { font: 600 15px "Space Grotesk"; }
.librarian-bar .hint { margin-top: 4px; }
.librarian-actions { display: flex; gap: 10px; align-items: center; }
.progress { height: 4px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin-bottom: 16px; }
.progress i { display: block; height: 100%; background: var(--acid); transition: width .4s; }
.review-head { display: flex; justify-content: space-between; align-items: center; }

.review { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr) 300px; gap: 24px; align-items: center; padding: 20px 0; border-top: 1px solid var(--line); }
.review.unsure { background: linear-gradient(90deg, rgba(255,116,108,.05), transparent 60%); }
.review-diff { display: grid; gap: 10px; }
.review-label { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 3px; }
.review-before s { color: var(--muted); font-size: 13px; }
.review-after strong { font: 600 19px/1.15 "Space Grotesk"; display: block; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag { padding: 2px 8px; border-radius: 20px; font-size: 11px; color: var(--violet); background: rgba(139,125,255,.12); border: 1px solid rgba(139,125,255,.25); }
.review-why p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
/* The model's transcript. Quoted, because it is testimony rather than prose: it is
   what the reviewer checks the proposed title against. */
.review-why p.heard { color: var(--text); font-style: italic; border-left: 2px solid var(--line); padding-left: 10px; }
.review-flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.confidence { font-size: 11px; color: var(--acid); }
.confidence.low { color: var(--coral); }
.flag { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; }
.flag.warn { color: var(--coral); border-color: #4a2f31; }
.review-actions { display: grid; gap: 10px; justify-items: end; }
.review-actions audio { width: 100%; height: 34px; }
.review-actions div { display: flex; gap: 8px; }

@media (max-width: 1100px) { .review { grid-template-columns: 1fr; gap: 14px; } .review-actions { justify-items: stretch; } }
.page { max-width: 1180px; margin: auto; padding: 64px 28px 100px; }.page-title { max-width: 720px; margin-bottom: 50px; }.page-title p:last-child { color: var(--muted); font-size: 16px; }.import-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }.import-card { min-height: 360px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; padding: 24px; background: var(--panel); }.import-card .number { color: var(--acid); font: 600 12px "Space Grotesk"; }.import-card h2 { font: 600 27px "Space Grotesk"; margin: 60px 0 6px; }.import-card p { color: var(--muted); min-height: 42px; }.import-card input { width: 100%; padding: 12px; margin: 6px 0; }.import-card button { margin-top: auto; border: 0; border-radius: 10px; padding: 12px; background: var(--acid); color: #111; font-weight: 700; cursor: pointer; }.range-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.jobs { margin-top: 56px; }.section-title h2 { font: 600 28px "Space Grotesk"; margin: 0 0 18px; }.job { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); align-items: center; }.job-state { color: var(--acid); font-size: 11px; text-transform: uppercase; }.job strong, .job small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.job small { color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }.metric { padding: 28px; min-height: 180px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); display: flex; flex-direction: column; }.metric span { color: var(--muted); }.metric strong { margin-top: auto; font: 700 58px "Space Grotesk"; color: var(--acid); }.empty { border: 1px dashed var(--line); padding: 50px; border-radius: 16px; display: grid; gap: 6px; text-align: center; color: var(--muted); }.empty strong { color: var(--text); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); min-width: 320px; max-width: 680px; padding: 14px 16px; border: 1px solid #53633b; border-radius: 12px; background: #1d271a; box-shadow: 0 15px 50px #0008; display: flex; justify-content: space-between; z-index: 30; }.toast.error { background: #2b191c; border-color: #64393d; }.toast button { border: 0; background: none; cursor: pointer; font-size: 20px; }.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%,rgba(139,125,255,.12),transparent 45%), var(--bg); }
.gate-card { width: min(420px,100%); border: 1px solid var(--line); border-radius: 20px; padding: 38px; background: var(--panel); display: flex; flex-direction: column; gap: 14px; }.gate-card h1 { font: 700 clamp(30px,4vw,44px)/.98 "Space Grotesk"; letter-spacing: -.04em; margin: 0 0 4px; }.gate-help { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.gate-card label, .panel label { display: grid; gap: 7px; font-size: 12px; color: var(--muted); }.gate-card input, .panel input, .panel select { border: 1px solid var(--line); background: var(--bg); color: var(--text); outline: none; border-radius: 11px; padding: 13px 14px; font-size: 14px; }.gate-card input:focus, .panel input:focus { border-color: var(--violet); }
button.primary { margin-top: 8px; border: 0; border-radius: 11px; padding: 13px; background: var(--acid); color: #10130b; font-weight: 700; cursor: pointer; }button.primary:disabled { opacity: .55; cursor: progress; }
button.ghost { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; background: none; color: var(--text); cursor: pointer; font-size: 12px; }button.ghost:hover:not(:disabled) { border-color: #454e65; background: var(--panel-2); }button.ghost:disabled { opacity: .4; cursor: not-allowed; }button.ghost.danger { color: var(--coral); border-color: #4a2f31; }
.who { color: var(--muted); font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; align-items: start; }.panel { border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: var(--panel); display: flex; flex-direction: column; gap: 14px; }.panel.wide, .secret.wide { grid-column: 1 / -1; }.panel h2 { font: 600 24px "Space Grotesk"; margin: 0; }.hint { color: var(--muted); font-size: 12px; margin: 0; }.hint code { color: var(--acid); }
.inline-form { display: flex; gap: 8px; }.inline-form input, .inline-form select { flex: 1; }.inline-form button { white-space: nowrap; margin-top: 0; }
.rows { list-style: none; padding: 0; margin: 0; }.rows li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }.rows li:first-child { border-top: 0; }.rows strong { font-size: 14px; display: block; }.rows small { color: var(--muted); font-size: 11px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.secret { border: 1px solid #53633b; background: #1a2016; border-radius: 12px; padding: 16px; display: grid; gap: 10px; margin-bottom: 20px; }.secret code { display: block; word-break: break-all; color: var(--acid); font-size: 12px; background: #10130b; padding: 12px; border-radius: 8px; }.secret button { justify-self: start; }

@media (max-width: 900px) { .topbar { padding: 0 16px; }.brand { min-width: 0; }.brand small { display: none; }.main-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: var(--panel); border-top: 1px solid var(--line); justify-content: center; z-index: 20; }.board-layout { grid-template-columns: 1fr; }.queue-panel { border-left: 0; border-top: 1px solid var(--line); }.import-grid, .metric-grid { grid-template-columns: 1fr 1fr; }.app-shell { padding-bottom: 60px; } }
@media (max-width: 620px) { .connection { display: none; }.topbar { gap: 10px; }.connection-tools { margin-left: auto; }.catalog { padding: 36px 16px; }.catalog-head { display: block; }.search input { width: 100%; margin-top: 24px; }.sound-grid { grid-template-columns: 1fr 1fr; gap: 9px; }.play-face { min-height: 145px; padding: 15px; }.import-grid, .metric-grid { grid-template-columns: 1fr; }.page { padding: 42px 16px 90px; }.job { grid-template-columns: 80px 1fr; }.job small { display: none; } }
