/* ---------- tokens ---------- */
:root {
  --navy: #0D2B4E;
  --navy-2: #163B66;
  --blue: #0178BE;
  --blue-2: #005F98;
  --accent: #009BED;
  --ink: #1F2B3A;
  --ink-2: #4F5D6E;
  --muted: #7A8797;
  --ground: #F2F5F9;
  --panel: #FFFFFF;
  --panel-2: #F7F9FC;
  --line: #DCE3EC;
  --line-2: #C7D1DD;
  --shadow: 0 10px 30px rgba(13, 43, 78, 0.12);
  --shadow-sm: 0 2px 8px rgba(13, 43, 78, 0.10);
  --ok: #178A56;
  --ok-bg: #E4F5EC;
  --no: #C0433C;
  --no-bg: #FBE9E7;
  --unk: #8A96A3;
  --unk-bg: #EEF1F5;
  --map-bg: #E7EEF5;
  --map-state: #EDF1F5;
  --map-state-line: #CBD5E0;
  --map-county-line: #FFFFFF;
  --map-idaho-line: #7C8FA6;
  --t-north: #DDE6EE;
  --t-treasure: #D2E4F7;
  --t-magic: #D7EBE2;
  --t-east: #E2DDF3;
  --t-southeast: #CFE7EC;
  --t-utah: #ECE8E0;
  --t-other: #E4E9EF;
  --r-north: #5B7A99;
  --r-treasure: #2F6FBF;
  --r-magic: #2E8B6E;
  --r-east: #6A5BB5;
  --r-southeast: #1F8A96;
  --r-utah: #8A7F6E;
  --pin: #0D2B4E;
  --pin-ring: #FFFFFF;
  --bar-bg: #FFFFFF;
  --bar-fg: #0D2B4E;
  --bar-muted: #566A77;
  --bar-phone: #0A4E7C;
  --font-display: "futura-pt", "Jost", "Century Gothic", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --bar-h: 72px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #0B1F38; --navy-2: #12335A; --blue: #4FB1F0; --blue-2: #7CC6F5; --accent: #5CC1FF;
    --ink: #E8EEF5; --ink-2: #B9C4D1; --muted: #8C9AAB;
    --ground: #0F1822; --panel: #17222F; --panel-2: #1D2A39; --line: #2B3949; --line-2: #3A4A5C;
    --shadow: 0 10px 30px rgba(0,0,0,0.45); --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
    --ok: #4CC58A; --ok-bg: #163527; --no: #F08A82; --no-bg: #3B1F1D; --unk: #8C9AAB; --unk-bg: #26313E;
    --map-bg: #111C29; --map-state: #182433; --map-state-line: #2C3B4D; --map-county-line: #0F1822; --map-idaho-line: #6E86A3;
    --t-north: #243547; --t-treasure: #1F3A5C; --t-magic: #1E3D34; --t-east: #2E2A4E; --t-southeast: #1C3E46; --t-utah: #332F29; --t-other: #1E2A38;
    --r-north: #8FA9C5; --r-treasure: #6FA6E6; --r-magic: #63BF9C; --r-east: #A497E0; --r-southeast: #5EBECB; --r-utah: #BBAF9B;
    --pin: #E8EEF5; --pin-ring: #17222F;
    --bar-bg: #17222F; --bar-fg: #E8EEF5; --bar-muted: #B9C4D1; --bar-phone: #7CC6F5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #0B1F38; --navy-2: #12335A; --blue: #4FB1F0; --blue-2: #7CC6F5; --accent: #5CC1FF;
  --ink: #E8EEF5; --ink-2: #B9C4D1; --muted: #8C9AAB;
  --ground: #0F1822; --panel: #17222F; --panel-2: #1D2A39; --line: #2B3949; --line-2: #3A4A5C;
  --shadow: 0 10px 30px rgba(0,0,0,0.45); --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --ok: #4CC58A; --ok-bg: #163527; --no: #F08A82; --no-bg: #3B1F1D; --unk: #8C9AAB; --unk-bg: #26313E;
  --map-bg: #111C29; --map-state: #182433; --map-state-line: #2C3B4D; --map-county-line: #0F1822; --map-idaho-line: #6E86A3;
  --t-north: #243547; --t-treasure: #1F3A5C; --t-magic: #1E3D34; --t-east: #2E2A4E; --t-southeast: #1C3E46; --t-utah: #332F29; --t-other: #1E2A38;
  --r-north: #8FA9C5; --r-treasure: #6FA6E6; --r-magic: #63BF9C; --r-east: #A497E0; --r-southeast: #5EBECB; --r-utah: #BBAF9B;
  --pin: #E8EEF5; --pin-ring: #17222F;
  --bar-bg: #17222F; --bar-fg: #E8EEF5; --bar-muted: #B9C4D1; --bar-phone: #7CC6F5;
  color-scheme: dark;
}

