/* Ramada School site — main stylesheet
   Design system: Editorial spec sheet (per design-ref/africa/project/Spec Sheet.html)
   Palette: Mono Slate. Typography: Newsreader + IBM Plex Sans + IBM Plex Mono.
*/

/* Google Fonts are loaded via <link> in each HTML head (not @import here)
   so they can run in parallel with this stylesheet and the preconnect
   hints in the same head start the TLS handshake earlier. See site/*.html. */

:root {
  /* Mono Slate palette */
  --paper:       #ececea;
  --paper-pure:  #ffffff;
  --ink:         #111111;
  --ink-soft:    #3a3a3a;
  --ink-mute:    #6b6b6b;
  --accent:      #3d3d3d;
  --accent-soft: #b8b8b8;
  --rule:        #cfcfcb;
  --rule-soft:   #dededa;

  /* Status colours kept restrained */
  --c-success: #2f5d3c;
  --c-warning: #8a6324;
  --c-danger:  #8a3324;
  --c-focus:   #3a3a3a;

  /* Aliases for legacy class names — map to Mono Slate */
  --c-primary:        var(--ink);
  --c-primary-hover:  var(--accent);
  --c-accent:         var(--accent);
  --c-bg:             var(--paper);
  --c-bg-soft:        var(--rule-soft);
  --c-bg-sunken:      var(--rule);
  --c-text:           var(--ink);
  --c-text-soft:      var(--ink-soft);
  --c-text-muted:     var(--ink-mute);
  --c-border:         var(--rule);
  --c-border-soft:    var(--rule-soft);

  --radius: 0px;
  --radius-lg: 0px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.12);

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans:  "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* One prose measure for the whole site. Page intros, section intros and
     callouts all read from this token instead of per-page 70/72/78ch / inline
     max-width overrides, so the reading width is consistent everywhere. */
  --measure: 72ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  margin: 0;
  line-height: 1.45;
  font-size: 19px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; width: 100%; min-width: 0; }
.site-header, .site-nav, .site-footer { width: 100%; }

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  z-index: 1000;
}
.skip-link:focus { top: 8px; }

/* === HEADER (editorial topbar) === */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  border-top: 2px solid var(--ink);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: var(--ink);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand-tagline {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-transform: none;
}

.header-search { position: relative; }
.header-search input {
  width: 100%;
  padding: 6px 12px 6px 32px;
  border: 1px solid var(--rule);
  background: var(--paper-pure) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%23888" stroke-width="1.5"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>') 10px center no-repeat;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink);
  border-radius: 0;
}
.header-search input:focus {
  border-color: var(--ink);
}

.header-pills {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.lang-toggle button {
  padding: 4px 10px;
  color: var(--ink-soft);
  background: var(--paper);
  border-right: 1px solid var(--ink);
}
.lang-toggle button:last-child { border-right: none; }
.lang-toggle button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* === NAV (secondary row, editorial) === */
.site-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  overflow-x: auto;
  /* Hide the chunky OS scrollbar on the overflowing nav strip at narrow
     widths — the strip stays swipe/scroll-able. */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.site-nav::-webkit-scrollbar { display: none; }
.nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 0;
}
.nav-inner a {
  padding: 10px 16px 10px 0;
  margin-right: 16px;
  color: var(--ink-soft);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
}
.nav-inner a:hover { color: var(--ink); }
.nav-inner a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* === MAIN === */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 38px;
  line-height: 1.02;
  letter-spacing: -0.014em;
  color: var(--ink);
  margin: 0 0 6px;
}
.page-intro {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0 0 28px;
  line-height: 1.45;
}

/* Short intro paragraph under a .section-title (not the big italic page-intro).
   Replaces the scattered inline style="margin:0 0 14px; max-width:…" on
   electrical / security / budget / tax / plans / internet. */
.section-intro {
  margin: 0 0 14px;
  max-width: var(--measure);
}

/* Section title — uppercase label + flex rule on the right */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 28px 0 12px;
  padding: 0;
  border: none;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
  margin-left: 4px;
}

