/* Portal-only additions.
 *
 * app.css is the box's design system, copied verbatim and never edited here.
 * This file holds the few things the portal needs that the local UI has no
 * equivalent for - chips for scalar lists, compact nested tables, and a
 * success note. Keep it small: anything reusable belongs in app/server.py.
 */

/* Scalar lists (IP addresses, capabilities). Without these, values render
   run together - "192.168.100.121/24fe80::6a1d..." reads as one string. */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  border: 1px solid rgba(15, 23, 42, .08);
  font-size: 12.5px; font-weight: 700; color: #0f172a;
  white-space: nowrap;
}

/* Nested tables inside a status panel: tighter than the page-level table,
   and allowed to be narrower than the 860px minimum. */
table.mini { min-width: 0; font-size: 12.5px; }
table.mini th, table.mini td { padding: 8px 10px; }

.ok-note {
  background: rgba(52, 199, 89, .12);
  border: 1px solid rgba(52, 199, 89, .28);
  color: #1c6b31; font-weight: 800;
  padding: 11px 14px; border-radius: 15px; margin-bottom: 14px;
}
.warn-note {
  background: rgba(255, 149, 0, .12);
  border: 1px solid rgba(255, 149, 0, .30);
  color: #8a5200; font-weight: 800;
  padding: 11px 14px; border-radius: 15px; margin-bottom: 14px;
}

/* Two-up layouts collapse on narrow screens. The design system's quickGrid
   already does this at 900px; this keeps nested cards from inheriting an
   awkward inner margin when they stack. */
@media (max-width: 900px) {
  .quickGrid > .card { margin-bottom: 0; }
}

/* Tables inside a two-up column must not force the page to scroll sideways. */
.quickGrid table { min-width: 0; }
.quickGrid .tablewrap { max-width: 100%; }

/* Channel picker on the portal's remote page.
 *
 * Deliberately NOT .quickChannels: that class belongs to the box's fullscreen
 * remote, where a media query hides it on short screens so the keypad stays
 * reachable. Here the channels have their own card and must always show, so
 * reusing the class inherited a rule written for a different layout - which is
 * exactly why it rendered as an empty card.
 */
.portalChannels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.portalChannels .channelChip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 52px; cursor: pointer;
}
.portalChannels .channelChip small { color: var(--muted); font-weight: 800; }

/* Long URLs under a QR must wrap inside their card rather than overflow it. */
.qrCard code {
  display: block; word-break: break-all; white-space: normal; line-height: 1.5;
}

/* Output route selection.
 *
 * Four cards rather than a dropdown: these are distinct signal paths with
 * different consequences, and a select box hides that. Matches how the box's
 * own Audio page presents them.
 */
.outputCard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: left; cursor: pointer; min-height: 92px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.outputCard:hover { transform: translateY(-1px); }
.outputCard.selected {
  border-color: rgba(0, 122, 255, .55);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .14), var(--shadow2);
  background: rgba(0, 122, 255, .06);
}

/* Tables nested inside a two-up column must not force sideways scrolling. */
.quickGrid table.mini { min-width: 0; }

/* ---------------------------------------------------------------- IR page */

/* A capped, internally scrolling table.
 *
 * A box with twenty bound keys produced a card over 1300px tall, which pushed
 * everything below it off the page. Capping the body and letting it scroll
 * inside keeps the card a fixed, predictable size no matter how many keys a
 * particular handset has. The header stays put so the columns stay readable
 * while scrolling.
 */
.scrollTable { max-height: 340px; overflow-y: auto; }
.scrollTable table.mini thead th {
  position: sticky; top: 0; z-index: 1;
  background: #fff;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, .10);
}
.scrollTable table.mini td { vertical-align: middle; }
.scrollTable select { width: 100%; min-width: 0; }

/* Row buttons sit on one line and never wrap a row to double height. */
.rowActions {
  white-space: nowrap; text-align: right;
}
.rowActions .btn { margin-left: 6px; }

.filterRow {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 12px;
}
.filterRow input {
  flex: 1 1 auto; min-width: 0;
}
.filterRow .muted { white-space: nowrap; font-size: 12.5px; font-weight: 700; }

/* Keys captured during a learning session.
 *
 * Mapping a handset means pressing twenty buttons. Showing only the most
 * recent one forces a stop-start rhythm; keeping the last few visible lets
 * someone press through the remote and bind at their own pace.
 */
.captureList { display: flex; flex-wrap: wrap; gap: 8px; }
.captureItem {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 12px; cursor: pointer;
  background: rgba(15, 23, 42, .04);
  border: 1px solid rgba(15, 23, 42, .10);
  font: inherit; color: inherit;
}
.captureItem:hover { background: rgba(15, 23, 42, .07); }
.captureItem.selected {
  border-color: rgba(0, 122, 255, .55);
  background: rgba(0, 122, 255, .08);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .12);
}
.captureItem code { font-weight: 800; }

