:root {
  color-scheme: dark;
  --bg: var(--eia-navy-dark);
  --panel: var(--eia-navy);
  --panel-hi: var(--eia-navy-panel);
  --edge: var(--eia-border);
  --text: var(--eia-white);
  --muted: var(--eia-muted);
  --accent: var(--eia-orange);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, rgba(230,119,19,.17), transparent 34rem), linear-gradient(135deg, var(--panel), var(--bg));
  color: var(--text);
  font: 14px var(--wc-font-sans);
}
button, input, select { font: inherit; }
.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--edge);
  background: rgba(7,24,39,.82);
  backdrop-filter: blur(18px);
}
.topbar a { color: var(--text); text-decoration: none; font-weight: 700; }
.studio-brand { display: flex; align-items: center; gap: 13px; }
.studio-brand img { width: 96px; height: 45px; object-fit: contain; mix-blend-mode: screen; }
.studio-brand strong { font-size: 22px; font-weight: 900; letter-spacing: -.03em; white-space: nowrap; }
.studio-label, .eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .18em; font-weight: 900; }
.topbar-spacer { flex: 1; }
.topbar .back-link { color: var(--muted); font-size: 12px; }
.topbar .back-link:hover { color: var(--accent); }
main { height: calc(100vh - 74px); display: grid; grid-template-columns: minmax(340px, 390px) minmax(0, 1fr); }
.panel { overflow-y: auto; padding: 26px; background: rgba(14,40,65,.9); border-right: 1px solid var(--edge); }
h1 { margin: 7px 0 8px; font-size: 30px; font-weight: 900; letter-spacing: -.04em; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin: 0 0 14px; font-weight: 900; }
p { line-height: 1.5; }
.intro, .hint, .status { color: var(--muted); }
.intro { margin-bottom: 22px; }
.play-link { display:inline-block; padding:12px 16px; margin:6px 0 16px; border-radius:7px; background:var(--accent); color:var(--bg); font-weight:900; text-decoration:none; }
.hint { font-size: 12px; margin: 9px 0; }
.status { font-size: 12px; min-height: 18px; margin-top: 10px; }
.status.error { color: #ff9898; }
section { padding: 20px 0; border-top: 1px solid var(--edge); }
label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; flex: 1; min-width: 0; }
input, select { color: var(--text); background: var(--bg); border: 1px solid var(--edge); border-radius: 7px; padding: 10px; width: 100%; margin-top: 6px; min-height: 42px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 10px; margin-top: 10px; }
button, .file-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; background: var(--accent); color: var(--bg); border: 1px solid transparent;
  border-radius: 7px; padding: 9px 13px; font-weight: 800; font-size: 12px;
  cursor: pointer; margin: 3px 5px 3px 0;
}
.secondary { background: rgba(255,255,255,.055); color: var(--text); border-color: var(--edge); }
button:hover, .file-button:hover { filter: brightness(1.14); }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--accent); }
.manual-matches { max-height: 180px; overflow-y: auto; white-space: pre-wrap; font-size: 12px; line-height: 1.5; color: var(--muted); }
.manual-matches p { border-bottom: 1px solid var(--edge); padding-bottom: 8px; }
.manual-draft { margin-top: 12px; font-size: 12px; color: var(--muted); }
.manual-draft p { margin: 8px 0; }
.manual-draft strong { color: var(--text); }
.manual-draft ul { padding-left: 19px; line-height: 1.5; }
.zone-list { font-size: 12px; color: var(--muted); margin-top: 8px; }
.zone-list button { padding: 3px 7px; margin-left: 8px; min-height: 28px; }
.workspace { min-height: 0; display: flex; flex-direction: column; }
.hud { min-height: 70px; display: flex; align-items: center; gap: 24px; padding: 0 18px; border-bottom: 1px solid var(--edge); background: rgba(7,24,39,.55); }
.hud div { display: flex; flex-direction: column; }
.hud b { font-size: 22px; font-variant-numeric: tabular-nums; }
.hud small { font-size: 10px; color: var(--muted); letter-spacing: .13em; }
.hud button:first-of-type { margin-left: auto; }
#viewport { position: relative; flex: 1; min-height: 200px; overflow: hidden; }
#viewport canvas { display: block; }
#viewNote { position: absolute; z-index: 1; left: 14px; bottom: 14px; background: rgba(7,24,39,.88); color: var(--text); padding: 10px 12px; border: 1px solid var(--edge); border-radius: 7px; font-size: 12px; pointer-events: none; }
.footer-note { font-size: 12px; color: var(--muted); padding: 11px 16px; border-top: 1px solid var(--edge); background: rgba(7,24,39,.65); }
@media(max-width: 850px) {
  main { height: auto; display: flex; flex-direction: column; }
  .panel { overflow: visible; }
  .workspace { height: 70vh; }
  .studio-label { display: none; }
}
@media(max-width: 600px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .studio-brand img { width: 65px; }
  .studio-brand strong { font-size: 19px; }
  .topbar .back-link { font-size: 11px; }
  .hud { gap: 9px; padding: 6px 10px; flex-wrap: wrap; }
  .hud button { min-height: 34px; padding: 6px 8px; }
  .hud b { font-size: 18px; }
  #viewNote { max-width: calc(100% - 28px); }
}
