/* Dead End look: the CORE dashboard palette and slide-out menu layout (always dark, whatever the system theme). Static file, no inline CSS. */
:root {
  color-scheme: dark;       /* always dark (owner 2026-11-05): one palette, the system theme is ignored, no toggle */
  --bg: #0b111c; --side: #0e1624; --card: #111a29; --card2: #16213a; --fg: #e8edf5; --muted: #8b97ad; --line: rgba(148, 163, 184, 0.18);
  --crit: #ff6b6b; --warn: #fab219; --info: #5aa9ff; --ok: #3ccf3c; --unk: #b9a3f0; --wash: rgba(148, 163, 184, 0.08);
  --band: rgba(90, 169, 255, .22);
  --l0: #e8edf5; --l1: #5aa9ff; --l2: #ff9a62; --l3: #3ccf3c; --l4: #b9a3f0;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.45 system-ui, -apple-system, Segoe UI, sans-serif; }
.layout { display: block; min-height: 100vh; }
/* top bar: menu button + avatar/name on the left; notices wrap below. The page list lives in the left drawer (below). */
.top { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 8px; padding: 8px 12px; background: var(--side); border-bottom: 1px solid var(--line); }
.top-left { display: flex; flex-direction: row; align-items: center; gap: 12px; }      /* button at the far left, avatar to its right. For "avatar above": flex-direction: column-reverse; align-items: flex-start; */
.top .brand-avatar { width: 36px; height: 36px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0; }
.brand strong { display: block; font-size: 17px; letter-spacing: 0.04em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand-avatar { display: block; width: 42px; height: 42px; border-radius: 50%; flex: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); color: var(--info); }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; flex-direction: column; }
.nav a { display: flex; align-items: center; padding: 11px 18px; color: var(--muted); text-decoration: none; border-left: 3px solid transparent; }
.nav a:hover { background: var(--wash); color: var(--fg); }
.nav a[aria-current] { background: var(--wash); color: var(--fg); border-left-color: var(--info); font-weight: 600; }
.top .notice { flex: 1 0 100%; margin: 4px 0; font-size: 12px; }
.content { min-width: 0; }
main { max-width: 760px; margin: 0 auto; padding: 8px 20px 32px; }
.mockbar { background: var(--warn); color: #0b0b0b; text-align: center; font-size: 13px; padding: 3px; }
h1 { font-size: 1.6rem; margin: 16px 0 4px; } h2 { font-size: 1.15rem; margin: 0 0 8px; } h3 { font-size: 1rem; margin: 8px 0 4px; }
a { color: var(--info); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; }
.items { list-style: none; padding: 0; margin: 12px 0; }
.item { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--info); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.item h3 { font-size: 1.05rem; margin: 6px 0 2px; }
.sev-critical { border-left-color: var(--crit); } .sev-warning { border-left-color: var(--warn); }
.sev-info { border-left-color: var(--info); } .sev-unknown { border-left-color: var(--unk); }
.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.sev { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sev-critical .sev { color: var(--crit); } .sev-warning .sev { color: var(--warn); } .sev-unknown .sev { color: var(--unk); } .sev-info .sev { color: var(--info); }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; } .chip-attn { border-color: var(--crit); color: var(--crit); font-weight: 600; }
.fresh { border-radius: 999px; padding: 0 8px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.fresh-stale { border-color: var(--warn); color: var(--warn); font-weight: 600; } .fresh-unavailable { border-color: var(--unk); color: var(--unk); font-weight: 600; }
.unknown { color: var(--unk); font-weight: 700; }
.reason, .asof, .src, footer, .conf { color: var(--muted); font-size: 14px; } .ok { color: var(--ok); }
.item-detail { font-size: 14px; margin: 4px 0; }
.item-detail.cal-text { margin-top: 12px; }      /* calendar sentences are their own paragraph, as in the shared text */
.item .reason, .item-detail { color: var(--fg); }      /* Today cards: all body text is one colour (the headline's); grey stays for small labels */
.more { font-size: 14px; display: inline-block; padding: 4px 0; }
.item .more { display: inline-flex; align-items: center; padding-left: 0; min-height: 44px; }
.notice { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; margin: 8px 0; }
.notice-stale, .notice-attn { border-color: var(--warn); } .notice-apps { color: var(--muted); }
.alert-card { border: 1px solid var(--line); border-left: 6px solid var(--info); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.alert-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert-card .headline { font-weight: 600; margin: 4px 0; }
.alert-text { margin: 6px 0; white-space: pre-line; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font-size: 14px; margin: 8px 0; }
dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; }
.ack button { font: inherit; font-weight: 600; padding: 10px 18px; min-height: 44px; border-radius: 8px; border: 1px solid var(--fg); background: var(--fg); color: var(--bg); cursor: pointer; }
.acked { color: var(--ok); font-size: 14px; } .acked-wrap { margin: 8px 0; } .acked-wrap summary { cursor: pointer; padding: 6px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; } th { text-align: left; font-weight: 500; color: var(--muted); }
td, th { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sensor { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 8px; } .placement { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.val { font-weight: 600; } .unit { font-weight: 400; color: var(--muted); }
.chart { width: 100%; height: auto; } .chart .grid { stroke: var(--line); } .chart .axis { fill: var(--muted); font-size: 11px; }
.chart .band { fill: var(--band); stroke: none; } .chart .line { fill: none; stroke-width: 2; }
.line-0 { stroke: var(--l0); } .line-1 { stroke: var(--l1); } .line-2 { stroke: var(--l2); } .line-3 { stroke: var(--l3); } .line-4 { stroke: var(--l4); }
.legend { list-style: none; padding: 0; font-size: 14px; } .swatch { display: inline-block; width: 14px; height: 4px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.swatch.line-0 { background: var(--l0); } .swatch.line-1 { background: var(--l1); } .swatch.line-2 { background: var(--l2); } .swatch.line-3 { background: var(--l3); } .swatch.line-4 { background: var(--l4); } .swatch.off { background: var(--line); }
.period { border-top: 1px solid var(--line); padding-top: 6px; }
.radar-ctl { display: flex; gap: 12px; align-items: center; margin: 6px 0; } .radar-ctl button { font: inherit; min-height: 40px; padding: 0 14px; }
#radar-label.model { color: var(--warn); font-weight: 700; }
.placeholder { border: 1px dashed var(--line); border-radius: 8px; padding: 18px; color: var(--muted); text-align: center; }
footer { position: relative; text-align: center; padding: 16px; }

/* Sign-in and error screens (body.login): the CORE login box, same stylesheet. */
body.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
body.login .mockbar { position: fixed; top: 0; left: 0; right: 0; }
body.login .box { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
body.login .brand { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.1; letter-spacing: .08em; margin-bottom: 12px; padding: 0; }
body.login .brand-avatar { margin-bottom: 8px; }
body.login .brand small { color: var(--info); font-size: 11px; }
body.login h1 { margin: 0 0 16px; font-size: 20px; }
body.login label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
body.login p { margin: 0 0 12px; }
body.login input { display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
body.login input:focus { outline: 2px solid var(--info); border-color: var(--info); }
body.login button { width: 100%; padding: 12px; font: inherit; font-weight: 600; color: var(--bg); background: var(--info); border: 0; border-radius: 8px; cursor: pointer; }
body.login .notice { color: var(--muted); margin: 0 0 16px; }
body.login .notice-attn { color: var(--crit); border-color: var(--crit); }
body.login a { color: var(--info); }

/* ---- weather dashboard (the original layout: topbar, KPI tiles, 12-column panels) ---- */
main.wide { max-width: 1280px; }
.topbar { display: grid; grid-template-columns: 1fr auto auto; gap: 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 650; }
.sub { color: var(--muted); font-size: 13px; margin: 0; }
.overall { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 10px; color: var(--fg); text-decoration: none; }
.overall:hover { background: var(--wash); }
.overall strong { display: block; font-size: 14px; }
.overall small, .clock small { display: block; color: var(--muted); font-size: 12px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--unk); flex: none; display: inline-block; }
.dot.good { background: var(--ok); } .dot.warning { background: var(--warn); } .dot.critical { background: var(--crit); }
.clock { text-align: right; padding-left: 20px; border-left: 1px solid var(--line); }
.clock strong { font-size: 18px; font-variant-numeric: tabular-nums; }
main.wide { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-content: start; }
main.wide > * { grid-column: 1 / -1; margin: 0; min-width: 0; }
main.wide > .s4 { grid-column: span 4; } main.wide > .s8 { grid-column: span 8; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 12px; align-items: start; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 12px; }
.kpi > div { min-width: 0; }
.kpi h2 { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-icon { color: var(--info); margin-top: 2px; } .kpi-icon .icon { width: 30px; height: 30px; stroke-width: 1.6; }
.kpi.alt .kpi-icon { color: var(--warn); }
.kpi-value { font-size: 22px; font-weight: 650; margin: 2px 0 0; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 13px; font-weight: 400; color: var(--muted); } .kpi-value.idle { color: var(--muted); } .kpi-value.good { color: var(--ok); } .kpi-value.warning { color: var(--warn); } .kpi-value.critical { color: var(--crit); }
.kpi-sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; overflow-wrap: anywhere; }
.kpi .fresh { font-size: 11px; padding: 0 6px; }
.spark { grid-column: 1 / -1; margin-top: 8px; } .spark svg { display: block; width: 100%; height: 22px; overflow: visible; }
.spark-line { fill: none; stroke: var(--info); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark-cap { font-size: 11px; color: var(--muted); }
.day-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.day-card { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.day-head { display: flex; justify-content: space-between; gap: 8px; } .day-cond { margin: 4px 0 8px; font-size: 14px; color: var(--muted); }
.kv-list, dl.kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 14px; margin: 0; } dl.kv dd { text-align: right; }
.empty { color: var(--muted); font-size: 14px; margin: 8px 0; }
.health { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.health li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 14px; } .h-sub { color: var(--muted); font-size: 12px; }
.forecast-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.sub-card, section.sub { min-width: 0; } section.sub h3 { margin: 0 0 6px; color: var(--muted); font-weight: 500; font-size: 14px; }
.chart-table { margin-top: 6px; } .chart-table summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; } .sensor-table details summary { cursor: pointer; font-weight: 600; } .sensor-table dl { margin: 6px 0; }
.why, .plain { padding-left: 18px; margin: 4px 0 8px; } .plain li { margin: 6px 0; }
.radar-wrap { position: relative; }
.radar { position: relative; width: 100%; aspect-ratio: auto; height: 440px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
.radar.dragging { cursor: grabbing; }
.radar-stage { position: absolute; inset: 0; }
.radar-base, .radar-layer, .radar-labels { position: absolute; inset: 0; } .radar-labels { pointer-events: none; }
.radar-stage img { position: absolute; display: block; max-width: none; }
.radar-layer { opacity: 0; transition: opacity .45s linear; pointer-events: none; } .radar-layer.on { opacity: .8; }
.radar-stage img.failed { visibility: hidden; }
.radar-stage img.fc { outline: 1px dashed var(--warn); outline-offset: -1px; }
.radar-home { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid var(--fg); background: var(--info); pointer-events: none; }
.radar-zoom { position: absolute; top: 10px; right: 10px; display: grid; gap: 6px; }
.radar-zoom button { width: 36px; height: 36px; font: inherit; font-size: 20px; line-height: 1; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.radar-zoom button:disabled { opacity: .4; cursor: default; }
.radar-ctl { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0; }
.radar-ctl button, .radar-ctl select { font: inherit; min-height: 36px; padding: 0 12px; color: var(--fg); background: var(--card2); border: 1px solid var(--line); border-radius: 8px; }
.radar-ctl button:disabled { opacity: .6; }
.radar-ctl input[type="range"] { flex: 1 1 200px; min-width: 120px; }
.radar-speed { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .forecast-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) { main.wide > .s4, main.wide > .s8 { grid-column: 1 / -1; } .topbar { grid-template-columns: 1fr auto; } .clock { display: none; } .radar { height: 340px; } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .radar-layer { transition: none; } }
#models .chart { max-width: 680px; } #forecast .chart { max-width: 760px; }

/* Admin > Users (rows, forms, status chips); 44px tap targets */
.subnav { display: flex; gap: 14px; margin: 0 0 12px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows .row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 44px; }
.row-link { display: flex; align-items: center; min-height: 44px; color: var(--fg); text-decoration: none; }
.row-main { font-weight: 600; }
.row-sub { color: var(--muted); font-size: .85rem; }
form.stack { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
form.inline { display: inline-flex; gap: 8px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.actions .button, .actions button, form.stack button { min-height: 44px; padding: 0 14px; }
.danger { border-color: var(--crit); color: var(--crit); }
.chip.user-active, .chip.user-ok { color: var(--ok); }
.chip.user-disabled, .chip.user-fail, .chip.user-refused { color: var(--crit); }
.chip.user-locked, .chip.user-other { color: var(--warn); }
.chip.user-role { color: var(--info); }

/* Detail drawer (right panel on desktop, bottom sheet on phones) */
[data-drawer][tabindex] { cursor: pointer; }
[data-drawer][tabindex]:focus-visible, .more:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.drawer-src { display: none; }
.drawer { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--card); color: var(--fg); border-left: 1px solid var(--line); padding: 16px; overflow-y: auto; }
.drawer[hidden], .drawer-back[hidden] { display: none; }
.drawer-back { position: fixed; z-index: 40; inset: 0; background: rgba(0, 0, 0, .45); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.drawer-head button, .more { min-height: 44px; min-width: 44px; padding: 0 14px; }
.drawer h4 { margin: 14px 0 4px; color: var(--muted); font-size: .85rem; }
.drawer .explain { color: var(--muted); }
.drawer dd { overflow-wrap: anywhere; }
@media (max-width: 640px) { .drawer { top: auto; left: 0; width: 100%; max-height: 80vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; } }

.banner { margin: 10px 16px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--crit); color: var(--fg); background: var(--wash); }
.banner-error strong { color: var(--crit); }
dl.kv dd.pre { grid-column: 1 / -1; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 6px; }
.alert-card header .more { margin-left: auto; }

/* forecast radar */
.radar-badge { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 6px; background: var(--card); border: 1px solid var(--warn); color: var(--warn); font-weight: 700; font-size: 13px; pointer-events: none; }
.forecast-note { margin: 8px 0; } .forecast-note .model { color: var(--warn); }
.legend-row { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 6px 0; font-size: 14px; color: var(--muted); }
.legend-row li { display: inline-flex; align-items: center; gap: 6px; } .swatch { width: 14px; height: 14px; }
.forecast-off { margin: 8px 0; }

/* UPS footer: slim bar at the bottom of every signed-in owner page; a tap opens the detail sheet (native <details>, no script) */
.ups-spacer { height: 52px; }
.ups-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; padding: 6px 8px; background: var(--card); border-top: 1px solid var(--line); }
.ups-tile { flex: 1 1 0; min-width: 0; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.ups-tile summary, div.ups-tile { display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px; cursor: pointer; list-style: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
div.ups-tile { cursor: default; }
.ups-tile summary::-webkit-details-marker { display: none; }
.ups-name { font-weight: 600; }
.ups-icon { flex: none; }
.ups-ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.ups-warn { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.ups-crit { border: 2px solid var(--crit); color: var(--crit); font-weight: 600; background: color-mix(in srgb, var(--crit) 18%, transparent); animation: ups-flash 1.2s ease-in-out infinite; }
.ups-stale, .ups-none { color: var(--muted); border-color: var(--line); background: transparent; }
@keyframes ups-flash { 50% { background: color-mix(in srgb, var(--crit) 38%, transparent); } }
@media (prefers-reduced-motion: reduce) { .ups-crit { animation: none; } }
.ups-sheet { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 4px); max-height: 70vh; overflow: auto; padding: 12px 14px; background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); white-space: normal; }
.ups-sheet h3 { margin: 0 0 6px; } .ups-sheet h4 { margin: 12px 0 4px; } .ups-main { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.ups-tile[open] > summary { font-weight: 600; }
@media print { .ups-bar, .ups-spacer { display: none; } }

/* wide screens (desktop, and the iPhone "Request Desktop Website" ~980px viewport): width breakpoints only, phone layout above is untouched */
@media (min-width: 900px) {
  main { max-width: 1760px; padding-left: 24px; padding-right: 24px; }      /* side margins reduced (the menu is a hamburger now): 24 px, content up to 1760 px; phone unchanged */
  main:not(.wide) .items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  main:not(.wide) .items > .item { margin: 0; }
  .ups-tile { flex: 0 1 320px; }
  .ups-sheet { right: auto; width: min(480px, calc(100vw - 16px)); }
  .ups-bar { justify-content: flex-start; }
}
@media (min-width: 1400px) {
  body { font-size: 17px; }
  main { max-width: 1760px; padding-left: 24px; padding-right: 24px; }
  main.wide { max-width: 1760px; }
  main:not(.wide) .items { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .ups-sheet { width: min(520px, calc(100vw - 16px)); }
  main.wide { grid-auto-flow: dense; }
  main.wide > .topbar, main.wide > .banner, main.wide > .kpis { order: -2; }
  main.wide > #radar { order: -1; grid-column: span 8; }
  main.wide > #alerts { grid-column: span 4; }
  main.wide > #radar .radar { height: 520px; }
}
@media (min-width: 900px) and (pointer: coarse) {
  .pager-btn, .tab, .el-btn, .toggle, .nav a, button { min-height: 44px; }
}

/* UPS sheet: obvious "open" state (CSS only; the open tile's summary carries the tap-to-close scrim) */
.ups-bar { --ups-h: 54px; }
.ups-ok { --ups-c: var(--ok); } .ups-warn { --ups-c: var(--warn); } .ups-crit { --ups-c: var(--crit); } .ups-stale, .ups-none { --ups-c: var(--muted); }
.ups-tile summary::before { content: "\25B4"; order: 9; margin-left: auto; padding-left: 6px; font-size: 12px; }
.ups-tile[open] > summary::before { content: "\25BE"; }
.ups-tile[open] > summary { background: color-mix(in srgb, var(--ups-c) 32%, var(--card)); border-radius: 7px; box-shadow: inset 0 0 0 2px var(--ups-c); font-weight: 700; }
.ups-tile[open] > summary::after { content: ""; position: fixed; left: 0; right: 0; top: 0; bottom: var(--ups-h); background: rgba(0, 0, 0, .6); z-index: 0; cursor: pointer; }
.ups-sheet { z-index: 1; bottom: 100%; left: 0; right: 0; border-radius: 16px 16px 0 0; border: 1px solid var(--line); border-top: 3px solid var(--ups-c, var(--line)); background: var(--card2);
  box-shadow: 0 -10px 32px rgba(0, 0, 0, .55); padding-top: 14px; max-height: calc(100vh - var(--ups-h) - 80px); }
.ups-sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--muted); opacity: .6; margin: 0 auto 10px; }
.ups-sheet h3 { font-size: 1.1rem; }
.ups-sheet .table-wrap { margin: 0 -4px; } .ups-sheet th, .ups-sheet td { padding: 4px 4px; font-size: 13px; text-align: left; vertical-align: top; }
body:has(.ups-tile[open]) { overflow: hidden; }
/* wide screens: every sheet opens directly above ITS OWN tile, left edge on the tile's left edge (the tile is the positioning box). UPS2's sheet is narrowed so it can never run past the right edge:
   its tile starts at bar-left (216px, 240px from 1400px) + 8px padding + 320px tile + 8px gap, and 8px is kept free on the right. */
@media (min-width: 900px) {
  .ups-tile { position: relative; }
  .ups-sheet { left: -2px; right: auto; bottom: calc(100% + 6px); }      /* -2px = the tile border, so the sheet edge lines up with the tile edge */
  .ups-tile + .ups-tile .ups-sheet { left: -2px; right: auto; width: min(480px, calc(100vw - 344px)); }
}
@media (min-width: 1400px) { .ups-tile + .ups-tile .ups-sheet { width: min(520px, calc(100vw - 344px)); } }
.ups-tile:not(.ups-none) { flex: 2 1 0; }
.ups-tile summary { padding: 0 8px; }
.ups-tile summary::before { padding-left: 2px; flex: none; }
body.ups-open { overflow: hidden; }
.ups-close { position: sticky; top: 0; float: right; width: 44px; height: 44px; margin: -8px -8px 0 8px; font-size: 20px; line-height: 1; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.ups-close:hover { background: var(--wash); }
/* nav groups (Technology, Admin): native <details>, no script */
.nav-group summary { display: flex; align-items: center; gap: 6px; padding: 11px 18px; color: var(--muted); cursor: pointer; list-style: none; border-left: 3px solid transparent; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: "\25BE"; margin-left: auto; font-size: 12px; }
.nav-group[open] > summary::after { content: "\25B4"; }
.nav-group summary:hover { background: var(--wash); color: var(--fg); }
.nav-group.active > summary { color: var(--fg); font-weight: 600; border-left-color: var(--info); }
.nav-group > a { padding-left: 34px; font-size: 14px; }
.nav-admin, .nav-system { font-size: 13px; opacity: .85; }

/* radar timeline: past 3 h | now | forecast, under the scrubber */
.radar-tl { position: relative; height: 22px; margin: 0 8px 6px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.radar-tl span { position: absolute; top: 4px; white-space: nowrap; }
.radar-tl .tl-start { transform: none; } .radar-tl .tl-end { transform: translateX(-100%); color: var(--warn); font-weight: 700; }
.radar-tl .tl-now { transform: translateX(-50%); color: var(--fg); font-weight: 700; }
.radar-tl .tl-now::before { content: ""; position: absolute; left: 50%; top: -9px; width: 2px; height: 8px; background: var(--fg); }
.radar-skip { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  .ups-spacer { height: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .ups-bar { padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
}

/* footer tiles: identical size for UPS1 and UPS2 in every state. Equal columns, fixed height, same border/padding/font; the state classes below only recolour. */
.ups-bar { --ups-h: 58px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ups-tile { box-sizing: border-box; height: 44px; min-width: 0; flex: none; border: 2px solid var(--line); border-radius: 8px; font-size: 15px; font-weight: 600; }
.ups-tile > summary, div.ups-tile { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; height: 100%; min-height: 0; padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ups-tile > summary::before { position: absolute; right: 8px; margin: 0; padding: 0; }
.ups-tile[open] > summary { font-weight: 600; }
.ups-name { overflow: hidden; text-overflow: ellipsis; }
.ups-q { font-weight: 700; }
.ups-ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.ups-warn { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.ups-crit { border-color: var(--crit); color: var(--crit); background: color-mix(in srgb, var(--crit) 18%, transparent); animation: ups-flash 1.2s ease-in-out infinite; }
.ups-stale, .ups-none { color: var(--muted); border-color: var(--line); background: transparent; }
@media (prefers-reduced-motion: reduce) { .ups-crit { animation: none; } }
@media (min-width: 900px) { .ups-bar { grid-template-columns: repeat(2, minmax(0, 320px)); } }
/* end footer tiles */

/* Today page: briefing text first, the Weather page's radar below it on a phone; text left, radar right from 900px */
.today-grid { display: block; }
.today-radar > #radar { margin: 12px 0 0; }
.today-text .items { margin: 0; }
.today-text .item.sev-info { border-left: 1px solid var(--line); padding-left: 19px; }      /* plain tile look; only Warning / Critical / Unknown keep the coloured bar */
.today-radar > #radar > h2, .today-text .item h3 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 6px; }      /* one heading style for Radar and the Today / Tomorrow / This week cards */
.radar-attr { font-size: 12px; margin: 4px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Interactive Today tiles and card titles: plain links with hover, keyboard focus and pressed states */
a.kpi.tile-link { color: inherit; text-decoration: none; cursor: pointer; transition: background .12s, border-color .12s; }
a.kpi.tile-link:hover { background: var(--card2); border-color: var(--info); }
a.kpi.tile-link:focus-visible, .item-link:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
a.kpi.tile-link:active { background: var(--card2); transform: translateY(1px); }
.item h3 .item-link { color: inherit; text-decoration: none; } .item h3 .item-link:hover { text-decoration: underline; }
@media (min-width: 900px) {
  main:not(.wide) .today-text .items { display: block; }
  main:not(.wide) .today-text .items > .item { margin: 14px 0; }
  .today-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }      /* the same two equal columns and 14 px gutter as the tiles above */
  section.today-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main:not(.wide) .today-text .items > .item:first-child { margin-top: 0; } main:not(.wide) .today-text .items > .item:last-child { margin-bottom: 0; }
  .today-radar > #radar { margin-top: 0; }
  .today-radar { display: flex; } .today-radar > #radar { flex: 1; display: flex; flex-direction: column; } .today-radar .radar-wrap { flex: 1; display: flex; min-height: 420px; }
  .today-radar .radar { height: auto; flex: 1; }      /* the map grows so the radar card ends level with the left column */
}
@media (min-width: 1400px) { .today-radar .radar-wrap { min-height: 560px; } }

/* pop-outs (Weather drawer and Network drawer): title, plain readings, one-line explanation, history; the technical block is one collapsed Details toggle */
.d-tech { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 6px; color: var(--muted); font-size: 14px; }
.d-tech > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; list-style: none; }
.d-tech > summary::-webkit-details-marker { display: none; }
.d-tech > summary::after { content: "\25BE"; margin-left: 6px; font-size: 12px; }
.d-tech[open] > summary::after { content: "\25B4"; }
.d-reading { font-weight: 600; margin: 4px 0; }
.alert-text ul { margin: 6px 0; padding-left: 20px; white-space: normal; } .project { margin: 18px 0 4px; color: var(--muted); font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.today-kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 12px 0 14px; }
@media (min-width: 900px) { section.today-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.warn { color: var(--warn); font-weight: 700; } .bad { color: var(--crit); font-weight: 700; }
.ih-spark { display: block; width: 100%; height: 22px; margin-top: 4px; }
.ih-spark-line { fill: none; stroke: var(--info); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.ih-speed { color: var(--muted, inherit); font-style: italic; }
.ih-st { fill: var(--info); opacity: .18; }
.ih-strip { display: block; width: 100%; height: 8px; margin: 2px 0 8px; border-bottom: 1px solid var(--line, #8884); }
.ih-speedline { margin: 2px 0 0; font-size: .9em; opacity: .85; }
/* Photos page: album cards, 320 px thumbnail grid, viewer (no inline styles; CSP style-src 'self') */
.album-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.album-card { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--card2); }
.album-card:hover { border-color: var(--info); }
.album-cover { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--wash); }
.album-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-text { display: flex; flex-direction: column; min-width: 0; color: var(--muted); font-size: 14px; } .album-text strong { color: var(--fg); font-size: 16px; }
.photo-grid { list-style: none; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.photo-grid a { display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--wash); border: 1px solid var(--line); }
.photo-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-wait { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }
.viewer { margin: 8px 0; text-align: center; } .viewer img { max-width: 100%; height: auto; max-height: 80vh; border-radius: 8px; background: var(--wash); }
.more { text-align: center; } .btn-link { display: inline-block; padding: 8px 18px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }

/* Schedule page: calendar dots (colour painted by schedule.js from data-color) */
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: #888; vertical-align: baseline; }
/* Schedule agenda: filter, 7-day strip, day sections, rows with person chips (colours painted by schedule.js) */
.ag-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; } .ag-filter[hidden] { display: none; }
.ag-f { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--fg); cursor: pointer; }
.ag-f[aria-pressed="true"] { background: var(--card2); border-color: var(--info); font-weight: 600; }
.ag-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 10px 0 16px; }
.ag-d { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 6px 1px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); text-decoration: none; min-height: 58px; }
.ag-today { border-color: var(--info); } .ag-wd { font-size: 12px; color: var(--muted); } .ag-n { font-weight: 600; font-size: 13px; white-space: nowrap; } .ag-dots { min-height: 12px; line-height: 12px; } .ag-dots .cal-dot { width: 7px; height: 7px; margin: 0 1px; }
.ag-c { display: block; font-size: 11px; line-height: 1.2; text-align: center; margin-top: 2px; overflow-wrap: anywhere; color: var(--muted); }
.ag-go { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; } .ag-go input[type=date] { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
.ag-gobtn, .ag-todaybtn { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--fg); text-decoration: none; cursor: pointer; }
.ag-nodata { margin: 14px 0; color: var(--muted); }
.ag-day[hidden], .ag-ev[hidden] { display: none; } .ag-day h2 { margin: 16px 0 6px; font-size: 16px; }
.ag-list { list-style: none; margin: 0; padding: 0; }
.ag-ev { display: flex; gap: 12px; padding: 8px 10px; margin: 6px 0; border: 1px solid var(--line); border-left: 5px solid #888; border-radius: 8px; background: var(--card); }
.ag-shared { border-left-style: double; border-left-width: 7px; }
.ag-time { flex: 0 0 88px; color: var(--muted); font-size: 14px; } .ag-dur { display: block; font-size: 13px; } .ag-main { flex: 1; min-width: 0; } .ag-title { display: block; overflow-wrap: anywhere; }
.ag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ag-chip { display: inline-flex; align-items: center; padding: 1px 9px 1px 6px; border: 1px solid #888; border-radius: 999px; font-size: 13px; }
.ag-chip .cal-dot { margin-right: 5px; } .ag-sharedtag { font-size: 12px; color: var(--muted); align-self: center; }
.ag-past { opacity: 0.55; } .ag-now, .ag-next { background: var(--card2); } .ag-now { outline: 2px solid var(--info); } .ag-next { outline: 1px dashed var(--info); }
.ag-dim { opacity: 0.5; } .ag-hw { background: var(--card2); font-weight: 600; }
.ag-empty { margin: 10px 0; }

/* Memories page: captions and place tiles (reuses the .photo-grid / .viewer rules above) */
.mem-section { margin: 18px 0; } .mem-section h2 a { color: inherit; text-decoration: none; }
.photo-grid li { min-width: 0; } .mem-cap { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.mem-tile { display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--wash); border: 1px solid var(--line); } .mem-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* NAS page */
.nas-ok { color: var(--ok); } .nas-warn { color: var(--warn); } .nas-crit { color: var(--crit); }
.nas-range { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; }
.nas-range h2 { margin: 0; font-size: 18px; } .nas-seg { margin: 0; display: flex; gap: 8px; }
.nas-on { border-color: var(--info); color: var(--info); font-weight: 650; }
.range-loading .chart, .range-loading .chart-card, .range-loading svg { opacity: .5; transition: opacity .15s; }      /* range.js: charts dim while the new range loads */
.range-note { margin: 6px 0 0; color: var(--warn, var(--fg)); font-size: 14px; }
.nas-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.nas-charts .chart-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.nas-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.nas-lg::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; background: currentColor; }
.nas-lg.line-0 { color: var(--l0); } .nas-lg.line-1 { color: var(--l1); } .nas-lg.line-2 { color: var(--l2); } .nas-lg.line-3 { color: var(--l3); }

.foot-link { position: absolute; right: 16px; top: 16px; font-size: 11px; color: var(--muted); text-decoration: none; }
@media (max-width: 560px) { .foot-link { position: static; display: block; text-align: right; margin-top: 6px; } }
.nav-group summary a.nav-land { color: inherit; text-decoration: none; flex: 1; padding: 0; border-left: 0; background: none; }      /* the summary already has the padding: no second indent or gap */

/* Schedule: Last week / This week / Next week (replaces the 7-day tiles) */
.ag-weeks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 10px 0; }
.ag-wk { text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--fg); text-decoration: none; font-size: 14px; }
.ag-wk[aria-current="page"] { border-color: var(--info); font-weight: 600; background: var(--wash); }

.ps-card { margin: 18px 0; } .ps-card h2 { margin: 0 0 4px; font-size: 18px; } .ps-card h3 { margin: 16px 0 6px; font-size: 15px; }
.ps-sub, .ps-note, .ps-none { margin: 4px 0; font-size: 12px; color: var(--muted); } .ps-total { margin: 6px 0; }
.ps-bar, .ps-years { display: block; width: 100%; max-width: 560px; } .ps-bar { height: 22px; border-radius: 4px; background: var(--line); }
.ps-c1 { fill: var(--l1); background: var(--l1); } .ps-c2 { fill: var(--l2); background: var(--l2); } .ps-c3 { fill: var(--l3); background: var(--l3); } .ps-c4 { fill: var(--l4); background: var(--l4); }
.ps-axis { font-size: 8px; fill: var(--muted); }
.ps-table { width: 100%; max-width: 560px; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.ps-table th, .ps-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; } .ps-table th:first-child { text-align: left; font-weight: 600; white-space: normal; }
.ps-key { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; }
.ps-more { margin-top: 8px; } .ps-more summary { cursor: pointer; color: var(--info); font-size: 13px; }
/* Mothership page: gaps, restarts, reference line, tap columns, programs */
.cam-rows { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.cam-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto auto; gap: 0 8px; align-items: center; padding: 1px 4px; border-radius: 6px; }
.kpis .cam-health { grid-column: span 2; } .cam-health > div { flex: 1 1 auto; min-width: 0; }
.cam-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.cam-online .cam-dot { background: #3fb950; } .cam-offline .cam-dot { background: #ff4d4f; }
.cam-offline { color: #ff4d4f; font-weight: 600; animation: cam-flash 1s ease-in-out infinite; }
.cam-bat, .cam-seen { color: var(--muted); font-variant-numeric: tabular-nums; } .cam-offline .cam-bat, .cam-offline .cam-seen { color: inherit; }
@keyframes cam-flash { 0%, 100% { background: transparent; } 50% { background: rgba(255, 77, 79, .22); } }
@media (prefers-reduced-motion: reduce) { .cam-offline { animation: none; background: rgba(255, 77, 79, .18); } }
.chart .gap { fill: var(--wash); stroke: var(--line); stroke-width: .5; } .chart .reboot { stroke: var(--l2); stroke-width: 1.2; stroke-dasharray: 3 3; }
.chart .ref { stroke: var(--crit); stroke-width: 1; stroke-dasharray: 4 3; } .chart .sel { stroke: var(--info); stroke-width: 1.4; }
.chart .pt.line-0 { fill: var(--l0); } .chart .pt.line-1 { fill: var(--l1); } .chart .pt.line-2 { fill: var(--l2); } .chart .pt.line-3 { fill: var(--l3); }
.chart .tap { fill: transparent; } .chart a:hover .tap, .chart a:focus .tap { fill: var(--band); }
.ms-ref::before { background: var(--crit); } .ms-notes ul { margin: 4px 0 4px; padding-left: 20px; } .ms-notes h2, .ms-prog h2 { font-size: 18px; margin: 18px 0 6px; }
.ms-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; } .ms-tables h3 { margin: 6px 0; font-size: 15px; }
.ms-table { width: 100%; border-collapse: collapse; font-size: 14px; } .ms-table td { padding: 5px 4px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.ms-table td.num { text-align: right; white-space: nowrap; color: var(--muted); } .ms-moments { flex-wrap: wrap; margin: 10px 0; } .ms-ranges { margin: 12px 0; }

/* Shared chart component (app/charts.py + static/charts.js): legend, line styles, tap-for-values readout */
.ls-1 { stroke-dasharray: 7 4; } .ls-2 { stroke-dasharray: 2 4; stroke-linecap: round; } .ls-3 { stroke-dasharray: 9 3 2 3; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 2px; padding: 0; font-size: 13px; color: var(--fg); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg-sw { width: 26px; height: 10px; flex: none; } .lg-sw .line { fill: none; stroke-width: 2.4; }
svg.chart[data-pts] { touch-action: pan-y; cursor: crosshair; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
svg.chart[data-pts]:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.chart .cursor { stroke: var(--fg); stroke-width: 1.2; opacity: 0; pointer-events: none; } .chart .cursor.on { opacity: .85; }
svg.spark-h[data-pts] { touch-action: pan-y; cursor: crosshair; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
svg.spark-h[data-pts]:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.spark-h .cursor { stroke: var(--fg); stroke-width: 1.5; vector-effect: non-scaling-stroke; opacity: 0; pointer-events: none; } .spark-h .cursor.on { opacity: .85; }
.rd-sw.ih-st { color: var(--info); border-top-width: 9px; opacity: .45; } .rd-sw.ih-none { display: none; }
.chart-read { margin: 4px 0 2px; font-size: 13px; line-height: 1.5; color: var(--muted); min-height: 3em; }
.chart-read .rd-t { display: block; color: var(--fg); }
.chart-read .rd-i { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; color: var(--fg); white-space: nowrap; }
.rd-sw { display: inline-block; width: 16px; height: 0; border-top: 3px solid currentColor; }
.rd-sw.ls-1 { border-top-style: dashed; } .rd-sw.ls-2 { border-top-style: dotted; } .rd-sw.ls-3 { border-top-style: double; }
.rd-sw.line-0 { color: var(--l0); } .rd-sw.line-1 { color: var(--l1); } .rd-sw.line-2 { color: var(--l2); } .rd-sw.line-3 { color: var(--l3); } .rd-sw.line-4 { color: var(--l4); }
.ms-gpu-name { margin: 14px 0 6px; font-size: 15px; font-weight: 600; }
/* One body text colour: sentences and notices (data source lines, outlook text, empty notes, explanations) use the headline's colour; grey is kept for small labels only (tile sub-lines, axis text, timestamps, tags, footer). */
.reason, .src, .day-cond, .empty, .notice-apps, .drawer .explain, .legend-row, .placeholder { color: var(--fg); }
.vlan-h { margin: 14px 0 4px; font-size: 15px; font-weight: 600; } .vlan-h:first-of-type { margin-top: 4px; } .vlan-n { font-weight: 400; color: var(--muted); }
.dhcp-table th, .dhcp-table td { padding: 6px 8px; }

/* Ask AI (shared, owner only): bottom sheet on a phone, side panel on a wide screen. */
.ask-btn { justify-self: end; align-self: center; background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font: inherit; min-height: 40px; cursor: pointer; }
.ask-btn[aria-expanded="true"] { border-color: var(--info); }
.ask-panel { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; max-height: 80vh; overflow-y: auto; background: var(--card); color: var(--fg); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 14px 16px 20px; box-shadow: 0 -8px 30px rgba(0, 0, 0, .45); }
.ask-panel[hidden] { display: none; }
.ask-head { display: flex; justify-content: space-between; align-items: center; }
.ask-head h2 { margin: 0; font-size: 1.1rem; }
.ask-close, .ask-go, .ask-chip { background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; font: inherit; cursor: pointer; }
.ask-close { padding: 6px 12px; min-height: 36px; }
.ask-go { padding: 10px 18px; min-height: 44px; border-color: var(--info); }
.ask-go:disabled { opacity: .55; }
.ask-scope, .ask-foot, .ask-msg { color: var(--muted); font-size: .85rem; margin: 6px 0; }
.ask-sugg { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ask-chip { padding: 8px 12px; min-height: 40px; text-align: left; }
.ask-form { display: grid; gap: 8px; margin: 8px 0; }
.ask-q { width: 100%; box-sizing: border-box; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; resize: vertical; }
.ask-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 10px; }
.ask-job { background: var(--wash); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ask-jq { margin: 0; overflow-wrap: anywhere; }
.ask-st { display: inline-block; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--info); margin-right: 6px; }
.ask-done .ask-st { color: var(--ok); }
.ask-failed .ask-st { color: var(--crit); }
.ask-ans { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .ask-panel { left: auto; top: 0; width: 380px; max-height: none; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0, 0, 0, .45); }
}
.act-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.act-more { margin-top: 8px; }
.act-more summary { cursor: pointer; min-height: 32px; }
.live-stamp { color: var(--muted); }
.live-stamp.live-stale { color: var(--warn, #e0a030); }
[data-panel][hidden], .tab-panel[hidden] { display: none; }      /* a hidden tab panel stays hidden even when it also has a display rule (chart-grid) */

/* Phone readability of the shared charts (NAS, Network Performance): bigger text, thicker lines, clear marker, wrapped legend, one-line caption */
.chart-cap { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.nas-charts .chart .line, .chart-card .chart .line { stroke-width: 3; }
.chart-card .chart-line { stroke-width: 3; }
.chart .axis, .chart-card .chart-lbl { font-size: 13px; }
.chart .cursor { stroke-width: 2.4; }
.chart-read { font-size: 14px; }
.chart-legend { font-size: 14px; }
.chart-card svg.chart[data-pts] { min-height: 200px; }
@media (max-width: 600px) {
  .chart-card svg.chart[data-pts] { min-height: 230px; }
  .nas-charts, .chart-grid { grid-template-columns: 1fr; }
}

/* WAN vs LAN bars on the Network activity card */
.wl { display: grid; gap: 8px; margin: 6px 0 10px; }
.wl-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; font-size: 14px; }
.wl-name { color: var(--muted); }
.wl-bar { width: 100%; height: 12px; accent-color: var(--info); }
.wl-txt { color: var(--fg); }

.nas-last { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
[data-range-panel][hidden] { display: none; }

/* Network page: the four boxed panels (summary, top talkers, WAN vs LAN, odd outbound) */
.np .np-vh { font-size: 1rem; margin: 10px 0 0; }
.np-state { margin: 2px 0 6px; }
.np-sum { margin: 4px 0; font-size: 16px; line-height: 1.5; }
.np-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.np-col h4 { margin: 4px 0; font-size: 14px; color: var(--muted); }
.np-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.np-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.np-name { font-weight: 600; overflow-wrap: anywhere; }
.np-bar { width: 100%; height: 10px; accent-color: var(--info); }
.np-txt { font-size: 14px; color: var(--fg); }
.np-big { margin: 6px 0 0; font-size: 28px; font-weight: 700; }
.np-spark { display: block; width: 100%; height: 64px; margin-top: 8px; }
.np-lan { fill: var(--info); } .np-wan { fill: var(--warn); }
.np-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
span.np-key.np-lan { background: var(--info); } span.np-key.np-wan { background: var(--warn); }
.np-odd { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.np-how { margin-top: 8px; }
@media (max-width: 600px) { .np-cols { grid-template-columns: minmax(0, 1fr); } }

.share-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.share-btn { font: inherit; min-height: 44px; min-width: 44px; padding: 0 16px; color: var(--fg); background: var(--card2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.share-btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.share-note { color: var(--muted); font-size: 14px; }
.share-ta { position: fixed; left: -9999px; top: 0; }

/* slide-out menu (owner 2026-11-08): one drawer at every width. No script needed: the button is a link to #menu and the drawer opens with :target;
   menu.js upgrades it (aria-expanded, Esc, focus trap, scroll lock). */
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: none; border-radius: 10px; border: 1px solid var(--line);
  background: none; color: var(--fg); cursor: pointer; text-decoration: none; padding: 0; font: inherit; }
.menu-btn:hover { background: var(--wash); }
.menu-btn .icon { width: 32px; height: 32px; stroke-width: 2.2; }
.menu-btn:focus-visible, .menu-drawer a:focus-visible, .menu-close:focus-visible, .menu-drawer summary:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.menu-wrap { position: fixed; inset: 0; z-index: 60; visibility: hidden; transition: visibility 0s linear .25s; }
.menu-wrap:target, .menu-wrap.open { visibility: visible; transition-delay: 0s; }
.menu-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .8); opacity: 0; transition: opacity .25s ease-out; }
.menu-wrap:target .menu-backdrop, .menu-wrap.open .menu-backdrop { opacity: 1; }
.menu-drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(340px, 85vw); display: flex; flex-direction: column; overflow-y: auto; background: var(--side);
  border-right: 1px solid var(--line); padding: 10px 0 16px; transform: translateX(-100%); transition: transform .25s ease-out; will-change: transform; }
.menu-wrap:target .menu-drawer, .menu-wrap.open .menu-drawer { transform: none; }
.menu-head { display: flex; align-items: center; gap: 8px; padding: 0 8px 10px 16px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head .brand { flex: 1 1 auto; }
.menu-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; font-size: 24px; line-height: 1; color: var(--fg); text-decoration: none; border-radius: 10px; color: var(--info); border: 1px solid var(--info); }
.menu-close:hover { background: var(--wash); }
.menu-drawer .nav a, .menu-drawer .nav-group summary { min-height: 48px; }
.menu-drawer .nav > a, .menu-drawer .nav-group > summary { background: var(--wash); border-bottom: 1px solid var(--line); color: var(--fg); }      /* accordion rows: full width, lightly tinted, thin dividers */
.menu-drawer .nav-group > a { border-bottom: 1px solid var(--line); }
.menu-drawer .nav a[aria-current] { background: var(--band); }
.menu-drawer .nav-group summary::after { content: ""; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .25s ease-out; }
.menu-drawer .nav-group[open] > summary::after { content: ""; transform: rotate(225deg); }      /* chevron turns over when the row is open */
.menu-drawer .nav-admin { font-size: inherit; opacity: 1; }      /* Admin looks like Technology inside the drawer */
.menu-more { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.menu-more .menu-link, .menu-signout .menu-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 18px; font: inherit; font-size: 15px; color: var(--muted); background: none; border: 0; text-decoration: none; cursor: pointer; text-align: left; }
.menu-more .menu-link:hover { background: var(--wash); color: var(--fg); }
.menu-ver { margin: 0; padding: 4px 18px 12px; font-size: 11px; color: var(--muted); opacity: .6; user-select: all; }
.menu-more .menu-link .icon { width: 20px; height: 20px; }
.menu-signout { margin: 0; }
html { scrollbar-gutter: stable; }      /* locking the page scroll never changes the page width: the drawer overlays, nothing reflows */
body.menu-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .menu-drawer, .menu-backdrop, .menu-wrap, .menu-drawer .nav-group summary::after { transition: none; } }

.nas-details { display: grid; gap: 14px; margin: 14px 0; } .nas-detail h2 { margin: 0 0 6px; font-size: 18px; } .nas-detail h3 { margin: 0 0 6px; font-size: 15px; }
.nas-kv, .nas-shares { list-style: none; margin: 4px 0; padding: 0; } .nas-bar { width: 100%; max-width: 360px; }
.nas-disk.nas-warn { outline: 2px solid var(--warn); } .nas-backup { border-left: 3px solid var(--info); padding-left: 6px; }

/* Shared full screen button (header, every page; static/menu.js). Kiosk view (no Fullscreen API, iPhone Safari): chrome hidden, the button stays to exit. */
.pg-fs { margin-left: auto; align-self: center; min-height: 36px; padding: 0 14px; background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; font: inherit; cursor: pointer; }
.pg-fs[hidden] { display: none; }
body.pg-full .top { position: static; }
body.pg-full .top .top-left, body.pg-full .menu-wrap, body.pg-full .ups-bar, body.pg-full .ups-spacer, body.pg-full footer { display: none !important; }
/* I-422 Set up this iPhone */
.setup-btn { display: inline-block; font: inherit; font-weight: 600; padding: 10px 18px; min-height: 44px; border-radius: 8px; border: 1px solid var(--fg); background: var(--fg); color: var(--bg); cursor: pointer; text-decoration: none; }
.setup-pw { font-size: 20px; word-break: break-all; user-select: all; }

/* I-434: Set up this iPhone, issued devices as stacked cards on phones */
.setup-cards { display: none; }
@media (max-width: 599px) {
  .setup-table { display: none; }
  .setup-cards { display: block; }
  .setup-dev { border: 1px solid var(--muted); border-radius: 10px; padding: 12px; margin: 0 0 10px; overflow-wrap: anywhere; }
  .setup-dev-meta { color: var(--muted); font-size: 14px; margin: 2px 0; }
  .setup-dev-act { margin-top: 10px; } .setup-dev-act form { margin: 0; }
  .setup-dev-act .setup-btn { display: flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; }
}

/* Admin > Project Status (I-455, renamed I-460): one card per project, phone-first */
.pu-card { overflow-wrap: anywhere; line-height: 1.55; } .pu-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.pu-goals { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; } .pu-goals .chip { font-size: .85rem; padding: 2px 10px; }
.pu-prog { display: flex; align-items: center; gap: 10px; } .pu-pct { font-weight: 600; min-width: 3em; text-align: right; }
.pu-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line); overflow: hidden; }
/* I-855: segmented bar = yellow (built) progress under green (proven) progress; legend text carries the meaning too */
.pu-seg { position: relative; flex: 1; height: 10px; display: block; } .pu-seg .pu-bar { position: absolute; left: 0; top: 0; width: 100%; background: transparent; border-color: transparent; }
.pu-seg .pu-yellow { border-color: var(--line); background: var(--wash); } .pu-seg .pu-yellow::-webkit-progress-value { background: var(--warn); } .pu-seg .pu-yellow::-moz-progress-bar { background: var(--warn); }
.pu-seg .pu-green::-webkit-progress-value { background: var(--ok); } .pu-seg .pu-green::-moz-progress-bar { background: var(--ok); } .pu-seg .pu-green::-webkit-progress-bar { background: transparent; }
.pu-legend { display: block; font-size: 0.8em; }
.pu-bar { -webkit-appearance: none; appearance: none; display: block; } .pu-bar::-webkit-progress-bar { background: var(--wash); border-radius: 999px; } .pu-bar::-webkit-progress-value { background: var(--info); border-radius: 999px; } .pu-bar::-moz-progress-bar { background: var(--info); border-radius: 999px; }   /* I-460: <progress>, no inline width (CSP) */
.pu-meta { margin: 6px 0 14px; }
.pu-sec { margin: 0 0 16px; } .pu-sec:last-child { margin-bottom: 0; } .pu-sec h4 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pu-sec p { margin: 0 0 10px; }

/* I-723: Project Status cards fold; summary = name + progress, chevron right */
.pu-card > summary { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; list-style: none; min-height: 48px; }
.pu-card > summary::-webkit-details-marker { display: none; }
.pu-card > summary::after { content: ""; flex: none; margin: 8px 2px 0 0; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.pu-card[open] > summary::after { transform: rotate(-135deg); }
.pu-hd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pu-hd h3 { margin: 0; }
.pu-body { padding-top: 12px; }
.pu-hd .pu-goals { margin: 0; } .pu-hd .pu-meta { display: block; margin: 0; }   /* I-723: chips + status line live in the folded summary */

/* I-726: Completed section at the bottom of Project Status */
.pu-done-h { margin: 28px 0 12px; font-size: 1.1rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pu-done-h .pu-n { font-size: .85rem; padding: 1px 10px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line); color: var(--fg); }
/* I-881: Items list inside an opened Project Status card; scrolls inside the card, chips match the board legend */
.pu-fold > summary { cursor: pointer; list-style: none; } .pu-fold > summary::-webkit-details-marker { display: none; }
.pu-items { list-style: disc; margin: 0; padding: 0 0 0 20px; max-height: 60vh; overflow-y: auto; }
.pu-item { margin: 0 0 10px; overflow-wrap: anywhere; } .pu-itext { margin: 2px 0 0; color: var(--muted); }
.pu-item .bd-chip { display: inline-block; font-size: .8rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--wash); white-space: nowrap; }
.pu-item .bd-chip::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pu-item .bd-c-proven::before { background: var(--ok); } .pu-item .bd-c-built::before { background: var(--warn); } .pu-item .bd-c-todo::before { background: #4b5563; }
