:root {
  color-scheme: dark;
  --bg: #0c0c0d;
  --surface-1: #141415;
  --surface-2: #1b1b1d;
  --surface-3: #252527;
  --border: #242426;
  --border-strong: #333336;
  --text-primary: #ededec;
  --text-secondary: #a9a9a5;
  --text-muted: #75756f;
  --grid: #222224;
  --accent: #4f8cff;
  --accent-ink: #ffffff;
  --accent-soft: #172235;
  --accent-grad: var(--accent);
  --series-1: #4f8cff;
  --sev-kick: #e5484d;
  --sev-high: #f0803c;
  --sev-warn: #f5b100;
  --sev-info: #6f6f6a;
  --good: #16a34a;
  --chip-kick-bg: #3a1519;
  --chip-high-bg: #3a2014;
  --chip-warn-bg: #362b0c;
  --chip-info-bg: #222224;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 8px 28px -12px rgb(0 0 0 / 0.7);
  --shadow-lg: 0 30px 80px -10px rgb(0 0 0 / 0.75), 0 2px 8px rgb(0 0 0 / 0.5);
  --danger: #ff5c63;
  --danger-soft: #3a171b;
  --test: #a98bff;
  --test-soft: #231b42;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }

.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(380px, 100%); background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; display: grid; gap: 14px; box-shadow: var(--shadow);
}
.login-card p { margin: 0; }
.login-error { color: var(--sev-kick); min-height: 1.2em; font-size: 13px; }

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px; background: var(--surface-1); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: -0.01em; padding: 2px 8px; }
.brand-lg { font-size: 19px; padding: 0; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z' stroke='white' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-weight: 500; text-decoration: none;
}
.nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: var(--surface-2); color: var(--text-primary); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav-badge {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; font-size: 11.5px; line-height: 20px;
  text-align: center; background: var(--sev-kick); color: #fff; font-weight: 600;
}
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.live { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); padding: 0 8px; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.live.on .dot { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.live.off { color: var(--sev-kick); }
.live.off .dot { background: var(--sev-kick); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sev-kick) 22%, transparent); }
.sidebar-actions { display: flex; gap: 6px; padding: 0 4px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border); cursor: pointer; color: var(--text-secondary);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main { padding: 24px 28px 48px; outline: none; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; letter-spacing: -0.02em; margin: 0; font-weight: 650; }
.page-head .sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-1);
  cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.dur { display: grid; gap: 10px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.dur[hidden] { display: none; }
.dur-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.dur-cell { display: flex; align-items: stretch; height: 46px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-1); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.dur-cell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dur-step { flex: none; width: 30px; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 17px; line-height: 1; cursor: pointer; user-select: none; }
.dur-step:hover { background: var(--surface-2); color: var(--text-primary); }
.dur-step:active { background: var(--surface-3); }
.dur-value { flex: 1; align-self: center; display: flex; align-items: baseline; justify-content: center; gap: 4px; min-width: 0; cursor: text; }
.dur-cell input.dur-num { width: 4.2ch; min-width: 1.3ch; height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: center; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.dur-cell input.dur-num:focus { outline: none; }
.dur-value span { font-size: 12.5px; color: var(--text-muted); }
.dur-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.dur-chip { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-1); color: var(--text-secondary); font: inherit; font-size: 12.5px; cursor: pointer; }
.dur-chip:hover { color: var(--text-primary); border-color: var(--text-muted); }
.dur-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.dur-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dur-preview { font-size: 12.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.dur-preview.bad { color: var(--danger); }
.ctl-form .dur { grid-column: 1 / -1; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], input:not([type]), select, textarea {
  height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-1); color: var(--text-primary); font: inherit; min-width: 0;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .icon-btn:focus-visible, .nav a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 7px; cursor: pointer; color: var(--text-secondary); font-weight: 500; }
.segmented button.on { background: var(--surface-1); color: var(--text-primary); box-shadow: var(--shadow); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input[type="search"] { width: 240px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); }

.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.card h2 { margin: 0 0 12px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.card h2 .muted { font-weight: 400; font-size: 12.5px; }
.kpi { display: grid; gap: 4px; }
.kpi-label { font-size: 12.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.kpi-delta.up::before { content: "▲ "; font-size: 9px; }
.kpi-delta.down::before { content: "▼ "; font-size: 9px; }
.swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.empty { color: var(--text-muted); padding: 24px 0; text-align: center; font-size: 13px; }

.sev {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em; white-space: nowrap; color: var(--text-primary);
}
.sev::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.sev-KICK { background: var(--chip-kick-bg); } .sev-KICK::before { background: var(--sev-kick); }
.sev-HIGH { background: var(--chip-high-bg); } .sev-HIGH::before { background: var(--sev-high); }
.sev-WARN { background: var(--chip-warn-bg); } .sev-WARN::before { background: var(--sev-warn); }
.sev-INFO { background: var(--chip-info-bg); color: var(--text-secondary); } .sev-INFO::before { background: var(--sev-info); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-secondary); font-family: var(--mono); }
.verdict { font-size: 11.5px; font-weight: 600; }
.verdict-confirmed { color: var(--sev-kick); }
.verdict-false_positive { color: var(--good); }

.table-wrap { position: relative; overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--text-muted); font-size: 12px; padding: 0 10px 8px; white-space: nowrap; }
td { padding: 9px 10px; border-top: 1px solid var(--border); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
tr.fresh td { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: var(--accent-soft); } to { background: transparent; } }
td.detail { color: var(--text-secondary); max-width: 560px; overflow-wrap: anywhere; }
td.nowrap, th.nowrap { white-space: nowrap; }
.right { text-align: right; }
.load-more { display: flex; justify-content: center; padding-top: 14px; }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.chart .hit { fill: transparent; }
.chart .col:hover .hit, .chart .col.hover .hit { fill: var(--surface-2); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 12.5px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-family: var(--mono); font-size: 12px; }
.bar-track { height: 10px; background: transparent; }
.bar-fill { height: 10px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.bar-row .val { font-variant-numeric: tabular-nums; color: var(--text-primary); min-width: 3ch; text-align: right; }
.bar-row button.name { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.bar-row button.name:hover { color: var(--accent); }

.kick-list { display: grid; gap: 2px; }
.kick-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 9px 0; border-top: 1px solid var(--border); cursor: pointer; }
.kick-item:first-child { border-top: 0; }
.kick-item:hover .kick-title { color: var(--accent); }
.kick-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kick-sub { grid-column: 2; color: var(--text-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kick-time { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.profile { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.stat-row { display: flex; gap: 22px; flex-wrap: wrap; margin-left: auto; }
.stat-row div { display: grid; }
.stat-row b { font-size: 18px; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 12px; color: var(--text-muted); }

.drawer-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 0.35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(560px, 100%); z-index: 50; background: var(--surface-1);
  border-left: 1px solid var(--border); transform: translateX(100%); transition: transform 0.18s ease;
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 4px 0 0; font-size: 16px; overflow-wrap: anywhere; }
.drawer-head .icon-btn { margin-left: auto; flex: none; }
.drawer-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 7px 12px; font-size: 13px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.detail-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; overflow-wrap: anywhere; }
pre.json { margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font: 12px/1.5 var(--mono); overflow: auto; max-height: 320px; white-space: pre-wrap; overflow-wrap: anywhere; }
.verdict-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 13px; color: var(--text-secondary); margin: 0 0 6px; font-weight: 600; }

.tooltip {
  position: fixed; z-index: 60; pointer-events: none; background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); min-width: 150px;
}
.tooltip .tt-title { font-weight: 600; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .tt-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.toast {
  position: fixed; bottom: 20px; left: 50%; z-index: 80; display: flex; align-items: center; gap: 14px;
  max-width: calc(100% - 32px); background: var(--text-primary); color: var(--surface-1);
  padding: 10px 12px 10px 16px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow-lg);
  overflow: hidden; opacity: 0; transform: translate(-50%, 12px); transition: opacity 0.16s ease, transform 0.16s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-text { min-width: 0; }
.toast-action {
  border: 0; background: color-mix(in srgb, var(--surface-1) 16%, transparent); color: var(--surface-1);
  height: 28px; padding: 0 12px; border-radius: 8px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.toast-action:hover { background: color-mix(in srgb, var(--surface-1) 26%, transparent); }
.toast-progress {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: color-mix(in srgb, var(--surface-1) 45%, transparent);
  transform-origin: left; animation: toast-countdown linear forwards;
}
@keyframes toast-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 86%, black); }
.btn-danger-ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border-strong)); background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn:disabled { opacity: 0.5; cursor: default; }

.check { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; cursor: pointer; vertical-align: middle; }
.check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.check span {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--surface-1);
  transition: background 0.12s, border-color 0.12s; pointer-events: none;
}
.check input:checked + span, .check input:indeterminate + span { background: var(--accent); border-color: var(--accent); }
.check input:checked + span::after {
  content: ""; display: block; width: 4px; height: 8px; margin: 1px 0 0 4.5px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check input:indeterminate + span::after { content: ""; display: block; width: 8px; height: 2px; margin: 6px 0 0 3px; background: #fff; border-radius: 1px; }
.check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
th.c-sel, td.c-sel { width: 30px; padding-right: 4px; }
td.c-sel { padding-top: 10px; cursor: pointer; }
th.c-act, td.c-act { width: 40px; text-align: right; }
td.c-act { padding-top: 5px; }
tr.selected td { background: var(--accent-soft); }
tr.click.selected:hover td { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface-2)); }
.row-del {
  width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--text-muted); cursor: pointer; opacity: 0; transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.row-del svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
tr:hover .row-del, .row-del:focus-visible, tr.selected .row-del { opacity: 1; }
.row-del:hover { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.row-del:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: none) { .row-del { opacity: 1; } }
tr.row-removing td { transition: opacity 0.18s ease, background 0.18s ease; opacity: 0; background: var(--danger-soft); }
.kick-item.row-removing { transition: opacity 0.18s ease; opacity: 0; }

