/* Matrix 3 – panel. Flight-deck telemetry: ink surfaces, hairline instruments, one ice signal colour.
   Severity colours are reserved for data. Motion is composited (transform/opacity) and stops when idle. */
@font-face { font-family: "Unbounded"; src: url("../fonts/unbounded.woff") format("woff"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Onest"; src: url("../fonts/onest.woff") format("woff"); font-weight: 100 900; font-display: swap; }

:root {
  --void: #04060d; --bg: #070a14; --s1: #0b1020; --s2: #10172c; --s3: #172140;
  --hair: #1b2540; --hair2: #2a3964; --ctl: #5d6fa6; --text: #e9eefb; --muted: #a3afcd; --dim: #8693b8;
  --sig: #6fe3ff; --sig-ink: #031019; --sig-soft: #6fe3ff1f;
  --ok: #4be3a4; --warn: #ffb547; --crit: #ff5d7d; --mid: #8fb2ff;
  --r: 8px; --gap: 18px;
  --f-display: "Unbounded", "Onest", system-ui, sans-serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--sig); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sig); outline-offset: 2px; border-radius: 4px; }
.content:focus, .content:focus-visible, h1[tabindex]:focus { outline: none; }
::selection { background: #6fe3ff44; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2rem); }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .6em; }
.num { font-family: var(--f-display); font-variant-numeric: tabular-nums; font-weight: 600; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 8px 12px; background: var(--sig); color: var(--sig-ink); border: 0; border-radius: 6px; font-weight: 700; cursor: pointer; }
.skip:focus { top: 8px; }

/* ---------- backdrop: drawn once, never animated */
#space { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5; }
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }

/* ---------- rail */
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; background: #060912f2; border-right: 1px solid var(--hair); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand b { font-family: var(--f-display); font-weight: 700; font-size: 1rem; letter-spacing: .14em; }
.brand small { display: block; color: var(--dim); font-size: .72rem; margin-top: 1px; }
.logo { width: 32px; height: 32px; flex: none; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 6px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); background: #ffffff07; text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--sig-soft); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sig); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .mobile-only { display: none; }
.nav .count { margin-left: auto; font: 600 .72rem/1 var(--f-display); padding: 4px 7px; border-radius: 99px; background: var(--s3); color: var(--text); font-variant-numeric: tabular-nums; }
.nav .sep { height: 1px; background: var(--hair); margin: 8px 6px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.meter { padding: 10px 12px; border: 1px solid var(--hair); border-radius: var(--r); font-size: .8rem; color: var(--muted); }
.meter .row { justify-content: space-between; flex-wrap: nowrap; }
.meter b { color: var(--text); font: 600 .78rem var(--f-display); font-variant-numeric: tabular-nums; }
.meter .track { height: 4px; border-radius: 9px; background: var(--hair); margin-top: 8px; overflow: hidden; }
.meter .fill { height: 100%; background: var(--sig); border-radius: 9px; }
.who { display: flex; align-items: center; gap: 10px; font-size: .85rem; min-width: 0; }
.who span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--s3); font-weight: 700; flex: none; }
.who button { margin-left: auto; }

/* ---------- top bar with telemetry strip */
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 14px; padding: 0 26px; height: 58px; background: #070a14eb; border-bottom: 1px solid var(--hair); backdrop-filter: blur(8px); }
.siteswitch { display: flex; align-items: center; gap: 10px; min-width: 0; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px !important; }
.siteswitch select { max-width: 300px; background-color: var(--s1); border: 1px solid var(--hair2); border-radius: 6px; padding: 7px 12px; text-overflow: ellipsis; }
.telemetry { display: flex; align-items: center; gap: 18px; min-width: 0; overflow: hidden; font-size: .8rem; color: var(--dim); }
.telemetry span { white-space: nowrap; display: flex; align-items: baseline; gap: 6px; }
.telemetry b { color: var(--text); font: 600 .8rem var(--f-display); font-variant-numeric: tabular-nums; }
.telemetry .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); align-self: center; box-shadow: 0 0 8px var(--ok); }
.top .spacer { flex: 1; }
.jobpill { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 4px 0 12px; border-radius: 6px; background: var(--s1); border: 1px solid var(--sig); font-size: .82rem; max-width: 440px; min-width: 0; }
.jobpill .bar { width: 90px; height: 3px; border-radius: 9px; background: var(--hair2); overflow: hidden; flex: none; }
.jobpill .bar i { display: block; height: 100%; background: var(--sig); transition: width .5s; }
.jobpill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.content { padding: 26px 26px 90px; max-width: 1340px; width: 100%; margin: 0 auto; }