/* === CARDS === */
.card {
  background: var(--paper-pure);
  border: 1px solid var(--rule);
  padding: 18px 20px;
  border-radius: 0;
}
a.card { text-decoration: none; color: inherit; display: block; }

.callout {
  background: var(--paper-pure);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  padding: 10px 14px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-soft);
}
/* Long prose callouts (rare) can opt back into the readable cap via
   class="callout measure". Default is to fill the column — scope/notes/
   admin callouts on every page would otherwise dead-stop at ~50% width. */
.callout strong { color: var(--ink); font-weight: 600; }
.callout-info { border-left-color: var(--ink); }

/* === GRIDS === */
.grid-cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-cards { grid-template-columns: repeat(3, 1fr); }
}

/* === BADGES === */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 0;
  background: var(--rule-soft);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}
.badge-success { background: var(--paper-pure); color: var(--c-success); border-color: var(--c-success); }
.badge-warning { background: var(--paper-pure); color: var(--c-warning); border-color: var(--c-warning); }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.btn-ghost {
  background: var(--paper-pure);
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-small { padding: 5px 10px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* === FILTERS / FORM === */
.filters {
  background: var(--paper-pure);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  border-radius: 0;
  margin-bottom: 22px;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

/* Action bar — a left-clustered row of page actions (docs link + print).
   Distinct from .filters (a responsive auto-fit grid of form controls):
   two lone buttons in .filters each claim a 1fr cell and drift apart. */
.actions-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
@media (min-width: 768px) {
  .filters { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
  /* Action buttons keep their intrinsic width on desktop — a ghost button
     stretched to its grid column reads as a text input. Form fields
     (select/input) still fill their column; mobile stays full-width. */
  .filter-group > .btn { align-self: flex-start; }
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.filter-group select, .filter-group input {
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper-pure);
  font: inherit;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink);
}
.filter-group select:focus, .filter-group input:focus {
  border-color: var(--ink);
}

/* === TABLES (editorial spec-table style) === */
.table-wrap {
  background: var(--paper-pure);
  border: 1px solid var(--rule);
  border-radius: 0;
  overflow-x: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--ink);
}
table.data th {
  text-align: left;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
}
table.data td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr.total td {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  background: rgba(0,0,0,0.025);
  border-top: 1px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 10px 12px;
}
table.data td.num, table.data th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
table.data tr.total td.num {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
}
/* Subtotal / contingency rows that bridge the line rows and the grand total
   (e.g. the BOM foots: Σlines = subtotal, +10% contingency, = total). Lighter
   than tr.total; the first one carries the top rule so the summary block reads
   as a unit. */
table.data tr.bom-subtotal td {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  padding: 7px 12px;
  border-bottom: 1px solid var(--rule-soft);
}
table.data tr.bom-subtotal td.num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
table.data tr.bom-subtotal:first-of-type td { border-top: 1px solid var(--rule); }
table.data tr.bom-subtotal:hover td { background: transparent; }
table.data tbody tr:hover { background: rgba(0,0,0,0.025); }

td.best { background: rgba(0,0,0,0.04) !important; font-weight: 600; }

/* === BILL OF MATERIALS (vendor-linked, sortable) ===
   One shared component for the BOM "Where to buy" cell + the clickable-header
   sortable table. Previously duplicated verbatim in electrical.html and
   security.html, and partially (just .bom-buy / .bom-vendor) in items.html.
   The per-page <script> still owns the data, vendor URLs and sort logic — only
   the structure/style lives here. */

/* Buy link + vendor / category sub-labels in the BOM "Where to buy" cell. */
.bom-buy {
  font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; text-decoration: none; color: var(--ink-soft);
  border: 1px solid var(--rule); padding: 3px 7px; white-space: nowrap;
  /* WCAG 2.5.8: ensure a >=24x24px clickable target without enlarging the text. */
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; box-sizing: border-box;
}
.bom-buy:hover { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.bom-buy .ext { font-size: 11px; }
.bom-vendor { display: block; font-family: var(--font-mono); font-size: 13px; color: var(--ink-mute); margin-top: 3px; }
.bom-cat { display: block; font-family: var(--font-sans); font-size: 13px; color: var(--ink-mute); margin-top: 2px; }

/* Sort bar: a compact "Sort by" select that mirrors the clickable-header state
   for touch / discoverability. */
.bom-sortbar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.bom-sortbar label {
  font-family: var(--font-sans); font-size: 14px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-mute);
}
.bom-sortbar select {
  padding: 6px 10px; border: 1px solid var(--rule); border-radius: 0;
  background: var(--paper-pure); font: inherit; font-family: var(--font-mono); font-size: 14px;
  color: var(--ink); cursor: pointer;
}
.bom-sortbar select:focus { border-color: var(--ink); }

/* Sortable column headers: the header itself is the control. A caret shows the
   active key + direction; the active column is inked. */
table.data th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
table.data th.th-sort:hover { color: var(--ink); }
table.data th.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.th-caret { font-family: var(--font-mono); font-weight: 600; margin-left: 5px; color: var(--ink-mute); }
th.th-sort[aria-sort="none"] .th-caret { opacity: 0.32; }
th.th-sort[aria-sort]:not([aria-sort="none"]) { color: var(--ink); }
th.th-sort[aria-sort]:not([aria-sort="none"]) .th-caret { color: var(--accent); opacity: 1; }

/* Category sub-header rows clustering each group when sorted by category. */
table.data tr.bom-group td {
  font-family: var(--font-sans); font-size: 12px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-mute); background: rgba(0,0,0,0.025);
  padding: 8px 12px 6px; border-bottom: 1px solid var(--rule);
}
table.data tr.bom-group:hover td { background: rgba(0,0,0,0.025); }
/* Hide group sub-header rows only when the table actually collapses to
   stacked cards (480px) — between 481–768px it is still a normal table and
   the category headers must stay visible. */
@media (max-width: 480px) { table.data[data-mobile-cards] tr.bom-group { display: none; } }

/* === DOCUMENT DETAIL TWO-PANE === */
.doc-pane-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .doc-pane-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
.pdf-frame {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper);
}
/* Stacked single-column layout: keep the PDF preview to ~half the viewport
   so the tab card (which works on phones) is reachable within one scroll. */