.bulk-bar {
  position: fixed; left: 50%; bottom: 20px; z-index: 75; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  width: min(720px, calc(100% - 32px)); padding: 10px 12px 10px 18px; border-radius: 14px;
  background: var(--surface-1); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity 0.16s ease, transform 0.16s ease;
}
.bulk-bar.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.bulk-count { font-size: 13.5px; }
.bulk-count b { font-variant-numeric: tabular-nums; }
.bulk-spacer { flex: 1; }
body:has(.toast.show) .bulk-bar.show { bottom: 78px; }

@media (min-width: 761px) {
  .toast, .bulk-bar { left: calc(50% + 116px); }
  .bulk-bar { width: min(720px, calc(100% - 232px - 32px)); }
}

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / 0.45); animation: fade-in 0.14s ease; }
.modal-card {
  width: min(420px, 100%); background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px; padding: 22px;
  box-shadow: var(--shadow-lg); display: grid; gap: 10px; animation: pop-in 0.16s ease;
}
.modal-card h3 { margin: 4px 0 0; font-size: 17px; letter-spacing: -0.01em; }
.modal-card p { margin: 0; color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; }
.modal-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.modal-icon.danger { background: var(--danger-soft); color: var(--danger); }
.modal-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.tests-btn { position: relative; }
.tests-btn[aria-pressed="true"] { background: var(--test-soft); border-color: var(--test); color: var(--test); }
.tests-badge {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--test); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; font-weight: 700;
  border: 2px solid var(--surface-1); box-sizing: content-box;
}
.warn-banner {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px; font-size: 13.5px; line-height: 1.45;
  background: var(--danger-soft); color: var(--danger);
  border-bottom: 1px solid var(--danger);
}
.warn-banner b { font-weight: 650; }
.warn-banner .mono { font-family: var(--mono); }
.test-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding: 12px 14px;
  border-radius: var(--radius); background: var(--test-soft); border: 1px solid color-mix(in srgb, var(--test) 35%, transparent);
}
.test-banner-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--test); color: #fff; flex: none; }
.test-banner-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.test-banner-text { display: grid; gap: 1px; min-width: 0; flex: 1 1 260px; font-size: 13px; color: var(--text-secondary); }
.test-banner-text b { color: var(--test); font-size: 13.5px; }
.test-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.test-banner .btn-primary { background: var(--test); border-color: var(--test); }
html.test-mode .brand-mark { background-color: var(--test); }
html.test-mode .nav a.active { background: var(--test-soft); color: var(--test); }
.test-chip { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--test-soft); color: var(--test); font-size: 11.5px; font-weight: 600; }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); margin-top: auto; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1100px) {
  .ev-table, .ev-table thead, .ev-table tbody { display: block; width: 100%; }
  .ev-table thead tr { display: flex; align-items: center; padding: 0 8px 6px; }
  .ev-table thead th { display: none; padding: 0; }
  .ev-table thead th.c-sel { display: flex; align-items: center; gap: 10px; width: auto; }
  .ev-table thead th.c-sel::after { content: "Выбрать все на странице"; font-size: 12.5px; color: var(--text-muted); }
  .ev-table tbody tr {
    display: grid; grid-template-columns: 22px auto minmax(0, 1fr) 32px; gap: 6px 10px; padding: 12px 8px;
    border-top: 1px solid var(--border); align-items: start; border-radius: 10px;
  }
  .ev-table tbody tr:first-child { border-top: 0; }
  .ev-table td { border: 0; padding: 0; background: transparent !important; min-width: 0; overflow-wrap: anywhere; }
  .ev-table tbody tr.click:hover { background: var(--surface-2); }
  .ev-table tbody tr.selected, .ev-table tbody tr.selected:hover { background: var(--accent-soft); }
  .ev-table tbody tr.row-removing { background: var(--danger-soft); }
  .ev-table td.c-sel { grid-column: 1; grid-row: 1 / span 3; padding-top: 2px; width: auto; }
  .ev-table td.c-time { grid-column: 2; grid-row: 1; align-self: center; }
  .ev-table td.c-sev { grid-column: 3; grid-row: 1; justify-self: start; }
  .ev-table td.c-act { grid-column: 4; grid-row: 1 / span 2; padding: 0; width: auto; }
  .ev-table td.c-mod { grid-column: 2; grid-row: 2; }
  .ev-table td.c-player { grid-column: 3; grid-row: 2; }
  .ev-table td.c-detail { grid-column: 2 / -1; grid-row: 3; max-width: none; color: var(--text-primary); }
  .ev-table-player td.c-mod { grid-column: 2 / 4; }
  .row-del { opacity: 0.6; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .sidebar .brand { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 7px 9px; }
  .nav a span { display: none; }
  .nav-badge { margin-left: 2px; }
  .sidebar-foot { margin: 0 0 0 auto; display: flex; align-items: center; gap: 6px; }
  .live #live-text { display: none; }
  .main { padding: 16px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters input[type="search"] { width: 100%; }
  .kv { grid-template-columns: 90px minmax(0, 1fr); }
  .bulk-bar { padding: 10px 12px; gap: 8px; }
  .bulk-spacer { display: none; }
  .bulk-bar .btn { flex: 1; }
  .drawer-foot { padding: 12px 16px; }
}

:root {
  --cat-tools: #5aa0ef; --cat-client: #a98bea; --cat-movement: #34b9a5; --cat-combat: #e86bb6;
  --cat-interaction: #7cb34a; --cat-decoy: #c0915d; --cat-network: #3fb2d6; --cat-rejoin: #8590ee; --cat-other: #6f6e68;
  --ok-soft: #173019; --bad-soft: #3a1c1c;
}
.cat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--cat-other); }
.cat-tools { background: var(--cat-tools); } .cat-client { background: var(--cat-client); } .cat-movement { background: var(--cat-movement); }
.cat-combat { background: var(--cat-combat); } .cat-interaction { background: var(--cat-interaction); } .cat-decoy { background: var(--cat-decoy); }
.cat-network { background: var(--cat-network); } .cat-rejoin { background: var(--cat-rejoin); }
.cat-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

.risk { --lv: var(--sev-info); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.risk-cheat { --lv: var(--sev-kick); } .risk-likely { --lv: var(--sev-high); } .risk-suspect { --lv: var(--sev-warn); }
.risk-low { --lv: var(--sev-info); } .risk-clean { --lv: var(--good); }
.risk b { min-width: 3.4ch; text-align: right; font-weight: 650; }
.risk-track { position: relative; display: inline-block; width: 72px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; flex: none; }
.risk-track i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--lv); }
.risk-sm .risk-track { width: 48px; }
.risk-label { font-size: 12.5px; color: var(--text-secondary); }
.risk-track-lg { display: block; width: 100%; height: 8px; border-radius: 4px; }

.reason-chips { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; }
.reason-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis;
}
.reason-chip b { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.reason-chip em { font-style: normal; font-size: 11px; color: var(--text-muted); }
.pv { display: inline-block; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 19px; vertical-align: 1px; }
.pv-cheater { background: var(--bad-soft); color: var(--danger); }
.pv-clean { background: var(--ok-soft); color: var(--good); }
.nav-badge-soft { background: var(--surface-3); color: var(--text-primary); }
.nav a.active .nav-badge-soft { background: var(--accent); color: var(--accent-ink); }

.ev-title { font-weight: 550; color: var(--text-primary); margin-bottom: 3px; white-space: normal; min-width: 140px; }
td.c-mod { white-space: nowrap; }
.rep { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-primary); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lag-chip { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--chip-warn-bg); color: var(--text-primary); font-size: 11.5px; font-weight: 600; }
.scope-chip { border-style: dashed; }

