:root {
  --bg: #0d141b;
  --panel: #141d26;
  --panel-2: #1b2733;
  --line: #26333f;
  --txt: #e8eef4;
  --muted: #93a3b3;
  --accent: #35d0ff;
  --green: #2fbf71;
  --amber: #f0a72a;
  --red: #ef5b5b;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: radial-gradient(1200px 600px at 80% -10%, #16283a 0%, var(--bg) 55%) no-repeat, var(--bg);
  color: var(--txt);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.35rem; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8rem; }

/* ---------------------------------------------------------------- top bar */
.top { border-bottom: 1px solid var(--line); background: rgba(13, 20, 27, .82); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand h1 { margin: 0; }
.tag { margin: 0; color: var(--muted); font-size: .82rem; }
.lens {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  border: 3px solid var(--accent); position: relative;
  box-shadow: 0 0 0 4px rgba(53, 208, 255, .12);
}
.lens::after {
  content: ""; position: absolute; inset: 7px; border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), transparent 70%);
}
.top-actions { display: flex; gap: .5rem; }
.ghost { color: var(--muted); text-decoration: none; font-size: .86rem; padding: .35rem .6rem; border-radius: 8px; }
.ghost:hover { color: var(--txt); background: var(--panel-2); }

/* ----------------------------------------------------------------- panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin: 1.5rem 0; }
.panel h2 { margin-bottom: .9rem; }
.intro { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.6rem; }
.pillars { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .45rem; }
.pillars li { color: var(--muted); font-size: .93rem; padding-left: 1.3rem; position: relative; }
.pillars li::before { content: "✓"; position: absolute; left: 0; color: var(--green); }
.pillars strong { color: var(--txt); }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.cols p { color: var(--muted); font-size: .93rem; }

/* -------------------------------------------------------------- dropzone */
.dropzone-wrap { display: flex; flex-direction: column; gap: .8rem; }
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.4rem;
  display: grid; gap: .3rem; text-align: center; cursor: pointer; transition: .15s;
  background: var(--panel-2);
}
.drop:hover, .drop.hot { border-color: var(--accent); background: #1d2b39; }
.drop strong { font-size: 1.02rem; }
.drop span, .drop small { color: var(--muted); font-size: .88rem; }
.drop-icon {
  width: 34px; height: 24px; margin: 0 auto .4rem; border-radius: 5px;
  border: 2px solid var(--accent); position: relative;
}
.drop-icon::after { content: "+"; position: absolute; inset: -6px 0 0 0; text-align: center; color: var(--accent); font-weight: 700; }
.demo-label { color: var(--muted); font-size: .86rem; margin: 0; }
.demo-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.demo {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: .25rem;
  color: var(--muted); cursor: pointer; display: grid; gap: .2rem; font-size: .75rem; width: 92px;
}
.demo:hover { border-color: var(--accent); color: var(--txt); }
.demo img { width: 100%; height: 58px; object-fit: cover; border-radius: 7px; }
.engine-status { font-size: .85rem; color: var(--muted); margin: 0; }
.engine-status[data-state="ready"] { color: var(--green); }
.engine-status[data-state="error"] { color: var(--red); }

/* ----------------------------------------------------------------- stage */
.stage { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.4rem; margin: 1.5rem 0; }
.stage-main, .stage-side { min-width: 0; }
.viewer { background: #0a1016; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.viewer canvas { display: block; width: 100%; height: auto; }
.controls { display: flex; flex-direction: column; gap: .6rem; margin-top: .8rem; }
.scrub { display: grid; gap: .35rem; font-size: .86rem; color: var(--muted); }
.scrub input { width: 100%; accent-color: var(--accent); }
.buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
button { font: inherit; cursor: pointer; border-radius: 10px; padding: .55rem .9rem; border: 1px solid var(--line); background: var(--panel-2); color: var(--txt); }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: progress; }
.primary { background: var(--accent); color: #04202b; border-color: var(--accent); font-weight: 650; }
.secondary { font-size: .88rem; }
.hint { color: var(--muted); font-size: .84rem; margin: 0; }

/* ------------------------------------------------------------- scorecard */
.score-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.score-num { display: flex; align-items: baseline; gap: .2rem; font-size: 2.9rem; font-weight: 700; letter-spacing: -.02em; }
.score-num small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.score-band { display: inline-block; font-size: .82rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.score-band[data-band="green"] { color: var(--green); }
.score-band[data-band="amber"] { color: var(--amber); }
.score-band[data-band="red"] { color: var(--red); }
.score-headline { margin: .5rem 0 0; font-size: .93rem; }

.checks { display: grid; gap: .55rem; margin: .9rem 0; }
.check { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: .6rem .75rem; background: var(--panel); }
.check.pass { border-left-color: var(--green); }
.check.warn { border-left-color: var(--amber); }
.check.fail { border-left-color: var(--red); }
.check.unknown { border-left-color: var(--muted); opacity: .8; }
.check-top { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.check-top strong { font-size: .93rem; }
.check-value { margin-left: auto; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.pill { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; padding: .15rem .4rem; border-radius: 6px; background: var(--panel-2); color: var(--muted); }
.check.pass .pill { color: var(--green); }
.check.warn .pill { color: var(--amber); }
.check.fail .pill { color: var(--red); }
.check-detail, .check-target, .check-cue, .check-drill { margin: .35rem 0 0; font-size: .86rem; color: var(--muted); }
.check-cue { color: #cfe0ee; }
.check-target { font-variant-numeric: tabular-nums; }
.check-drill span { color: var(--accent); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; margin-right: .3rem; }

.report { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.report-actions { display: flex; gap: .35rem; }
.mini { font-size: .78rem; padding: .3rem .55rem; }
textarea { width: 100%; background: #0b131a; color: var(--txt); border: 1px solid var(--line); border-radius: 9px; padding: .6rem; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.disclaimer { color: var(--muted); font-size: .8rem; margin: .8rem 0 0; }

/* ------------------------------------------------------------------ table */
.check-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.check-table th, .check-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.check-table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.check-table td:first-child { color: var(--txt); white-space: nowrap; }
.check-table td { color: var(--muted); }
.foot { color: var(--muted); font-size: .82rem; padding: 1.5rem 0 3rem; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .intro, .stage, .cols { grid-template-columns: 1fr; }
  .tag { display: none; }
}
@media print {
  .top, .panel, .controls, .demo-label, .demo-row, .hint, .report-actions, .foot, .dropzone-wrap { display: none !important; }
  body { background: #fff; color: #000; }
  .check, .score-box { border-color: #999; break-inside: avoid; }
  .check-detail, .check-cue, .check-drill, .disclaimer, .score-band { color: #333; }
}
