/* Layout: control-room dark-first UI — fixed top bar, scene tabs, 12-col card grid; numbers in mono, labels in Golos. */
:root {
  --bg: #0c1117;
  --surface: #141b24;
  --surface-2: #1b242f;
  --border: #24313f;
  --border-strong: #34465a;
  --fg: #e8eef4;
  --fg-2: #aebccb;
  --muted: #7c8da0;
  --accent: #f0a62e;
  --accent-ink: #1a1206;
  --accent-soft: rgba(240, 166, 46, 0.14);
  --good: #3fb67a;
  --warn: #e8b339;
  --crit: #e5534b;
  --info: #4f9cf0;
  --good-soft: rgba(63, 182, 122, 0.15);
  --warn-soft: rgba(232, 179, 57, 0.16);
  --crit-soft: rgba(229, 83, 75, 0.16);
  --info-soft: rgba(79, 156, 240, 0.15);
  --c1: #c4851a;
  --c2: #3d8be0;
  --c3: #1f9a8a;
  --c4: #9d78e6;
  --c5: #d9483f;
  --grid: rgba(255, 255, 255, 0.07);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font:
    "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef1f5;
    --surface: #ffffff;
    --surface-2: #f4f6f9;
    --border: #d7dee7;
    --border-strong: #b9c5d2;
    --fg: #15202b;
    --fg-2: #3f4f61;
    --muted: #6a7a8c;
    --accent: #c47a0b;
    --accent-ink: #ffffff;
    --accent-soft: rgba(196, 122, 11, 0.12);
    --good: #1f8f58;
    --warn: #b7850f;
    --crit: #c93f36;
    --info: #2b74c7;
    --good-soft: rgba(31, 143, 88, 0.12);
    --warn-soft: rgba(183, 133, 15, 0.14);
    --crit-soft: rgba(201, 63, 54, 0.12);
    --info-soft: rgba(43, 116, 199, 0.12);
    --c1: #b8780f;
    --c2: #2b74c7;
    --c3: #0f9484;
    --c4: #7f5bd1;
    --c5: #c93f36;
    --grid: rgba(0, 0, 0, 0.07);
    --shadow: 0 8px 24px rgba(20, 32, 45, 0.1);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --border: #d7dee7;
  --border-strong: #b9c5d2;
  --fg: #15202b;
  --fg-2: #3f4f61;
  --muted: #6a7a8c;
  --accent: #c47a0b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(196, 122, 11, 0.12);
  --good: #1f8f58;
  --warn: #b7850f;
  --crit: #c93f36;
  --info: #2b74c7;
  --good-soft: rgba(31, 143, 88, 0.12);
  --warn-soft: rgba(183, 133, 15, 0.14);
  --crit-soft: rgba(201, 63, 54, 0.12);
  --info-soft: rgba(43, 116, 199, 0.12);
  --c1: #b8780f;
  --c2: #2b74c7;
  --c3: #0f9484;
  --c4: #7f5bd1;
  --c5: #c93f36;
  --grid: rgba(0, 0, 0, 0.07);
  --shadow: 0 8px 24px rgba(20, 32, 45, 0.1);
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}
a {
  color: var(--info);
}

/* top bar */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.top-in {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}
.brand small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ctx {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--fg-2);
  white-space: nowrap;
}
.chip b {
  color: var(--fg);
  font-weight: 600;
}
.chip.demo {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px var(--good-soft);
}
.dot.live {
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--good-soft);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}
select.sel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 28px 5px 10px;
  font-size: 12px;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* tabs */
.tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs-in {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
}
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab .k {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.tab:hover {
  color: var(--fg-2);
}
.tab[aria-selected="true"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}
.tab[aria-selected="true"] .k {
  color: var(--accent);
  border-color: var(--accent);
}

/* page */
.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 16px 56px;
}
.scene {
  display: none;
}
.scene.on {
  display: block;
  animation: fade 0.25s ease;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.scene-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.scene-head h2 {
  font-size: 20px;
  font-weight: 700;
}
.scene-head p {
  color: var(--muted);
  max-width: 68ch;
  margin-top: 4px;
}
.proof {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--good-soft);
  color: var(--good);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.proof.ready {
  background: var(--info-soft);
  color: var(--info);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  min-width: 0;
}
.card h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.card h3 .sub {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.span3 {
  grid-column: span 3;
}
.span4 {
  grid-column: span 4;
}
.span5 {
  grid-column: span 5;
}
.span6 {
  grid-column: span 6;
}
.span7 {
  grid-column: span 7;
}
.span8 {
  grid-column: span 8;
}
.span12 {
  grid-column: span 12;
}
@media (max-width: 1100px) {
  .span3 {
    grid-column: span 6;
  }
  .span4 {
    grid-column: span 6;
  }
  .span5,
  .span7,
  .span8 {
    grid-column: span 12;
  }
  .span6 {
    grid-column: span 12;
  }
}
@media (max-width: 640px) {
  .span3,
  .span4 {
    grid-column: span 12;
  }
}

/* KPI tiles */
.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) {
  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .kpis {
    grid-template-columns: 1fr;
  }
}
.kpi {
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.15s;
  position: relative;
}
.kpi:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.kpi .v {
  font-family: var(--mono);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.kpi .v small {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}
.kpi .d {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.delta {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 5px;
}
.delta.good {
  color: var(--good);
  background: var(--good-soft);
}
.delta.bad {
  color: var(--crit);
  background: var(--crit-soft);
}
.delta.neu {
  color: var(--fg-2);
  background: var(--surface-2);
}
.kpi .go {
  position: absolute;
  right: 12px;
  top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.gauge {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  margin-top: 10px;
  overflow: hidden;
  position: relative;
}
.gauge i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
}

/* badges */
.sev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sev::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.sev.crit {
  color: var(--crit);
  background: var(--crit-soft);
}
.sev.warn {
  color: var(--warn);
  background: var(--warn-soft);
}
.sev.good {
  color: var(--good);
  background: var(--good-soft);
}
.sev.info {
  color: var(--info);
  background: var(--info-soft);
}
.sev.neu {
  color: var(--fg-2);
  background: var(--surface-2);
}

/* lists & tables */
.list {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}
.row:first-child {
  border-top: 0;
}
.row.click {
  cursor: pointer;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 6px;
}
.row.click:hover {
  background: var(--surface-2);
}
.row .t {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  width: 46px;
  flex: none;
}
.row .main {
  flex: 1;
  min-width: 0;
}
.row .main b {
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .main span {
  font-size: 12px;
  color: var(--muted);
}
.bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
td.num,
th.num {
  text-align: right;
}
.tbl {
  overflow-x: auto;
}

/* charts */
.chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.chart text {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--muted);
}
.chart .ax {
  stroke: var(--grid);
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--fg-2);
  margin-top: 8px;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: var(--shadow);
  display: none;
  white-space: nowrap;
}
.tip b {
  font-family: var(--mono);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.btn:hover {
  border-color: var(--muted);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover {
  filter: brightness(1.06);
}
.btn.ghost {
  background: transparent;
}
.btn.sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn.good {
  color: var(--good);
  border-color: var(--good);
}
.btn.crit {
  color: var(--crit);
  border-color: var(--crit);
}

/* cameras */
.cams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px) {
  .cams {
    grid-template-columns: 1fr;
  }
  .brand small {
    display: none;
  }
  .top-in {
    gap: 8px;
  }
  .chip {
    font-size: 11px;
    padding: 4px 8px;
  }
}
.cam {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #0a0f14;
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
  cursor: pointer;
}
.cam.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.cam svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cam .lbl {
  position: absolute;
  left: 8px;
  top: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: #dfe7ef;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 7px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
}
.cam .lbl .rec {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e5534b;
  animation: pulse 1.2s infinite;
}
.cam .cnt {
  position: absolute;
  right: 8px;
  top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: #fff;
  background: rgba(229, 83, 75, 0.85);
  padding: 3px 7px;
  border-radius: 5px;
}
.cam .cnt.ok {
  background: rgba(63, 182, 122, 0.8);
}
.cam .foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px;
  font-size: 11px;
  color: #dfe7ef;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.bbox {
  fill: none;
  stroke-width: 1.6;
}
.bbox.ok {
  stroke: #3fb67a;
}
.bbox.bad {
  stroke: #e5534b;
  stroke-dasharray: 4 2;
}
.btag {
  font-family: var(--mono);
  font-size: 7px;
  fill: #fff;
  font-weight: 600;
}
.zone {
  fill: rgba(229, 83, 75, 0.12);
  stroke: #e5534b;
  stroke-width: 1;
  stroke-dasharray: 5 3;
}
.zone.ok {
  fill: rgba(240, 166, 46, 0.08);
  stroke: #f0a62e;
}

/* event detail */
.detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 4px 10px;
  font-size: 13px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  font-weight: 500;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* upload */
.drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  transition: border-color 0.15s;
}
.drop.over {
  border-color: var(--accent);
  color: var(--fg);
}
.drop p {
  margin-top: 6px;
  font-size: 12px;
}
.preview {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  margin-top: 10px;
}
.preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.preview svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
}
.callout.info {
  border-color: var(--info);
  background: var(--info-soft);
}
.callout.crit {
  border-color: var(--crit);
  background: var(--crit-soft);
}
.callout.good {
  border-color: var(--good);
  background: var(--good-soft);
}
.progress {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.3s;
}
.samples {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.samples button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 6px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.samples button:hover {
  border-color: var(--border-strong);
}
.samples svg {
  width: 44px;
  height: 28px;
  border-radius: 4px;
  background: #0a0f14;
}

/* permits */
.permits {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
@media (max-width: 900px) {
  .permits {
    grid-template-columns: 1fr;
  }
}
.pitem {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pitem:hover {
  border-color: var(--border-strong);
}
.pitem.sel {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pitem b {
  font-weight: 600;
}
.pitem span {
  font-size: 12px;
  color: var(--muted);
}
.doc {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
}
.doc h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.doc .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 640px) {
  .fields {
    grid-template-columns: 1fr;
  }
}
.field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}
.field .l {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field .v {
  margin-top: 2px;
  font-weight: 500;
  min-height: 18px;
  text-align: left;
}
.field .v.empty {
  color: var(--crit);
  font-style: italic;
  font-weight: 400;
}
.field.hl-crit {
  border-color: var(--crit);
  box-shadow: 0 0 0 3px var(--crit-soft);
}
.field.hl-warn {
  border-color: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}
.field.hl-note {
  border-color: var(--info);
  box-shadow: 0 0 0 3px var(--info-soft);
}
.field.wide {
  grid-column: 1/-1;
}
.verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: 600;
}
.verdict.crit {
  background: var(--crit-soft);
  color: var(--crit);
}
.verdict.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.verdict.good {
  background: var(--good-soft);
  color: var(--good);
}
.verdict .ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: currentColor;
  flex: none;
}
.verdict .ico svg {
  stroke: var(--surface);
  width: 16px;
  height: 16px;
  fill: none;
  stroke-width: 2.4;
}
.verdict small {
  display: block;
  font-weight: 500;
  font-size: 12px;
  opacity: 0.9;
}
.finding {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface);
  transition: border-color 0.15s;
}
.finding:hover,
.finding.sel {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.finding .stripe {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  flex: none;
}
.finding b {
  display: block;
  font-weight: 600;
}
.finding p {
  font-size: 12px;
  color: var(--fg-2);
  margin-top: 3px;
}
.finding .rule {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.finding .fix {
  font-size: 12px;
  color: var(--good);
  margin-top: 4px;
}
.ai {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.ai .spark {
  width: 16px;
  height: 16px;
  color: var(--accent);
}
textarea {
  width: 100%;
  min-height: 90px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
}

/* heatmap */
.heat {
  display: grid;
  gap: 3px;
  font-size: 11px;
}
.heat .hc {
  aspect-ratio: 1.6;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  color: var(--fg);
  cursor: default;
}
.heat .hl {
  color: var(--muted);
  display: flex;
  align-items: center;
  padding-right: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heat .ht {
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
}

/* equipment */
.eq {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  cursor: pointer;
  border-top: 1px solid var(--border);
}
.eq:hover,
.eq.sel {
  background: var(--surface-2);
}
.eq:first-child {
  border-top: 0;
}
.ring {
  width: 40px;
  height: 40px;
  flex: none;
}
.ring circle {
  fill: none;
  stroke-width: 4;
}
.ring .bgc {
  stroke: var(--surface-2);
}
.ring text {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  fill: var(--fg);
  text-anchor: middle;
}
.eq .main {
  flex: 1;
  min-width: 0;
}
.eq .main b {
  display: block;
  font-weight: 600;
}
.eq .main span {
  font-size: 12px;
  color: var(--muted);
}
.eq .rul {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}
.eq .rul small {
  display: block;
  color: var(--muted);
  font-family: var(--font);
}

/* calculator */
.calc {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .calc {
    grid-template-columns: 1fr;
  }
}
.ctl {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ctl label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--fg-2);
  gap: 10px;
}
.ctl label output {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--fg);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin-top: 6px;
}
.out {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 520px) {
  .out {
    grid-template-columns: 1fr;
  }
}
.out .o {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px 14px;
}
.out .o .l {
  font-size: 12px;
  color: var(--muted);
}
.out .o .v {
  font-family: var(--mono);
  font-size: clamp(20px, 4vw, 24px);
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: -0.02em;
}
.out .o .v small {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font);
  font-weight: 500;
}
.out .o.big {
  grid-column: 1/-1;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}
.out .o.big .v {
  font-size: clamp(22px, 4.5vw, 30px);
  color: var(--accent);
}
.out .o.crit-card {
  grid-column: 1/-1;
  background: color-mix(in oklab, var(--crit) 10%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--crit) 35%, transparent);
}
.out .o.crit-card .l {
  color: var(--fg-2);
  font-weight: 600;
  font-size: 13px;
}
.out .o.crit-card .v {
  color: var(--crit);
}
.assump {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}
.assump b {
  color: var(--fg-2);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
.assump ul {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.assump li {
  list-style: disc;
}

/* architecture */
.arch {
  width: 100%;
  height: auto;
}
.arch text {
  font-family: var(--font);
  font-size: 11px;
  fill: var(--fg);
}
.arch .box {
  fill: var(--surface-2);
  stroke: var(--border-strong);
}
.arch .core {
  fill: var(--accent-soft);
  stroke: var(--accent);
}
.arch .lbl {
  fill: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.arch .ln {
  stroke: var(--border-strong);
  stroke-width: 1.2;
  fill: none;
  marker-end: url(#arr);
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 800px) {
  .steps {
    grid-template-columns: 1fr;
  }
}
.step {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 14px;
  border-top: 3px solid var(--border-strong);
}
.step:nth-child(1) {
  border-top-color: var(--info);
}
.step:nth-child(2) {
  border-top-color: var(--accent);
}
.step:nth-child(3) {
  border-top-color: var(--good);
}
.step .n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.step h4 {
  margin: 4px 0 6px;
  font-size: 15px;
}
.step p {
  font-size: 13px;
  color: var(--fg-2);
}
.step ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--fg-2);
}
.step li {
  margin: 2px 0;
}

.foot {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px);
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  opacity: 0;
  transition: all 0.25s;
  z-index: 60;
  pointer-events: none;
  max-width: calc(100% - 32px);
}
.toast.on {
  opacity: 1;
  transform: translateX(-50%);
}
.hint {
  font-size: 12px;
  color: var(--muted);
}
.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