.drawer-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.explain { display: grid; gap: 10px; }
.explain-lead { margin: 0; font-size: 14.5px; line-height: 1.5; }
.prose { margin: 0; color: var(--text-secondary); line-height: 1.55; }
.prose-list { margin: 0; padding-left: 18px; color: var(--text-secondary); line-height: 1.55; display: grid; gap: 3px; }
.hint { font-size: 12.5px; margin: 8px 0 0; line-height: 1.45; }
.measure { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; }
.measure > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; min-width: 0; }
.measure dt { font-size: 11.5px; color: var(--text-muted); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.measure dd { margin: 0; overflow-wrap: anywhere; font-size: 13.5px; }
.measure .env-bad { border-color: color-mix(in srgb, var(--sev-kick) 45%, var(--border)); background: var(--chip-kick-bg); }
.measure .env-warn { border-color: color-mix(in srgb, var(--sev-warn) 55%, var(--border)); background: var(--chip-warn-bg); }
.pl-reports { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pl-reports.many { color: var(--sev-high); }
.stat-reported b { color: var(--sev-high); }
.report-window { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.report-hit { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; cursor: pointer; font-size: 13px; }
.report-hit:hover { border-color: var(--border-strong); }
.report-hit .num { min-width: 42px; }
.report-detail { flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.shotmap { margin: 0; display: grid; gap: 8px; }
.shotmap svg { display: block; width: 100%; height: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.shotmap line, .shotmap polyline, .shotmap path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sm-grid { stroke: var(--grid); stroke-width: 1; }
.shotmap .sm-side { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sm-arc { stroke: var(--accent); stroke-width: 1.4; opacity: 0.85; }
.sm-arc-label { fill: var(--accent); font-weight: 600; }
.sm-scale-text { font: 500 10.5px var(--font); fill: var(--text-muted); }
.sm-los { stroke: var(--text-muted); stroke-width: 1.4; stroke-dasharray: 2 4; }
.sm-los-clear { stroke: var(--good); }
.sm-los-blocked { stroke: var(--sev-kick); opacity: 0.75; }
.sm-look { stroke: var(--accent); stroke-width: 2; }
.sm-look-prev { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 6 5; opacity: 0.55; }
.sm-look-fan { stroke: var(--accent); stroke-width: 1; opacity: 0.28; }
.sm-shot { stroke: var(--sev-kick); stroke-width: 2; }
.sm-wall { stroke: var(--text-primary); stroke-width: 4; }
.sm-link { stroke: var(--text-muted); stroke-width: 1; }
.sm-move { stroke: var(--sev-high); stroke-width: 1.4; stroke-dasharray: 4 3; }
.sm-arrow { fill: var(--sev-high); stroke: none; }
.sm-tick { stroke: var(--accent); stroke-width: 1.2; opacity: 0.7; }
.sm-trail-target { stroke: var(--sev-high); stroke-width: 1.6; opacity: 0.7; }
.sm-trail-cam { stroke: var(--accent); stroke-width: 1.6; opacity: 0.55; }
.sm-hit { stroke: var(--sev-kick); stroke-width: 2.2; }
.sm-cam { fill: var(--surface-2); stroke: var(--accent); stroke-width: 1.6; }
.sm-dot-me { fill: var(--accent); stroke: var(--surface-2); stroke-width: 2; }
.sm-dot-target { fill: var(--sev-high); stroke: var(--surface-2); stroke-width: 2; }
.sm-dot-target-soft { fill: var(--sev-high); opacity: 0.55; }
.sm-label { font: 600 11.5px var(--font); fill: var(--text-primary); paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px; }
.sm-dim { fill: var(--text-muted); font-weight: 500; }
.sm-wall-label { fill: var(--text-secondary); font-weight: 500; }
.sm-scale path { stroke: var(--text-muted); stroke-width: 1.2; }
.sm-scale text, .sm-north text { font: 500 10.5px var(--font); fill: var(--text-muted); }
.sm-north path { fill: var(--text-muted); }
.sm-facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 13px; line-height: 1.45; color: var(--text-secondary); }
.sm-facts .sm-bad { color: var(--text-primary); }
.sm-facts .sm-bad::before, .sm-facts .sm-ok::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--sev-kick); }
.sm-facts .sm-ok::before { background: var(--good); }
.sm-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-muted); }
.sm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sm-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid; }
.sm-k-look { border-color: var(--accent); }
.sm-k-fan { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.sm-k-shot { border-color: var(--sev-kick); }
.sm-k-target { width: 8px !important; height: 8px !important; border: 0 !important; border-radius: 50%; background: var(--sev-high); }
.sm-k-hit { border-color: var(--sev-kick); border-top-style: dotted !important; }
.sm-k-wall { border-top-width: 4px !important; border-color: var(--text-primary); }
.sm-k-trail { border-color: var(--sev-high); }

.aimscore { display: grid; gap: 10px; }
.as-row { display: grid; grid-template-columns: 76px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.as-name { color: var(--text-secondary); }
.as-row .num { text-align: right; }
.as-bar { position: relative; height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }
.as-fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--sev-info); }
.as-fill.as-warn { background: var(--sev-warn); } .as-fill.as-high { background: var(--sev-high); } .as-fill.as-kick { background: var(--sev-kick); }
.as-tick { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1px solid var(--border-strong); }
.as-tick span { position: absolute; top: 14px; transform: translateX(-50%); font: 500 10px var(--font); color: var(--text-muted); }
.as-note { margin: 6px 0 0; font-size: 12px; }
.as-parts { display: grid; gap: 4px; }
.as-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.as-part { display: grid; grid-template-columns: minmax(0, 1fr) 120px 40px; align-items: center; gap: 10px; font-size: 13px; }
.as-part-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.as-part-bar { height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.as-part-bar span { display: block; height: 100%; background: var(--accent); }
.as-part .num { text-align: right; }

.killreplay { margin: 0; display: grid; gap: 8px; }
.killreplay > svg { display: block; width: 100%; height: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.killreplay line, .killreplay polyline, .killreplay path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.kr-trail-s { stroke: var(--accent); stroke-width: 1.4; opacity: 0.45; stroke-dasharray: 3 4; }
.kr-trail-v { stroke: var(--sev-high); stroke-width: 1.6; opacity: 0.55; }
.kr-link { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 2 4; }
.kr-hit { stroke: var(--sev-kick); stroke-width: 2.2; }
.kr-hit.kr-head { stroke-width: 3; }
.kr-err { fill: var(--text-secondary); font-weight: 500; }
.kr-stage { position: relative; }
.kr-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kr-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.kr-nav .num { font-size: 12.5px; }
.kr-k-ghost { border-color: var(--accent); border-top-style: dotted !important; opacity: 0.7; }
.kr-canvas { display: block; width: 100%; height: 300px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: grab; touch-action: none; }
.kr-canvas:active { cursor: grabbing; }
.kr-views { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.kr-views .btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.kr-full { position: absolute; top: 10px; right: 10px; min-width: 34px; }
.kr-stage:fullscreen { background: var(--bg); display: flex; align-items: center; }
.kr-stage:fullscreen .kr-canvas { border-radius: 0; border: 0; }
.kr-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kr-buttons .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text-primary); }
.kr-play { min-width: 64px; }
.kr-shot.kr-shot-wall { stroke: var(--sev-warn); }
.kr-lag { fill: var(--sev-warn); opacity: 0.55; }
.kr-vshot { stroke: var(--sev-high); stroke-width: 1.6; opacity: 0.7; }
.kr-speed { fill: none; stroke: var(--text-muted); stroke-width: 1.2; opacity: 0.8; }
.kr-jump { fill: #7bcf7b; opacity: 0.9; }
.kr-stance { opacity: 0.85; }
.kr-vjump { fill: var(--sev-high); }
.kr-k-near, .kr-k-lag, .kr-k-cam { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.kr-k-near { background: #cf9a72; opacity: 0.6; }
.kr-k-lag { border: 1.5px solid var(--sev-high); }
.kr-k-cam { background: #e8e8e8; }
.kr-stance-c { fill: #c9b26a; }
.kr-stance-p { fill: #b07f4f; }
.kr-stance-d { fill: #e08a56; }
.kr-k-state, .kr-k-car, .kr-k-water { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.kr-k-car { background: #5a7ea8; }
.kr-k-water { background: rgba(52, 140, 215, 0.75); }
.kr-vshot.kr-vshot-hit { opacity: 1; stroke-width: 2.2; }
.kr-lag.kr-lag-high { fill: var(--sev-kick); }
.kr-stage .kr-err { position: absolute; left: 12px; bottom: 10px; font-size: 12.5px; pointer-events: none; }
.kr-k-me { border-color: var(--accent); }
.kr-k-target { border-color: var(--sev-high); }
.kr-k-wall { border-color: var(--border-strong); }
.kr-k-block { border-color: var(--sev-warn); }
.kr-controls { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
@media (max-width: 640px) { .kr-controls { grid-template-columns: 1fr; } .kr-views .btn { padding: 4px 8px; font-size: 12px; } }
.kr-timeline { width: 100%; height: auto; cursor: pointer; touch-action: none; }
.kr-axis { stroke: var(--border-strong); stroke-width: 1.2; }
.kr-tl-label { font: 500 10.5px var(--font); fill: var(--text-muted); }
.kr-shot { stroke: var(--text-muted); stroke-width: 2; }
.kr-shot-hit { stroke: var(--sev-high); }
.kr-shot.kr-head { stroke: var(--sev-kick); stroke-width: 3; }
.kr-cursor { stroke: var(--text-primary); stroke-width: 2; }
.kr-time { min-width: 52px; text-align: right; font-size: 12.5px; }
.kr-k-s { border-color: var(--accent); border-top-style: dashed !important; }
.model-note { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.model-note p { margin: 0; font-size: 13px; line-height: 1.5; }
.model-note p + p { margin-top: 4px; }
.player-strip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  color: inherit; text-decoration: none; flex-wrap: wrap;
}
.player-strip:hover { background: var(--surface-2); text-decoration: none; }
.ps-who { display: grid; min-width: 0; flex: 1 1 140px; }
.ps-risk { margin-left: auto; }
.avatar-sm { width: 34px; height: 34px; border-radius: 9px; font-size: 14px; flex: none; }
details.raw summary { cursor: pointer; color: var(--text-muted); font-size: 12.5px; }
details.raw[open] summary { margin-bottom: 8px; }
.btn.on-bad { background: var(--bad-soft); border-color: var(--danger); color: var(--danger); }
.btn.on-ok { background: var(--ok-soft); border-color: var(--good); color: var(--good); }

.keys-hint { font-size: 12px; margin: -8px 0 14px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
kbd { font: 11px/1 var(--mono); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-1); color: var(--text-secondary); }
.queue { display: grid; gap: 10px; }
.q-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  display: grid; gap: 10px; outline: none; transition: border-color 0.12s, box-shadow 0.12s, opacity 0.18s, transform 0.18s;
}
.q-card.focused { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.q-card.leaving { opacity: 0; transform: translateX(16px); }
.q-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.q-who { display: grid; min-width: 0; flex: 1 1 160px; }
.q-name { font-weight: 650; font-size: 15px; color: var(--text-primary); }
.q-risk .risk b { font-size: 16px; }
.q-risk .risk-track { width: 110px; }
.q-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.q-actions { display: flex; gap: 6px; }
.btn-ok:hover { background: var(--ok-soft); border-color: var(--good); color: var(--good); }
.btn-bad:hover { background: var(--bad-soft); border-color: var(--danger); color: var(--danger); }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; text-align: center; }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--ok-soft); color: var(--good); margin-bottom: 4px; }
.empty-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.risk-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.risk-card { --lv: var(--sev-info); display: grid; gap: 12px; align-content: start; }
.risk-card.risk-cheat { --lv: var(--sev-kick); } .risk-card.risk-likely { --lv: var(--sev-high); } .risk-card.risk-suspect { --lv: var(--sev-warn); }
.risk-card.risk-clean { --lv: var(--good); }
.risk-card .risk-track i { background: var(--lv); }
.risk-big { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.risk-big b { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.risk-big span { font-size: 15px; font-weight: 600; }
.risk-meta { font-size: 12.5px; }
.risk-why { margin: 0; padding-left: 18px; display: grid; gap: 5px; color: var(--text-secondary); line-height: 1.5; font-size: 13px; }
.pv-actions { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.why-list { display: grid; gap: 2px; }
.why-row { display: grid; gap: 5px; padding: 9px 10px; margin: 0 -10px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
.why-row:hover { background: var(--surface-2); text-decoration: none; }
.why-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.why-head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.why-p { margin-left: auto; font-weight: 650; }
.why-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.why-bar i { display: block; height: 100%; border-radius: 3px; background: var(--series-1); }
.why-sub { font-size: 12px; }
.noise-chip { font-size: 11px; padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-secondary); font-weight: 600; }

.how { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-secondary); line-height: 1.5; font-size: 13px; }
.how b { color: var(--text-primary); }
.usage { display: grid; gap: 2px; }
.usage-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px; }
.usage-row:first-child { border-top: 0; }
.usage-row span { color: var(--text-secondary); }
.usage-meter { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
.usage-meter-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.usage-meter-head span { color: var(--text-secondary); }
.usage-ok i { background: var(--good); } .usage-warn i { background: var(--sev-warn); } .usage-bad i { background: var(--sev-kick); }
.rel { display: inline-flex; align-items: center; gap: 8px; }
.rel-track { position: relative; width: 90px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.rel-now { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--series-1); }
.rel-prior { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text-primary); border-radius: 1px; z-index: 1; }
.v-ok { color: var(--good); font-weight: 600; } .v-bad { color: var(--danger); font-weight: 600; }
.weights { display: grid; gap: 8px; }
.weight-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) 60px; align-items: center; gap: 12px; font-size: 13px; }
.weight-row span { color: var(--text-secondary); }
.weight-row b { text-align: right; }
.weight-bar { position: relative; height: 8px; }
.weight-bar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-strong); }
.weight-bar i { position: absolute; top: 0; height: 8px; border-radius: 3px; }
.weight-bar i.pos { left: 50%; background: var(--sev-high); }
.weight-bar i.neg { right: 50%; background: var(--series-1); }
.bar-row .name small { display: block; font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.bar-row .name { font-family: var(--font); font-size: 12.5px; }
.kpi a.kpi-delta { color: var(--text-muted); }

@media (max-width: 1180px) {
  .risk-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (hover: none) { .keys-hint { display: none; } }
@media (max-width: 760px) {
  .hide-sm { display: none; }
  .q-actions { width: 100%; }
  .q-actions .btn { flex: 1; }
  .risk-big b { font-size: 34px; }
  .weight-row { grid-template-columns: minmax(0, 1fr) 80px 48px; }
}

.grade {
  --g: var(--sev-info); display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 12px; font-weight: 650; white-space: nowrap; color: var(--text-primary);
  background: color-mix(in srgb, var(--g) 15%, var(--surface-1)); border: 1px solid color-mix(in srgb, var(--g) 35%, transparent);
}
.grade i { width: 8px; height: 8px; border-radius: 50%; background: var(--g); flex: none; }
.grade b { font-weight: 650; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.grade-ok { --g: var(--good); } .grade-warn { --g: var(--sev-warn); } .grade-bad { --g: var(--sev-kick); }
.grade-lg { height: 34px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.srv-grade { min-width: 180px; max-width: 320px; }
.srv-reason { font-size: 12px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn-text { color: var(--text-primary); font-weight: 650; }
.warn-text::after { content: " !"; color: var(--sev-high); }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.score-card { --lv: var(--sev-info); gap: 6px; }
.score-card.tone-good { --lv: var(--good); } .score-card.tone-warn { --lv: var(--sev-warn); } .score-card.tone-bad { --lv: var(--sev-kick); }
.score-card .kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.score-card .score-word { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0; }
.back-link { display: inline-block; font-size: 12.5px; margin-bottom: 4px; }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.reason { --rc: var(--sev-info); display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 13px; line-height: 1.45; }
.reason i { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); transform: translateY(-1px); }
.reason-bad { --rc: var(--sev-kick); } .reason-warn { --rc: var(--sev-warn); } .reason-ok { --rc: var(--good); }
.storm-chip { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-secondary); font-size: 11.5px; font-weight: 600; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .refline { stroke: var(--sev-warn); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .crosshair { stroke: var(--border-strong); stroke-width: 1; }
.chart .dot { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
.bar-row a.name.plain { color: var(--text-secondary); font-family: var(--font); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row a.name.plain:hover { color: var(--accent); text-decoration: none; }
.srv-events td.se-detail { max-width: 460px; }
@media (max-width: 1180px) {
  .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .kpis-4 { grid-template-columns: minmax(0, 1fr); }
  .srv-grade { min-width: 140px; }
  .srv-events thead { display: none; }
  .srv-events tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; padding: 12px 0; border-top: 1px solid var(--border); }
  .srv-events td { border: 0; padding: 0; }
  .srv-events td.se-title, .srv-events td.se-detail { grid-column: 1 / -1; max-width: none; }
}
.health { --lv: var(--sev-info); display: inline-flex; align-items: center; gap: 8px; }
.health.tone-good { --lv: var(--good); } .health.tone-warn { --lv: var(--sev-warn); } .health.tone-bad { --lv: var(--sev-kick); }
.health .risk-track { width: 56px; }
.srv-head-grade { display: grid; justify-items: end; gap: 4px; font-size: 12.5px; }
@media (max-width: 760px) { .srv-head-grade { justify-items: start; } }

.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.foot-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.risk-nodata { --lv: var(--text-muted, var(--text-secondary)); }
.risk-card.risk-nodata { --lv: var(--text-muted, var(--text-secondary)); }
.det-table td.c-act { width: 1%; white-space: nowrap; }
@media (max-width: 640px) {
  .head-actions { justify-content: flex-start; width: 100%; }
  .det-table td.c-act .btn { padding: 0 8px; }
}

.mod-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.online-chip, .ban-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; background: var(--surface-2); color: var(--text-secondary); }
.online-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sev-info); }
.online-chip.on { color: var(--text-primary); }
.online-chip.on::before { background: var(--good); }
.imm-btn b { font-weight: 600; }
.imm-btn.is-off { border-color: color-mix(in srgb, var(--sev-high, #d97706) 55%, var(--border)); }
.imm-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 12px; }
.imm-form .field { flex: 1 1 220px; max-width: 320px; }
.imm-switch { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; }
.imm-switch b { font-weight: 600; }
.imm-switch.is-off { border-color: color-mix(in srgb, var(--sev-high, #d97706) 55%, var(--border)); }
.ban-chip { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.cmd-status { font-size: 12.5px; font-weight: 600; }
.cmd-pending, .cmd-sent { color: var(--text-secondary); }
.cmd-done { color: var(--good); }
.cmd-failed, .cmd-expired { color: var(--danger); }
.ctl-form { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(140px, 180px) minmax(160px, 2fr); gap: 12px; align-items: end; }
.ctl-buttons { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.modal-card .field { margin-top: 4px; }
.usage-cols { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 24px; }
.usage-cols .usage-row:first-child, .usage-cols .usage-row { border-top: 1px solid var(--border); }
.usage-cols .usage-meter { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .ctl-form { grid-template-columns: 1fr; }
  .mod-actions { margin-left: 0; width: 100%; }
}

body { font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; background: var(--bg); }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
.mono { font-size: 12px; }

.login-card { width: min(380px, 100%); padding: 30px 28px; border-radius: 14px; box-shadow: none; }
.login-card .btn-primary { height: 40px; }
.login-card input[type="password"], .login-card input[type="text"] { height: 40px; }

.sidebar { gap: 22px; padding: 20px 12px 16px; background: var(--surface-1); }
.brand { font-size: 13.5px; font-weight: 650; letter-spacing: -0.015em; gap: 10px; padding: 2px 10px; line-height: 1.2; }
.brand > :last-child { min-width: 0; }
.brand-lg { font-size: 19px; padding: 0; }
:root .brand-mark { width: 24px; height: 24px; border-radius: 7px; background-color: var(--text-primary); background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z' stroke='%23141415' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.nav { gap: 1px; }
.nav a { padding: 8px 10px; border-radius: 8px; font-weight: 500; transition: background 0.12s, color 0.12s; }
.nav a svg { width: 18px; height: 18px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--surface-3); color: var(--text-primary); font-weight: 600; }
html.test-mode .nav a.active { background: var(--test-soft); color: var(--test); }
.nav-badge { line-height: 18px; min-width: 20px; font-size: 11px; }
.sidebar-foot { gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.icon-btn { border-radius: 8px; transition: background 0.12s, color 0.12s; }

.main { padding: 32px 40px 64px; max-width: 1480px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.025em; }
.page-head .sub { font-size: 13.5px; margin-top: 4px; }

.btn { height: 34px; padding: 0 14px; border-radius: 8px; font-weight: 550; transition: background 0.12s, border-color 0.12s; }
.btn-sm { height: 28px; padding: 0 10px; border-radius: 7px; }
.btn-primary { background: var(--text-primary); border-color: var(--text-primary); color: var(--surface-1); }
.btn-primary:hover { background: color-mix(in srgb, var(--text-primary) 85%, var(--surface-1)); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, black); }
input[type="text"], input[type="search"], input[type="password"], input[type="date"], input:not([type]), select, textarea { border-radius: 8px; transition: border-color 0.12s, box-shadow 0.12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text-muted); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-muted) 18%, transparent); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px;
  background: var(--surface-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c7c77' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 9px center/15px no-repeat;
}
.segmented { border-radius: 9px; padding: 3px; }
.segmented button { border-radius: 6px; font-weight: 550; }
.segmented button.on { box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), inset 0 0 0 1px var(--border); }

.grid { gap: 16px; }
.card { padding: 20px; border-radius: 12px; background: var(--surface-1); box-shadow: none; }
.card h2 { font-size: 14.5px; font-weight: 650; margin-bottom: 14px; }
.table-wrap { margin: 0 -20px; padding: 0 8px; }
th:first-child, td:first-child { padding-left: 12px; }
th:last-child, td:last-child { padding-right: 12px; }
.kpi { gap: 6px; }
.kpi-label { font-size: 13px; color: var(--text-secondary); }
.kpi-value { font-size: 30px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; }
.empty { padding: 32px 0; }

.sev { border-radius: 6px; }
.tag { border-radius: 6px; }
.reason-chip { border-radius: 6px; }

th { font-size: 12px; font-weight: 500; color: var(--text-muted); padding: 0 10px 9px; }
td { padding: 11px 10px; }
tr.click:hover td { background: var(--surface-2); }
tr.selected td, tr.click.selected:hover td { background: var(--accent-soft); }

.risk-track { height: 6px; border-radius: 99px; }
.risk-track i { border-radius: 99px; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 8px; border-radius: 99px; }
.chart .gridline { stroke-dasharray: 2 4; }

.kick-item { padding: 10px 8px; margin: 0 -8px; border-radius: 8px; border-top: 0; }
.kick-item:hover { background: var(--surface-2); }

.drawer { width: min(580px, 100%); box-shadow: var(--shadow-lg); transition: transform 0.22s cubic-bezier(.2,.8,.2,1); }
.drawer-head h3 { font-weight: 650; }
.modal-card { border-radius: 14px; }
.toast { border-radius: 10px; }

@media (max-width: 760px) {
  .main { padding: 20px 16px 56px; }
  .page-head h1 { font-size: 21px; }
  .kpi-value { font-size: 26px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 4px; }
}

.sw-note { margin: -6px 0 14px; font-size: 13px; }
.sw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 24px; }
.sw-cat { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 16px 0 6px; border-bottom: 1px solid var(--border); }
.sw-cat:first-child { padding-top: 0; }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.sw-text { display: grid; min-width: 0; }
.sw-text b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-text .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-row.is-off .sw-text b { color: var(--text-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-muted) 60%, transparent); }
.switch { position: relative; flex: none; width: 36px; height: 20px; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background 0.15s, border-color 0.15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface-1); box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform 0.15s; }
.switch input:checked + i { background: var(--good); border-color: var(--good); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + i { opacity: 0.6; }
.sw-row.is-wait .sw-text .muted { color: var(--warn, var(--text-secondary)); }
.ctl-pol summary { cursor: pointer; font-weight: 550; padding: 4px 0; }
.ctl-pol summary .muted { font-weight: 400; margin-left: 6px; }
.audit-list td { vertical-align: top; }
.place-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.place-list .tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; }
.place-list .tag button { border: 0; background: none; color: var(--text-muted); cursor: pointer; font: inherit; padding: 0 4px; }
.place-list .tag button:hover { color: var(--text); }
.ar-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.ar-person { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; }
.ar-person:hover { border-color: var(--border-strong); }
.ar-person b { font-weight: 600; }
.why-ctx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.why-ctx .tag { font-family: inherit; }
.ctx-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.ctx-list .tag { font-family: inherit; margin-right: 4px; }
.sanctions td { vertical-align: top; }
.off-chip { display: inline-block; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 19px; background: var(--surface-3); color: var(--text-secondary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .sidebar, .tooltip, .toast, .modal, .drawer, .drawer-backdrop, .nav, .sidebar-actions, .warn-banner,
  .btn, .row-actions, [data-answer], [data-cancel], [data-close] { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none !important; border: 1px solid #d0d4dc !important; break-inside: avoid; }
  .card + .card { margin-top: 10px; }
  a { text-decoration: none; color: inherit; }
  body { background: #fff !important; color: #000 !important; }
}
.srv-roster { min-width: 160px; max-width: 340px; }
.roster-chip { display: inline-flex; align-items: center; gap: 4px; margin: 2px 4px 2px 0; padding: 1px 8px; border-radius: 999px; font-size: 12px; text-decoration: none; color: var(--text-primary, inherit); background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--lv, var(--border)); white-space: nowrap; }
.roster-chip:hover { border-color: var(--lv, var(--text-secondary)); }
.roster-chip b { color: var(--lv); font-weight: 600; }
.pm-chip { display: inline-block; min-width: 34px; text-align: center; padding: 0 6px; margin-right: 4px; border-radius: 6px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--lv); background: var(--surface-2); border: 1px solid var(--lv); }
tr.drawer-current td { background: var(--accent-soft); }
.ready-card h2 { margin-top: 18px; }
.ready-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.ready-ring { width: 132px; height: 132px; flex: none; }
.ready-ring .ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.ready-ring .ring-fg { fill: none; stroke-width: 12; stroke-linecap: round; }
.ready-ring.tone-good .ring-fg { stroke: var(--good); }
.ready-ring.tone-warn .ring-fg { stroke: var(--sev-warn); }
.ready-ring.tone-bad .ring-fg { stroke: var(--danger); }
.ready-ring .ring-num { font: 600 24px var(--font); fill: var(--text-primary); }
.ready-ring .ring-sub { font: 11px var(--font); fill: var(--text-muted); }
.ready-parts { flex: 1; min-width: 240px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; }
.ready-part { display: grid; gap: 4px; font-size: 12.5px; }
.ready-part-head { display: flex; justify-content: space-between; }
.needs { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.need { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid var(--lv, var(--border)); border-radius: 10px; background: var(--surface-1); }
.need-critical { --lv: var(--danger); } .need-high { --lv: var(--sev-warn); } .need-medium { --lv: var(--sev-info); } .need-low { --lv: var(--border-strong); } .need-ok { --lv: var(--good); }
.need-main { display: grid; gap: 4px; min-width: 0; }
.need-main p { margin: 0; font-size: 12.5px; }
.need-level { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--lv); }
.need-prog { display: flex; gap: 8px; align-items: center; max-width: 360px; }
.need-prog .risk-track { flex: 1; }
.need-prog .risk-track i { background: var(--lv); }
.need-queue { margin-top: 14px; display: grid; gap: 6px; }
.queue-item { text-align: left; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); cursor: pointer; font: inherit; font-size: 12.5px; }
.queue-item:hover { border-color: var(--accent); }
.ci-chart { width: 100%; height: auto; }
.ci-chart .gridline { stroke: var(--grid); stroke-dasharray: 2 4; }
.ci-chart .axis-label, .ci-chart .ci-val { fill: var(--text-muted); font: 11px var(--font); }
.ci-chart .ci-label { fill: var(--text-secondary); font: 12px var(--font); }
.ci-chart .ci-band { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.ci-chart .ci-band.ci-prior { fill: var(--surface-2); stroke: var(--border-strong); stroke-dasharray: 3 3; }
.ci-chart .ci-start { stroke: var(--text-muted); stroke-width: 2; }
.ci-chart .ci-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.ci-chart .ci-dot.ci-noisy { fill: var(--danger); }
.heat th span { display: inline-block; max-width: 90px; white-space: normal; font-size: 11px; line-height: 1.2; }
.heat td.heat-cell { text-align: center; min-width: 64px; font-size: 11.5px; }
.heat td.heat-cell b { display: block; }
.heat td.heat-up { background: color-mix(in srgb, var(--good) calc(var(--heat) * 45%), transparent); }
.heat td.heat-down { background: color-mix(in srgb, var(--danger) calc(var(--heat) * 45%), transparent); }
.heat td.heat-flat { background: var(--surface-2); }
.calib { width: 100%; max-width: 360px; height: auto; }
.calib .refline { stroke: var(--text-muted); stroke-dasharray: 4 4; }
.calib .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.calib .calib-dot { fill: var(--accent); }
.calib .axis-label { fill: var(--text-muted); font: 11px var(--font); }
.grid.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.bal-row { display: grid; gap: 6px; margin-bottom: 14px; }
.bal-head { display: flex; justify-content: space-between; font-size: 12.5px; }
.bal-track { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.bal-a { background: var(--danger); } .bal-b { background: var(--good); }
@media (max-width: 640px) { .need { flex-direction: column; } .ready-head { justify-content: center; } }

.mv { --mv-cheat: #f0675f; --mv-false: #3cc48d; --mv-line: #f2f2ef; --mv-prior: #8a8a84; --mv-band: rgb(242 242 239 / 0.09); --mv-card: var(--surface-1); display: grid; gap: 16px; }
.mv .page-head { margin-bottom: 0; }
.mv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mv-loading { display: flex; align-items: center; gap: 12px; padding: 48px 0; color: var(--text-secondary); }
.mv-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--text-primary); animation: mv-spin 0.8s linear infinite; }
@keyframes mv-spin { to { transform: rotate(360deg); } }

.mv-hero { display: grid; grid-template-columns: auto minmax(250px, 360px) minmax(0, 1fr); border: 1px solid var(--border); border-radius: 14px; background: var(--mv-card); overflow: hidden; }
.mv-hero > * { padding: 20px 22px; min-width: 0; }
.mv-hero > * + * { border-left: 1px solid var(--border); }
.mv-ready { display: flex; align-items: center; gap: 18px; }
.mv-ring { width: 92px; height: 92px; flex: none; }
.mv-ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.mv-ring-fg { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray 0.6s cubic-bezier(.2,.8,.2,1); }
.mv-ring.tone-good .mv-ring-fg { stroke: var(--mv-false); }
.mv-ring.tone-warn .mv-ring-fg { stroke: var(--sev-warn); }
.mv-ring.tone-bad .mv-ring-fg { stroke: var(--mv-cheat); }
.mv-ring-num { font: 650 25px var(--font); fill: var(--text-primary); letter-spacing: -0.03em; }
.mv-ring-pct { font-size: 13px; fill: var(--text-muted); }
.mv-ready-text { display: grid; gap: 3px; max-width: 210px; }
.mv-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); }
.mv-ready-text b { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; }
.mv-ready-text p { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.mv-parts { display: grid; gap: 10px; align-content: center; }
.mv-part { display: grid; grid-template-columns: 74px minmax(0, 1fr) 98px; align-items: center; gap: 12px; font-size: 12.5px; cursor: help; }
.mv-part-name { color: var(--text-secondary); }
.mv-part-val { text-align: right; color: var(--text-primary); white-space: nowrap; }
.mv-part-track, .mv-bar { position: relative; display: block; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.mv-part-track i, .mv-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--text-secondary); transition: width 0.5s cubic-bezier(.2,.8,.2,1); }
.mv .tone-good > i { background: var(--mv-false); }
.mv .tone-warn > i { background: var(--sev-warn); }
.mv .tone-bad > i { background: var(--mv-cheat); }
.mv-focus { --lv: var(--text-muted); display: grid; gap: 6px; align-content: center; justify-items: start; }
.mv-focus .mv-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--lv); }
.mv-focus b { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.mv-focus p { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mv-focus-btn { margin-top: 6px; }

.mv-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 14px; background: var(--mv-card); }
.mv-fact { display: grid; gap: 3px; padding: 14px 20px; min-width: 0; align-content: start; }
.mv-fact + .mv-fact { border-left: 1px solid var(--border); }
.mv-fact b { font-size: 24px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }
.mv-fact span { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-primary); }
.mv-fact small { font-size: 12px; color: var(--text-muted); }
.mv-grade { --g: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 550; color: var(--g); background: color-mix(in srgb, var(--g) 13%, transparent); white-space: nowrap; }
.mv-grade i { width: 6px; height: 6px; border-radius: 50%; background: var(--g); }
.mv-grade.tone-good { --g: var(--mv-false); }
.mv-grade.tone-warn { --g: var(--sev-warn); }
.mv-grade.tone-bad { --g: var(--mv-cheat); }
.mv-tab-n { margin-left: 7px; padding: 1px 6px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-secondary); }

.mv-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-top: 4px; position: sticky; top: 0; z-index: 3; background: var(--bg); }
.mv-tabs button { border: 0; background: none; cursor: pointer; padding: 10px 14px 11px; font-weight: 550; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mv-tabs button:hover { color: var(--text-primary); }
.mv-tabs button.on { color: var(--text-primary); border-bottom-color: var(--text-primary); }
.mv-tab { display: grid; gap: 16px; animation: mv-in 0.18s ease-out; }
@keyframes mv-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.mv-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mv-card-plain { border: 1px solid var(--border); border-radius: 12px; background: var(--mv-card); padding: 16px 18px; min-width: 0; }
.mv-card-plain h3, .mv-side h3, .mv-ev-head h3 { margin: 0 0 6px; font-size: 14px; font-weight: 650; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mv-card-plain h3 .muted { font-weight: 400; font-size: 12.5px; }
.mv-hint { margin: 0 0 12px; font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.mv-empty { padding: 28px 8px; text-align: center; color: var(--text-muted); font-size: 13px; }
.mv-ok { padding: 14px; border-radius: 10px; background: color-mix(in srgb, var(--mv-false) 12%, transparent); font-size: 13px; }

.mv-needs { list-style: none; margin: 0; padding: 0; display: grid; }
.mv-need { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--border); }
.mv-need:first-child { border-top: 0; padding-top: 2px; }
.mv-need-main { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.mv-lv { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 550; color: var(--lv); }
.mv-lv i { width: 6px; height: 6px; border-radius: 50%; background: var(--lv); }
.lv-critical { --lv: var(--mv-cheat); }
.lv-high { --lv: var(--sev-warn); }
.lv-medium { --lv: #7f9cc9; }
.lv-low { --lv: var(--text-secondary); }
.lv-ok { --lv: var(--mv-false); }
.mv-need-main b { font-weight: 600; font-size: 13.5px; line-height: 1.4; }
.mv-need-main p { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.mv-need-prog { display: grid; grid-template-columns: minmax(120px, 220px) auto; gap: 10px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.mv-need-prog .mv-bar i { background: var(--lv); }
.mv-more { margin-top: 4px; border: 0; background: none; color: var(--text-secondary); cursor: pointer; padding: 6px 0; font-size: 12.5px; }
.mv-more:hover { color: var(--text-primary); }

.mv-queue td { vertical-align: middle; }
.mv-queue tr.click:hover td { background: var(--surface-2); }
.mv-pbar { display: inline-flex; align-items: center; gap: 8px; --lv: var(--sev-info); }
.mv-pbar-track { position: relative; width: 96px; height: 8px; border-radius: 99px; background: var(--surface-3); }
.mv-pbar-band { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: color-mix(in srgb, var(--lv) 35%, transparent); }
.mv-pbar-dot { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--lv); box-shadow: 0 0 0 2px var(--surface-1); }
.mv-pbar b { min-width: 3.2ch; text-align: right; font-weight: 650; font-size: 12.5px; }

.mv-load { display: flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 12px; background: var(--mv-card); }
.mv-load-item { display: grid; gap: 2px; align-content: start; padding: 10px 18px; font-size: 12px; color: var(--text-muted); }
.mv-load-item + .mv-load-item { border-left: 1px solid var(--border); }
.mv-load-item b { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.mv-load-meter { grid-template-columns: minmax(80px, 120px) auto; column-gap: 10px; align-items: center; margin-left: auto; }
.mv-load-meter > span:first-child { grid-column: 1 / -1; }

.mv-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.mv-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.mv-seg button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; height: 28px; padding: 0 11px; border-radius: 7px; cursor: pointer; color: var(--text-secondary); font-weight: 550; font-size: 12.5px; }
.mv-seg button.on { background: var(--surface-1); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--border); }
.mv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mv-chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); cursor: pointer; font-size: 12.5px; }
.mv-chip-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.mv-chip-btn.on { color: var(--text-primary); border-color: var(--text-secondary); background: var(--surface-2); }
.mv-gdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }

.mv-params-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 16px; align-items: start; }
.mv-side { position: sticky; top: 52px; border: 1px solid var(--border); border-radius: 12px; background: var(--mv-card); padding: 16px; }
.mv-imp { display: grid; gap: 2px; }
.mv-imp-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; align-items: center; border: 0; background: none; padding: 5px 4px; border-radius: 7px; cursor: pointer; text-align: left; color: var(--text-primary); font-size: 12.5px; }
.mv-imp-row:hover { background: var(--surface-2); }
.mv-imp-name { display: flex; align-items: center; gap: 8px; min-width: 0; line-height: 1.3; }
.mv-imp-track { position: relative; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.mv-imp-track i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.mv-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); }
.mv-legend b { flex-basis: 100%; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.mv-legend p { flex-basis: 100%; margin: 0 0 4px; font-size: 12px; line-height: 1.45; }
.mv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mv-legend i { display: inline-block; width: 14px; }
.mv-lg-line { height: 2px; background: var(--mv-line); border-radius: 2px; }
.mv-lg-prior { height: 0; border-top: 1.5px dashed var(--mv-prior); }
.mv-lg-band { height: 10px; background: rgb(242 242 239 / 0.16); border-radius: 3px; }
.mv-legend .mv-lg-c { height: 10px; width: 10px; background: var(--mv-cheat); border-radius: 2px; }
.mv-legend .mv-lg-f { height: 10px; width: 10px; background: var(--mv-false); border-radius: 2px; }
.mv-legend .mv-lg-u { height: 10px; width: 10px; border: 1px solid var(--border-strong); border-radius: 2px; }
.mv-key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: 12px; color: var(--text-secondary); }
.mv-key span { display: inline-flex; align-items: center; gap: 7px; }
.mv-key svg { height: 14px; width: auto; flex: none; }
.mv-key .k-dot { fill: var(--text-secondary); }
.mv-key .k-ring { fill: none; stroke: var(--mv-line); stroke-width: 1.6; }
.mv-key .k-band { fill: rgb(242 242 239 / 0.16); }
.mv-key .k-tick { stroke: var(--mv-prior); stroke-width: 1.5; }

.mv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-content: start; }
.mv-grid-tight { margin-top: 12px; }
.mv-ev-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.mv-ev-head h3 { margin: 0; }
.mv-ev-head select { height: 30px; min-width: 220px; }
.mv-param { border: 1px solid var(--border); border-radius: 12px; background: var(--mv-card); padding: 12px 14px; display: grid; gap: 6px; transition: border-color 0.2s; min-width: 0; align-content: start; }
.mv-param.flash { border-color: var(--text-secondary); }
.mv-param header { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.mv-param header b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-param header .muted { font-size: 12px; }
.mv-chip { margin-left: auto; flex: none; font-size: 11px; color: var(--text-muted); padding: 1px 7px; border-radius: 99px; border: 1px solid var(--border); white-space: nowrap; }
.mv-verbal { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.mv-chart { display: block; width: 100%; height: auto; overflow: visible; }
.mv-chart .mv-gl { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 4; }
.mv-chart .mv-zero { stroke: var(--border-strong); stroke-width: 1; }
.mv-chart .mv-axis, .mv-detchart .mv-axis { fill: var(--text-muted); font: 10.5px var(--font); }
.mv-chart .mv-unit { font-size: 10px; }
.mv-chart .mv-band { fill: var(--mv-band); }
.mv-chart .mv-prior { fill: none; stroke: var(--mv-prior); stroke-width: 1.4; stroke-dasharray: 4 4; }
.mv-chart .mv-line { fill: none; stroke: var(--mv-line); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mv-chart .mv-h-c { fill: var(--mv-cheat); opacity: 0.75; }
.mv-chart .mv-h-f { fill: var(--mv-false); opacity: 0.8; }
.mv-chart .mv-h-u { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.mv-chart .mv-hit { fill: transparent; cursor: crosshair; }
.mv-chart .mv-cross { stroke: var(--text-muted); stroke-width: 1; pointer-events: none; }
.mv-chart .mv-cross-dot { fill: var(--mv-line); stroke: var(--surface-1); stroke-width: 2; pointer-events: none; }
.mv-chart .mv-lvl { fill: var(--text-secondary); font: 11.5px var(--font); }
.mv-chart .mv-lvl-bar.pos { fill: var(--mv-cheat); }
.mv-chart .mv-lvl-bar.neg { fill: var(--mv-false); }
.mv-chart .mv-whisker { stroke: var(--text-muted); stroke-width: 1; }
.mv-chart .mv-prior-tick { stroke: var(--mv-prior); stroke-width: 1.5; stroke-dasharray: 2 2; }
.mv-chart .mv-diag { stroke: var(--mv-prior); stroke-dasharray: 4 4; }
.mv-chart .mv-calib-dot { fill: var(--mv-line); fill-opacity: 0.85; stroke: var(--surface-1); stroke-width: 1.5; }
.mv-chart .mv-calib-dot.thin { fill-opacity: 0.3; }

.mv-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.mv-detchart { display: block; width: 100%; min-width: 620px; height: auto; }
.mv-detchart .mv-gl { stroke: var(--grid); stroke-dasharray: 2 4; }
.mv-detchart .mv-det-label { fill: var(--text-secondary); font: 12px var(--font); }
.mv-detchart .mv-ci { fill: rgb(242 242 239 / 0.14); }
.mv-detchart .mv-ci.prior { fill: none; stroke: var(--border-strong); stroke-dasharray: 3 3; }
.mv-detchart .mv-ci-start { stroke: var(--mv-prior); stroke-width: 1.5; }
.mv-detchart .mv-ci-dot { fill: var(--mv-line); stroke: var(--surface-1); stroke-width: 2; }
.mv-detchart .mv-ci-dot.noisy { stroke: var(--mv-cheat); stroke-width: 2.5; }
.mv-detchart .mv-ci-avg { fill: none; stroke: var(--mv-line); stroke-width: 1.6; opacity: 0.8; }
.mv-detchart .mv-det-val { fill: var(--text-secondary); }
.mv-detchart .v-ok { fill: var(--mv-false); }
.mv-detchart .v-bad { fill: var(--mv-cheat); }
.cat-fill-tools { fill: var(--cat-tools) !important; }
.cat-fill-client { fill: var(--cat-client) !important; }
.cat-fill-movement { fill: var(--cat-movement) !important; }
.cat-fill-combat { fill: var(--cat-combat) !important; }
.cat-fill-interaction { fill: var(--cat-interaction) !important; }
.cat-fill-decoy { fill: var(--cat-decoy) !important; }
.cat-fill-network { fill: var(--cat-network) !important; }
.cat-fill-rejoin { fill: var(--cat-rejoin) !important; }
.mv-dets tr.open td { background: var(--surface-2); }
.mv-det-open > td { background: var(--surface-2); padding: 4px 14px 16px !important; }
.mv-det-detail p { margin: 6px 0 10px; font-size: 12.5px; color: var(--text-secondary); max-width: 760px; }
.mv-det-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.mv-q-intro { margin: 0; max-width: 920px; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.mv-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mv-q { display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 8px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--mv-card); min-width: 0; }
.mv-q header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.mv-q-title { font-size: 13px; font-weight: 550; color: var(--text-secondary); }
.mv-q-value { font-size: 34px; font-weight: 650; letter-spacing: -0.035em; line-height: 1.05; }
.mv-q-text { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-primary); }
.mv-cmp { display: grid; gap: 10px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border); }
.mv-cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name val" "track track"; gap: 5px 10px; align-items: center; font-size: 12px; }
.mv-cmp-name { grid-area: name; color: var(--text-secondary); white-space: nowrap; }
.mv-cmp-row b { grid-area: val; }
.mv-cmp-track { grid-area: track; position: relative; height: 8px; border-radius: 99px; background: var(--surface-3); }
.mv-cmp-track i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--text-primary); }
.mv-cmp-track u { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text-muted); box-shadow: 0 0 0 1.5px var(--mv-card); }
.mv-cmp-row b { text-align: right; font-weight: 600; }
.mv-cmp-row.is-base .mv-cmp-track i { background: var(--text-muted); }
.mv-cmp-row.is-base .mv-cmp-name, .mv-cmp-row.is-base b { color: var(--text-muted); }
.mv-q-foot { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--text-muted); }
.mv-q-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mv-q-grid .mv-chart { max-width: 340px; margin: 0 auto; }
.mv-threshold { display: grid; gap: 18px; }
.mv-th-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 28px; }
.mv-th-top .mv-hint { margin: 0; }
.mv-th-ctl { display: grid; grid-template-columns: auto minmax(180px, 320px) 50px; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-secondary); }
.mv-th-ctl input { width: 100%; margin: 0; accent-color: var(--text-primary); }
.mv-th-ctl b { font-size: 18px; font-weight: 650; text-align: right; color: var(--text-primary); }
.mv-th-body { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 28px; align-items: center; }
.mv-th-stats { display: grid; gap: 18px; }
.mv-th-stat { display: grid; gap: 2px; }
.mv-th-stat b { font-size: 30px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.05; }
.mv-th-stat span { font-size: 13px; }
.mv-th-stat small { font-size: 12px; color: var(--text-muted); }
.mv-cm { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.mv-cm-h { padding: 0 4px 2px; font-size: 12px; color: var(--text-muted); }
.mv-cm-r { align-self: center; padding-right: 10px; font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; }
.mv-cm-cell { --c: var(--text-muted); display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--c) 9%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--c) 20%, transparent); }
.mv-cm-cell b { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.mv-cm-cell span { font-size: 12px; color: var(--text-secondary); }
.mv-cm-cell.tone-good { --c: var(--mv-false); }
.mv-cm-cell.tone-warn { --c: var(--sev-warn); }
.mv-cm-cell.tone-bad { --c: var(--mv-cheat); }
.mv-details { border: 1px solid var(--border); border-radius: 12px; background: var(--mv-card); padding: 12px 18px; }
.mv-details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.mv-details summary .muted { font-weight: 400; margin-left: 6px; }
.mv-details[open] summary { margin-bottom: 10px; }
.mv-progress { display: grid; gap: 10px; max-width: 420px; padding: 30px 0; }

.mv-explain { --mv-cheat: #f0675f; --mv-false: #3cc48d; display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.mv-explain-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--text-secondary); padding: 2px 0 6px; }
.mv-explain-head b { margin-left: auto; font-size: 15px; color: var(--text-primary); }
.mv-explain-total { border-top: 1px solid var(--border-strong); padding: 8px 0 0; margin-top: 6px; flex-wrap: wrap; }
.mv-explain-total span:first-child { color: var(--text-primary); font-weight: 600; }
.mv-explain-total .muted { flex-basis: 100%; text-align: right; font-size: 12px; }
.mv-wf-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 62px; gap: 10px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.mv-wf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-wf-bar { position: relative; height: 8px; }
.mv-wf-bar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border-strong); }
.mv-wf-bar i { position: absolute; top: 0; height: 8px; border-radius: 3px; }
.mv-wf-bar i.pos { left: 50%; background: var(--mv-cheat); }
.mv-wf-bar i.neg { right: 50%; background: var(--mv-false); }
.mv-wf-row b { text-align: right; font-weight: 600; }