/* ---------- buttons, chips, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 15px; border-radius: 6px; border: 1px solid var(--ctl);
  background: var(--s2); color: var(--text); cursor: pointer; font-weight: 600; font-size: .88rem; white-space: nowrap; transition: border-color .15s, background .15s, transform .1s; }
.btn:hover { border-color: var(--sig); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary[disabled] { background: transparent; color: var(--sig); border-color: #6fe3ff80; opacity: .7; }
.btn.primary { border-color: var(--sig); color: var(--sig-ink); background: var(--sig); }
.btn.primary:hover { background: #9bedff; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #ff5d7d66; color: #ffc2cf; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: .8rem; }
.btn.icon { padding: 7px; }
.btn svg { width: 15px; height: 15px; flex: none; }
.kbd { font: 600 .68rem var(--f-display); padding: 1px 5px; border: 1px solid var(--hair2); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 4px; font-size: .76rem; font-weight: 600; border: 1px solid var(--hair2); color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--ok); border-color: #4be3a455; } .chip.warn { color: var(--warn); border-color: #ffb54755; }
.chip.bad { color: var(--crit); border-color: #ff5d7d55; } .chip.info { color: var(--sig); border-color: #6fe3ff55; }
.chip.solid { background: var(--s3); color: var(--text); border-color: transparent; }
.chip svg { width: 12px; height: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.critical { background: var(--crit); box-shadow: 0 0 8px var(--crit); } .dot.high { background: var(--warn); } .dot.medium { background: var(--mid); } .dot.low { background: var(--dim); } .dot.info { background: #b8a8ff; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  background-color: var(--void); border: 1px solid var(--ctl); border-radius: 6px; padding: 9px 12px; width: 100%; }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--sig); outline: none; box-shadow: 0 0 0 3px #6fe3ff22; }
input[type=checkbox] { appearance: none; width: 20px; height: 20px; border: 1.5px solid var(--ctl); border-radius: 5px; background: var(--void); display: grid; place-items: center; cursor: pointer; margin: 0; flex: none; }
input[type=checkbox]:checked { background: var(--sig); border-color: var(--sig); }
input[type=checkbox]:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--sig-ink); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
label.f { display: grid; gap: 6px; font-size: .86rem; color: var(--muted); }
label.f > span { font-weight: 600; color: var(--text); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }

/* ---------- panels: hairline instruments with corner brackets */
.grid { display: grid; gap: var(--gap); align-items: start; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { position: relative; background: #0b1020e6; border: 1px solid var(--hair); border-radius: var(--r); padding: 20px; min-width: 0; }
.card::before, .card::after { content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none; border-color: var(--hair2); border-style: solid; }
.card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-top-left-radius: var(--r); }
.card::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; border-bottom-right-radius: var(--r); }
.card.flat { background: transparent; }
.card h2 { margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: .88rem; margin-bottom: 14px; }
.card.tight { padding: 12px 14px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head > div:first-child { min-width: 0; flex: 1 1 420px; }
.head p { color: var(--muted); margin: 6px 0 0; max-width: 72ch; }
.kpi { display: grid; gap: 2px; min-width: 0; }
.kpi .v { font-family: var(--f-display); font-size: 1.55rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .l { color: var(--muted); font-size: .8rem; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 8px; }
.empty .row { justify-content: center; margin-top: 14px; }
.note { padding: 11px 14px; border-radius: 6px; border: 1px solid var(--hair2); border-left-width: 3px; background: var(--s1); color: var(--muted); font-size: .88rem; }
.note.warn { border-color: #ffb54766; border-left-color: var(--warn); color: #ffdcab; } .note.bad { border-color: #ff5d7d66; border-left-color: var(--crit); color: #ffc7d2; } .note.ok { border-color: #4be3a466; border-left-color: var(--ok); color: #bdf6dd; }

/* ---------- site cards (list) */
.sites { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.sitecard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; color: inherit; }
.sitecard:hover { text-decoration: none; border-color: var(--hair2); }
.sitecard .name { min-width: 0; }
.sitecard h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sitecard .kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sitecard .kpis .kpi:last-child { text-align: right; }

/* ---------- bridge: orbit map + trajectory */
.bridge { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.orbitcard { padding: 0; overflow: hidden; }
.orbitcard .hud { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 0; }
.orbitcard .hud .score { font: 700 clamp(2.4rem, 1.8rem + 2vw, 3.4rem)/1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.orbitcard .hud .score small { font-size: .42em; color: var(--muted); margin-left: 4px; }
.orbitcard .hud .lbl { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.orbit { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 640px; touch-action: manipulation; }
.orbit canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.orbit .sweep { position: absolute; inset: 6%; border-radius: 50%; pointer-events: none; opacity: 0;
  background: conic-gradient(from 0deg, #6fe3ff00 0deg, #6fe3ff00 300deg, #6fe3ff26 356deg, #6fe3ff66 360deg); }
@media (prefers-reduced-motion: no-preference) {
  .orbit .sweep.on { opacity: 1; animation: sweep 4s linear infinite; will-change: transform; }
  .orbit.intro .sweep { opacity: 1; animation: sweep 2.2s cubic-bezier(.3, .1, .3, 1) 1 forwards, fadeout 2.4s forwards; }
}
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes fadeout { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.orbit-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(70%, 320px); text-align: center; color: var(--muted); font-size: .9rem; margin: 0; }
.orbit:focus-visible { outline: 2px solid var(--sig); outline-offset: -2px; border-radius: 8px; }
.diff .media { display: inline-block; padding: 1px 6px; margin: 2px 0; border: 1px dashed var(--ctl); border-radius: 4px; font-size: .8rem; color: var(--muted); }
.orbit .tip { position: absolute; z-index: 3; pointer-events: none; max-width: 280px; padding: 8px 10px; border-radius: 6px; background: #04060df2; border: 1px solid var(--hair2); font-size: .8rem; transform: translate(-50%, calc(-100% - 12px)); }
.orbit .tip b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.orbit .tip small { color: var(--muted); }
.sectors { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 16px; }
.sectors button { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--ctl); background: transparent; color: var(--muted); font-size: .8rem; font-weight: 600; cursor: pointer; }
.sectors button b { color: var(--text); font: 600 .76rem var(--f-display); font-variant-numeric: tabular-nums; }
.sectors button[aria-pressed="true"] { border-color: var(--sig); color: var(--text); background: var(--sig-soft); }
.maplegend { display: flex; flex-wrap: wrap; gap: 14px; padding: 0 18px 16px; font-size: .78rem; color: var(--dim); }
.maplegend span { display: inline-flex; align-items: center; gap: 6px; }

/* trajectory: true positions on a 0-100 flight path; dots centred on the rail, labels above/below it */
.traj { position: relative; margin: 26px 6px 22px; height: 112px; }
.traj .rail0 { position: absolute; left: 0; right: 0; top: 55px; height: 2px; background: repeating-linear-gradient(90deg, var(--hair2) 0 6px, transparent 6px 11px); }
.traj .done { position: absolute; left: 0; top: 54px; height: 4px; border-radius: 4px; background: var(--sig); width: 0; }
@media (prefers-reduced-motion: no-preference) { .traj .done { transition: width 1.1s cubic-bezier(.2, .8, .2, 1); } }
.traj.nodown { height: 72px; margin-bottom: 10px; }
.traj .lab em { font-style: normal; color: var(--ok); }
.traj .lab.goal b { font-size: .95rem; }
.traj .ghost { position: absolute; left: 0; top: 54px; height: 4px; border-radius: 4px; background: repeating-linear-gradient(90deg, #4be3a4aa 0 8px, #4be3a433 8px 12px); }
.traj .pt { position: absolute; top: 50px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; border: 2px solid var(--s1); }
.traj .pt.now { background: var(--sig); box-shadow: 0 0 0 4px #6fe3ff33; z-index: 2; }
.traj .pt.proj { background: var(--ok); z-index: 1; }
.traj .pt.goal { background: var(--text); margin-left: -12px; }
.traj .lab { position: absolute; transform: translateX(-50%); display: grid; justify-items: center; white-space: nowrap; line-height: 1.2; }
.traj .lab b { font: 600 clamp(1rem, .8rem + .8vw, 1.35rem) var(--f-display); font-variant-numeric: tabular-nums; }
.traj .lab span { font-size: .74rem; color: var(--muted); }
.traj .lab.up { bottom: 70px; } .traj .lab.up span { order: -1; }
.traj .lab.down { top: 70px; }
.traj .lab.now b { color: var(--sig); } .traj .lab.proj b { color: var(--ok); }
.traj .lab.edge-l { transform: none; justify-items: start; } .traj .lab.edge-r { transform: translateX(-100%); justify-items: end; }

.pack { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--hair); }
.pack:first-of-type { border-top: 0; }
.pack .ico { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--hair2); }
.pack .ico svg { width: 19px; height: 19px; color: var(--sig); }
.pack h3 { margin-bottom: 2px; }
.pack p { margin: 0; color: var(--muted); font-size: .84rem; }
.pack .act { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* areas (pillars) as labelled bars */
.areas { display: grid; gap: 9px; }
.area { display: grid; grid-template-columns: 112px minmax(0, 1fr) 58px; gap: 12px; align-items: center; font-size: .84rem; color: var(--muted); }
.area .t { position: relative; height: 6px; border-radius: 6px; background: var(--hair); overflow: hidden; }
.area .t i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; }
.area b { font: 600 .82rem var(--f-display); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- lists & tables */
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--void); border: 1px solid var(--hair); width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 6px; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; font-size: .85rem; }
.tabs button[aria-selected="true"], .tabs button[aria-checked="true"] { background: var(--s3); color: var(--text); box-shadow: inset 0 -2px 0 var(--sig); }
.tabs button .n { margin-left: 6px; color: var(--dim); font-weight: 500; font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; font-weight: 600; color: var(--dim); padding: 0 10px 8px; white-space: nowrap; }
.table td { padding: 10px; border-top: 1px solid var(--hair); vertical-align: middle; font-size: .9rem; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td, .table tr.click:focus-within td { background: #ffffff05; }
.table .u { max-width: 0; width: 52%; }
.table .u a, .table .u button.lnk { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); background: none; border: 0; padding: 0; text-align: left; width: 100%; cursor: pointer; }
.table .u small { display: block; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .78rem; }
.scorebar { display: flex; align-items: center; gap: 10px; min-width: 110px; }
.scorebar .t { flex: 1; height: 5px; border-radius: 9px; background: var(--hair); overflow: hidden; }
.scorebar .t i { display: block; height: 100%; border-radius: 9px; }
.scorebar b { font: 600 .8rem var(--f-display); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-ok { color: var(--ok); } .s-warn { color: var(--warn); } .s-bad { color: var(--crit); }
.bg-ok { background: var(--ok); } .bg-warn { background: var(--warn); } .bg-bad { background: var(--crit); }
.list { display: grid; }
.li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--hair); color: inherit; }
a.li:hover { text-decoration: none; background: #ffffff04; }
.li:first-child { border-top: 0; }
.li .t { min-width: 0; }
.li .t b { display: block; font-weight: 600; }
.li .t b.url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .t small { color: var(--muted); font-size: .82rem; display: block; overflow-wrap: anywhere; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: .85rem; flex-wrap: wrap; }
.sevkey { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--dim); margin: -6px 0 12px; }
.sevkey span { display: inline-flex; align-items: center; gap: 6px; }
.req { display: flex; flex-wrap: wrap; gap: 4px; }
.req .chip { padding: 1px 6px; }

/* ---------- problem groups */
.areablock { margin: 14px 0 0; border-top: 1px solid var(--hair); }
.areablock[open] { padding-bottom: 6px; }
.areahead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0 10px; cursor: pointer; list-style: none; }
.areahead::-webkit-details-marker { display: none; }
.areahead .chev { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; margin-right: 6px; }
.areablock[open] .areahead .chev { transform: rotate(225deg); }
.areahead p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }
.rule { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 6px; background: #0b1020cc; border: 1px solid var(--hair); margin-bottom: 6px; color: inherit; }
a.rule:hover { border-color: var(--hair2); text-decoration: none; }
.rule .t b { display: block; font-weight: 600; }
.rule .t small { color: var(--muted); display: block; font-size: .84rem; }
.rule .cnt { font: 600 1rem var(--f-display); font-variant-numeric: tabular-nums; text-align: right; min-width: 52px; }
.rule .cnt small { display: block; font: 500 .7rem var(--f-body); color: var(--dim); }
.impact { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; margin-bottom: 8px; }
.impact .card { padding: 14px 16px; }

/* ---------- actions (proposals) cockpit */
#abar { position: sticky; top: 58px; z-index: 5; }
.cmdbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 10px 14px; margin: 0 0 14px; border-radius: 8px; background: #0b1020f5; border: 1px solid var(--hair2); }
.cmdbar .keys { display: flex; gap: 10px; flex-wrap: wrap; color: var(--dim); font-size: .76rem; }
.act-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 15px 16px; border-radius: 8px; background: #0b1020e6; border: 1px solid var(--hair); margin-bottom: 8px; }
.act-card.sel { border-color: var(--sig); }
.act-card.cur { box-shadow: inset 3px 0 0 var(--sig); }
.act-card .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; min-width: 0; }
.act-card .meta .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.act-card .meta a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; font-size: .82rem; color: var(--muted); }
.diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.diff.solo { grid-template-columns: 1fr; }
.diff > div { border-radius: 6px; padding: 10px 12px; font-size: .88rem; background: var(--void); border: 1px solid var(--hair); overflow-wrap: anywhere; max-height: 280px; overflow: auto; }
.diff .b { color: var(--muted); }
.diff .a { border-color: #4be3a440; }
.diff .lab { display: flex; gap: 8px; align-items: center; font-size: .74rem; color: var(--dim); margin-bottom: 4px; font-weight: 600; }
.diff .html h2, .diff .html h3, .diff .html h4 { font-family: var(--f-body); font-size: .95rem; margin: .5em 0 .2em; }
.diff .html table { border-collapse: collapse; font-size: .82rem; } .diff .html th, .diff .html td { border-bottom: 1px solid var(--hair); padding: 3px 8px 3px 0; text-align: left; }
.howto { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 9px 12px; border-radius: 6px; background: var(--sig-soft); color: var(--text); font-size: .86rem; }
.howto svg { width: 16px; height: 16px; flex: none; color: var(--sig); margin-top: 2px; }
.danger-zone { grid-column: 1 / -1; border-color: #ff5d7d44; }
.sitecard small.dim { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-card .why { color: var(--muted); font-size: .84rem; margin-top: 8px; }
.act-card .ops { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
@media (prefers-reduced-motion: no-preference) {
  .act-card.commit { animation: commit .55s cubic-bezier(.5, 0, .2, 1) forwards; transform-origin: left center; }
  .act-card.rewind { animation: rewind .5s cubic-bezier(.5, 0, .2, 1) forwards; }
}
@keyframes commit { 0% { border-color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); } 35% { border-color: var(--ok); transform: none; opacity: 1; } 100% { border-color: var(--ok); transform: translateX(40px); opacity: 0; } }
@keyframes rewind { to { transform: translateX(-24px); opacity: 0; } }

/* ---------- google snippet preview */
.serp { background: #fff; color: #202124; border-radius: 8px; padding: 14px 16px; font-family: Arial, sans-serif; }
.serp .site { font-size: 12px; color: #4d5156; overflow-wrap: anywhere; } .serp .t { color: #1a0dab; font-size: 19px; line-height: 1.3; margin: 3px 0; }
.serp .d { font-size: 14px; color: #4d5156; line-height: 1.5; }

/* ---------- drawer, modal, toast */
.drawer-bg { position: fixed; inset: 0; z-index: 20; background: #02040ccc; }
.drawer { position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--bg); border-left: 1px solid var(--hair2); display: flex; flex-direction: column; }
.drawer header { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--hair); }
.drawer header .t { min-width: 0; } .drawer header h2 { overflow-wrap: anywhere; }
.drawer header small { color: var(--dim); overflow-wrap: anywhere; display: block; margin-top: 4px; }
.drawer .body { overflow: auto; padding: 18px 22px 40px; display: grid; gap: 18px; align-content: start; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.facts > div { padding: 9px 12px; border: 1px solid var(--hair); border-radius: 6px; min-width: 0; overflow-wrap: anywhere; }
.facts small { display: block; color: var(--dim); font-size: .76rem; }
@media (prefers-reduced-motion: no-preference) { .drawer { animation: slidein .26s cubic-bezier(.2, .8, .2, 1); } .drawer-bg, .modal-bg { animation: fade .2s; } }
@keyframes slidein { from { transform: translateX(36px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; z-index: 40; right: 18px; bottom: 18px; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 11px 14px; border-radius: 6px; background: var(--s2); border: 1px solid var(--hair2); border-left-width: 3px; font-size: .9rem; }
.toast.bad { border-left-color: var(--crit); } .toast.ok { border-left-color: var(--ok); }
.modal-bg { position: fixed; inset: 0; z-index: 30; background: #02040cd9; display: grid; place-items: center; padding: 16px; }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg); border: 1px solid var(--hair2); border-radius: 10px; padding: 22px; }
.modal h2 { margin-bottom: 8px; padding-right: 36px; }
.modal .x { position: absolute; right: 12px; top: 12px; }
.nav a[data-active] { color: var(--text); }
.sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.sheet a, .sheet button { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; border: 1px solid var(--hair); background: var(--s1); color: var(--text); font-weight: 600; font-size: .9rem; cursor: pointer; text-align: left; }
.sheet a:hover { text-decoration: none; border-color: var(--hair2); }
.sheet a[aria-current="page"] { border-color: var(--sig); background: var(--sig-soft); }
.sheet svg { width: 20px; height: 20px; flex: none; color: var(--sig); }
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--s1) 0, var(--s2) 50%, var(--s1) 100%); background-size: 200% 100%; min-height: 80px; }
@media (prefers-reduced-motion: no-preference) { .skel { animation: shimmer 1.4s infinite linear; } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- login */
.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box { width: min(420px, 100%); }
.login .card { padding: 28px; }
.login h1 { font-size: 1.5rem; margin: 18px 0 6px; }

.table .show-m { display: none; }
/* ---------- responsive */
@media (max-width: 1180px) { .bridge { grid-template-columns: 1fr; } .orbit { max-height: 560px; margin: 0 auto; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .telemetry .opt { display: none; } }
@media (max-width: 900px) { .shell { grid-template-columns: 76px minmax(0, 1fr); } .rail { padding: 14px 8px; } .brand span, .rail-foot .meter, .who span:nth-child(2) { display: none; }
  .nav .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav a { justify-content: center; padding: 10px 0; } .nav a[aria-current="page"]::before { left: -8px; } .nav .count { position: absolute; top: 2px; right: 4px; padding: 2px 5px; font-size: .62rem; } .who { justify-content: center; } .who .av { display: none; } .who button { margin: 0; } .brand { justify-content: center; padding: 6px 0 16px; }
  .telemetry { display: none; } }
@media (max-width: 640px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 10; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--hair); }
  .rail .brand, .rail-foot, .nav .more-only, .nav .sep { display: none; }
  .nav .mobile-only { display: flex; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; min-width: 56px; }
  .nav .lbl { position: static; width: auto; height: auto; clip: auto; overflow: visible; display: block; font-size: .66rem; }
  .nav a[data-active]::before { content: ""; position: absolute; left: 12px; right: 12px; top: -4px; height: 3px; border-radius: 0 0 3px 3px; background: var(--sig); }
  .modal-bg.bottom { place-items: end stretch; padding: 0; }
  .modal-bg.bottom .modal { width: 100%; border-radius: 14px 14px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .traj .lab.goal { display: none; }
  .areahead { grid-template-columns: 1fr; } .areahead .btn { justify-self: start; }
  .area { grid-template-columns: 92px minmax(0, 1fr) 54px; }
  .nav a[aria-current="page"]::before { left: 12px; right: 12px; top: -4px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .top { padding: 0 14px; height: 52px; } .content { padding: 18px 14px 100px; }
  #abar { top: 52px; } .cmdbar .keys { display: none; }
  .cmdbar { flex-wrap: nowrap; gap: 8px; padding: 6px 8px; } .cmdbar > span:first-child { font-size: .8rem; white-space: nowrap; }
  .cmdbar .row { flex-wrap: nowrap; overflow-x: auto; gap: 6px; } .cmdbar .btn { padding: 5px 8px; font-size: .76rem; }
  .impact { grid-template-columns: repeat(2, minmax(0, 1fr)); } .impact .card { padding: 10px 12px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .diff { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .pack { grid-template-columns: 36px minmax(0, 1fr); } .pack .act { grid-column: 1 / -1; justify-content: flex-start; }
  .rule { grid-template-columns: auto minmax(0, 1fr) auto; } .rule .go { display: none; }
  .table .hide-m, .sevkey.hide-m { display: none; }
  .table .show-m { display: flex; margin-top: 6px; }
  .jobpill .bar { display: none; }
  .siteswitch select { max-width: 48vw; }
  .orbitcard .hud .score { font-size: 2.2rem; }
}
