/* MVR Studio – design system */
:root {
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f7f9fc; --surface-3: #eef2f7;
  --border: #e2e7ef; --border-strong: #cfd7e3;
  --text: #172133; --text-2: #3c4a60; --muted: #66748a; --faint: #95a1b3;
  --primary: #1f5fa8; --primary-600: #1a5292; --primary-soft: #e7eff9; --primary-ring: rgba(31, 95, 168, .22);
  --ok: #1d7a46; --ok-soft: #e4f4ea; --warn: #9a5419; --warn-soft: #fcefdf; --warn-dot: #a65a1c;
  --danger: #c0352b; --danger-soft: #fce8e6; --info: #4f6b8f; --info-soft: #eaf0f7;
  --radius: 12px; --radius-sm: 8px; --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --sidebar-w: 288px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  --stage-bg: #14181f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1319; --surface: #161b23; --surface-2: #1b212b; --surface-3: #222a36;
    --border: #273040; --border-strong: #35404f;
    --text: #e6ebf2; --text-2: #c2cbd8; --muted: #8e9aac; --faint: #667387;
    --primary: #5b9be0; --primary-600: #78acea; --primary-soft: #1b2a3e; --primary-ring: rgba(91, 155, 224, .3);
    --ok: #4cc283; --ok-soft: #173225; --warn: #e7a35c; --warn-soft: #3a2a17; --warn-dot: #d38a3e;
    --danger: #f07368; --danger-soft: #3c1d1b; --info: #9fb4d0; --info-soft: #1d2836;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; font-weight: 650; }
p { margin: .4em 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .strong { font-weight: 600; }
.text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-danger { color: var(--danger); }
.grow { flex: 1; } .row { display: flex; align-items: center; } .gap { gap: 8px; } .wrap { flex-wrap: wrap; } .center { justify-content: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pad { padding: 14px; } .pad-b { padding-bottom: 10px; }
.span2 { grid-column: 1 / -1; }
[hidden] { display: none !important; }
.boot, .page-loading { display: grid; place-items: center; min-height: 40vh; }
.boot { height: 100vh; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--primary); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------ buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none !important; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); background: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; box-shadow: none; }
.btn-block { width: 100%; height: 42px; }
.btn-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-2); }
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon:disabled { opacity: .35; cursor: default; background: none; }
.btn-icon.sm { width: 30px; height: 30px; }
.btn-icon.danger:hover { color: var(--danger); background: var(--danger-soft); }
.link { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 550; }
.link:hover { text-decoration: underline; }
.pill { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--text-2); font-weight: 500; letter-spacing: 0; text-transform: none; }
.pill.on { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.input, input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea {
  height: 36px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
.input-sm, select.input-sm { height: 30px; font-size: 13px; }
.input-xs { height: 24px !important; padding: 0 6px !important; font-size: 12px; width: 84px !important; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366748a' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px !important; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; }
input[type=range] { accent-color: var(--primary); width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; min-width: 0; flex: 1; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; justify-content: space-between; }
.field output { font-weight: 500; color: var(--muted); }
.check { display: flex; align-items: center; gap: 9px; margin: 8px 0; cursor: pointer; }
fieldset { border: 0; padding: 0; margin: 4px 0 12px; } legend { font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: 2px; }
.input-group { display: flex; } .input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; } .input-group span { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.otp { font-family: var(--mono); font-size: 22px !important; letter-spacing: .4em; text-align: center; height: 48px !important; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg-sm button { height: 24px; padding: 0 8px; font-size: 12px; }
.seg-block { display: flex; } .seg-block button { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------ badges / status */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.badge-ok { background: var(--ok-soft); color: var(--ok); } .badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); } .badge-blue { background: var(--primary-soft); color: var(--primary); }
.count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 650; display: inline-grid; place-items: center; }
.count-warn { background: var(--warn-soft); color: var(--warn); }
.status { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: var(--faint); }
.status.sm { width: 7px; height: 7px; }
.status-ok { background: #24914f; } .status-warn { background: var(--warn-dot); } .status-danger { background: var(--danger); } .status-info { background: #6f86a6; }
.status-none { background: transparent; border: 1.5px solid var(--faint); }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip-blue { background: var(--primary-soft); color: var(--primary); } .chip-warn { background: var(--warn-soft); color: var(--warn); } .chip-ok { background: var(--ok-soft); color: var(--ok); }

/* ------------------------------------------------ auth */
body.auth { background: radial-gradient(1200px 600px at 20% -10%, var(--primary-soft), transparent 60%), var(--bg); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; }
.auth-top { position: absolute; top: 18px; right: 18px; }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px; }
.auth-card h2 { font-size: 17px; margin: 22px 0 16px; }
.auth-brand { display: flex; gap: 14px; align-items: center; }
.auth-brand h1 { font-size: 19px; } .auth-brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.auth-error { color: var(--danger); min-height: 20px; font-size: 13px; margin: -4px 0 10px; }
.auth-foot { position: absolute; bottom: 16px; color: var(--faint); font-size: 12px; }
.shake { animation: shake .35s; } @keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.logo { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(145deg, #2a6fc0, #1a4f8e); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px rgba(31, 95, 168, .35); }
.fatal { display: grid; place-items: center; height: 100vh; color: var(--danger); text-align: center; }

/* ------------------------------------------------ shell */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; transition: margin-left .2s ease; z-index: 30; }
.nav-collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w)); }
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 12px; }
.brand-text b { display: block; font-size: 17px; letter-spacing: -.01em; } .brand-text small { color: var(--muted); font-size: 12.5px; }
.project-card { margin: 4px 14px 10px; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 14px; }
.pc-label, .nav-sec { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.pc-switch { display: flex; align-items: center; gap: 9px; width: 100%; background: none; border: 0; padding: 7px 0 5px; text-align: left; font-size: 16px; font-weight: 650; }
.pc-switch:hover .pc-name { color: var(--primary); }
.pc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-name .dirty { color: var(--warn-dot); font-size: 12px; vertical-align: middle; }
.pc-chips { display: flex; justify-content: space-between; gap: 6px; margin: 2px 0 6px; }
.pc-meta { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.project-card.empty .pc-switch { color: var(--muted); }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; }
.nav-sec { padding: 16px 10px 6px; }
.nav-sec.row { justify-content: space-between; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 10px; color: var(--text); font-size: 14.5px; font-weight: 500; text-decoration: none !important; margin: 1px 0; }
.nav-item .ic { color: var(--text-2); }
.nav-item:hover { background: var(--surface-3); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.nav-item.active .ic { color: var(--primary); }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-head { display: flex; align-items: center; gap: 6px; width: 100%; height: 32px; padding: 0 8px; background: none; border: 0; color: var(--text-2); font-weight: 650; font-size: 13.5px; border-radius: 8px; }
.nav-group-head:hover { background: var(--surface-3); }
.nav-group .chev { transition: transform .15s; transform: rotate(-90deg); }
.nav-group.open .chev { transform: none; }
.nav-group-body { display: none; margin-left: 16px; border-left: 1px solid var(--border); padding-left: 6px; }
.nav-group.open .nav-group-body { display: block; }
.nav-sub { height: 34px; font-size: 14px; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; text-decoration: none !important; flex: none; }
.who { flex: 1; min-width: 0; line-height: 1.25; } .who b { display: block; font-size: 13.5px; } .who small { color: var(--muted); font-size: 12px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 58px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.crumbs { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; }
.crumbs h1 { font-size: 17px; white-space: nowrap; } .crumbs span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions, .top-global { display: flex; align-items: center; gap: 6px; }
.top-global { padding-left: 8px; border-left: 1px solid var(--border); }
.content { flex: 1; overflow: auto; position: relative; }
.content-viewer { overflow: hidden; }
.scrim { display: none; }
.only-mobile { display: none; }

/* ------------------------------------------------ pages, cards, tables */
.page { max-width: 1240px; margin: 0 auto; padding: 24px 24px 60px; }
.page-wide { max-width: none; } .page-narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; } .page-head p { margin: 4px 0 0; max-width: 680px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 12px; }
.card-title { margin-bottom: 14px; } .card-title p { margin: 4px 0 0; }
.card-foot { display: flex; gap: 8px; align-items: center; margin: 14px -18px -18px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.search { max-width: 260px; }
.table-wrap { overflow: auto; } .table-wrap.tall { max-height: calc(100vh - 210px); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); user-select: none; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table-compact td { padding: 7px 12px; } .table-compact th { padding: 8px 12px; }
.sticky th { position: sticky; top: 0; z-index: 2; }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--text); }
.sort-ind { display: inline-block; width: 8px; margin-left: 4px; opacity: .3; }
.sort-ind::after { content: "↕"; font-style: normal; }
th.asc .sort-ind, th.desc .sort-ind { opacity: 1; color: var(--primary); }
th.asc .sort-ind::after { content: "↑"; } th.desc .sort-ind::after { content: "↓"; }
td.actions { text-align: right; white-space: nowrap; } td.actions > * { margin-left: 4px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.current td { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
tr.row-danger td { background: color-mix(in srgb, var(--danger-soft) 70%, transparent); }
tr.row-sel td { background: var(--primary-soft) !important; }
tr.row-muted td { opacity: .55; }
.patch-cell { cursor: text; } .patch-cell:hover { text-decoration: underline dotted; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { color: var(--faint); margin-bottom: 8px; } .empty h3 { color: var(--text); font-size: 16px; margin: 6px 0; } .empty.small { padding: 30px 10px; }
.empty .row { margin-top: 16px; }
.notice { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 13.5px; }
.notice span { flex: 1; }
.notice-info { background: var(--info-soft); color: var(--info); } .notice-warn { background: var(--warn-soft); color: var(--warn); } .notice-danger { background: var(--danger-soft); color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.grid-2 > .card { margin: 0; }
.grid-2 + .card { margin-top: 16px; }
.toolbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.kpi > .ic { color: var(--primary); background: var(--primary-soft); border-radius: 10px; padding: 8px; width: 38px; height: 38px; }
.kpi.warn > .ic { color: var(--warn); background: var(--warn-soft); } .kpi.ok > .ic { color: var(--ok); background: var(--ok-soft); }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi b { display: block; font-size: 24px; letter-spacing: -.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); }
.dropzone { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); margin-bottom: 16px; cursor: pointer; transition: all .15s; position: relative; color: var(--muted); }
.dropzone b { display: block; color: var(--text); } .dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone .progress { position: absolute; left: 18px; right: 18px; bottom: 8px; }
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .2s; width: 0; }
.progress.indeterminate i { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.meter { height: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; width: 120px; } .meter i { display: block; height: 100%; background: var(--primary); }
dl.kv { display: grid; grid-template-columns: 108px 1fr; gap: 6px 12px; margin: 4px 0 14px; font-size: 13px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.type-list { list-style: none; padding: 0; margin: 0; } .type-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

/* findings */
.summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sum { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.sum span { font-weight: 600; color: var(--text-2); } .sum b { font-size: 20px; } .sum.ok b { color: var(--ok); } .sum.warn b { color: var(--warn); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.check-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); text-decoration: none !important; transition: box-shadow .15s, border-color .15s, transform .15s; box-shadow: var(--shadow-sm); }
.check-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.check-card header { display: flex; align-items: center; gap: 9px; } .check-card header b { flex: 1; } .check-card header .ic { color: var(--text-2); }
.check-card p { font-size: 13px; min-height: 38px; }
.check-num { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; } .check-num b { font-size: 26px; letter-spacing: -.02em; }
.st-ok .check-num b { color: var(--ok); } .st-warn .check-num b { color: var(--warn); } .st-danger .check-num b { color: var(--danger); }
.mini-list { list-style: none; padding: 8px 0 0; margin: 8px 0 0; border-top: 1px solid var(--border); font-size: 12.5px; } .mini-list li { padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* universes */
.uni-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 720px), 1fr)); }
.uni-list .card { margin: 0; }
.uni header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; } .uni header .meter { margin-left: auto; }
.uni-grid { display: grid; grid-template-columns: repeat(32, minmax(0, 20px)); gap: 2px; }
.cell { aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); display: block; }
.cell.used { background: hsl(var(--h) 52% var(--l, 62%)); } .cell.start { box-shadow: inset 2px 0 0 rgba(0, 0, 0, .45); }
.cell.conflict { background: repeating-linear-gradient(45deg, var(--danger), var(--danger) 3px, #f39a91 3px, #f39a91 6px); }
.cell:hover { outline: 2px solid var(--text); outline-offset: 0; }
.legend-inline { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cell-demo { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.cell-demo.used { background: hsl(210 55% 62%); } .cell-demo.start { background: hsl(210 55% 62%); box-shadow: inset 2px 0 0 rgba(0, 0, 0, .45); } .cell-demo.conflict { background: var(--danger); }
.tip { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 10px; padding: 8px 11px; font-size: 12.5px; pointer-events: none; min-width: 180px; max-width: 260px; }
.tip b { display: block; font-family: var(--mono); }

/* steps / radio cards */
.steps { list-style: none; padding: 0; margin: 0; }
.step h3 { margin-bottom: 12px; }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-grid; place-items: center; font-size: 12.5px; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.radio-card { border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 13px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; align-items: center; transition: border-color .12s, background .12s; }
.radio-card input { grid-row: span 2; } .radio-card small { color: var(--muted); grid-column: 2; }
.radio-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.radio-card.disabled { opacity: .5; cursor: not-allowed; }
.sticky-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-row { display: flex; gap: 10px; margin: 10px 0 14px; } .stat-row > div { flex: 1; background: var(--surface-2); border-radius: 10px; padding: 10px; text-align: center; }
.stat-row b { display: block; font-size: 20px; } .stat-row span { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 8px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 10px 9px; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; margin-bottom: -1px; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs.inline { padding: 0; margin: -6px 0 12px; }
.search-hero { display: flex; gap: 10px; margin-bottom: 16px; } .search-hero input { height: 44px; font-size: 15px; }
.search-hero .btn { height: 44px; }

/* ------------------------------------------------ 3D viewer */
.vw { display: grid; grid-template-columns: 1fr 320px; height: 100%; }
.vw.no-panel { grid-template-columns: 1fr 0; } .vw.no-panel .vw-panel { display: none; }
.vw-stage { position: relative; overflow: hidden; background: var(--stage-bg); color: #e5e9ef; }
.vw-stage.light { --stage-bg: #e9edf2; color: var(--text); }
.viewer-host { position: absolute; inset: 0; }
.viewer-host canvas { display: block; outline: none; touch-action: none; }
.vw-toolbar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 8px; z-index: 5; pointer-events: none; }
.tb-group { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: rgba(22, 27, 35, .78); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(10px); pointer-events: auto; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); }
.light .tb-group { background: rgba(255, 255, 255, .86); border-color: var(--border); box-shadow: var(--shadow); }
.tb { height: 30px; min-width: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 12.5px; font-weight: 600; display: inline-grid; place-items: center; opacity: .85; }
.tb:hover { background: rgba(255, 255, 255, .1); opacity: 1; } .light .tb:hover { background: var(--surface-3); }
.tb.on { background: rgba(91, 155, 224, .28); color: #9cc7ff; opacity: 1; } .light .tb.on { background: var(--primary-soft); color: var(--primary); }
.tb-icon { padding: 0; width: 30px; } .tb-caret { width: 18px; margin-left: -3px; }
.vw-overlay { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; pointer-events: none; }
.vw-overlay > * { pointer-events: auto; }
.empty-stage { text-align: center; max-width: 620px; padding: 24px; color: #c9d2de; }
.light .empty-stage { color: var(--text-2); }
.empty-stage .ic { opacity: .7; } .empty-stage h2 { font-size: 22px; margin: 12px 0 6px; color: #fff; } .light .empty-stage h2 { color: var(--text); }
.empty-stage .row { justify-content: center; margin: 20px 0 28px; flex-wrap: wrap; }
.vw-stage:not(.light) .empty-stage .btn:not(.btn-primary) { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: #e5e9ef; }
.hint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; text-align: left; font-size: 12.5px; opacity: .85; }
.hint-grid div { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, .04); }
.light .hint-grid div { background: rgba(255, 255, 255, .7); }
.load-card { width: min(360px, 90%); background: rgba(22, 27, 35, .92); border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; padding: 20px; display: grid; gap: 10px; justify-items: center; text-align: center; box-shadow: var(--shadow-lg); color: #e5e9ef; }
.load-card .progress { width: 100%; background: rgba(255, 255, 255, .1); } .load-card small { max-width: 100%; }
.vw-status { position: absolute; left: 0; right: 0; bottom: 0; height: 28px; display: flex; align-items: center; gap: 16px; padding: 0 14px; font-size: 12px; background: rgba(15, 19, 25, .7); backdrop-filter: blur(6px); z-index: 5; color: #b9c3d0; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.light .vw-status { background: rgba(255, 255, 255, .8); color: var(--text-2); }
.vw-status:empty { display: none; }
.vw-drop { position: absolute; inset: 12px; border: 2px dashed #5b9be0; border-radius: 16px; background: rgba(31, 95, 168, .22); display: grid; place-content: center; justify-items: center; gap: 6px; z-index: 8; opacity: 0; pointer-events: none; transition: opacity .15s; color: #fff; text-align: center; }
.vw-drop.show { opacity: 1; }
.vw-panel { border-left: 1px solid var(--border); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.vw-panel .tabs button { flex: 1; justify-content: center; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; }
.panel-actions { display: flex; gap: 6px; margin-bottom: 10px; }
.fsec { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.fsec header { display: flex; align-items: center; gap: 7px; padding: 9px 10px; background: var(--surface-2); cursor: pointer; font-size: 13px; }
.fsec header .link { font-size: 12px; font-weight: 500; }
.fsec .chev { transform: rotate(-90deg); transition: transform .15s; } .fsec.open .chev { transform: none; }
.fsec-body { display: none; max-height: 290px; overflow-y: auto; padding: 4px; } .fsec.open .fsec-body { display: block; }
.filter-row { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.filter-row:hover { background: var(--surface-2); }
.filter-row input { display: none; } .filter-row .eye { color: var(--primary); display: inline-grid; }
.filter-row.off { color: var(--faint); } .filter-row.off .eye { color: var(--faint); }
.fr-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; } .fr-n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cat-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.cat-light { background: #e0a63a; } .cat-truss { background: #a7afb9; } .cat-rigging { background: #6b7280; } .cat-audio { background: #34383f; } .cat-video { background: #3f6ea8; } .cat-stage { background: #8a7a66; } .cat-scenery { background: #9aa0a8; } .cat-other { background: #c3c8cf; }
.vw-programmer { position: absolute; left: 12px; bottom: 40px; width: 300px; z-index: 6; background: rgba(22, 27, 35, .9); border: 1px solid rgba(255, 255, 255, .09); backdrop-filter: blur(12px); border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); color: #e5e9ef; }
.light .vw-programmer { background: rgba(255, 255, 255, .94); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-lg); }
.vw-programmer header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .vw-programmer header b { display: flex; gap: 6px; align-items: center; flex: 1; }
.vw-programmer .muted { color: #9aa6b6; } .light .vw-programmer .muted { color: var(--muted); }
.vw-programmer .btn { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .12); color: inherit; box-shadow: none; }
.light .vw-programmer .btn { background: var(--surface); border-color: var(--border-strong); }
.vw-programmer .btn-icon { color: inherit; }
.slider { display: grid; grid-template-columns: 62px 1fr 48px; align-items: center; gap: 8px; font-size: 12.5px; margin: 6px 0; }
.slider output { text-align: right; font-variant-numeric: tabular-nums; opacity: .8; }
.slider input:disabled { opacity: .35; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.sw { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .25); background: var(--c); padding: 0; }
.sw.on { outline: 2px solid #9cc7ff; outline-offset: 2px; }
.sw-pick { position: relative; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); cursor: pointer; }
.sw-pick input { opacity: 0; position: absolute; inset: 0; cursor: pointer; }
.sw:disabled { opacity: .35; }
.inline-form .row input { width: 80px; }
.vw-panel .notice { padding: 8px 10px; font-size: 12.5px; }

/* popovers, modals, toasts */
.popover { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .12s ease-out; }
.popover.pad { padding: 14px 14px 2px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; }
.menu button span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .menu button small { color: var(--muted); }
.menu button:hover, .menu button.on { background: var(--surface-3); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.menu-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); padding: 6px 10px 4px; }
.menu-empty { padding: 8px 10px; color: var(--muted); }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(15, 20, 30, .42); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .15s; backdrop-filter: blur(2px); }
.modal-backdrop.in { opacity: 1; }
.modal { width: min(500px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); transform: translateY(6px) scale(.99); transition: transform .15s; }
.modal-backdrop.in .modal { transform: none; }
.modal-wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; } .modal-head h2 { font-size: 17px; }
.modal-body { padding: 8px 18px 16px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.lead { font-size: 14.5px; }
.secret { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.secret code { flex: 1; font-size: 15px; letter-spacing: .03em; overflow-wrap: anywhere; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 100; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 420px; padding: 11px 14px; border-radius: 11px; background: #1d2430; color: #f1f4f8; box-shadow: var(--shadow-lg); font-size: 13.5px; transform: translateY(10px); opacity: 0; transition: all .2s; }
.toast.in { transform: none; opacity: 1; }
.toast-success .ic { color: #5fd496; } .toast-error { background: #4b1d1a; } .toast-error .ic { color: #ff9b91; } .toast-info .ic { color: #8fbaf0; }

/* plot */
.plot-layout { display: grid; grid-template-columns: 320px 1fr; height: 100%; }
.plot-opts { margin: 0; border-radius: 0; border-width: 0 1px 0 0; overflow-y: auto; box-shadow: none; }
.plot-opts h3 { margin-bottom: 14px; }
.plot-preview { display: flex; flex-direction: column; min-width: 0; background: var(--surface-3); }
.plot-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.paper-wrap { flex: 1; overflow: auto; padding: 28px; display: grid; place-items: center; }
.paper { width: 100%; max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 8px 30px rgba(16, 24, 40, .18); border-radius: 2px; }
.paper svg { display: block; width: 100%; height: 100%; }
.paper.zoom100 { max-width: none; max-height: none; }
.paper-wrap:has(.zoom100) { place-items: start; }

/* settings */
.settings-layout { display: grid; grid-template-columns: 250px 1fr; gap: 20px; max-width: 1280px; margin: 0 auto; padding: 24px; align-items: start; }
.subnav { padding: 10px; position: sticky; top: 0; }
.subnav-sec { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; color: var(--muted); padding: 12px 10px 6px; }
.subnav-sec:first-child { padding-top: 4px; }
.subnav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-weight: 500; text-decoration: none !important; }
.subnav a:hover { background: var(--surface-3); } .subnav a.on { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.settings-body { min-width: 0; }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; } .roles > div { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.hero-version { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; background: linear-gradient(135deg, var(--primary-soft), var(--surface) 70%); }
.hero-version h2 { font-size: 34px; letter-spacing: -.03em; margin: 2px 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 24px; margin: 0; flex: 1; max-width: 680px; }
.facts dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; } .facts dd { margin: 2px 0 0; font-weight: 600; font-size: 13.5px; }
.staged { display: grid; gap: 10px; margin-bottom: 14px; }
.staged-item { border: 1px solid var(--border-strong); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.si-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .si-head > .ic { color: var(--primary); }
.si-notes { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; } .si-notes ul { margin: 4px 0 8px; padding-left: 18px; }
.safety { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 4px 0 0; font-size: 12.5px; color: var(--muted); } .safety li { display: flex; gap: 6px; align-items: center; }
.notes details { border-bottom: 1px solid var(--border); padding: 10px 0; } .notes summary { cursor: pointer; } .notes ul { margin: 8px 0 0; padding-left: 20px; } .notes li { margin: 3px 0; }
.console summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; } .console summary::-webkit-details-marker { display: none; }
.cmd-list { margin-top: 14px; display: grid; gap: 8px; }
.cmd { display: grid; grid-template-columns: minmax(260px, auto) auto 1fr; gap: 10px; align-items: center; font-size: 13px; }
.cmd code { background: var(--surface-3); padding: 6px 10px; border-radius: 7px; white-space: nowrap; }
.clean-list { max-height: 260px; overflow: auto; padding-left: 0; list-style: none; } .clean-list li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.job-state { display: flex; align-items: center; gap: 12px; font-size: 16px; margin-bottom: 4px; }
.job-log { list-style: none; padding: 0; margin: 14px 0 0; max-height: 200px; overflow: auto; font-size: 12.5px; font-family: var(--mono); } .job-log li { padding: 3px 0; }
.job-log li.ok { color: var(--ok); } .job-log li.warn { color: var(--warn); }
.twofa { display: grid; gap: 6px; } .qr { width: 180px; height: 180px; margin: 0 auto; background: #fff; padding: 6px; border-radius: 10px; } .qr svg { width: 100%; height: 100%; }
.twofa ol { padding-left: 20px; margin: 6px 0; }

/* ------------------------------------------------ responsive */
@media (max-width: 1100px) { .vw { grid-template-columns: 1fr 280px; } .plot-layout { grid-template-columns: 280px 1fr; } }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; margin-left: calc(-1 * var(--sidebar-w)); box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { margin-left: 0; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
  .only-mobile { display: inline-grid; } .only-desktop { display: none; }
  .topbar { padding: 0 10px; } .crumbs span, .hide-sm { display: none; }
  .vw { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .vw-panel { max-height: 40vh; border-left: 0; border-top: 1px solid var(--border); }
  .vw-programmer { left: 8px; right: 8px; width: auto; bottom: 34px; }
  .vw-overlay { padding-top: 96px; align-items: start; overflow-y: auto; }
  .tb-group { padding: 2px; } .tb { height: 28px; min-width: 28px; }
  .plot-layout { grid-template-columns: 1fr; height: auto; } .plot-opts { border-width: 0 0 1px; } .paper-wrap { min-height: 60vh; }
  .settings-layout { grid-template-columns: 1fr; padding: 14px; } .subnav { position: static; display: flex; flex-wrap: wrap; gap: 4px; } .subnav-sec { width: 100%; padding: 6px 4px 0; }
  .page { padding: 16px 14px 40px; }
  .cmd { grid-template-columns: 1fr auto; } .cmd span { grid-column: 1 / -1; color: var(--muted); }
  .uni-grid { grid-template-columns: repeat(32, minmax(0, 1fr)); gap: 1px; }
  .top-global .seg { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