@media (max-width: 1180px) {
  .mv-hero { grid-template-columns: auto minmax(0, 1fr); }
  .mv-hero > .mv-focus { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); }
  .mv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mv-q-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mv-params-layout { grid-template-columns: minmax(0, 1fr); }
  .mv-side { position: static; }
}
@media (max-width: 860px) {
  .mv-two { grid-template-columns: minmax(0, 1fr); }
  .mv-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mv-fact:nth-child(3) { border-left: 0; }
  .mv-fact:nth-child(n+3) { border-top: 1px solid var(--border); }
  .mv-th-body { grid-template-columns: minmax(0, 1fr); }
  .mv-th-stats { grid-template-columns: 1fr 1fr; }
  .mv-load-meter { margin-left: 0; }
}
@media (max-width: 640px) {
  .mv-hero { grid-template-columns: minmax(0, 1fr); }
  .mv-hero > * { padding: 16px; }
  .mv-hero > * + * { border-left: 0; border-top: 1px solid var(--border); }
  .mv-ring { width: 80px; height: 80px; }
  .mv-part { grid-template-columns: 70px minmax(0, 1fr) auto; }
  .mv-fact { padding: 12px 14px; }
  .mv-fact b { font-size: 20px; }
  .mv-tiles, .mv-q-grid { grid-template-columns: minmax(0, 1fr); }
  .mv-tabs { overflow-x: auto; }
  .mv-tabs button { white-space: nowrap; padding: 10px 10px 11px; }
  .mv-grid { grid-template-columns: minmax(0, 1fr); }
  .mv-wf-row { grid-template-columns: minmax(0, 1fr) 70px 56px; }
  .mv-pbar-track { width: 64px; }
  .mv-need { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mv-need > .btn { justify-self: start; }
  .mv-th-ctl { grid-template-columns: auto minmax(0, 1fr) 46px; width: 100%; }
  .mv-th-stat b { font-size: 26px; }
  .mv-cm-r { white-space: normal; }
  .mv-cm-cell { padding: 10px 12px; }
  .mv-load { display: grid; grid-template-columns: 1fr 1fr; }
  .mv-load-item + .mv-load-item { border-left: 0; }
  .mv-load-item:nth-child(even) { border-left: 1px solid var(--border); }
  .mv-load-item:nth-child(n+3) { border-top: 1px solid var(--border); }
  .mv-load-meter { grid-column: 1 / -1; border-left: 0 !important; }
}
@media (prefers-reduced-motion: reduce) {
  .mv-tab { animation: none; }
  .mv-ring-fg, .mv-bar i, .mv-part-track i { transition: none; }
}
tr.marked td, .kick-item.marked { animation: marked-flash 0.9s ease-out; }
@keyframes marked-flash { from { background: var(--accent-soft); } to { background: transparent; } }
.sub kbd { font-size: 10.5px; padding: 1px 5px; }
.me-chip { display: grid; gap: 1px; font-size: 12.5px; line-height: 1.3; min-width: 0; }
.me-chip b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.me-chip:empty { display: none; }
.no-access { display: grid; justify-items: center; gap: 8px; padding: 40px 16px; }
.no-access b { color: var(--text-primary); font-size: 15px; }
.modal-card.modal-wide { width: min(680px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.secret-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); margin: 6px 0; }
.secret-box .mono { font-size: 15px; letter-spacing: 0.04em; word-break: break-all; color: var(--text-primary); user-select: all; }
.pw-meter { height: 18px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); position: relative; }
.pw-meter:empty { height: 0; }
.pw-meter i { display: block; height: 4px; border-radius: 2px; flex: 0 0 auto; max-width: 140px; background: var(--danger); }
.pw-meter[data-level="2"] i { background: var(--sev-warn); }
.pw-meter[data-level="3"] i, .pw-meter[data-level="4"] i { background: var(--good); }
.steps { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 8px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; }
.setup-card { width: min(440px, 100%); display: grid; gap: 12px; }
.setup-title { margin: 6px 0 0; font-size: 18px; letter-spacing: -0.01em; }
.setup-card .linkish { justify-self: center; }
.stack { display: grid; gap: 10px; }
.sec-table td, .sec-table th { vertical-align: top; }
.sec-table tr.is-current td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.sec-table tr.is-off td { opacity: 0.6; }
.tag-accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.tag-ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.tag-warn { color: var(--sev-warn); border-color: color-mix(in srgb, var(--sev-warn) 40%, var(--border)); }
.tag-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.res-ok { color: var(--good); font-weight: 600; }
.res-bad { color: var(--danger); font-weight: 600; }
.me-big { display: grid; gap: 2px; margin-bottom: 10px; }
.me-big b { font-size: 16px; }
.perm-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; font-size: 12.5px; }
.checklist { display: grid; gap: 2px; }
.check-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.check-item:last-child { border-bottom: 0; }
.check-item .muted { font-size: 12.5px; margin-top: 2px; line-height: 1.45; }
.check-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; }
.check-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.check-item.is-ok .check-icon { background: var(--ok-soft); color: var(--good); }
.check-item.is-warn .check-icon { background: color-mix(in srgb, var(--sev-warn) 18%, transparent); color: var(--sev-warn); }
.check-item.is-info .check-icon { background: var(--accent-soft); color: var(--accent); }
.val-bad { color: var(--danger); }
.card.flash { animation: card-flash 1.2s ease-out; }
@keyframes card-flash { 0%, 30% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.perm-group { border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px 6px; margin: 4px 0 0; }
.perm-group legend { padding: 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.perm-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.perm-row:last-child { border-bottom: 0; }
.perm-row .check { margin-top: 1px; }
.perm-text { display: grid; gap: 2px; font-size: 13.5px; }
.perm-text .muted { font-size: 12.5px; }
.perm-row.is-danger .perm-text b { color: var(--text-primary); }
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.perm-count { margin-right: auto; font-size: 12.5px; align-self: center; }
.role-preview { font-size: 12.5px; padding: 2px 0 4px; }
.role-list { display: grid; gap: 10px; }
.role-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.role-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.role-head b { font-size: 14.5px; }
.role-actions { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.acc-status { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; }
.row-menu { position: relative; display: inline-block; }
.row-menu summary { list-style: none; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; display: grid; padding: 4px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-1); box-shadow: var(--shadow-lg); }
.row-menu-list button { text-align: left; background: none; border: 0; border-radius: 7px; padding: 7px 10px; font: inherit; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.row-menu-list button:hover { background: var(--surface-2); }
.row-menu-list button.danger { color: var(--danger); }
@media (max-width: 760px) {
  .acc-table th:nth-child(4), .acc-table td:nth-child(4) { display: none; }
  .check-item { grid-template-columns: 26px minmax(0, 1fr); }
  .check-item .btn { grid-column: 2; justify-self: start; }
  .role-actions { margin-left: 0; }
}
.hint-more { margin-top: 10px; font-size: 12.5px; }
.hint-more summary { cursor: pointer; }
#sec-pw form { max-width: 460px; }
@media (max-width: 760px) {
  .sec-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sec-kpis .kpi { padding: 12px 14px; }
  .sec-kpis .kpi-value { font-size: 24px; }
  .sec-kpis .kpi-label { font-size: 12px; }
}
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.check-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 0; font-size: 13.5px; cursor: pointer; }
.check-row input { margin: 2px 0 0; accent-color: var(--accent); }
.check-row > span { display: grid; gap: 2px; }
.check-row .muted { font-size: 12.5px; line-height: 1.45; }
.sub-h { margin: 18px 0 6px; font-size: 13.5px; font-weight: 600; }
.card-danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.field.grow { flex: 1 1 200px; }
#sec-label { align-items: end; }
.audit-health { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.audit-health.is-bad { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: var(--danger-soft); }
.audit-health .grow { flex: 1 1 260px; }
.audit-list .dev { font-size: 12px; }
.audit-more { margin-top: 12px; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .map-layout { grid-template-columns: 1fr; } }
.map-card { padding: 12px; display: grid; gap: 10px; }
.map-box { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: #0c0c0d; }
.map-box canvas { display: block; width: 100%; cursor: grab; touch-action: none; }
.map-box canvas:active { cursor: grabbing; }
.map-zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; }
.map-zoom .icon-btn { width: 30px; height: 30px; background: color-mix(in srgb, var(--surface-2) 88%, transparent); border: 1px solid var(--border-strong); font-size: 16px; }
.map-tip { position: absolute; z-index: 3; display: grid; gap: 3px; max-width: 280px; padding: 9px 11px; font-size: 12.5px; line-height: 1.35; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); pointer-events: none; }
.hm-tip-det { color: var(--text-primary); }
.map-legend { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.map-ramp { display: inline-block; width: 160px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(255,196,0,0.35), rgb(255,120,30), rgb(235,50,60), rgb(255,235,220)); }
.map-ramp-false_positive { background: linear-gradient(90deg, rgba(60,200,220,0.35), rgb(40,150,240), rgb(90,110,255), rgb(225,240,255)); }
.map-ramp-confirmed { background: linear-gradient(90deg, rgba(255,120,60,0.35), rgb(235,50,60), rgb(200,20,80), rgb(255,225,230)); }
.map-ramp-none { background: linear-gradient(90deg, rgba(200,200,200,0.35), rgb(230,180,90), rgb(240,120,60), rgb(255,240,220)); }
.map-help { margin-left: auto; }
@media (max-width: 700px) { .map-help { display: none; } }
.map-hot-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.map-hot-item { grid-template-columns: minmax(0, 1fr) 28px; gap: 2px; }
.map-hot-open { width: 28px; height: 28px; color: var(--text-muted); }
.map-hot-item:hover .map-hot-open { color: var(--text-primary); }
#map-count { margin-left: auto; }
.map-side { padding: 14px; }
.map-hot { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.map-hot-row { width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm); background: transparent; border: 1px solid transparent; color: inherit; font: inherit; cursor: pointer; }
.map-hot-row:hover { background: var(--surface-2); border-color: var(--border); }
.map-hot-row .num { font-size: 15px; }
.map-hot-row > span { display: grid; gap: 2px; min-width: 0; font-size: 12.5px; }
.map-hot-det { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-size: 13px; }

.tl-card h2 { margin-bottom: 10px; }
.tl-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.tl-chip { flex: none; display: grid; gap: 1px; text-align: left; padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary); font: 500 12px var(--font); cursor: pointer; }
.tl-chip b { color: var(--text-primary); font-size: 12.5px; }
.tl-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.tl-chip-high { color: var(--sev-high); }
.tl { position: relative; }
.tl svg { display: block; width: 100%; height: auto; }
.tl-lane { stroke: var(--border); stroke-width: 1; }
.tl-lane-label { font: 500 12px var(--font); fill: var(--text-secondary); }
.tl-grid { stroke: var(--grid); stroke-width: 1; }
.tl-time { font: 500 10.5px var(--font); fill: var(--text-muted); }
.tl-mark { stroke: var(--surface-1); stroke-width: 1.5; transition: r 0.12s; }
.tl-mark.tl-fp { stroke: var(--good); stroke-width: 2.5; }
.tl-mark.tl-cheat { stroke: var(--danger); stroke-width: 2.5; }
.tl-mark.tl-lag { opacity: 0.5; }
.tl-mark.tl-hover { stroke: var(--text-primary); stroke-width: 2.5; }
.tl-sanction line { stroke: var(--sev-kick); stroke-width: 1.5; stroke-dasharray: 4 3; }
.tl-sanction text { font: 600 10.5px var(--font); fill: var(--sev-kick); }
.tl-hit { fill: transparent; cursor: crosshair; touch-action: none; }
.tl-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 6px; font-size: 12px; }
.tl-k { width: 9px !important; height: 9px !important; border: 0 !important; border-radius: 50%; }
.tl-k-fp { background: transparent !important; border: 2px solid var(--good) !important; }
.tl-k-cheat { background: transparent !important; border: 2px solid var(--danger) !important; }
.tl-k-lag { background: var(--sev-info); opacity: 0.5; }