@media (max-width: 1023px) {
  .pdf-frame { height: 55vh; }
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ink);
  overflow-x: auto;
}
.tabs button {
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.tab-panel { padding: 16px 0; }

/* === COLLAPSIBLE TECHNICAL DETAIL (details.tech) ===
   Shared component: electrical.html (system diagram toggles) and
   security.html (technical & compliance block). The pages keep only their
   bespoke .sld-* / .tech-sub rules locally. */
details.tech {
  border: 1px solid var(--rule); background: var(--paper-pure); margin-top: 4px;
}
details.tech > summary {
  list-style: none; cursor: pointer; padding: 12px 16px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink); display: flex; align-items: center; gap: 10px;
}
details.tech > summary::-webkit-details-marker { display: none; }
details.tech > summary::before {
  content: "+"; font-family: var(--font-mono); font-size: 18px; font-weight: 600;
  width: 16px; display: inline-block; color: var(--ink-mute);
}
details.tech[open] > summary::before { content: "–"; }
details.tech > summary:hover { color: var(--accent); }
/* Belt-and-braces: keep the diagram hidden until the toggle is opened,
   independent of UA <details> quirks. */
details.tech:not([open]) .tech-body { display: none; }
details.tech .tech-body { padding: 4px 16px 18px; border-top: 1px solid var(--rule-soft); }

