/* Theme lives here only: re-skin by changing these variables. */
:root {
  --navy-900: #0b1630;
  --navy-800: #111f42;
  --navy-700: #1a2c5b;
  --line: #2b3d6e;
  --text: #eef1f8;
  --muted: #9eabc9;
  --gold: #e3b341;
  --magenta: #d6246e;
  --magenta-hover: #ea3a83;
  --ok: #49c58a;
  --bad: #ff7b7b;
  --radius: 14px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--navy-900); color: var(--text); line-height: 1.45;
  min-height: 100vh; min-height: 100dvh; overflow-wrap: anywhere; }

.topbar { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; justify-content: space-between;
  padding: .7rem 1rem; padding: max(.7rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .7rem max(1rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line); }
.brand { font-size: 1.1rem; letter-spacing: .01em; }
.brand b { color: var(--gold); }
.tag { color: var(--muted); font-size: .75rem; }

main { padding: 1rem; padding: 1rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }
.screen.narrow { max-width: 34rem; margin: 0 auto; }
.screen.wide { max-width: 72rem; margin: 0 auto; display: grid; gap: 1rem; }
@media (min-width: 700px) { .screen.wide { grid-template-columns: minmax(0, 3fr) minmax(15rem, 2fr); align-items: start; } }

h1 { font-size: 1.6rem; margin: .2rem 0 .8rem; }
h1 small { font-size: 1rem; color: var(--muted); font-weight: 400; margin-left: .3rem; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin: 1.1rem 0 .5rem; }
h2:first-child { margin-top: 0; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.error { color: var(--bad); min-height: 1.4em; margin: .6rem 0 0; }
ul.plain { padding-left: 1.1rem; margin: 1rem 0; }
ul.plain li { margin: .3rem 0; }

label { display: block; font-size: .85rem; color: var(--muted); margin: 1rem 0 .35rem; }
input { width: 100%; padding: .85rem .9rem; font: inherit; font-size: max(1rem, 16px); -webkit-appearance: none; appearance: none; color: var(--text); background: var(--navy-800);
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: .5rem; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

button { font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; border-radius: 10px; min-height: 48px; padding: .7rem 1.2rem; border: 1px solid transparent; }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--magenta); color: #fff; font-weight: 600; width: 100%; margin-top: .8rem; }
.primary:hover:not(:disabled) { background: var(--magenta-hover); }
.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.ghost[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }

.note { background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.note-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.note p { margin: .3rem 0 0; font-size: 1.05rem; }

.avatar-box { position: relative; background: #000; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16 / 9; max-height: 68vh; margin: 0 auto; }
@supports not (aspect-ratio: 1) { .avatar-box { height: 56.25vw; } }
@media (orientation: landscape) and (max-height: 520px) { .avatar-box { max-height: 60vh; } .captions { height: 4.5rem; } }
.avatar-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-content: center; justify-items: center; gap: .5rem; background: var(--navy-700); }
.portrait span { width: 6rem; height: 6rem; border-radius: 50%; background: var(--navy-900); border: 2px solid var(--gold);
  display: grid; place-content: center; font-size: 2rem; color: var(--gold); }
.portrait small { color: var(--muted); }
.stage-status { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-content: center; text-align: center; padding: 1rem;
  background: rgba(11, 22, 48, .82); color: var(--text); }
.stage-meta { position: absolute; left: .6rem; right: .6rem; bottom: .5rem; display: flex; justify-content: space-between;
  font-size: .8rem; text-shadow: 0 1px 3px #000; pointer-events: none; }

.captions { height: 7.5rem; overflow-y: auto; margin-top: .6rem; padding: .6rem .8rem; background: var(--navy-800);
  border: 1px solid var(--line); border-radius: var(--radius); font-size: .92rem; }
.captions p { margin: 0 0 .35rem; }
.captions .who { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin-right: .4rem; }
.captions .doctor .who { color: var(--gold); }

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .6rem; }
.controls .primary { margin-top: 0; }

.panel { background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chips button { min-height: 40px; padding: .4rem .8rem; font-size: .88rem; background: var(--navy-700); color: var(--text); border-color: var(--line); }
.chips button.done { border-color: var(--gold); color: var(--gold); }
.cards { display: grid; gap: .5rem; }
.card { background: var(--navy-900); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; }
.card .kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card .label { font-weight: 600; }
.card .result { margin-top: .15rem; font-size: .92rem; }

.domains { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: 1rem; }
.domain { background: var(--navy-800); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; }
.domain b { display: block; font-size: 1.3rem; }
.domain span { font-size: .78rem; color: var(--muted); text-transform: capitalize; }
.check { list-style: none; padding: 0; margin: 0 0 .5rem; }
.check li { padding: .25rem 0 .25rem 1.5rem; position: relative; }
.check li::before { position: absolute; left: 0; }
.check li.yes::before { content: "✓"; color: var(--ok); }
.check li.no::before { content: "✗"; color: var(--bad); }
details { margin: 1rem 0; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
details summary { cursor: pointer; }
details p { margin: .4rem 0; font-size: .9rem; }