/* ---------- base (scoped so the embed does not restyle the host page) ---------- */
html.rbsnm-fullscreen, body.rbsnm-fullscreen { height: 100%; }
body.rbsnm-fullscreen { margin: 0; background: var(--ground); overflow: hidden; }
.rbsnm, .rbsnm *, .rbsnm *::before, .rbsnm *::after { box-sizing: border-box; }
.rbsnm {
  background: var(--ground); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.45; text-align: left;
  -webkit-font-smoothing: antialiased;
}
.rbsnm button, .rbsnm input { font: inherit; color: inherit; margin: 0; text-transform: none; letter-spacing: normal; line-height: inherit; box-shadow: none; }
.rbsnm button { cursor: pointer; }
.rbsnm a { color: var(--blue); }
.rbsnm :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.rbsnm p { margin: 0; }
.rbsnm .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rbsnm h1, .rbsnm h2, .rbsnm h3, .rbsnm h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; margin: 0; color: var(--ink); line-height: 1.2; }
.rbsnm .eyebrow { font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- app shell ---------- */
.rbsnm { position: fixed; inset: 0; display: grid; grid-template-rows: var(--bar-h) 1fr; grid-template-columns: minmax(0, 1fr); }
.mode-grid .regions, .mode-grid .zoomctl, .mode-grid .credit, .mode-grid .legend { display: none; }

.bar {
  background: var(--bar-bg); color: var(--bar-fg); display: flex; align-items: center; gap: 18px; padding: 0 24px;
  border-bottom: 3px solid var(--blue); z-index: 5; position: relative; min-width: 0; overflow: hidden;
}
.bar .logo { display: flex; align-items: center; text-decoration: none; color: inherit; }
.bar .logo img { max-height: 46px; width: auto; display: block; }
:root[data-theme="dark"] .bar .logo img { background: #fff; border-radius: 6px; padding: 4px 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bar .logo img { background: #fff; border-radius: 6px; padding: 4px 8px; } }
.bar .title { font-family: var(--font-display); font-size: 18px; font-weight: 500; letter-spacing: 0.01em; padding-left: 18px; border-left: 1px solid var(--line); white-space: nowrap; color: var(--bar-fg); line-height: 1.2; }
.bar .title small { display: block; font-size: 12px; font-weight: 400; color: var(--bar-muted); letter-spacing: 0.02em; font-family: var(--font-body); margin-top: 2px; }
.bar .spacer { flex: 1; }
.bar .links { display: flex; align-items: center; gap: 14px; }
.bar .links a { text-decoration: none; white-space: nowrap; }
.bar .links a.back { font-family: var(--font-body); font-size: 14px; color: var(--bar-muted); }
.bar .links a.back:hover { color: var(--blue); }
.bar .links a.back::before { content: "\2190\00a0"; }
.bar .links a.phone { font-family: var(--font-display); font-size: 17px; color: var(--bar-phone); }
.bar .links a.phone:hover { color: var(--accent); }
.bar .links a.cta { font-family: var(--font-display); font-size: 13px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; background: var(--blue); color: #fff; border-radius: 4px; padding: 11px 17px; }
.bar .links a.cta:hover { background: var(--blue-2); }
.bar .links a.cta .short { display: none; }

.work { position: relative; display: grid; grid-template-columns: 1fr 420px; min-height: 0; }

/* ---------- map stage ---------- */
.stage { position: relative; min-width: 0; min-height: 0; background: var(--map-bg); overflow: hidden; }
.stage svg.map { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; cursor: grab; }
.stage svg.map.dragging { cursor: grabbing; }
.map .state { fill: var(--map-state); stroke: var(--map-state-line); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.map .county { stroke: var(--map-county-line); stroke-width: 0.9; vector-effect: non-scaling-stroke; fill: var(--t-other); transition: fill 300ms ease, opacity 300ms ease; }
.map .county.north { fill: var(--t-north); }
.map .county.treasure { fill: var(--t-treasure); }
.map .county.magic { fill: var(--t-magic); }
.map .county.east { fill: var(--t-east); }
.map .county.southeast { fill: var(--t-southeast); }
.map .county.utah { fill: var(--t-utah); }
.map .county.dim { opacity: 0.45; }
.map .idaho-outline { fill: none; stroke: var(--map-idaho-line); stroke-width: 1.6; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .utah-outline { fill: none; stroke: var(--map-idaho-line); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; opacity: 0.6; }
.map .label { font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; fill: var(--ink-2); opacity: 0.55; pointer-events: none; text-anchor: middle; }
.map .city { font-family: var(--font-body); font-size: 11px; fill: var(--ink-2); opacity: 0.75; pointer-events: none; paint-order: stroke; stroke: var(--map-bg); stroke-width: 2.5px; stroke-linejoin: round; }
.map .citydot { fill: var(--ink-2); opacity: 0.55; pointer-events: none; }

.pin { cursor: pointer; }
.pin .dot { fill: var(--pin); stroke: var(--pin-ring); stroke-width: 2; transition: fill 160ms ease; }
.pin .glyph { fill: var(--pin-ring); pointer-events: none; }
.pin .halo { fill: var(--accent); opacity: 0; }
.pin:hover .dot, .pin:focus-visible .dot { fill: var(--blue); }
.pin.selected .dot { fill: var(--blue); }
.pin.selected .halo { opacity: 0.35; animation: halo 1.8s ease-out infinite; }
.pin.ok .dot { fill: var(--ok); }
.pin.no .dot { fill: var(--no); }
.pin.unk .dot { fill: var(--unk); }
.pin.faded { opacity: 0.35; }
.pin.cluster .dot { fill: var(--navy-2); }
.pin.cluster.ok .dot { fill: var(--ok); } .pin.cluster.no .dot { fill: var(--no); } .pin.cluster.unk .dot { fill: var(--unk); }
.pin.mixed .dot { fill: var(--pin-ring); }
.pin .seg.ok { fill: var(--ok); } .pin .seg.no { fill: var(--no); } .pin .seg.unk { fill: var(--unk); }
.pin.mixed text.cnt { paint-order: stroke; stroke: rgba(0,0,0,0.35); stroke-width: 2px; }
.pin.cluster text.cnt { fill: #fff; font-family: var(--font-display); font-weight: 600; font-size: 12px; text-anchor: middle; pointer-events: none; }
.pin .tag { font-family: var(--font-display); font-size: 11.5px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--map-bg); stroke-width: 3px; stroke-linejoin: round; cursor: pointer; }
@keyframes halo { 0% { transform: scale(0.6); opacity: 0.5; } 100% { transform: scale(2.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pin.selected .halo { animation: none; opacity: 0.25; } }

/* overlays on the map */
.regions {
  position: absolute; top: 14px; left: 14px; right: 14px; display: flex; flex-wrap: wrap; gap: 8px; z-index: 2; pointer-events: none;
}
.regions button {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px 6px 9px; font-family: var(--font-display); font-size: 13px; font-weight: 500; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.regions button:hover { transform: translateY(-1px); border-color: var(--line-2); }
.regions button .sw { width: 12px; height: 12px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7); }
.regions button .n { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.regions button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.regions button.active .n { color: rgba(255,255,255,0.7); }
.regions button.home { padding-left: 12px; }

.zoomctl { position: absolute; right: 14px; bottom: 44px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.zoomctl button {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  box-shadow: var(--shadow-sm); font-size: 20px; line-height: 1; display: grid; place-items: center;
}
.zoomctl button:hover { border-color: var(--line-2); color: var(--blue); }

.legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 2; display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; font-size: 12.5px; color: var(--ink-2);
}
.legend .k { display: inline-flex; align-items: center; gap: 6px; }
.legend .k i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.legend .k i.ok { background: var(--ok); } .legend .k i.no { background: var(--no); } .legend .k i.unk { background: var(--unk); } .legend .k i.pin { background: var(--pin); }
.legend[hidden] { display: none; }

.credit { position: absolute; right: 14px; bottom: 14px; z-index: 2; font-size: 11px; color: var(--muted); }

.tip {
  position: absolute; z-index: 4; pointer-events: none; background: var(--navy); color: #fff; border-radius: 8px; padding: 8px 11px;
  font-family: var(--font-display); font-size: 13px; line-height: 1.3; box-shadow: var(--shadow); transform: translate(-50%, calc(-100% - 16px));
  white-space: nowrap; opacity: 0; transition: opacity 120ms ease;
}
.tip.show { opacity: 1; }
.tip small { display: block; font-family: var(--font-body); font-size: 12px; opacity: 0.75; }
.tip::after { content: ""; position: absolute; left: calc(50% + var(--arrow, 0px)); bottom: -6px; width: 12px; height: 12px; background: var(--navy); transform: translateX(-50%) rotate(45deg); }

/* ---------- side panel ---------- */
.panel { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 3; }
.panel .modes { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; padding: 12px 14px 0; }
.panel .modes button {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); border-radius: 8px; padding: 9px 6px;
  font-family: var(--font-display); font-size: 13.5px; font-weight: 500;
}
.panel .modes button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.panel .search { padding: 12px 14px 8px; position: relative; }
.panel .search input {
  width: 100%; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 9px; padding: 10px 12px 10px 38px; font-size: 15px;
}
.panel .search input::placeholder { color: var(--muted); }
.panel .search svg { position: absolute; left: 26px; top: 23px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; }
.panel .search + .search { padding-top: 0; }
.panel .search + .search svg { top: 11px; }
.pin.provider .dot { fill: var(--accent); }
.rbsnm.embed { position: relative; inset: auto; height: var(--embed-h, 760px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rbsnm.embed .bar { display: none; }
.rbsnm.embed { grid-template-rows: 1fr; }
.rbsnm.embed .panel { position: relative; }
@media (max-width: 900px) { .rbsnm.embed .panel { position: absolute; } }
.panel .body { overflow: auto; padding: 6px 14px 20px; flex: 1; min-height: 0; overscroll-behavior: contain; }

.hlist { list-style: none; margin: 0; padding: 0; }
.hlist li + li { border-top: 1px solid var(--line); }
.hlist button {
  width: 100%; text-align: left; background: none; border: 0; padding: 10px 6px; display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; border-radius: 8px;
}
.hlist button:hover { background: var(--panel-2); }
.hlist .sw { width: 12px; height: 12px; border-radius: 50%; justify-self: center; }
.hlist .nm { font-family: var(--font-display); font-weight: 500; font-size: 14.5px; line-height: 1.25; }
.hlist .ct { font-size: 13px; color: var(--muted); }
.hlist .st { font-size: 12px; font-family: var(--font-display); font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.st.cnt { color: var(--ink-2); background: var(--unk-bg); }
.st.ok { color: var(--ok); background: var(--ok-bg); } .st.no { color: var(--no); background: var(--no-bg); } .st.unk { color: var(--unk); background: var(--unk-bg); }
.grp { margin: 14px 0 6px; display: flex; align-items: center; justify-content: space-between; }
.grp .eyebrow { display: flex; align-items: center; gap: 8px; }
.grp .eyebrow i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.grp .cnt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { padding: 26px 8px; text-align: center; color: var(--muted); font-size: 14px; }

/* hospital detail */
.detail .top { padding: 8px 4px 0; }
.detail .crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.detail .crumbs button { background: none; border: 0; padding: 4px 0; color: var(--blue); font-family: var(--font-display); font-size: 13px; font-weight: 500; }
.detail .crumbs button::before { content: "\2190\00a0"; }
.detail h2 { font-size: 22px; line-height: 1.15; margin: 4px 0 6px; }
.detail .sys { font-size: 14px; color: var(--ink-2); }
.detail .sys b { font-weight: 600; color: var(--ink); }
.detail .addr { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.detail .sum { margin: 14px 0 6px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail .sum div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.detail .sum b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.detail .sum span { font-size: 12px; color: var(--muted); }
.detail .sum .ok b { color: var(--ok); } .detail .sum .no b { color: var(--no); } .detail .sum .unk b { color: var(--unk); }
.carriers { list-style: none; padding: 0; margin: 10px 0 0; }
.carriers li { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.carriers li:first-child { border-top: 0; }
.clogo { display: flex; align-items: center; min-height: 30px; }
.clogo img { max-width: 104px; max-height: 32px; width: auto; height: auto; display: block; }
.clogo .badge { font-family: var(--font-display); font-weight: 600; font-size: 13px; line-height: 1.1; color: var(--c, var(--navy)); padding: 6px 9px; border: 1.5px solid currentColor; border-radius: 6px; }
.clogo img, .pick button img, table.grid th.c img { background: #fff; border-radius: 5px; padding: 3px 6px; box-sizing: content-box; }
.nets { display: flex; flex-wrap: wrap; gap: 6px; }
.net { display: inline-flex; align-items: center; gap: 5px; border: 1px solid transparent; border-radius: 999px; padding: 4px 10px 4px 7px; font-family: var(--font-display); font-size: 13px; font-weight: 600; }
.net:hover { border-color: currentColor; }
.net svg { width: 13px; height: 13px; }
.net.ok { background: var(--ok-bg); color: var(--ok); } .net.no { background: var(--no-bg); color: var(--no); } .net.unk { background: var(--unk-bg); color: var(--unk); }
.wrapnote { font-size: 12.5px; color: var(--muted); margin-top: 4px; grid-column: 2; }
.note { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); margin-top: 16px; }
.note b { color: var(--ink); }
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border-radius: 9px; padding: 11px 14px; font-family: var(--font-display); font-weight: 600; font-size: 14.5px; border: 1px solid var(--line-2); color: var(--ink); background: var(--panel); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); border-color: var(--blue-2); }
.btn:hover { border-color: var(--blue); }

/* plan picker */
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.pick button { border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 10px; display: grid; place-items: center; min-height: 58px; }
.pick button img { max-width: 100%; max-height: 30px; display: block; }
.pick button:hover { border-color: var(--blue); }
.pick button.active { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue) inset; }
.pick .badge { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--c, var(--navy)); }
.netpick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.netpick button { border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-family: var(--font-display); font-size: 13px; font-weight: 600; }
.netpick button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.planhead { margin-top: 14px; padding: 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); }
.planhead .nm { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.planhead .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.planhead .bar2 { height: 8px; border-radius: 999px; background: var(--no-bg); margin-top: 10px; overflow: hidden; }
.planhead .bar2 i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }

/* grid view */
.gridwrap { position: absolute; inset: 0; overflow: auto; background: var(--panel); padding: 18px; }
.gridwrap[hidden] { display: none; }
.gridwrap h2 { font-size: 20px; margin-bottom: 4px; }
.gridwrap .lead { color: var(--ink-2); font-size: 14px; margin: 0 0 14px; max-width: 70ch; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 900px; }
table.grid th, table.grid td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
table.grid thead th { position: sticky; top: -18px; background: var(--panel); z-index: 1; }
table.grid th.c { font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: 0.02em; }
table.grid th.c img { max-height: 26px; max-width: 96px; display: block; margin: 0 auto 4px; }
table.grid th.n { font-family: var(--font-display); font-size: 11.5px; font-weight: 500; color: var(--ink-2); border-bottom: 2px solid var(--line-2); }
table.grid th.c { border-left: 1px solid var(--line); }
table.grid td.first { border-left: 1px solid var(--line); }
table.grid td.h { text-align: left; white-space: nowrap; font-family: var(--font-display); font-weight: 500; position: sticky; left: -18px; background: var(--panel); z-index: 1; }
table.grid td.h small { display: block; color: var(--muted); font-family: var(--font-body); font-weight: 400; font-size: 12px; }
table.grid td.h i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
table.grid td .m { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.m.ok { background: var(--ok-bg); color: var(--ok); } .m.no { background: var(--no-bg); color: var(--no); } .m.unk { background: var(--unk-bg); color: var(--unk); }
table.grid tr.sysrow td.h { font-weight: 600; }
table.grid tr.wrap td { color: var(--muted); font-size: 12px; border-bottom: 0; padding-top: 10px; }
.gridwrap .foot { font-size: 12px; color: var(--muted); margin-top: 14px; max-width: 80ch; }

/* ---------- mobile ---------- */
.sheet-handle { display: none; }
@media (max-width: 900px) {
  :root { --bar-h: 60px; }
  .bar { gap: 10px; padding: 0 12px; }
  .bar .logo img { max-height: 38px; }
  .bar .links { gap: 10px; }
  .bar .links a.cta { padding: 9px 12px; font-size: 12px; }
  .bar .links a.phone { font-size: 15px; }
  .bar .title { display: none; }
  .bar .links a.back { display: none; }
  .bar .links a.cta .long { display: none; } .bar .links a.cta .short { display: inline; }
  .work { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .stage { grid-row: 1; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; height: 46%; border-left: 0; border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(13,43,78,0.18); transition: height 260ms ease;
  }
  .panel.tall { height: 78%; }
  .panel .modes { padding-top: 6px; }
  .sheet-handle { display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--line-2); margin: 8px auto 0; }
  .regions { top: 10px; left: 10px; right: 10px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .regions::-webkit-scrollbar { display: none; }
  .regions button { flex: 0 0 auto; font-size: 12.5px; }
  .zoomctl { bottom: calc(46% + 12px); right: 10px; }
  .panel.tall ~ .zoomctl { bottom: calc(78% + 12px); }
  .legend { display: none; }
  .credit { display: none; }
  .gridwrap { padding: 12px; }
  table.grid thead th { top: -12px; }
  table.grid td.h { left: -12px; }
  .detail .sum b { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .rbsnm * { transition: none !important; } }
@media print {
  html.rbsnm-fullscreen, body.rbsnm-fullscreen { height: auto; overflow: visible; }
  .rbsnm, .rbsnm.embed { position: static !important; display: block !important; height: auto !important; border: 0 !important; background: #fff !important; color: #000 !important; }
  .bar, .zoomctl, .regions, .legend, .credit, .tip, .panel, svg.map { display: none !important; }
  .work { display: block !important; }
  .stage { position: static !important; display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; }
  .gridwrap { display: block !important; position: static !important; overflow: visible !important; padding: 0 !important; background: #fff !important; }
  table.grid thead th, table.grid td.h { position: static !important; }
  table.grid { min-width: 0; font-size: 11px; }
  table.grid th, table.grid td { padding: 4px 5px; }
  .m.ok, .m.no, .m.unk, .net.ok, .net.no, .net.unk { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