/* === BUDGET EXPLORER === plan-card editorial style */
.scenario-card {
  background: var(--paper-pure);
  border: 1px solid var(--rule);
  padding: 16px 18px;
  position: relative;
  border-radius: 0;
}
/* Recommended (C) — white background, accent left border. Badge floats above. */
.scenario-card.recommended {
  border-left: 4px solid var(--accent);
  padding-left: 15px;
}
.scenario-card.recommended::before {
  content: attr(data-badge);
  position: absolute;
  top: -22px; right: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 0;
  border: 1px solid var(--ink);
  border-bottom: none;
}
.scenario-card:not(.recommended)::before {
  content: attr(data-badge);
  position: absolute;
  top: -22px; right: 0;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 0;
}
.scenario-card:not(.recommended):not([data-badge]):not([data-badge=""])::before { display: none; }
.scenario-card[data-badge=""]::before { display: none; }
.scenario-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.005em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 12px;
}
.scenario-total {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.014em;
  color: var(--ink);
  margin: 10px 0 0;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.scenario-total-usd {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink-mute);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.scenario-breakdown {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink-soft);
  margin-top: 12px;
}
.scenario-breakdown div { display: flex; justify-content: space-between; padding: 2px 0; gap: 8px; }

.eq-section-head {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  border-top: 1px solid var(--rule-soft);
  margin-top: 8px;
  padding-top: 6px;
}
.eq-section-head:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.eq-row {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-soft);
  padding: 1px 0 1px 8px;
  font-weight: 400;
}
.eq-row span:last-child { font-family: var(--font-mono); font-size: 15px; font-variant-numeric: tabular-nums; }
.scenario-decisions {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--rule-soft);
}
.scenario-decisions .decision-link {
  background: none;
  border: none;
  /* keep the base >=24px-tall target (WCAG 2.5.8); zero only horizontal padding */
  padding: 4px 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: left;
}

/* === ALL-IN CAMPUS TOTAL === */
.allin-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-top: 12px;
}
@media (min-width: 768px) { .allin-grid { grid-template-columns: repeat(2, 1fr); } }
.allin-card {
  background: var(--paper-pure);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--ink-soft);
  padding: 16px 18px 16px 15px;
}
.allin-card.recommended { border-left-color: var(--accent); }
.allin-label {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.allin-sub {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-soft);
  margin: 2px 0 12px;
}
.allin-lines {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink-soft);
}
.allin-lines div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
}
.allin-lines div span:last-child { font-family: var(--font-mono); font-size: 15px; font-variant-numeric: tabular-nums; }
.allin-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.allin-total {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.014em;
  text-transform: none;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.allin-total-alt {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink-mute);
  margin: 4px 0 0;
  letter-spacing: 0.04em;
  text-align: right;
}

/* Install / turnkey vendor highlight card */
.install-group-recommended {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.install-group-recommended h3 { color: var(--paper) !important; }
.install-group-recommended strong { color: var(--paper) !important; }
.install-group-recommended .text-soft { color: rgba(236,236,234,0.7) !important; }

/* === DOWNLOAD BUTTONS === */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}
.download-btn .dl-glyph { flex-shrink: 0; }
.download-btn:hover .dl-glyph { transform: translateY(1px); transition: transform 0.15s; }

