/* Pulse Site Kit architecture site.
   Tokens, fonts and the SVG vocabulary come from pulse-site-kit.html (8 Oct 2026).
   Layout: one spec-sheet column (max 1040px). Figures and viewers run full width on a
   surface panel. Prose stays near 68ch. Hairlines separate sections. */
:root {
  --bg: #F2F4F6;
  --surface: #FFFFFF;
  --fg: #17212B;
  --muted: #5A6672;
  --line: #CBD3DB;
  --accent: #C98200;
  --accent-ink: #8A5A00;
  --accent-soft: #FFF3D6;
  --bad: #B3392F;
  --bad-soft: #FBE7E5;
  --ok: #1E7A4E;
  --ok-soft: #E2F3EA;
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1318; --surface: #151C23; --fg: #E4E9EE; --muted: #93A0AC; --line: #2B3640;
    --accent: #F0B232; --accent-ink: #F5C55E; --accent-soft: #33270C;
    --bad: #EE7B70; --bad-soft: #3A1714; --ok: #58C68E; --ok-soft: #10301F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1318; --surface: #151C23; --fg: #E4E9EE; --muted: #93A0AC; --line: #2B3640;
  --accent: #F0B232; --accent-ink: #F5C55E; --accent-soft: #33270C;
  --bad: #EE7B70; --bad-soft: #3A1714; --ok: #58C68E; --ok-soft: #10301F;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: 20px;
  padding-block: 40px 64px;
}
p, li { max-width: 68ch; }
a { color: var(--accent-ink); text-underline-offset: 2px; overflow-wrap: anywhere; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: var(--f-mono); font-size: 0.88em; }
.num { font-variant-numeric: tabular-nums; }

/* Header */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
h1 {
  font-family: var(--f-display);
  font-stretch: 118%;
  font-weight: 780;
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  text-wrap: balance;
}
.lede { font-size: 1.18rem; margin: 0 0 18px; }
.chip {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  max-width: 100%;
}

/* Spec strip */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  margin: 32px 0 8px;
  border-top: 2px solid var(--fg);
}
.strip > div {
  padding: 14px 18px 14px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.strip b {
  display: block;
  font-family: var(--f-display);
  font-stretch: 110%;
  font-weight: 760;
  font-size: 2rem;
  line-height: 1.1;
}
.strip span { color: var(--muted); font-size: 0.95rem; }

/* Page index */
nav.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 22px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
nav.toc a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
nav.toc a:hover { color: var(--fg); border-bottom-color: var(--fg); }

/* Sections */
section { margin-top: 56px; }
h2 {
  font-family: var(--f-display);
  font-stretch: 110%;
  font-weight: 720;
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0 0 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-wrap: balance;
}
h3, .h3 {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 8px;
}
section > p { margin: 0 0 14px; }
.sub { margin-top: 40px; }

/* Figures */
figure { margin: 18px 0 0; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  overflow-x: auto;
}
.panel svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
  color: var(--fg);
}
figcaption { color: var(--muted); font-size: 0.95rem; margin-top: 10px; max-width: 72ch; }
.scroll-hint { display: none; font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }

/* SVG vocabulary (page CSS styles the inline SVG; no style inside the SVG itself) */
.box { fill: var(--surface); stroke: currentColor; stroke-width: 1.25; }
.ghost { fill: none; stroke: var(--muted); stroke-width: 1.25; stroke-dasharray: 7 6; }
.ph { fill: var(--surface); stroke: currentColor; stroke-width: 1.25; }
.ln { stroke: currentColor; stroke-width: 1.5; fill: none; }
.ln-bus { stroke: currentColor; stroke-width: 2.5; }
.ln-thin { stroke: var(--muted); stroke-width: 1.5; }
.ln-acc { stroke: var(--accent); stroke-width: 4.5; stroke-linecap: round; }
.ln-cell { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.ln-pwr { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 0.5 5; stroke-linecap: round; fill: none; }
.ln-div { stroke: var(--line); stroke-width: 1; }
.risk { fill: var(--surface); stroke: var(--bad); stroke-width: 1.5; }
.risk-x { stroke: var(--bad); stroke-width: 1.75; stroke-linecap: round; }
.t { font: 400 12.5px var(--f-body); fill: currentColor; }
.t-m { font: 400 12px var(--f-body); fill: var(--muted); }
.t-h { font: 720 13px var(--f-display); letter-spacing: 0.06em; fill: currentColor; }
.t-mono { font: 500 11px var(--f-mono); fill: var(--muted); letter-spacing: 0.02em; }
.t-acc { font: 700 12.5px var(--f-body); fill: var(--accent-ink); }

/* Legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend svg { width: 34px; height: 10px; color: var(--fg); flex: none; }

/* Callouts */
.key-fact {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 14px;
  margin: 18px 0 14px;
  font-size: 1.08rem;
}
.key-fact p { margin: 0; }
.note {
  border-left: 2px solid var(--line);
  padding: 2px 0 2px 12px;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 14px 0;
}

/* Tabs for the two builds */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 12px;
}
.tabs [role="tab"] {
  font-family: var(--f-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.tabs [role="tab"][aria-selected="true"] {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}
.tabs [role="tab"]:hover { color: var(--fg); border-color: var(--fg); }
.tabs [role="tab"][aria-selected="true"]:hover { color: var(--bg); }
[role="tabpanel"][hidden] { display: none; }

/* 3D viewer */
.viewer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.stage {
  position: relative;
  height: clamp(380px, 56vw, 580px);
  background: var(--surface);
  overflow: hidden;
}
.stage .gl, .stage .css2d { position: absolute; inset: 0; }
.stage .gl { display: block; width: 100%; height: 100%; cursor: grab; }
.stage .gl:active { cursor: grabbing; }
.stage .css2d { pointer-events: none; }
.labels-off .css2d { display: none; }
.tag { position: absolute; width: 0; height: 0; pointer-events: none; }
.tag-in {
  position: absolute;
  top: 0;
  transform: translateY(-50%);
  white-space: nowrap;
  font: 500 11.5px/1.35 var(--f-mono);
  letter-spacing: 0.02em;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 6px 1px 4px;
}
.tag-in b {
  font-weight: 500;
  color: var(--muted);
  margin-right: 5px;
  padding-right: 5px;
  border-right: 1px solid var(--line);
}
.is-narrow .tag-in { padding: 0 5px; }
.is-narrow .tag-in b { margin: 0; padding: 0; border: 0; color: var(--fg); font-weight: 600; }
.is-narrow .tag.acc .tag-in b { color: var(--accent-ink); }
.tag[data-side="r"] .tag-in { left: 5px; }
.tag[data-side="l"] .tag-in { right: 5px; }
.tag.acc .tag-in { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tag.acc .tag-in b { color: var(--accent-ink); border-right-color: var(--accent); }
.vfail {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, var(--bg) 14px 15px),
    var(--surface);
}
.vfail[hidden] { display: none; }
.vfail p { margin: 0 auto 8px; max-width: 46ch; }
.vfail b { color: var(--fg); }
.vbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.vbar button {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}
.vbar button:hover { border-color: var(--fg); }
.vbar button[aria-pressed="true"] { border-color: var(--fg); }
.vbar button[data-act="explode"][aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.vbar button:disabled { opacity: 0.45; cursor: not-allowed; }
.vhint {
  flex: 1 1 220px;
  margin: 0;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
}

/* Numbered part key under each viewer */
ol.key {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 8px 28px;
  font-size: 0.93rem;
}
ol.key li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; max-width: none; }
ol.key li > span:first-child {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  height: 20px;
  line-height: 18px;
  margin-top: 1px;
}
ol.key li.acc > span:first-child { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
ol.key b { font-weight: 700; }
.about { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.about li { padding-left: 16px; position: relative; }
.about li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 7px; height: 1.5px; background: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 14px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 11px 14px 11px 0;
  border-bottom: 1px solid var(--line);
}
th {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--fg);
}
td:first-child { font-weight: 700; }
td small, .sm { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 3px; }
.price { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Failure table: same as the kit page */
table.fail { min-width: 680px; }
table.fail td:first-child { width: 24%; }
table.fail td:nth-child(3) { white-space: nowrap; color: var(--muted); font-family: var(--f-mono); font-size: 12.5px; }

table.cmp { min-width: 640px; }
table.cmp td:first-child { width: 17%; }
table.cmp th:nth-child(2), table.cmp th:nth-child(3) { width: 41.5%; }
table.bom { min-width: 940px; }
table.bom td:first-child { width: 12%; }
table.bom td:nth-child(2) { width: 27%; }
table.bom td:nth-child(3) { width: 15%; }
table.bom td:nth-child(4) { width: 18%; }
table.buy { min-width: 700px; }
table.phones { min-width: 760px; }
table.today { min-width: 560px; }

.pill {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill.no, .pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.some, .pill.warn { background: var(--accent-soft); color: var(--accent-ink); }
.pill.yes { background: var(--bad-soft); color: var(--bad); }
.pill.open { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 1px 8px; }

/* Totals */
.totals {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0 28px;
  border-top: 2px solid var(--fg);
}
.totals > div { padding: 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.totals b.big {
  display: block;
  font-family: var(--f-display);
  font-stretch: 110%;
  font-weight: 760;
  font-size: 1.9rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.totals span { color: var(--muted); font-size: 0.95rem; }
.totals ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.93rem; }
.totals li { margin: 3px 0; }

/* Jiji block: results that arrived later */
#jiji {
  margin-top: 28px;
  border: 1.5px dashed var(--accent);
  border-radius: 6px;
  padding: 16px 18px 6px;
  background: var(--surface);
}
#jiji .jiji-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
#jiji h3 { margin: 0; color: var(--accent-ink); }
#jiji .jiji-meta { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); }
#jiji .table-wrap { margin-top: 8px; }

/* Brand-share chart */
.chart { margin-top: 18px; max-width: 640px; }
.chart .ch-title { font-family: var(--f-display); font-stretch: 108%; font-weight: 720; font-size: 1.02rem; margin: 0; }
.chart .ch-sub { color: var(--muted); font-size: 0.9rem; margin: 2px 0 10px; }
.bars { display: grid; gap: 8px; }
.b-row, .b-axis {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 60px;
  align-items: center;
  gap: 10px;
}
.b-lbl { text-align: right; font-size: 0.93rem; }
.b-track {
  position: relative;
  height: 24px;
  border-left: 1px solid var(--fg);
  border-right: 1px solid var(--line);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 25% 100%;
  background-position: -1px 0;
}
.b-fill {
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  background: var(--muted);
  border-radius: 0 4px 4px 0;
}
.b-row:hover .b-fill { background: var(--fg); }
.b-val { font: 500 12.5px var(--f-mono); font-variant-numeric: tabular-nums; }
.b-ticks { position: relative; height: 16px; font: 400 11px var(--f-mono); color: var(--muted); }
.b-ticks span { position: absolute; top: 0; transform: translateX(-50%); }

/* Decisions */
ul.open { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 12px; }
ul.open li { display: flex; gap: 12px; align-items: baseline; max-width: none; }
ul.open li > span:last-child { max-width: 68ch; min-width: 0; }
.owner {
  flex: none;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  width: 40px;
  text-align: center;
  padding: 1px 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
}
.owner.mtn { border-color: var(--accent); color: var(--accent-ink); }
.odds {
  flex: none;
  width: 92px;
  text-align: center;
}

footer {
  margin-top: 64px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
footer h3 { margin-top: 18px; }
footer ul { margin: 0; padding-left: 18px; columns: 2 300px; column-gap: 32px; }
footer li { margin: 0 0 6px; break-inside: avoid; }

/* Hover cards (js/cards.js): photo, name, price, note. Fixed position, the script places it. */
.pcard {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  width: 260px;
  max-width: calc(100vw - 16px);
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(14, 19, 24, 0.18);
  pointer-events: none;
  overflow: hidden;
  font-size: 0.88rem;
  line-height: 1.4;
}
.pcard[hidden] { display: none; }
/* Shop photos have white backgrounds, so the photo sits on a light panel in both themes. */
.pcard-media {
  height: 150px;
  padding: 8px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pcard-media[hidden] { display: none; }
.pcard-media img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.pcard-media img[hidden] { display: none; }
.pcard-media.is-none {
  height: auto;
  padding: 10px 12px 0;
  background: transparent;
  border-bottom: 0;
}
.pcard-nophoto {
  flex: 1;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: center;
  padding: 9px 8px;
  border: 1px dashed var(--line);
  border-radius: 4px;
}
.pcard-nophoto[hidden] { display: none; }
.pcard-body { padding: 10px 12px 12px; }
.pcard-body p { margin: 0; max-width: none; }
.pcard-body p[hidden] { display: none; }
.pcard-name { font-weight: 700; }
.pcard-body .pcard-price { margin-top: 4px; font-family: var(--f-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.pcard-body .pcard-note { margin-top: 4px; color: var(--muted); font-size: 0.85rem; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pcard { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); }
}
:root[data-theme="dark"] .pcard { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); }

/* Table rows with a hover card */
tr[data-part] { cursor: default; }
tr[data-part]:hover > td { background: rgba(127, 140, 153, 0.10); }
tr[data-part]:focus { outline: none; }
tr[data-part]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
tr[data-part]:focus-visible > td { background: rgba(127, 140, 153, 0.10); }

@media (max-width: 560px) {
  .wrap { padding-block: 28px 48px; padding-inline: 16px; }
  .scroll-hint { display: block; }
  .vhint { text-align: left; }
  .tag-in { font-size: 10.5px; padding: 0 5px 0 3px; }
  .tag-in b { margin-right: 4px; padding-right: 4px; }
  ul.open li { flex-wrap: wrap; gap: 6px 10px; }
  ul.open li > span:last-child { flex-basis: 100%; }
  .strip b { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Today list: photo thumbnails and the 5V warning */
.pick-with-photo { display: flex; gap: 12px; align-items: flex-start; }
.thumb { flex: none; width: 56px; height: 56px; object-fit: contain; background: #FFFFFF; border: 1px solid var(--line); border-radius: 4px; }
.warn-line { margin: 14px 0; padding: 8px 12px; border-left: 3px solid var(--bad); background: var(--bad-soft); color: var(--fg); max-width: 68ch; }
.warn-line b { color: var(--bad); }