/* Supporting detail under a form: quiet, dense, and aligned. */
.factList {
  display: grid; grid-template-columns: auto 1fr;
  gap: 7px 16px; margin: 16px 0 0;
  font-size: 13px; align-items: baseline;
}
.factList dt {
  color: var(--muted); font-weight: 850;
  text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px;
  white-space: nowrap;
}
.factList dd { margin: 0; font-weight: 800; color: #0f172a; overflow-wrap: anywhere; }

/* Volume slider on the Audio page. */
.sliderRow { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.sliderRow input[type="range"] {
  flex: 1 1 auto; min-width: 0; min-height: 0; padding: 0;
  height: 8px; border-radius: 999px; border: 0;
  background: rgba(15, 23, 42, .12); box-shadow: none;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.sliderRow input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #0a84ff, #0066d6);
  box-shadow: 0 4px 12px rgba(0, 122, 255, .35); cursor: pointer;
}
.sliderRow input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, #0a84ff, #0066d6); cursor: pointer;
}
.sliderValue {
  font-size: 22px; font-weight: 950; letter-spacing: -.03em;
  color: #0f172a; min-width: 68px; text-align: right;
}

/* A filter that lives in a card header rather than taking a row of its own. */
.inlineFilter {
  width: auto; min-width: 200px; min-height: 38px;
  padding: 8px 14px; font-size: 13px; border-radius: 999px;
}

/* Channel pickers grow with the fleet's channel count; cap and scroll them
   so one bulk-generate cannot make a card taller than the screen. */
.chanScroll { max-height: 300px; overflow-y: auto; padding-right: 4px; }
.portalChannels .channel { padding: 10px; border-radius: 14px; }
.portalChannels .channel b { font-size: 14px; }
.portalChannels .channel.selected {
  border-color: rgba(0, 122, 255, .55);
  background: rgba(0, 122, 255, .08);
}

/* A usage bar under a stat card. Percentages are easier to read as a length
   than as a number, and the colour already carries the warning. */
.meter {
  margin-top: 8px; height: 6px; border-radius: 999px;
  background: rgba(15, 23, 42, .10); overflow: hidden;
}
.meter span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #0a84ff, #0066d6);
}
.statcard .value.numWarn ~ .meter span {
  background: linear-gradient(90deg, #ffb340, #ff9500);
}
.statcard .value.numBad ~ .meter span {
  background: linear-gradient(90deg, #ff6961, #d70015);
}

/* Statistics page.
 *
 * "not reported" is deliberately quiet and italic: it is the absence of a
 * measurement, and it must not be mistaken at a glance for a value. The unit
 * is smaller than the number so a row of figures stays scannable.
 */
.notReported {
  font-size: 14px; font-weight: 700; font-style: italic;
  color: var(--muted); letter-spacing: 0;
}
.statUnit {
  font-size: 13px; font-weight: 800; color: var(--muted);
  margin-left: 3px; letter-spacing: 0;
}

/* Statistics tiles.
 *
 * .statcard is sized for a headline number: 92px tall, 23px value. Used for
 * a dozen readings it produced a wall of near-empty boxes, and one long
 * string - "hevc (HEVC (High Efficiency Video Coding))" - wrapped to five
 * lines and dragged its whole row with it.
 *
 * A reading is not a headline. These fit many to a row, stay one line, and
 * keep the full text available on hover rather than in the layout.
 */
.statTiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
.statTile {
  min-width: 0;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .70);
  border: 1px solid rgba(15, 23, 42, .08);
;height:100%}
.statTileLabel {
  color: var(--muted);
  font-size: 10.5px; font-weight: 850;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.statTileValue {
  font-size: 18px; font-weight: 900; letter-spacing: -.02em;
  color: #0f172a; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.statTileNote {
  color: var(--muted); font-size: 10.5px; font-weight: 700;
  margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.statTile .notReported { font-size: 13px; }
.statTile .statUnit { font-size: 11.5px; }
.statTile .meter { margin-top: 6px; height: 5px; }

@media (max-width: 640px) {
  .statTiles { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .statTileValue { font-size: 16px; }
}

/* ------------------------------------------------------- IR mapping grid */

/* Action-first mapping.
 *
 * The old page listed Linux key names and asked which action each should
 * perform. Nobody knows what their remote calls its buttons, and KEY_KPENTER
 * is not a thing anyone should have to learn. These tiles list the FUNCTIONS
 * a set-top box has, and you press the button for each.
 *
 * Sized for scanning, not for reading. There are twenty-six of them, so a
 * tile that looks generous on its own becomes a wall: the hint text is the
 * first casualty, moved to a tooltip, and the buttons share one row instead
 * of wrapping onto three.
 */
.mapGroup { margin-bottom: 14px; }
.mapGroup .sectionTitle { margin-bottom: 7px; }
.mapGroup .sectionTitle h3 {
  margin: 0; font-size: 11.5px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.mapGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 8px;
}
.mapTile {
  min-width: 0; padding: 10px 11px; border-radius: 13px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(15, 23, 42, .09);
  display: flex; flex-direction: column; gap: 7px;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.mapTile.bound { background: rgba(52, 199, 89, .06); }
/* The tile being learned has to be findable at a glance from across a cabin:
   the person's eyes are on the remote, not the screen. */
.mapTile.learning {
  border-color: rgba(0, 122, 255, .60);
  background: rgba(0, 122, 255, .09);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .16);
}
.mapLabel {
  font-weight: 900; font-size: 13px; color: #0f172a; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mapKeys {
  display: flex; flex-wrap: wrap; gap: 4px; min-height: 20px; align-items: center;
}
.mapKeys .chip {
  font-size: 10.5px; padding: 2px 7px; font-weight: 800;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.mapKeys .notReported { font-size: 11.5px; }
/* One row, aligned, never wrapping to three. */
.mapActions { display: flex; gap: 5px; margin-top: auto; }
.mapActions .btn {
  flex: 1 1 0; min-width: 0; min-height: 28px;
  padding: 5px 6px; font-size: 11px; border-radius: 9px;
  box-shadow: none; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.mapActions .btn:hover { transform: none; box-shadow: none; }
/* The hint lives in the tooltip. Twenty-six paragraphs of guidance turned a
   grid into a page of prose. */
.mapHint { display: none; }

@media (max-width: 640px) {
  .mapGrid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
}

/* A key this remote has actually sent, as opposed to a default alias it can
   never produce. Both are real bindings; only one is relevant in the room. */
.mapKeys .chip.liveKey {
  background: rgba(52, 199, 89, .16);
  border-color: rgba(52, 199, 89, .32);
  color: #1c6b31;
}
.mapKeys .chip.muted { opacity: .55; font-weight: 700; }

/* Transient messages.
 *
 * busy() replaces the whole panel, which is right while a tab loads and badly
 * wrong for an action taken from inside one: pressing Test on a key-map tile
 * blanked the entire tab and left "Sending menu..." on screen. A toast sits
 * above the content, so whatever was being looked at is still there when it
 * fades.
 */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 60; max-width: min(560px, 92vw);
  padding: 12px 20px; border-radius: 999px;
  background: rgba(15, 23, 42, .93); color: #fff;
  font-weight: 850; font-size: 13.5px; letter-spacing: -.01em;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .30);
  opacity: 0; transition: opacity .22s ease;
  pointer-events: none; text-align: center;
}
#toast.bad { background: rgba(215, 0, 21, .95); }

/* A hop where loss is real, as opposed to a router rate-limiting its own
   replies. The distinction is the entire value of the analysis, so it is
   marked in the row rather than left in a column someone might not read. */
tr.lossHop td { background: rgba(255, 59, 48, .07); }
tr.lossHop td:first-child { box-shadow: inset 3px 0 0 rgba(215, 0, 21, .8); }
/* The .deployNote banner's rules lived here. Removing the banner in favour of
   the header chip took the three SELECTOR lines and left their declaration
   bodies behind - three orphaned blocks and three stray closing braces, which
   a browser skips by discarding tokens until it finds its footing again. Two
   tests checked that the class was gone from the PAGE; nobody checked the
   stylesheet, so this shipped. */

/* Instrument panel - byte-identical rules to the box page, so a metric
   looks the same on both surfaces. */
/* Two tiers, the way a monitoring surface works.
Forty identical tiles read as a toy and, worse, forty green bars made
the one amber invisible. Healthy is PLAIN here: neutral rows, no
green anything. Colour appears only where attention is needed, so a
problem is the only coloured thing on a calm page. */

/* Tier 1: the at-a-glance verdict. Six, compact. */
.kpiStrip{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;
margin:0 0 16px}
@media(max-width:1100px){.kpiStrip{grid-template-columns:repeat(3,1fr)}}
@media(max-width:620px){.kpiStrip{grid-template-columns:repeat(2,1fr)}}
.kpi{background:var(--card);border:1px solid rgba(15,23,42,.09);
border-radius:12px;padding:8px 11px;min-height:52px;cursor:pointer;
display:flex;flex-direction:column;justify-content:center}
.kpi .kLabel{font-size:10px;font-weight:850;letter-spacing:.06em;
text-transform:uppercase;color:var(--muted);margin-bottom:2px;
white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kpi .kVal{font-size:20px;font-weight:900;letter-spacing:-.02em;
line-height:1.1;font-variant-numeric:tabular-nums;color:#0f172a;
white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kpi .kUnit{font-size:10px;font-weight:700;color:var(--muted);
margin-left:3px}
.kpi.warn{border-color:rgba(255,149,0,.5);background:rgba(255,149,0,.07)}
.kpi.bad{border-color:rgba(255,59,48,.5);background:rgba(255,59,48,.07)}
.kpi.warn .kVal{color:#8a5d0d} .kpi.bad .kVal{color:#b3261e}
.kpi.na .kVal{color:var(--muted);font-style:italic;font-size:14px}

/* Tier 2: dense grouped tables, packed into columns so the whole page
fits one screen. The old layout was three screens tall. */
.mCols{column-count:4;column-gap:14px}
@media(max-width:1500px){.mCols{column-count:3}}
@media(max-width:1150px){.mCols{column-count:2}}
@media(max-width:760px){.mCols{column-count:1}}
.mGroup{break-inside:avoid;page-break-inside:avoid;display:inline-block;
width:100%;background:var(--card);border:1px solid rgba(15,23,42,.09);
border-radius:12px;padding:9px 11px 5px;margin:0 0 12px}
.mGroupHead{display:flex;align-items:center;gap:7px;margin:0 0 5px}
.mGroupHead h2{margin:0;font-size:11px;font-weight:900;
letter-spacing:.07em;text-transform:uppercase;color:#334155}
.mTable{width:100%;min-width:0;border-collapse:collapse;font-size:12.5px}
.mTable tr{height:29px;border-top:1px solid rgba(15,23,42,.05)}
.mTable tr:first-child{border-top:0}
.mTable td{padding:0;border:0;vertical-align:middle}
.mK{font-size:10.5px;font-weight:800;letter-spacing:.03em;
text-transform:uppercase;color:var(--muted);white-space:nowrap;
overflow:hidden;text-overflow:ellipsis;max-width:1px;width:60%}
.mV{text-align:right;font-variant-numeric:tabular-nums;font-weight:800;
color:#0f172a;white-space:nowrap}
.mU{font-size:10px;font-weight:700;color:var(--muted);margin-left:3px}
.mRow{cursor:pointer}
.mRow:hover{background:rgba(15,23,42,.035)}
.mRow.warn .mV{color:#8a5d0d}
.mRow.bad .mV{color:#b3261e}
.mRow.na .mV{color:var(--muted);font-style:italic;font-weight:700}

/* A dot only where attention is needed. Green lives on the group
header and nowhere else. */
.dot{display:inline-block;width:6px;height:6px;border-radius:50%;
margin-right:5px;vertical-align:middle}
.dot.warn{background:#ff9500} .dot.bad{background:#ff3b30}
.gdot{display:inline-block;width:7px;height:7px;border-radius:50%;
background:rgba(15,23,42,.16);flex:none}
.gdot.good{background:#34c759} .gdot.warn{background:#ff9500}
.gdot.bad{background:#ff3b30}

/* The description, revealed by clicking a row. */
.mDescRow td{padding:6px 2px 8px;font-size:11.5px;line-height:1.45;
color:var(--muted);font-weight:600;white-space:normal;text-align:left}
.attnChip{cursor:pointer;border:0;font:inherit}

/* --------------------------------------------------------------- header chips
   A warning belongs beside the brand, not above the content. As a full-width
   banner the deploy-skew note pushed the device header down the page on every
   view, for a condition that is usually a build in flight. */
.chipWrap { position: relative; display: inline-flex; align-items: center; margin-right: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .01em;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(148,163,184,.12); color: var(--fg, #0f172a);
}
.chip:hover { border-color: rgba(148,163,184,.6); }
.chip:focus-visible { outline: 2px solid var(--gold, #d4a017); outline-offset: 2px; }
.chipDot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex: 0 0 auto; }
.chip.warn { background: rgba(217,160,23,.14); border-color: rgba(217,160,23,.45); }
.chip.warn .chipDot { background: #d9a017; }
.chip.bad  { background: rgba(220,38,38,.14);  border-color: rgba(220,38,38,.45); }
.chip.bad  .chipDot { background: #dc2626; }

/* Overlays, never reflows: opening the detail must not move the page either. */
.chipPanel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: min(420px, 78vw); text-align: left;
  padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  background: var(--card, #fff); color: var(--fg, #0f172a);
  border: 1px solid rgba(148,163,184,.35);
  box-shadow: 0 10px 30px rgba(15,23,42,.18);
}
.chipPanel[hidden] { display: none; }
.chipPanel code { font-size: 12px; }
.chipClose {
  display: block; margin-top: 10px; font: inherit; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(148,163,184,.4); background: transparent; color: inherit;
}

/* ------------------------------------------------------- compact status rows
   The Fleet Reporting card was a heading, a state line and two paragraphs of
   prose - five lines explaining a single boolean, above the tabs somebody
   opened the page to reach. Values and small labels; the explanation lives
   behind the info button. */
.statRow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 0 0 12px; padding: 8px 12px; border-radius: 10px;
  background: var(--card, #fff); border: 1px solid rgba(148,163,184,.25);
}
.statChip {
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(148,163,184,.16); border: 1px solid rgba(148,163,184,.3);
}
.statChip.ok    { background: rgba(22,163,74,.14);  border-color: rgba(22,163,74,.4); }
.statChip.quiet { background: rgba(217,160,23,.14); border-color: rgba(217,160,23,.42); }
.statFact { display: inline-flex; align-items: center; gap: 6px;
             font-size: 12.5px; opacity: .85; white-space: nowrap; }
.chipInfo {
  width: 20px; height: 20px; padding: 0; border-radius: 50%; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; line-height: 1;
  border: 1px solid rgba(148,163,184,.45); background: transparent; color: inherit;
}
.chipInfo:hover { border-color: rgba(148,163,184,.8); }
.chipWrap .chipPanel { left: auto; right: auto; }
.statRow .chipWrap { margin-right: 0; margin-left: auto; }
.statRow .chipPanel { right: 0; }

/* The portal's own commit: a footer fact, not a header alarm. */
.portalFoot {
  margin: 22px 2px 8px; font-size: 11.5px; opacity: .55; text-align: right;
}

/* Update progress: one line, and honest about what it knows. */
.updateResult { margin: 0 0 10px; font-size: 12.5px; min-height: 0; }
.updateResult:empty { display: none; }
.updateResult.ok  { color: #16a34a; font-weight: 600; }
.updateResult.bad { color: #dc2626; font-weight: 600; }
.hostSel { font: inherit; font-size: 12px; padding: 2px 6px; border-radius: 6px;
           max-width: 230px; text-overflow: ellipsis;
           border: 1px solid rgba(148,163,184,.4); background: transparent; color: inherit; }

/* The brand is a link home. It looked like one and was not, on pages whose
   only other anchors were Hosts, Install and Sign out - so anyone who followed
   a link into them was stuck. */
.brandLink { text-decoration: none; color: inherit; }
.brandLink:hover .brand { opacity: .82; }
.brandLink:focus-visible { outline: 2px solid var(--gold, #d4a017); outline-offset: 3px; border-radius: 6px; }

/* Lineup assignment and preview */
.pkgPick { margin: 6px 0 12px; }
.pkgList { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.pkgOpt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
          white-space: nowrap; }
/* The admin theme sizes bare inputs to fill their container, which stretched a
   checkbox next to a wrapping label into a large blue square. */
.pkgOpt input[type="checkbox"] {
  width: 15px; height: 15px; min-width: 15px; margin: 0; flex: 0 0 auto;
}
.lineupBad { color: #dc2626; font-size: 12.5px; font-weight: 600; }

/* "playing" is not an answer on its own - playing what? The channel sits under
   the Status card, where it is the second thing read rather than a hunt. */
.kSub { margin-top: 2px; font-size: 11.5px; font-weight: 600; opacity: .65;
        letter-spacing: .01em; }

/* Catalogue and packages */
.filterRow { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; margin: 10px 0 14px; }
.filterRow label { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
                   font-weight: 700; color: var(--muted, #64748b); }
.filterRow select, .filterRow input { min-width: 160px; }
.pkgCard { border: 1px solid rgba(148,163,184,.25); border-radius: 14px;
           padding: 12px 14px; margin: 0 0 12px; background: var(--card, #fff); }
.pkgChans { margin: 8px 0; padding-left: 22px; }
.pkgChans li { padding: 4px 0; font-size: 13px; display: flex; align-items: center;
               gap: 8px; }
/* Order is what the device receives, so the controls that change it sit on the
   row they act on rather than in a separate mode. */
.pkgOps { margin-left: auto; display: inline-flex; gap: 6px; }
.pkgOps .btn { min-width: 34px; }
.pkgTestLbl { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pkgTestLbl input[type="checkbox"] { width: 15px; height: 15px; min-width: 15px;
                                     margin: 0; flex: 0 0 auto; }

/* .mini set only font-size, so every "mini" button kept .btn's 46px height and
   its drop shadow. In a twelve-row table that made Delete the loudest thing on
   the page and pushed each row to twice the height it needed. */
.btn.mini {
  min-height: 30px; padding: 5px 11px; border-radius: 10px;
  font-size: 12px; font-weight: 800; box-shadow: none;
}
.btn.mini:hover { transform: none; box-shadow: 0 2px 8px rgba(15,23,42,.14); }
/* A destructive action in a list should be findable, not shouted. The colour
   still says what it is; the weight no longer competes with the data. */
td .btn.mini.red, .pkgOps .btn.red {
  background: transparent; color: #dc2626;
  border: 1px solid rgba(220,38,38,.45);
}
td .btn.mini.red:hover, .pkgOps .btn.red:hover { background: rgba(220,38,38,.08); }
/* The checkbox and its caption are two things, not one wrapping label. */
.pkgTestBox { display: flex; flex-direction: column; gap: 4px; }
.pkgTestBox .pkgTestLbl { white-space: nowrap; font-weight: 600; }
.pkgTestBox .mini { line-height: 1.35; }
.overrideNote { padding: 8px 12px; border-radius: 10px; margin: 0 0 10px;
                background: rgba(217,160,23,.10); border: 1px solid rgba(217,160,23,.35); }

/* The device page's Now-playing header. Provenance is the point of the view,
   so it reads as a statement, not as a caption under the table. */
.nowFrom { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: #1f2937; }
.nowFrom b { color: #0f172a; }
.advBox > summary.advHead {
  cursor: pointer; font-weight: 800; font-size: 13px; color: #64748b;
  letter-spacing: .02em; list-style: none; display: flex; align-items: center; gap: 7px;
}
.advBox > summary.advHead::-webkit-details-marker { display: none; }
.advBox > summary.advHead::before { content: "\25B8"; font-size: 11px; transition: transform .15s ease; }
.advBox[open] > summary.advHead::before { transform: rotate(90deg); }
.advBox[open] > summary.advHead { color: #dc2626; }


/* ==========================================================================
   FLAT NOC LAYER
   ==========================================================================
   The portal borrowed the box's local admin theme wholesale: a radial-gradient
   page, translucent cards, 18px blur, 24px radii, 46px controls. That reads as
   a consumer app. This is an operations console - somebody scans it to find
   the one aircraft that is wrong, and every pixel of decoration is a pixel not
   spent on a row.

   THE TINTED CARDS WERE NEVER TINTED. --card is rgba(255,255,255,.78) and the
   body carries two radial gradients, so each card picked up whatever wash was
   behind it - the four KPI boxes shaded blue, white, white, gold purely by
   x-position. So the fix is two tokens and one background, not a per-card
   patch: opaque cards on a solid ground, and the "tints" have nowhere to come
   from.

   WHY THIS IS AN OVERRIDE LAYER AND NOT AN EDIT. portal/static/app.css is
   GENERATED - tools/extract_css.py lifts it from app/server.py so the box page
   and the portal share one system. Editing it by hand loses the change on the
   next extract, and editing app/server.py would re-style the box's own web UI,
   which nobody asked for. Portal-only decisions live in portal-only CSS.
   ========================================================================== */

:root {
  --surface-0: #eef1f6;   /* page ground */
  --surface-1: #ffffff;   /* cards, opaque */
  --surface-2: #f6f8fb;   /* table heads, strips */
  --line:      #dde3ec;   /* hairline */
  --line-soft: #e9edf3;
  --ink:       #0f172a;
  --muted:     #64748b;
  --dim:       #8a94a6;   /* diagnostic columns */
  --ok:        #15803d;
  --warn:      #b45309;
  --bad:       #b91c1c;
  --idle:      #94a3b8;
  --accent:    #0a6ed1;
  --r:         8px;

  /* Retune the inherited system at the token level. */
  --card: #ffffff;
  --shadow: none;
  --shadow2: none;
  --blur: none;
}

html, body { background: var(--surface-0); }
body {
  background-image: none;           /* the two radial gradients, gone */
  font-size: 14px;
  color: var(--ink);
}

/* --- One card treatment. Hairline, opaque, no wash, no lift. ------------- */
.card, .proPanel, .adminContent {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 14px 16px;
}
.card:hover { box-shadow: none; }
.wrap { max-width: 1560px; padding: 14px 20px 28px; }

h1 { font-size: 19px; letter-spacing: -.02em; margin: 0 0 10px; }
h2 { font-size: 15px; letter-spacing: -.01em; margin: 0 0 10px; }
/* NOT uppercase. h3 also carries the package NAME on the packages page, and
   a display rule that rewrites "Economy10" as "ECONOMY10" is changing what
   somebody typed. Static section labels opt IN with .formHead. */
h3 { font-size: 13.5px; letter-spacing: -.01em; margin: 18px 0 8px; color: var(--ink);
     font-weight: 800; }
.formHead { font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
            color: var(--muted); font-weight: 800; margin: 16px 0 8px; }

/* --- Header: two groups, not eight equal pills. -------------------------- */
.top {
  background: var(--surface-1);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  padding: 0 20px; min-height: 46px;
}
.brand { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.topRight { gap: 0; }
.navGroup { display: flex; align-items: center; gap: 2px; }
.topLink, .pill, #topstate {
  min-height: 28px; border-radius: 6px; padding: 6px 10px;
  font-size: 12.5px; font-weight: 650; border: 1px solid transparent;
  background: transparent; color: var(--muted); box-shadow: none;
}
.topLink:hover { background: var(--surface-2); color: var(--ink); }
/* The current page is marked by weight and an underline rule, not by being
   the one thing on the bar with a saturated fill. */
.topLink.active {
  background: transparent; color: var(--ink); font-weight: 850;
  border-color: transparent; box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 6px 6px 0 0;
}
/* Account controls are not navigation. A rule separates them and they sit a
   step quieter, so the five sections read as one group. */
.navAccount {
  display: flex; align-items: center; gap: 2px;
  margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line);
}
.navAccount .topLink { font-size: 12px; font-weight: 600; color: var(--dim); }
.navAccount .topLink:hover { color: var(--ink); }
.navAccount .topLink.admin,
.navAccount .topLink.admin.active {
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line); font-weight: 700; cursor: default;
}

/* --- The summary strip. One bar, four facts, ~64px. --------------------- */
.sumStrip {
  display: flex; align-items: stretch; gap: 0;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 12px; overflow-x: auto;
}
/* Equal columns, so the four facts span the bar instead of huddling at the
   left with two thirds of the strip empty - which is the same dead space the
   fleet row was pulled up on. */
.sumItem {
  flex: 1 1 0; min-width: 130px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; min-height: 62px; white-space: nowrap;
  border-right: 1px solid var(--line-soft);
}
.sumItem:last-child { border-right: 0; }
.sumDot { width: 7px; height: 7px; border-radius: 50%; flex: none;
          background: var(--idle); }
.sumDot.ok { background: #22c55e; }
.sumDot.idle { background: #b0b8c4; }
.sumDot.warn { background: #f59e0b; }
.sumDot.neutral { background: #64748b; }
.sumNum {
  font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -.03em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.sumNum.warn { color: var(--warn); }
.sumLbl {
  font-size: 10.5px; font-weight: 750; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.sumTxt { display: flex; flex-direction: column; gap: 3px; }

/* --- Section head: title, an info affordance, actions on the right. ------ */
.secHead {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.secHead h2 { margin: 0; }
.secHead .spacer { flex: 1; }
/* The paragraph explaining that offline is normal was true and worth saying
   once. As a permanent two-line block above the table it was a manual printed
   on the page every time anybody looked at the fleet. */
.infoDot {
  width: 17px; height: 17px; border-radius: 50%; flex: none; padding: 0;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--muted); font-size: 11px; font-weight: 800; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  min-height: 0;
}
.infoDot:hover { border-color: var(--accent); color: var(--accent); }
.infoWrap { position: relative; display: inline-flex; }
.infoPop {
  display: none; position: absolute; top: 24px; left: -6px; z-index: 40;
  width: 330px; padding: 11px 13px; border-radius: var(--r);
  background: var(--surface-1); border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(15,23,42,.13);
  font-size: 12.5px; line-height: 1.5; color: var(--muted); font-weight: 400;
  text-transform: none; letter-spacing: 0; white-space: normal;
}
.infoWrap.open .infoPop { display: block; }

/* --- Tables: dense, aligned, and quiet where the data is diagnostic. ----- */
.tablewrap { border: 1px solid var(--line); border-radius: var(--r); background: transparent; }
table { font-size: 12.5px; min-width: 0; }
th {
  background: var(--surface-2); color: var(--muted);
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fafd; }
/* Release, agent version and build are for somebody already looking at a
   problem. They stay - a missing column cannot be checked - but they do not
   compete with State and Health, which is what the page is scanned for. */
td.diag, .diag {
  color: var(--dim); font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.colDevice { width: 22%; min-width: 150px; }
.colState  { width: 132px; }
.colHealth { width: 132px; }
.colWhen   { width: 110px; }
.colDiag   { width: 100px; }
.colAct    { width: 84px; text-align: right; }
td.colAct  { padding-right: 12px; }

/* A row that navigates somewhere should say so before it is clicked. Manage
   stays as the explicit affordance - a clickable row with no visible control
   is a secret. */
tr.rowLink { cursor: pointer; }
tr.rowLink:hover td { background: #f2f7fd; }
tr.rowLink a { text-decoration: none; }
tr.rowLink td:first-child a { color: var(--accent); font-weight: 700; }

/* --- Controls sized for a console, not a phone. ------------------------- */
.btn, button.btn, a.btn {
  min-height: 30px; padding: 6px 12px; border-radius: 6px;
  font-size: 12.5px; font-weight: 700; box-shadow: none;
  background: var(--surface-1); color: var(--ink); border: 1px solid var(--line);
}
.btn:hover { transform: none; box-shadow: none; background: var(--surface-2); }
.btn:active { transform: none; }
.btn.mini { min-height: 26px; padding: 4px 10px; font-size: 12px; }
/* One primary per view. Everything else is a bordered neutral, which is what
   lets the primary mean anything. */
.btn.gold, .btn.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: none;   /* app.css's gold glow survived under the blue fill */
}
.btn.gold:hover, .btn.primary:hover { background: #0961b8; }
.btn.red { background: var(--surface-1); color: var(--bad); border-color: #f0c9c9; }
.btn.red:hover { background: #fdf3f3; }
.btn.green { background: var(--surface-1); color: var(--ok); border-color: #c6e3ce; }

input, select, textarea {
  min-height: 32px; padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-1);
  font-size: 13px; box-shadow: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,110,209,.12);
}
textarea { min-height: 64px; }
.formgrid { gap: 10px; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); }
.formgrid label { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.filterRow { gap: 10px; }
.actions { gap: 8px; }

/* --- Status chips: a dot and a word, not a lozenge. --------------------- */
.healthBadge, .statChip, .badge {
  padding: 3px 9px; border-radius: 5px; font-size: 11.5px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.healthBadge.ok    { background: #eefaf1; border-color: #c6e3ce; color: var(--ok); }
.healthBadge.warn  { background: #fef6ec; border-color: #f0dcc0; color: var(--warn); }
.healthBadge.bad   { background: #fdf1f1; border-color: #f0c9c9; color: var(--bad); }
.healthBadge.quiet { background: var(--surface-2); border-color: var(--line);
                     border-style: solid; color: var(--muted); }

.muted, .pageLead { color: var(--muted); }
.pageLead { font-size: 12.5px; margin: -2px 0 12px; }
.portalFoot { color: var(--dim); font-size: 11px; }
.value { font-size: 19px; letter-spacing: -.02em; }
.label { font-size: 10px; letter-spacing: .07em; }

/* The empty state is one line in the table, not a card-sized apology. */
.emptyLine { padding: 22px 12px; color: var(--muted); font-size: 12.5px; }
.emptyLine b { color: var(--ink); }

@media (max-width: 900px) {
  .sumItem { padding: 10px 14px; min-height: 54px; }
  .sumNum { font-size: 20px; }
  .navAccount { margin-left: 6px; padding-left: 6px; }
}


/* --- The header chip. It reports a portal-wide condition, and it was the
   loudest object on a page whose job is to surface a device fault. Same
   information, ordinary weight. --------------------------------------- */
.chip {
  border-radius: 6px; font-size: 11.5px; font-weight: 700;
  padding: 4px 9px; min-height: 26px; box-shadow: none;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
}
/* The condition still colours its dot. It is the fill behind the whole chip
   that was doing the shouting. */
.chip.warn { background: var(--surface-2); border-color: var(--line); color: var(--warn); }
.chip.bad  { background: var(--surface-2); border-color: #f0c9c9; color: var(--bad); }
.chip.warn .chipDot { background: #f59e0b; }
.chip.bad .chipDot  { background: #dc2626; }
.chipDot { width: 6px; height: 6px; }
.chipPanel {
  border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-1); box-shadow: 0 6px 20px rgba(15,23,42,.13);
  font-size: 12.5px;
}

/* --- Inner pages: same card, same density, one primary. ---------------- */
.filterRow label { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pkgOpt { font-size: 12.5px; }
.rowActions { white-space: nowrap; text-align: right; }
.rowActions .btn { margin-left: 6px; }
/* A sub-line under a name is context, not a second row of content. */
.subNote { display: block; color: var(--dim); font-size: 11px; margin-top: 2px; }


/* --- Destructive actions in a repeated row. ---------------------------------
   Ten Delete buttons down the right edge of a table striped the column red and
   made a list of channels look like a list of problems. The severity belongs
   on the button somebody is about to press, not on all ten at rest: red word,
   neutral border, and the full red treatment on hover and focus. */
.rowActions .btn.red, td .btn.red, .pkgOps .btn.red, .pkgChans .btn.red {
  border-color: var(--line); background: var(--surface-1); color: var(--bad);
  font-weight: 650;
}
.rowActions .btn.red:hover, td .btn.red:hover, .pkgOps .btn.red:hover,
.pkgChans .btn.red:hover,
.rowActions .btn.red:focus-visible, td .btn.red:focus-visible,
.pkgOps .btn.red:focus-visible {
  border-color: #e5a3a3; background: #fdf1f1; font-weight: 750;
}

/* A note under a name is context. Repeated identically down ten rows it is
   noise, so it reads at the weight of a footnote. */
.chNote, .subNote {
  display: block; color: var(--dim); font-size: 11px; margin-top: 1px;
  font-weight: 400;
}

/* --- The in-page confirmation. --------------------------------------------
   Everything behind it keeps painting - that is the whole point, so the
   backdrop is a scrim rather than an opaque cover, and the page is visibly
   still running underneath. */
.modalWrap {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(15, 23, 42, .34);
}
.modalCard {
  width: min(460px, 100%); max-height: 84vh; overflow-y: auto;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
}
.modalTitle { margin: 0 0 10px; font-size: 15px; font-weight: 800; color: var(--ink); }
.modalBody { font-size: 13px; line-height: 1.55; color: var(--muted); }
.modalBody p { margin: 0 0 9px; }
.modalBody p:last-child { margin-bottom: 0; }
.modalFacts {
  display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0 0 10px;
}
.modalFacts dt { font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
                 text-transform: uppercase; color: var(--dim); align-self: center; }
.modalFacts dd { margin: 0; color: var(--ink); font-weight: 600; }
.modalActions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}
/* The dialog's own destructive confirm IS the moment, so it is filled - the
   opposite of the same class in a table row, where ten of them at rest would
   stripe the column. */
.modalActions .btn.red {
  background: var(--bad); color: #fff; border-color: var(--bad); font-weight: 750;
}
.modalActions .btn.red:hover { background: #a01818; }

/* --- The device header: two tight rows, nothing else above the tab strip. -- */
.devHead { padding: 12px 16px; }
.devHead .sectionTitle { margin-bottom: 8px; }
.devHead h1 { font-size: 17px; }
.devHead .statRow { margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line-soft); }
.devHead .reportRO, .devHead .warn { margin-top: 8px; font-size: 12.5px; }
.devHead .updateResult:empty { display: none; }

/* The tab strip sits directly under the header and stays put while a tab
   scrolls. */
.adminCards {
  top: 47px; margin: 12px 0 12px; padding: 4px; gap: 2px;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: none; backdrop-filter: none;
}
.adminCard {
  border-radius: 6px; padding: 7px 12px; font-size: 12.5px; font-weight: 700;
  color: var(--muted);
}
.adminCard:hover { background: var(--surface-2); color: var(--ink); }
.adminCard.active { background: var(--ink); color: #fff; box-shadow: none; }

/* The preview is a disclosure, closed. Same treatment as Advanced so the two
   collapsed things on the tab read as the same kind of thing. */
.previewBox { margin: 12px 0 0; }
.previewBox > summary.advHead { color: var(--muted); }
.previewBox[open] > summary.advHead { color: var(--ink); }
.statChip.warn { background: #fef6ec; border-color: #f0dcc0; color: var(--warn); }
/* A chip past its line. The stream health card has always asked for this
   class and the stylesheet never defined it, so a figure the aircraft had
   judged bad rendered in the same grey as one it was happy with - the
   colour that was carrying the warning simply was not there. */
.statChip.bad  { background: #fdf1f1; border-color: #f0c9c9; color: var(--bad); }
/* Every figure on that card explains itself in a tooltip. The cursor is the
   only thing that says so. */
.statChip[title] { cursor: help; }
.modalField { display: block; margin-top: 12px; font-size: 11.5px;
              font-weight: 700; color: var(--muted); }
.modalField input { margin-top: 5px; }

/* ============================================================ REPORTS
 *
 * The charts are server-rendered SVG, so everything here is layout and print.
 * There was no rule for .chart at all until now: the figures inherited the
 * browser's default figure margin and sat inset from every other card on the
 * page.
 */
.chart { margin: 0 0 6px; }
.chart + .chart { margin-top: 22px; }
.chart figcaption {
  font-size: 13px; font-weight: 900; color: #111827;
  margin: 0 0 10px; letter-spacing: -.01em;
}
.chart figcaption .unit {
  font-weight: 700; color: var(--muted, #64748b);
  letter-spacing: 0; margin-left: 6px;
}
/* Wide charts scroll inside their own box. The page body never scrolls
   sideways, which on a phone is the difference between a report you can read
   and one you fight. */
.chart svg { display: block; width: 100%; height: auto; max-width: 100%; }
.chartScroll { overflow-x: auto; }

.reportFilter { align-items: end; }
.reportFilter label { min-width: 0; }
.reportFilter .presets { display: flex; gap: 6px; flex-wrap: wrap; }
.reportFilter .presets a {
  text-decoration: none; font-size: 12px; font-weight: 850;
  padding: 8px 12px; border-radius: 999px;
  background: rgba(15,23,42,.06); color: #0f172a;
  border: 1px solid rgba(15,23,42,.08);
}
.reportFilter .presets a.on {
  background: #111827; color: #fff; border-color: transparent;
}

/* A share legend that carries the colour AND the name, because the segments
   themselves are too thin to label once there are more than a few. */
.chanKey { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 10px 0 0; }
.chanKey span { display: inline-flex; align-items: center; gap: 7px;
                font-size: 12.5px; font-weight: 800; color: #334155; }
.chanKey i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.liveDot { width: 9px; height: 9px; border-radius: 50%; display: inline-block;
           background: #34c759; margin-right: 7px; }
.liveOff { background: #94a3b8; }
@media (prefers-reduced-motion: no-preference) {
  .liveDot.beat { animation: liveBeat 2s ease-in-out infinite; }
}
@keyframes liveBeat { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ------------------------------------------------------------------ PRINT
 *
 * This is the PDF. A customer saves or prints the page and that file is the
 * report they forward, so the printed form is a deliverable and not an
 * afterthought: no navigation, no buttons that do nothing on paper, nothing
 * that splits a chart across two pages, and the aircraft and date range on
 * every sheet.
 *
 * It also means the report needs no PDF library in the container. The charts
 * are already SVG on the server, so what prints is exactly what was measured,
 * at whatever resolution the printer has.
 */
@media print {
  @page { margin: 14mm 12mm; }
  html, body { background: #fff !important; color: #000; }
  body { font-size: 11.5pt; }

  .top, .nav, .navGroup, .navAccount, .adminBack, .adminCards,
  .reportFilter, .noPrint, .chipPanel, .portalFoot { display: none !important; }

  .wrap { max-width: none; padding: 0; }
  .card, .proPanel {
    background: #fff !important; border: 1px solid #d4d4d0 !important;
    box-shadow: none !important; border-radius: 8px; padding: 12px 14px;
    backdrop-filter: none !important;
    /* A chart broken over a page fold is unreadable and looks like an error. */
    break-inside: avoid; page-break-inside: avoid;
  }
  .grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px; }
  .statcard { min-height: 0; }
  .statcard .value { font-size: 15pt; }
  .tablewrap { overflow: visible; border-radius: 0; background: #fff; }
  table { min-width: 0 !important; font-size: 9.5pt; }
  thead { display: table-header-group; }   /* headers repeat on every page */
  tr { break-inside: avoid; page-break-inside: avoid; }
  a { text-decoration: none; color: #000; }
  .chart svg { max-width: 100%; }
  .printHead { display: block !important; }
}
.printHead { display: none; }

/* ------------------------------------------------------------- QR codes ---
   The two codes a passenger scans, shown on the device page so an operator on
   the ground can produce a seat card without anybody being in the cabin.

   White ground and a border on purpose: a QR is read by a camera, and the
   quiet zone around it is part of the code. On a dark card, or bled to the
   edge of a coloured panel, the same image scans on one phone and not the
   next. */
.qrPair{display:flex;gap:20px;flex-wrap:wrap;margin:14px 0 18px}
.qrCell{flex:0 0 auto;text-align:center}
.qrCap{font-size:.78rem;font-weight:700;letter-spacing:.03em;
  color:var(--muted);margin-bottom:8px}
.qrBox{background:#fff;border:1px solid #dde3ea;border-radius:10px;
  padding:10px;display:inline-block;line-height:0}
.qrBox svg{width:180px;height:180px;display:block}