/* PDFs page header: title left, "Download all docs (zip)" CTA right */
.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 28px;
}
.download-all-cta {
  background: #000;
  color: #fff;
  border-color: #000;
  font-size: 15px;
  letter-spacing: 0.16em;
  padding: 10px 18px;
}
.download-all-cta:hover,
.download-all-cta:focus-visible {
  background: #1f1f1f;
  color: #fff;
  border-color: #1f1f1f;
}
.download-all-cta .dl-glyph { width: 16px; height: 16px; color: #fff; }
.download-all-cta:visited { color: #fff; }
@media (max-width: 480px) {
  .docs-header { flex-direction: column; align-items: stretch; }
  .download-all-cta { justify-content: center; padding: 12px 18px; }
}

/* === PHONE / WHATSAPP LINKS === */
.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;            /* keep the whole number on one line */
}
.phone-link:hover { color: var(--accent); }
.phone-link .wa-glyph { flex-shrink: 0; color: inherit; }
.phone-link span { white-space: nowrap; }
/* Give the Phone column room so nowrap numbers don't force the table wide */
#supplier-table th:nth-child(2),
#supplier-table td:nth-child(2) { min-width: 150px; }

/* === VERIFICATION ICONS === */
.verify-icon {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  text-align: center;
  font-size: 14px;
  line-height: 12px;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
  font-family: var(--font-mono);
}
.verify-verified  { background: var(--c-success); color: var(--paper); }
.verify-indicative { background: var(--c-warning); color: var(--paper); }

/* === FOOTER (editorial strip) === */
/* Two stacked <p> lines from app.js buildFooter(): .footer-id (one-line
   address strip, keeps the uppercase editorial treatment) and .footer-note
   (the sentence-length disclaimer + FX line, plain sentence case). */
.site-footer {
  margin-top: auto;
  background: var(--paper);
  color: var(--ink-soft);
  padding: 16px 24px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  border-top: 1px solid var(--ink);
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.footer-id {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.8;
  margin: 0;
}
.footer-note {
  letter-spacing: normal;
  text-transform: none;
  opacity: 0.7;
  margin: 6px 0 0;
}
.site-footer a { color: var(--ink-soft); text-decoration: underline; }
.site-footer a:hover { color: var(--ink); }

/* === UTILITIES === */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.measure { max-width: var(--measure); }
.text-sm { font-size: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--ink-mute); }
.text-soft { color: var(--ink-soft); }

/* MODAL */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17,17,17,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal {
  background: var(--paper-pure);
  border: 1px solid var(--ink);
  border-radius: 0;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  /* Anchor the absolutely-positioned .close button to the dialog box, not
     the full-screen backdrop. */
  position: relative;
}
.modal h2 {
  margin-top: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.modal .close { position: absolute; top: 12px; right: 12px; min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; color: var(--ink-mute); }

/* === DECISION BLOCKS (inline modal popovers) === */
.decision-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.decision-block:last-of-type { border-bottom: none; }
.decision-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.decision-id {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--paper);
  background: var(--ink);
  padding: 2px 6px;
}
.decision-decision {
  background: rgba(47,93,60,0.07);
  border-left: 2px solid var(--c-success);
  padding: 8px 10px;
  margin: 4px 0;
  font-family: var(--font-serif);
  font-size: 17px;
}
.decision-rationale {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink-soft);
  margin: 8px 0;
}
.decision-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-style: dotted;
  cursor: pointer;
  /* WCAG 2.5.8: give the small inline decision links a >=24px-tall clickable
     target via vertical padding, without changing the visual text size. */
  min-height: 24px;
  padding: 4px 0;
}
.decision-link:hover { color: var(--ink); }

/* EMPTY STATES */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--ink-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-state-icon {
  font-size: 36px;
  line-height: 1;
  opacity: 0.45;
  color: var(--ink-mute);
}
.empty-state-icon svg { width: 38px; height: 38px; display: block; }
.empty-state-text {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink-soft);
}
.empty-state .btn,
.empty-state .btn-ghost {
  margin-top: 4px;
}

/* ============================================================
   MOBILE FIXES (Phase 6 audit)
   - 768px and below: header search drops to second row
   - 480px and below: header pills wrap below brand; tables collapse
     to stacked card view; nav becomes horizontal scroll
   - Floor plan stacks image-then-sidebar
   ============================================================ */

@media (max-width: 768px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand pills"
      "search search";
    row-gap: 8px;
  }
  .brand { grid-area: brand; }
  .header-pills { grid-area: pills; justify-self: end; }
  .header-search { grid-area: search; }

  .page-title { font-size: 30px; }
}