.update-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 16px; background: #b3261e; color: #fff; font-weight: 600; font-size: 14px; }
.update-bar .btn { background: #fff; color: #b3261e; border-color: #fff; }

.clan-tag { font-family: var(--mono, ui-monospace, monospace); font-weight: 700; }
.clan-descr { margin: 8px 0 0; color: var(--text-primary); max-width: 640px; white-space: pre-wrap; }
.clan-role { font-weight: 600; }
.clan-role-leader { color: var(--sev-high); }
.clan-role-coleader { color: var(--text-primary); }
.clan-role-officer, .clan-role-member { color: var(--text-muted); }
.clan-members .c-act { text-align: right; }
.clan-members .c-act .btn + .btn { margin-left: 6px; }
.clan-pending { color: var(--text-muted); }
.pl-clan { margin-top: 4px; }
a.brand { color: inherit; text-decoration: none; }
a.brand:hover { opacity: 0.85; }
a.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* login and setup pages: the same top bar as the site */
.auth-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; height: 56px; padding: 0 14px;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
}
.auth-topbar .brand { font-size: 15px; padding: 2px 8px; white-space: nowrap; }
:root .auth-topbar .brand-mark {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z' stroke='white' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.login { padding-top: 72px; }
.login-title { margin: 0 0 4px; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }

.login-captcha { min-height: 65px; }
.totp-steps { margin: 8px 0 12px; padding-left: 20px; display: grid; gap: 10px; }
.totp-steps .totp-qr { list-style: none; margin-left: -20px; }
.totp-qr svg { display: block; border-radius: 8px; }
.totp-key { word-break: break-all; }
.totp-confirm input { width: 140px; letter-spacing: 0.15em; }
.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; padding: 12px 14px; margin: 10px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.audit-acks { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; gap: 6px 12px; margin: 8px 0 12px; }
.audit-acks .hint { grid-column: 1 / -1; margin: 0; }
