:root {
  color-scheme: dark;
  --ink: #f6f8fa;
  --muted: #a9bac7;
  --bg: #071522;
  --panel: #0d2232;
  --panel-2: #123148;
  --line: #29475a;
  --accent: #f4b942;
  --accent-ink: #221900;
  --pass: #43d17a;
  --fail: #ff6868;
  --info: #65b6e8;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; font: 16px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: radial-gradient(circle at 100% 0, #164b68 0, transparent 32rem), var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, input, select { min-height: 46px; }
button { cursor: pointer; }
.shell { width: min(1100px, 100%); margin: 0 auto; padding: 18px 16px 100px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.mark { width: 44px; height: 44px; border-radius: 13px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-weight: 900; }
.topbar h1 { margin: 0; font-size: clamp(1.25rem, 5vw, 1.8rem); line-height: 1.1; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: .875rem; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; position: sticky; top: 8px; z-index: 20; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); }
.tab { border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 750; padding: 8px; }
.tab.active { color: var(--accent-ink); background: var(--accent); }
.view { display: none; padding-top: 16px; }
.view.active { display: block; }
.card { background: linear-gradient(145deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: 0 16px 35px rgba(0,0,0,.18); }
.card h2, .card h3 { margin: 0 0 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title small { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
label { color: #d9e3ea; font-weight: 650; font-size: .9rem; }
input, select, textarea { width: 100%; border: 1px solid #426079; border-radius: 12px; color: var(--ink); background: #071a29; padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(244,185,66,.18); }
input[readonly] { color: #bcd0dc; background: #102433; }
.hint { color: var(--muted); font-size: .8rem; }
.meter-row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; margin-bottom: 10px; }
.result-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 13px; font-weight: 850; letter-spacing: .04em; }
.status.pass { background: rgba(67,209,122,.15); color: var(--pass); border: 1px solid rgba(67,209,122,.55); }
.status.fail { background: rgba(255,104,104,.14); color: var(--fail); border: 1px solid rgba(255,104,104,.5); }
.status.wait { background: rgba(101,182,232,.12); color: var(--info); border: 1px solid rgba(101,182,232,.5); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.metric { padding: 12px; background: rgba(3,14,23,.45); border-radius: 13px; border: 1px solid rgba(111,145,166,.22); }
.metric span { display: block; color: var(--muted); font-size: .75rem; }
.metric strong { display: block; margin-top: 3px; font-size: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.btn { border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #18394f; padding: 10px 14px; font-weight: 750; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: transparent; border-color: rgba(255,104,104,.5); color: #ff9e9e; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.records { display: grid; gap: 10px; }
.record { border: 1px solid var(--line); border-radius: 15px; padding: 14px; background: rgba(9,29,43,.8); }
.record-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.record h3 { margin: 0; font-size: 1rem; }
.record p { margin: 5px 0 0; color: var(--muted); font-size: .875rem; }
.empty { text-align: center; color: var(--muted); padding: 35px 12px; }
.notice { border-left: 4px solid var(--accent); padding: 12px 14px; background: rgba(244,185,66,.08); border-radius: 0 12px 12px 0; color: #f4e1aa; }
.search { margin-bottom: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 20px; opacity: 0; pointer-events: none; background: #f6f8fa; color: #071522; border-radius: 999px; padding: 11px 16px; font-weight: 750; transition: .22s ease; z-index: 40; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.toast.show { opacity: 1; translate: -50% 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
dialog { width: min(520px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--panel); padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
dialog h2 { margin-top: 0; }
@media (max-width: 720px) {
  .grid, .grid.three { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tab { font-size: .85rem; }
  .card { padding: 15px; }
}
@media print {
  body { background: #fff; color: #111; }
  .topbar, .tabs, .actions, #view-records, #view-help, .notice { display: none !important; }
  .shell { width: 100%; padding: 0; }
  .view, #view-assess { display: block !important; }
  .card { background: #fff; color: #111; box-shadow: none; border: 1px solid #bbb; break-inside: avoid; }
  input, select { color: #111; background: #fff; border-color: #ccc; }
  label, .hint, .metric span { color: #444; }
}