@media (max-width: 480px) {
  /* Keep the sticky header short: smaller brand type + tighter tracking so
     the brand fits <=2 lines in EN and SW, a min-content pills track so the
     unwrapped toggles can't starve the brand column, tighter padding. */
  .header-inner { padding: 6px 14px; gap: 12px; row-gap: 6px; grid-template-columns: minmax(0, 1fr) min-content; }
  .brand-name { font-size: 11px; letter-spacing: 0.05em; }
  .brand-tagline { font-size: 10px; }
  .header-pills { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  .lang-toggle button { padding: 4px 7px; font-size: 12px; letter-spacing: 0.08em; }

  .nav-inner { padding: 0 16px; }
  .nav-inner a { padding: 10px 12px 10px 0; margin-right: 12px; font-size: 13px; letter-spacing: 0.14em; }

  .container { padding: 16px 16px 48px; }
  .page-title { font-size: 26px; }
  .filters { padding: 10px 12px; gap: 10px; }
  /* Fit all four doc tabs (SUMMARY … COMMENTS) within a phone viewport */
  .tabs button { padding: 8px 10px; font-size: 13px; letter-spacing: 0.12em; }
  .scenario-card { padding: 14px 14px 14px 18px; }
  .scenario-card.recommended { padding-left: 14px; border-left-width: 3px; }

  /* Floor plan page: tighter grid gap on phones */
  .plan-grid { gap: 12px; }

  /* === STACKED CARD TABLES ===
     Tables marked with [data-mobile-cards] reflow as a stack of cards
     on narrow viewports. The visible thead is hidden; each body cell uses
     its data-label attribute as a leading caption. The first body cell is a
     <th scope="row"> (row title) and renders as the card's header row. */
  table.data[data-mobile-cards], table.data[data-mobile-cards] tbody,
  table.data[data-mobile-cards] tr,
  table.data[data-mobile-cards] td, table.data[data-mobile-cards] tbody th {
    display: block; width: 100%;
  }
  table.data[data-mobile-cards] thead { display: none; }
  table.data[data-mobile-cards] tbody tr {
    border: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--paper-pure);
  }
  table.data[data-mobile-cards] tbody tr:hover { background: var(--paper-pure); }
  table.data[data-mobile-cards] td,
  table.data[data-mobile-cards] tbody th {
    padding: 4px 0;
    border-bottom: none;
    font-size: 16px;
    text-align: left;
  }
  table.data[data-mobile-cards] td.num { text-align: left; font-family: var(--font-mono); }
  /* Empty spacer cells (subtotal/contingency/total rows) would each render
     as a full-width padded block inside the stacked card — drop them. */
  table.data[data-mobile-cards] td:empty { display: none; }
  /* Two-column label/value layout via a hanging 90px label gutter: the
     ::before label sits in the gutter and wrapped value lines stay aligned
     in the value column instead of sliding flush-left under the label.
     (A grid would strand bare text nodes — e.g. the " · " between RFQ links
     on suppliers — in the label column, so the gutter is done with a
     hanging indent that any cell content shape survives.) */
  table.data[data-mobile-cards] td[data-label] {
    padding-left: 98px;        /* 90px label + 8px gap */
    text-indent: -98px;        /* pull only the first line back for the label */
    overflow-wrap: anywhere;   /* long emails/URLs wrap instead of clipping */
  }
  table.data[data-mobile-cards] td[data-label] > * { text-indent: 0; }
  table.data[data-mobile-cards] td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    width: 90px;
    text-indent: 0;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-right: 8px;
  }
  table.data[data-mobile-cards] td[data-label-hide]::before { content: none; min-width: 0; }
  /* The first body cell — now a <th scope="row"> — acts as the card title.
     Override the base table.data th styling (sticky/uppercase header look)
     so it reads as a title row, matching the old td:first-child treatment. */
  table.data[data-mobile-cards] tbody tr th[scope="row"],
  table.data[data-mobile-cards] tbody tr td:first-child {
    position: static;
    top: auto;
    background: none;
    border-bottom: none;
    text-transform: none;
    letter-spacing: normal;
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 4px;
  }
  table.data[data-mobile-cards] tbody tr th[scope="row"]::before,
  table.data[data-mobile-cards] tbody tr td:first-child::before { display: none; }
}

/* ------------------------------------------------------------------ *
 * Descriptive intro text removed site-wide (redundant, owner request).
 * Hides every page-intro blurb (any [data-i18n] key ending in "intro")
 * and the JS-populated .section-intro explainer lines. Keeps doc.html's
 * per-document summary and the floor-plan attribution caption.
 * Delete this block to restore the intros.
 * ------------------------------------------------------------------ */
[data-i18n$="intro"],
.section-intro {
  display: none !important;
}
