:root {
  --bg: #070b18;
  --bg2: #0d1430;
  --panel: #0f1735;
  --panel2: #131d42;
  --line: #22305e;
  --text: #e6ecff;
  --muted: #8f9cc4;
  --accent: #ffb547;
  --accent2: #ff8a3d;
  --blue: #7cc4ff;
  --good: #5fd39a;
  --warn: #ffcf5c;
  --bad: #ff7b6b;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #14204d 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--blue); }
h1 { margin: 0; font-size: 26px; color: var(--accent); letter-spacing: .2px; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 650; }
h3 { font-size: 13px; margin: 14px 0 4px; color: var(--muted); }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; max-width: 1400px; margin: 0 auto; padding: 20px 20px 8px; }
.sub { margin: 4px 0 0; color: var(--muted); max-width: 760px; }
.layout { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 18px; max-width: 1400px; margin: 0 auto; padding: 10px 20px 20px; align-items: start; }
.panel { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.inputs { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 14px; }
.inputs section { display: flex; flex-direction: column; gap: 8px; }
.num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #1a1205; font-size: 12px; margin-right: 6px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 550; }
label.check { flex-direction: row; align-items: center; gap: 7px; font-weight: 500; cursor: pointer; }
input, select { font: inherit; color: var(--text); background: #0a1028; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; min-width: 0; width: 100%; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=file] { padding: 6px; font-size: 13px; }
input:focus, select:focus { outline: 2px solid rgba(124,196,255,.45); outline-offset: 0; border-color: var(--blue); }
input::placeholder { color: #56628a; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.search-box { position: relative; flex: 1; min-width: 0; }
.dropdown { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 4px; background: #0c1330; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-height: 260px; overflow: auto; }
.dropdown li { padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.dropdown li:hover, .dropdown li.on { background: #1a2654; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.hint.center { text-align: center; margin-top: 6px; }
.tzhint { align-self: end; padding-bottom: 9px; font-family: ui-monospace, Consolas, monospace; }
.btn { font: inherit; font-weight: 650; color: var(--text); background: #18224d; border: 1px solid #2c3b75; border-radius: 10px; padding: 9px 14px; cursor: pointer; }
.btn:hover { background: #1f2b5e; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.primary { background: linear-gradient(180deg, #ffc266, #ff9a3d); color: #1e1204; border: 0; font-size: 16px; padding: 13px; box-shadow: 0 6px 24px rgba(255,154,61,.25); }
.btn.primary:hover { filter: brightness(1.06); }
.icon-btn { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #0d1532; color: var(--accent); font: italic 700 16px Georgia, serif; cursor: pointer; display: grid; place-items: center; }
.icon-btn.sq { border-radius: 10px; color: var(--text); font: inherit; width: 40px; height: 40px; }
.icon-btn:hover { background: #17214a; }
.progress .bar { height: 6px; background: #0a1028; border-radius: 4px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--accent)); transition: width .15s; }
.progress p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
details.data { border-top: 1px solid var(--line); padding-top: 10px; }
details.data summary { cursor: pointer; font-weight: 650; color: var(--muted); }
details.data[open] summary { margin-bottom: 8px; }
.group { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 6px 0; border-bottom: 1px dashed #1c2853; font-size: 13px; }
.group .gl { font-weight: 600; color: var(--text); }
.group .gs { grid-column: 2; font-size: 11.5px; color: var(--muted); }
.group .gs.ok { color: var(--good); }
.group .gs.err { color: var(--bad); }
.hint.err { color: var(--bad); }
.files { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12.5px; }
.files li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; color: var(--good); }
.files button { background: none; border: 0; color: var(--bad); cursor: pointer; }
.results { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.verdict { border-width: 1px; }
.verdict h2 { font-size: 20px; margin-bottom: 8px; }
.verdict.good { border-color: rgba(95,211,154,.6); box-shadow: inset 4px 0 0 var(--good); }
.verdict.warn { border-color: rgba(255,207,92,.6); box-shadow: inset 4px 0 0 var(--warn); }
.verdict.flare { border-color: rgba(255,138,61,.7); box-shadow: inset 4px 0 0 var(--accent2); }
.verdict.good h2 { color: var(--good); }
.verdict.warn h2 { color: var(--warn); }
.verdict.flare h2 { color: var(--accent2); }
.verdict p { margin: 6px 0; }
.verdict ul { margin: 6px 0; padding-left: 20px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.stat { background: #0a1129; border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; min-width: 110px; }
.stat b { display: block; font-size: 19px; }
.stat span { font-size: 11.5px; color: var(--muted); }
.caveat { background: rgba(255,123,107,.1); border: 1px solid rgba(255,123,107,.45); border-radius: 10px; padding: 8px 11px; font-size: 13px; margin-top: 10px; }
.caveat.mild { background: rgba(255,207,92,.08); border-color: rgba(255,207,92,.35); }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.viewer-head h2 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { font: inherit; font-size: 12.5px; background: #0b1230; color: var(--muted); border: 0; padding: 5px 10px; cursor: pointer; }
.seg button.on { background: #22306a; color: var(--text); }
canvas { display: block; width: 100%; border-radius: 10px; touch-action: none; }
.horizon { background: #05070d; cursor: crosshair; }
.dome { max-width: 460px; margin: 0 auto; cursor: grab; }
.player { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.player input[type=range] { width: 100%; padding: 0; accent-color: var(--accent); background: none; border: 0; margin: 0; }
.scrub-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.timeline { position: relative; height: 5px; margin: 0 8px; background: #141d42; border-radius: 3px; }
.timeline .band { position: absolute; top: 0; bottom: 0; min-width: 4px; background: var(--accent); border-radius: 3px; opacity: .8; }
.timelabels { display: flex; justify-content: space-between; font: 11.5px ui-monospace, Consolas, monospace; color: var(--muted); margin: 4px 52px 0 56px; gap: 8px; }
.timelabels b { color: var(--accent); font-weight: 600; }
.row.between { justify-content: space-between; }
.player select { width: auto; padding: 5px 8px; }
#playBtn { font: 14px system-ui; color: var(--text); }
.toggles { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 8px; }
.legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 8px; }
.legend .dot.ring { border: 1.5px solid #55648a; }
.legend .dash { display: inline-block; width: 18px; border-top: 2px dashed var(--blue); margin-left: 8px; }
.two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.mt { margin-top: 18px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.celist { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.celist li { padding: 3px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 6px 8px; border-bottom: 1px solid #18234c; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #142050; }
tbody tr.sel { background: #1b2a66; }
.pill { display: inline-block; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 99px; }
.pill.visible { background: rgba(255,211,107,.16); color: #ffd36b; }
.pill.flare { background: rgba(255,138,61,.18); color: #ff9a55; }
.pill.faint { background: rgba(185,198,230,.12); color: #b9c6e6; }
.pill.shadow { background: rgba(85,100,138,.2); color: #8090b8; }
.pill.outside { background: transparent; color: #66739a; border: 1px solid #2a3766; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.empty { color: var(--muted); text-align: center; padding: 18px; }
.foot { max-width: 1400px; margin: 0 auto; padding: 4px 20px 28px; color: #6c789f; font-size: 12px; }
.foot a { color: #8fa6d8; }
dialog { background: #0e1636; color: var(--text); border: 1px solid var(--line); border-radius: 16px; max-width: 720px; width: calc(100% - 32px); padding: 22px 26px; }
dialog::backdrop { background: rgba(2,4,10,.7); }
dialog .close { position: absolute; right: 14px; top: 14px; font: 20px system-ui; color: var(--muted); }
dialog li { margin: 5px 0; }
code { font-size: 12px; background: #0a1028; padding: 1px 5px; border-radius: 5px; }
code.wrap { display: block; word-break: break-all; padding: 6px 8px; margin-top: 4px; }

@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; }
  .inputs { position: static; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .top, .layout { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 22px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .legend { display: none; }
}
