:root {
  --ground: #F5F3EE;
  --side: #EDEAE2;
  --surface: #FFFFFF;
  --line: #DDD8CC;
  --line-soft: #EDEAE2;
  --ink: #1F1E1B;
  --ink-2: #3A3732;
  --muted: #5E5A52;
  --accent: #A8461F;
  --accent-dark: #8A3717;
  --good: #2C5E35; --good-bg: #E1EEE3;
  --mid: #8A5A12;  --mid-bg: #F5E9D2;
  --bad: #8A3717;  --bad-bg: #F6E3DA;
  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); background: var(--ground); color: var(--ink); font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.serif { font-family: var(--serif); font-weight: 500; }
.muted { color: var(--muted); }

/* Shell */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 260px; flex-shrink: 0; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; padding: 20px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #D3CDBF; background: var(--surface); font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink); }
.btn:hover:not(:disabled) { background: #FAF9F6; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #000; }
.btn-block { width: 100%; justify-content: flex-start; }
.side-label { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 8px 4px; }
.history { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.history a { display: flex; justify-content: space-between; gap: 8px; padding: 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.history a:hover, .history a[aria-current="page"] { background: #E2DED3; color: var(--ink); }
.history .score { font-weight: 600; font-size: 13px; color: var(--muted); }
.history-empty { font-size: 13px; color: var(--muted); padding: 4px 8px; line-height: 1.5; }
.spacer { flex-grow: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--line); }
.avatar-initials { width: 32px; height: 32px; border-radius: 50%; background: var(--ink-2); color: var(--ground); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.me-name { font-size: 14px; font-weight: 500; }
.linklike { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; text-decoration: underline; }

/* Room */
.room { flex-grow: 1; display: flex; flex-direction: column; gap: 16px; padding: 20px 32px 24px; min-width: 0; }
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.room-title { font-family: var(--serif); font-size: 24px; font-weight: 500; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-meta { font-size: 13px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; background: var(--side); color: var(--muted); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill[data-tone="good"] { background: var(--good-bg); color: var(--good); }
.pill[data-tone="live"] { background: var(--bad-bg); color: var(--accent-dark); }
.head-actions { display: flex; align-items: center; gap: 10px; }
.only-narrow { display: none; }

.stage { position: relative; flex-grow: 1; min-height: 260px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; transition: background .3s; }
.stage.drag { outline: 3px dashed var(--accent); outline-offset: -10px; }
.decor { position: absolute; inset: 0; pointer-events: none; }
.decor div { position: absolute; }
.avatar { position: relative; height: 92%; max-height: 520px; aspect-ratio: 320 / 360; }
.avatar svg { width: 100%; height: 100%; display: block; }
.ring { transform-origin: 160px 170px; opacity: 0; }
.talking .ring { animation: ring 1.6s ease-out infinite; }
.listening .ring { stroke: var(--accent); animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { opacity: .6; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18); } }
.eye { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.mouth-open { transform-box: fill-box; transform-origin: center; transform: scaleY(0); }
.talking .mouth-open { animation: talk .18s ease-in-out infinite alternate; }
.talking .smile { opacity: 0; }
@keyframes talk { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
.thinking .brow { transform: translateY(-3px); transition: transform .3s; }
@media (prefers-reduced-motion: reduce) {
  .ring, .eye, .talking .mouth-open { animation: none !important; }
  .talking .mouth-open { transform: scaleY(.6); }
}
.nametag { position: absolute; left: 20px; bottom: 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: var(--ground); max-width: calc(100% - 40px); }
.nametag b { font-size: 14px; }
.nametag span { font-size: 13px; color: #CFC9BC; }
.selfview { position: absolute; right: 20px; top: 20px; width: 200px; aspect-ratio: 16 / 10; border-radius: 12px; background: #2B2A28; border: 2px solid #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #CFC9BC; font-size: 13px; }
.selfview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.caption { position: absolute; left: 50%; top: 20px; transform: translateX(-50%); width: min(620px, calc(100% - 280px)); padding: 12px 18px; border-radius: 12px; background: #fff; font-size: 15px; line-height: 1.5; box-shadow: 0 6px 24px rgba(31,30,27,.12); }
.caption[hidden] { display: none; }
.caption small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.voice-debug {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 4;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.82);
  color: #f1f1f1;
  font-size: 12px;
  line-height: 1.3;
  max-width: calc(100% - 24px);
  white-space: normal;
}

.controls { display: flex; align-items: center; justify-content: center; gap: 12px; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 1px solid #D3CDBF; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.round[aria-pressed="false"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.start { min-height: 48px; padding: 0 28px; border-radius: 999px; font-size: 15px; }

.composer { border-radius: 18px; background: #fff; border: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 2px 10px rgba(31,30,27,.05); }
.composer.drag { border: 2px dashed var(--accent); }
.composer textarea { border: 0; resize: none; font-size: 15px; line-height: 1.5; background: transparent; outline: none; min-height: 48px; max-height: 160px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.composer-row .left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; max-width: 100%; padding: 6px 6px 6px 12px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line); font-size: 14px; }
.chip .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.icon-btn:hover { background: var(--side); }
.send { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.send-wrap { position: relative; display: inline-flex; align-items: center; justify-content: flex-end; }
.autosend-indicator {
  position: absolute;
  right: 52px;
  bottom: -4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 12px;
  box-shadow: 0 4px 14px rgba(31,30,27,.1);
  z-index: 2;
}
.autosend-indicator[hidden] { display: none !important; }
.autosend-bar {
  width: 54px;
  height: 3px;
  border-radius: 99px;
  background: var(--line-soft);
  overflow: hidden;
  flex-shrink: 0;
}
.autosend-bar i {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width .08s linear;
}
.file-label { position: relative; }
.file-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
select.btn { padding-right: 12px; }
.listen[aria-pressed="true"] { background: var(--bad-bg); border-color: var(--accent); color: var(--accent-dark); }

/* Customize panel */
.panel { width: 340px; flex-shrink: 0; background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.panel-head { padding: 22px 24px 14px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.panel-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.panel-body { flex-grow: 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > legend, .field > label, .field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.field > label { margin-bottom: 0; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-row span { font-size: 12px; color: var(--muted); }
.seg { display: grid; gap: 6px; }
.seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg button { min-height: 40px; border-radius: 10px; border: 1px solid #D3CDBF; background: #fff; font-size: 13px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px #D3CDBF; }
.swatch.sm { width: 30px; height: 30px; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.bgs button { min-height: 56px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; border-width: 2px; font-size: 12px; }
.bgs button[aria-pressed="true"] { border-color: var(--accent); background: inherit; color: inherit; }
.input { min-height: 40px; padding: 0 12px; border: 1px solid #D3CDBF; border-radius: 10px; background: #fff; font-size: 14px; width: 100%; }
input[type="range"] { accent-color: var(--accent); width: 100%; }
.divider { height: 1px; background: var(--line-soft); flex-shrink: 0; }
.panel-foot { padding: 14px 24px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; }
.panel-foot .btn { flex: 1; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 30px; }
.auth-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.auth-card .field label { font-size: 13px; font-weight: 600; }
.error { color: var(--bad); font-size: 14px; min-height: 1em; }

/* Report */
.report { flex-grow: 1; overflow-y: auto; padding: 28px 40px 48px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.report-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.report-head h1 { margin: 4px 0; font-family: var(--serif); font-size: 34px; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; }
.grid-2b { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.grid-2c { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; gap: 12px; }
.card h2 span { font-weight: 400; color: var(--muted); font-size: 12px; }
.score-card { align-items: center; }
.score-card h2 { align-self: stretch; }
.ring-wrap { position: relative; width: 168px; height: 168px; }
.ring-wrap .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-wrap .num b { font-family: var(--serif); font-size: 52px; font-weight: 500; line-height: 1; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.tone-good { background: var(--good-bg); color: var(--good); }
.tone-mid { background: var(--mid-bg); color: var(--mid); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.comp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; }
.comp { display: flex; flex-direction: column; gap: 6px; }
.comp-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; }
.comp p, .q-body p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.summary { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.55; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 14px; border-radius: 12px; background: var(--ground); display: flex; flex-direction: column; gap: 4px; }
.stat small { font-size: 12px; color: var(--muted); }
.stat b { font-family: var(--serif); font-size: 26px; font-weight: 500; }
.stat em { font-style: normal; font-size: 12px; font-weight: 500; }
.req { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.req:last-child { border-bottom: 0; }
.req .mark { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.req .t { flex-grow: 1; }
.req .s { font-size: 12px; font-weight: 600; text-transform: capitalize; }
.q { border: 1px solid #E5E1D7; border-radius: 12px; overflow: hidden; }
.q[open] { border-color: #C9C2B2; }
.q summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.q summary::-webkit-details-marker { display: none; }
.q[open] summary { background: var(--ground); }
.q .n { font-size: 12px; font-weight: 600; color: var(--muted); width: 24px; flex-shrink: 0; }
.q .qt { flex-grow: 1; font-size: 14px; font-weight: 500; }
.q .qs { min-width: 44px; text-align: center; padding: 4px 8px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.q-body { padding: 8px 16px 18px 54px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.q-body h3 { margin: 0 0 4px; font-size: 12px; font-weight: 600; }
.q-body p { color: var(--ink); font-size: 14px; }
.focus-card { background: var(--ink); color: var(--ground); border: 0; }
.focus-card h2 { color: #CFC9BC; }
.focus-item { display: flex; gap: 12px; }
.focus-item .fi-n { font-family: var(--serif); font-size: 22px; color: #E59A78; line-height: 1.1; }
.focus-item b { font-size: 15px; display: block; margin-bottom: 4px; }
.focus-item span { font-size: 13px; color: #CFC9BC; line-height: 1.5; }

/* Composer attachment slots: job description + resume */
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.slot { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); background: var(--ground); min-width: 0; }
.slot.drag { border: 2px dashed var(--accent); }
.slot-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.slot-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.slot .chip { background: var(--surface); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
select.linklike { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; }
.resume-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.resume-grid h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
@media (max-width: 820px) {
  .slots, .resume-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Dark theme (black, yellow actions, green status) ---------- */
:root[data-theme="dark"] {
  --ground: #000000;
  --side: #0E0E0E;
  --surface: #161616;
  --line: #2E2E2E;
  --line-soft: #1E1E1E;
  --ink: #F2F2EC;
  --ink-2: #D6D6CE;
  --muted: #A3A39A;
  --accent: #F5C518;
  --accent-dark: #FFD84D;
  --good: #4ADE80; --good-bg: #0F2A1A;
  --mid: #F5C518;  --mid-bg: #2A2205;
  --bad: #F87171;  --bad-bg: #2A1212;
  color-scheme: dark;
}
:root[data-theme="dark"] .btn { border-color: var(--line); }
:root[data-theme="dark"] .btn:hover:not(:disabled) { background: #1E1E1E; }
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .send { background: var(--accent); border-color: var(--accent); color: #0A0A0A; }
:root[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
:root[data-theme="dark"] .btn-dark { background: var(--accent); border-color: var(--accent); color: #0A0A0A; }
:root[data-theme="dark"] .btn-dark:hover:not(:disabled) { background: var(--accent-dark); }
:root[data-theme="dark"] .round { background: var(--surface); border-color: var(--line); color: var(--good); }
:root[data-theme="dark"] .round[aria-pressed="false"] { background: var(--surface); color: var(--muted); border-color: var(--line); }
:root[data-theme="dark"] .round:disabled { color: var(--muted); }
:root[data-theme="dark"] .listen[aria-pressed="true"] { background: var(--good-bg); border-color: var(--good); color: var(--good); }
:root[data-theme="dark"] .composer,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .auth-card { background: #111111; border-color: #222222; box-shadow: none; }
:root[data-theme="dark"] .seg button,
:root[data-theme="dark"] .input { background: var(--surface); border-color: var(--line); color: var(--ink); }
/* Selected options: yellow with black text so the label stays readable. */
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0A0A0A; }
:root[data-theme="dark"] .swatch { border-color: #0E0E0E; box-shadow: 0 0 0 2px #333; }
:root[data-theme="dark"] .swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
:root[data-theme="dark"] .bgs button[aria-pressed="true"] { border-color: var(--accent); }
:root[data-theme="dark"] .caption { background: #0A0A0A; border: 1px solid #2A2A2A; color: var(--ink); }
:root[data-theme="dark"] .caption small { color: var(--accent); }
:root[data-theme="dark"] .nametag { background: #0A0A0A; border: 1px solid #2A2A2A; color: var(--ink); }
:root[data-theme="dark"] .nametag b { color: var(--accent); }
:root[data-theme="dark"] .nametag span { color: #C9C9C0; }
:root[data-theme="dark"] .stage { border-color: #222; }
:root[data-theme="dark"] .history a:hover,
:root[data-theme="dark"] .history a[aria-current="page"] { background: #1A1A1A; }
:root[data-theme="dark"] .avatar-initials { background: var(--accent); color: #0A0A0A; }
:root[data-theme="dark"] .pill[data-tone="live"] { background: var(--good-bg); color: var(--good); }
:root[data-theme="dark"] .q { border-color: #222; }
:root[data-theme="dark"] .q[open] summary { background: #1A1A1A; }
:root[data-theme="dark"] .tone-good, :root[data-theme="dark"] .tone-mid, :root[data-theme="dark"] .tone-bad { color: #0A0A0A; }
:root[data-theme="dark"] .tone-good { background: var(--good); }
:root[data-theme="dark"] .tone-mid { background: var(--mid); }
:root[data-theme="dark"] .tone-bad { background: var(--bad); }
:root[data-theme="dark"] .focus-card { background: var(--accent); color: #0A0A0A; }
:root[data-theme="dark"] .focus-card h2, :root[data-theme="dark"] .focus-item span, :root[data-theme="dark"] .focus-item .fi-n { color: #1A1A1A; }
:root[data-theme="dark"] #toast { background: #F2F2EC; color: #0A0A0A; }
:root[data-theme="dark"] .ring-wrap circle:first-child { stroke: #222; }
:root[data-theme="dark"] .bar { background: #222; }
:root[data-theme="dark"] .autosend-indicator { border-color: var(--line); background: #0F0F0F; color: var(--ink-2); box-shadow: none; }
:root[data-theme="dark"] .autosend-bar { background: #2A2A2A; }
.theme-toggle { align-self: flex-start; min-height: 36px; padding: 0 12px; font-size: 13px; }
@media print { :root[data-theme="dark"] { --ground: #fff; --ink: #1F1E1B; } }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: min(560px, calc(100% - 32px)); z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { padding: 40px; color: var(--muted); }

@media (max-width: 1180px) {
  .panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 20; transform: translateX(100%); transition: transform .25s; box-shadow: -10px 0 30px rgba(0,0,0,.12); }
  body.panel-open .panel { transform: none; }
  .only-narrow { display: inline-flex; }
  .grid-2, .grid-2b, .grid-2c { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .room, .report { padding: 16px; }
  .selfview { width: 120px; }
  .caption { width: calc(100% - 32px); top: auto; bottom: 90px; }
  .comp-grid, .stats, .q-body { grid-template-columns: minmax(0, 1fr); }
  .q-body { padding-left: 16px; }
  .autosend-indicator { right: 48px; max-width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .autosend-bar i { transition: none; }
}
@media print {
  .sidebar, .report-actions, #toast { display: none !important; }
  .shell { height: auto; overflow: visible; }
  .report { overflow: visible; padding: 0; }
  .q:not([open]) .q-body { display: grid; }
  .card { break-inside: avoid; }
}
