/* =============================================================
   TBH — The Building Handbook
   Page layout + app chrome
   Each page is driven by a data-sec attribute (opr, tr, ps,
   dr, sr4b, pft, gi, fpt, sr5c, tab, om, wi, front) which sets
   --sec — the section color applied to the title banner,
   code chip, table headers, and rules.
   ============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');
@import url('./colors_and_type.css');

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #e3e6eb; }

/* =========== APP SHELL =========== */
.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--fg);
}

/* =========== SIDEBAR =========== */
.sidebar {
  background: var(--unvc-deep-navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--unvc-deep-navy);
}
.sb-brand {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sb-brand img { height: 22px; filter: brightness(0) invert(1); }
.sb-brand-txt {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 14px;
  line-height: 1;
  color: #fff;
}
.sb-brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .18em;
  color: #8aa4cc;
  margin-top: 3px;
  text-transform: uppercase;
}

.sb-search {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: relative;
}
.sb-search input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  padding: 8px 10px 8px 30px;
  font-family: var(--font-body);
  font-size: 12px;
  border-radius: 3px;
  outline: none;
  letter-spacing: .02em;
}
.sb-search input::placeholder { color: #6b7d9e; }
.sb-search input:focus { border-color: var(--unvc-teal); background: rgba(22,128,165,.08); }
.sb-search svg { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: #6b7d9e; }

.sb-scroll { overflow-y: auto; flex: 1; padding: 6px 0 40px; }
.sb-scroll::-webkit-scrollbar { width: 6px; }
.sb-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

/* Volumes (equipment types) */
.vol {
  padding: 10px 20px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  transition: background var(--dur-fast);
}
.vol:hover { background: rgba(255,255,255,.04); }
.vol-chev { width: 10px; font-family: var(--font-mono); font-size: 10px; color: #6b7d9e; }
.vol-num { font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; color: #6b7d9e; }
.vol-name {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  text-transform: uppercase; letter-spacing: .04em; color: #fff; flex: 1;
}
.vol-count { font-family: var(--font-mono); font-size: 9px; color: #6b7d9e; letter-spacing: .1em; }
.vol.inactive .vol-name { color: #6b7d9e; }
.vol.inactive .vol-num { color: #4a5a7a; }
.vol-body { padding: 2px 0 8px; }

/* Section groups inside volume — now carry a color dot */
.sec-group {
  padding: 8px 20px 4px 34px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .18em;
  color: #8aa4cc;
  text-transform: uppercase;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-group .swatch {
  width: 10px; height: 10px; border-radius: 2px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}

.sec-item {
  display: grid;
  grid-template-columns: 8px 44px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 24px;
  cursor: pointer;
  transition: background var(--dur-fast);
  font-family: var(--font-body);
  font-size: 12px;
  color: #c7d0de;
  line-height: 1.3;
  position: relative;
}
.sec-item .stripe {
  height: 18px; width: 4px; border-radius: 1px;
  background: var(--sec-color, #444);
  justify-self: center;
}
.sec-item:hover { background: rgba(255,255,255,.04); color: #fff; }
.sec-item.active {
  background: rgba(255,255,255,.05);
  color: #fff;
}
.sec-item.active .stripe { width: 6px; height: 24px; }
.sec-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  color: #fff;
  background: var(--sec-color, #414042);
  padding: 3px 6px;
  border-radius: 2px;
  text-align: center;
}
.sec-item-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sec-item-name { color: inherit; }
.sec-item-num { font-family: var(--font-mono); font-size: 8.5px; color: #6b7d9e; letter-spacing: .12em; }

/* Sidebar footer */
.sb-foot {
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
  color: #6b7d9e;
  text-transform: uppercase;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  justify-content: space-between;
}

/* =========== MAIN AREA =========== */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #dadde3;
}
.toolbar {
  height: 46px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  flex-shrink: 0;
}
.crumb {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.crumb .sep { color: var(--gray-300); }
.crumb .cur { color: var(--unvc-deep-navy); font-weight: 700; }
.crumb .code-chip {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  color: #fff;
  background: var(--sec, var(--unvc-mid-navy));
  padding: 3px 8px;
  border-radius: 999px;
}

.toolbar-spacer { flex: 1; }

.tb-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--dur-fast);
}
.tb-btn:hover { border-color: var(--unvc-teal); color: var(--unvc-teal); }
.tb-btn.primary {
  background: var(--unvc-mid-navy);
  border-color: var(--unvc-mid-navy);
  color: #fff;
}
.tb-btn.primary:hover { background: var(--unvc-deep-navy); border-color: var(--unvc-deep-navy); color: #fff; }

.page-ctr {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg);
  letter-spacing: .08em;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 10px;
  border-left: 1px solid var(--gray-200);
  border-right: 1px solid var(--gray-200);
  height: 30px;
}
.page-ctr .sep { color: var(--gray-300); }

/* Viewer */
.viewer {
  flex: 1;
  overflow: auto;
  padding: 24px 0 40px;
  scroll-behavior: smooth;
}
.viewer.density-compact .page-shell { transform: scale(.82); transform-origin: top center; margin-bottom: -180px; }

/* =========== PAGE SHELL (8.5x11 @ 96dpi = 816x1056) =========== */
.page-shell {
  width: 816px;
  min-height: 1056px;
  background: #fff;
  margin: 0 auto 28px;
  box-shadow: 0 10px 36px rgba(24,35,78,.18), 0 2px 8px rgba(24,35,78,.08);
  position: relative;
  display: flex;
  flex-direction: column;

  /* fall-back default; overridden by data-sec selectors below */
  --sec: var(--unvc-deep-navy);
}
/* Section-color top stripe — 10px bar at the very top of every body page.
   Uses --sec so each section is visually "tagged" on the shelf.
   Front-matter pages (cover / title / blank) suppress it. */
.page-shell::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
  background: var(--sec);
  z-index: 1;
}
.page-shell[data-sec="front"]::before { display: none; }
.page-shell.no-top-stripe::before { display: none; }

.page-inner {
  padding: 50px 64px 40px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.page-cover-bg { background: #fff; }

/* Section-color driver.
   Every body page carries data-sec="<code>" which sets --sec. */
.page-shell[data-sec="opr"]  { --sec: var(--sec-opr);  }
.page-shell[data-sec="tr"]   { --sec: var(--sec-tr);   }
.page-shell[data-sec="ps"]   { --sec: var(--sec-ps);   }
.page-shell[data-sec="dr"]   { --sec: var(--sec-dr);   }
.page-shell[data-sec="sr4b"] { --sec: var(--sec-sr4b); }
.page-shell[data-sec="pft"]  { --sec: var(--sec-pft);  }
.page-shell[data-sec="gi"]   { --sec: var(--sec-gi);   }
.page-shell[data-sec="fpt"]  { --sec: var(--sec-fpt);  }
.page-shell[data-sec="sr5c"] { --sec: var(--sec-sr5c); }
.page-shell[data-sec="tab"]  { --sec: var(--sec-tab);  }
.page-shell[data-sec="om"]   { --sec: var(--sec-om);   }
.page-shell[data-sec="wi"]   { --sec: var(--sec-wi);   }
.page-shell[data-sec="front"]{ --sec: var(--unvc-deep-navy); }

/* =========== BODY-PAGE HEADER / FOOTER =========== */
/* Matches reference: UNVC | ### on one side, ### | UNVC on the other
   No page numbers — watermark only.                              */
.hb-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--gray-500);
  padding: 0 0 12px;
  margin-bottom: 16px;
  text-transform: uppercase;
}
.hb-topbar.right { flex-direction: row-reverse; }
.hb-topbar .brand {
  font-weight: 700;
  color: var(--unvc-charcoal);
}
.hb-topbar .brand img {
  height: 11px; width: auto; vertical-align: middle;
  margin-right: 6px;
  filter: brightness(0) saturate(100%) invert(14%) sepia(18%) saturate(2128%) hue-rotate(199deg) brightness(92%) contrast(93%);
}
.hb-topbar .sep { color: var(--gray-300); margin: 0 6px; }

/* Section header — clean, text-only. Matches PDF reference:
   COMPRESSED AIR (small, muted) on line 1,
   SECTION NAME  [CODE]   PROJECT   DATE on line 2. */
.hb-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--unvc-charcoal);
  margin-bottom: 18px;
  gap: 18px;
}
.hb-banner .eq {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gray-500);
  line-height: 1.2;
  margin-bottom: 6px;
}
.hb-banner .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--unvc-charcoal);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hb-banner .name .code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  color: #fff;
  background: var(--sec);
  padding: 3px 8px;
  border-radius: 2px;
  text-transform: uppercase;
}
.hb-banner .proj {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--gray-500);
  text-transform: uppercase;
  line-height: 1.5;
}
.hb-banner .proj .d { color: var(--unvc-charcoal); font-weight: 700; }

/* Footer watermark + ribbon */
.hb-ribbon {
  height: 10px;
  background: var(--sec);
  opacity: .9;
  margin-top: auto;
}
.hb-footline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 8px 64px 14px;
  background: #fff;
}
.hb-footline .sep { color: var(--gray-300); margin: 0 6px; }
.hb-footline .wm {
  color: var(--gray-400);
  font-weight: 400;
  letter-spacing: .14em;
}

/* =========== HEADINGS INSIDE BODY =========== */
.hb-section-sub {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin: 4px 0 8px;
}
/* Page title — now hidden by default since hb-banner carries the section name.
   Pages that need an explicit sub-title inside the body can add .show. */
.hb-h1 { display: none; }
.hb-h1.show {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--unvc-charcoal);
  margin: 4px 0 12px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.hb-section-sub { display: none; } /* PDF ref doesn't use these eyebrows */
/* Numbered heading: "1. COMMISSIONING PROCESS OVERVIEW" — PDF-ref style.
   Charcoal text, small, underlined with the section color. */
.hb-h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--unvc-charcoal);
  margin: 20px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--sec);
}
.hb-h2 .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--unvc-charcoal);
  letter-spacing: .04em;
  min-width: 20px;
}
.hb-h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  color: var(--unvc-deep-navy);
  margin: 12px 0 6px;
  letter-spacing: .02em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.hb-h3 .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--sec);
  letter-spacing: .04em;
}
.hb-p {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.6;
  color: var(--unvc-charcoal);
  margin: 0 0 10px;
  text-wrap: pretty;
}

/* =========== TABLE =========== */
.hb-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--unvc-charcoal);
  font-variant-numeric: tabular-nums;
  margin: 6px 0 14px;
}
.hb-table th {
  background: var(--gray-100);
  color: var(--unvc-charcoal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 9.5px;
  padding: 7px 9px;
  text-align: left;
  border-bottom: 2px solid var(--sec);
  border-right: 1px solid var(--gray-200);
  vertical-align: top;
}
.hb-table th:last-child { border-right: 0; }
.hb-table td {
  padding: 6px 9px;
  border-bottom: 1px solid var(--gray-100);
  border-right: 1px solid var(--gray-100);
  vertical-align: top;
  line-height: 1.45;
}
.hb-table td:last-child { border-right: 0; }
.hb-table tr:nth-child(even) td { background: #fafafa; }
.hb-table .mono {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--sec);
  font-size: 10px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.hb-table .num-cell {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--unvc-deep-navy);
  letter-spacing: .04em;
}
.hb-table .placeholder { color: var(--gray-400); font-style: italic; }

/* Placeholder highlighting toggle */
.viewer.highlight-placeholders .placeholder,
.viewer.highlight-placeholders .ph {
  background: #fff4c8;
  color: #6b4800;
  padding: 0 3px;
  border-radius: 2px;
  font-style: normal;
}

/* Code chip (generic) */
.code-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  color: #fff;
  padding: 4px 10px;
  border-radius: 2px;
  min-width: 36px;
}
.code-chip.sm { font-size: 9px; padding: 2px 7px; letter-spacing: .1em; }

/* Status pills */
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: .14em;
  padding: 2px 7px;
  border-radius: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill.ok { background: #e7f1ea; color: #2f7a4f; }
.pill.warn { background: #f8edd9; color: #8c570e; }
.pill.open { background: #e1eef4; color: #0f5578; }
.pill.fail { background: #f4dcdc; color: #7a2727; }
.pill.na { background: var(--gray-100); color: var(--fg-muted); }
.pill.na-empty { background: transparent; color: var(--gray-400); border: 1px dashed var(--gray-300); }
.pill.pending { background: #f0eae3; color: #6b4800; }
.pill.critical { background: #f4dcdc; color: #7a2727; }
.pill.high     { background: #f8edd9; color: #8c570e; }
.pill.medium   { background: #eef1f7; color: var(--unvc-mid-navy); }
.pill.low      { background: var(--gray-100); color: var(--fg-muted); }

/* Callouts — keyed to the section color */
.hb-co {
  display: flex;
  gap: 14px;
  padding: 10px 14px;
  border-left: 4px solid var(--sec);
  background: #f4f5f8;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.55;
  color: var(--unvc-deep-navy);
  margin: 10px 0 14px;
}
.hb-co .lbl {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  min-width: 60px;
  color: var(--sec);
  padding-top: 1px;
}
.hb-co.shall { }
.hb-co.warn { border-color: #c47a1a; background: #fdf8ef; color: #6b4800; }
.hb-co.warn .lbl { color: #8c570e; }
.hb-co.note { border-color: var(--gray-400); background: var(--gray-50); color: var(--fg); }
.hb-co.note .lbl { color: var(--fg-muted); }

/* ======= TITLE PAGE (reference style) =======
   Big all-caps "COMPRESSED AIR" title over a single
   aspect/information table with 5 columns.                   */
/* ====== HANDBOOK MASTER COVER (black, full-bleed) ====== */
.section-divider.hb-cover {
  background: #0a0a0a;
  color: #fff;
  position: relative;
  overflow: hidden;
}
/* Faint photo glow behind the title only — sits behind everything */
.section-divider.hb-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255,255,255,.08), transparent 60%),
    linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
  pointer-events: none;
  z-index: 0;
}
.section-divider.hb-cover > * { position: relative; z-index: 2; }

/* Knockout title — letters are a window onto the building photo.
   Photo is positioned to fill the WHOLE printed page so the
   image visible inside each line stays continuous and the building
   reads correctly across "The / Building / Handbook". */
.hb-cover-knockout {
  background-image: url("../assets/uvu-classroom-bldg.png");
  background-size: 110% auto;          /* slight zoom for composition */
  background-position: center 38%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* keep stack-of-divs layout from .giant; ensure each line picks up
     the same continuous photo by sharing a single bg origin */
  background-origin: border-box;
  background-attachment: local;
}
/* Bigger letters so the photo fills more of the cover.
   "Building" / "Handbook" sized to fit the page width on 8.5×11. */
.section-divider.hb-cover .giant {
  font-size: 168px;
  letter-spacing: -.02em;
  line-height: .88;
}
.section-divider.hb-cover .giant > div { line-height: .88; }
.section-divider.hb-cover .giant .the {
  font-size: 56px;
  letter-spacing: .02em;
  line-height: 1;
  margin-bottom: 4px;
  font-weight: 700;
}

/* Three-band layout for the master cover:
   top band keeps the title up high right under the stamp,
   bottom band drops the TBH plate + paragraph low for breathing room. */
.section-divider.hb-cover .hb-cover-top {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.section-divider.hb-cover .hb-cover-title .eyebrow {
  margin-bottom: 14px;
}
.section-divider.hb-cover .hb-cover-bottom {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 8px;
}

.section-divider.hb-cover .eyebrow { color: rgba(255,255,255,.55); }
.section-divider.hb-cover .code-plate {
  background: #fff;
  color: #0a0a0a;
}
.section-divider.hb-cover .desc { color: rgba(255,255,255,.78); max-width: 540px; }
.section-divider.hb-cover .stamp { color: rgba(255,255,255,.7); }
.section-divider.hb-cover .stamp img { filter: invert(1) brightness(2); }
.section-divider.hb-cover .foot { color: rgba(255,255,255,.55); border-top: 1px solid rgba(255,255,255,.18); }
.section-divider.hb-cover .foot span:last-child { color: #fff; font-weight: 700; }

.hb-cover-vols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 28px;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.hb-cover-vols .vol-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.hb-cover-vols .vol-row .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.3);
  flex-shrink: 0;
}
.hb-cover-vols .vol-row.active { color: #fff; }
.hb-cover-vols .vol-row.active .dot { background: var(--unvc-amber, #f4a824); }

@media print {
  .hb-cover-knockout {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
   Single table with thick visible grid lines mimicking the source. */
.title-grid {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--unvc-charcoal);
  border: 1.5px solid var(--unvc-charcoal);
}
.title-grid th {
  background: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--unvc-charcoal);
  text-align: left;
  padding: 8px 10px;
  border: 1.5px solid var(--unvc-charcoal);
  border-bottom: 2px solid var(--unvc-charcoal);
}
.title-grid td {
  padding: 8px 10px;
  border: 1px solid var(--gray-300);
  vertical-align: middle;
  line-height: 1.4;
  font-size: 11px;
  height: 34px;
}
.title-grid td.t-aspect {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--unvc-charcoal);
  text-transform: uppercase;
  background: #fafafa;
}
.title-grid td.t-info {
  font-weight: 600;
  color: var(--unvc-charcoal);
}
.title-grid td.t-code {
  text-align: center;
  padding: 4px;
}
.title-grid .t-code-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  color: #fff;
  padding: 4px 10px;
  border-radius: 2px;
  min-width: 38px;
  text-align: center;
  text-transform: uppercase;
}
.title-grid td.t-section {
  font-weight: 600;
  color: var(--unvc-charcoal);
}
.title-grid td.t-date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--gray-600);
  text-transform: uppercase;
}

/* Title-page footer — three columns (logo / project / meta) */
.title-footer {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 26px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--gray-500);
  text-transform: uppercase;
}
.title-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--unvc-charcoal);
}
.title-table th {
  background: transparent;
  color: var(--unvc-charcoal);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--unvc-charcoal);
  border-right: 0;
}
.title-table th:first-child { padding-left: 0; }
.title-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
  font-size: 11px;
  line-height: 1.5;
}
.title-table td:first-child {
  padding-left: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--gray-600);
  text-transform: uppercase;
  width: 110px;
}
.title-table td.code-col {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  color: #fff;
  width: 56px;
  padding: 0;
}
.title-table td.code-col span {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 2px;
  min-width: 44px;
  text-align: center;
  background: var(--code-bg, var(--unvc-charcoal));
  text-transform: uppercase;
}
.title-table td.date-col {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--gray-500);
  width: 100px;
  text-transform: uppercase;
}
.title-table td.section-col {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--unvc-charcoal);
}
.title-aspect-head {
  padding-top: 14px !important;
  padding-bottom: 10px !important;
}

.title-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--gray-500);
  text-transform: uppercase;
}
.title-footer img { height: 14px; opacity: .6; }

/* Intentionally blank page */
.blank-msg {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gray-400);
}

/* ======= SECTION DIVIDER =======
   Full-bleed color page using --sec                             */
.section-divider {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 72px 64px;
  min-height: 1056px;
  background: var(--sec);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.section-divider .stamp {
  display: flex; gap: 10px; align-items: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em;
  color: rgba(255,255,255,.75); text-transform: uppercase;
}
.section-divider .stamp img { height: 14px; filter: brightness(0) invert(1); opacity: .85; }
.section-divider .giant {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 108px;
  line-height: .88;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
}
.section-divider .eyebrow {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 11px; letter-spacing: .28em;
  text-transform: uppercase; color: rgba(255,255,255,.7);
  margin-bottom: 16px;
}
.section-divider .code-plate {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .24em;
  color: var(--sec);
  background: #fff;
  padding: 8px 14px;
  border-radius: 2px;
  display: inline-block;
  margin-top: 20px;
}
.section-divider .desc {
  font-family: var(--font-body); font-size: 13px;
  line-height: 1.6; color: rgba(255,255,255,.85); max-width: 540px;
  margin-top: 20px;
}
.section-divider .foot {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .22em; color: rgba(255,255,255,.65); text-transform: uppercase;
}

/* ======= OPEN-SHELF SPECTRUM STRIP (shown on front matter) ======= */
.spectrum {
  display: flex;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  margin: 10px 0 0;
}
.spectrum .seg { flex: 1; }

/* =========== SCHEMATIC + INFOGRAPHICS =========== */
.schematic {
  background: var(--paper);
  border: 1px solid var(--gray-200);
  padding: 22px 18px;
  margin: 8px 0 12px;
}
.sch-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sch-node {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  border: 1.5px solid var(--sec);
  background: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--unvc-charcoal);
}
.sch-node .tag {
  display: block; font-weight: 700; font-size: 8.5px;
  color: var(--sec); margin-bottom: 2px; letter-spacing: .14em;
}
.sch-node .lbl { font-size: 9.5px; font-weight: 700; color: var(--unvc-deep-navy); }
.sch-arrow {
  font-family: var(--font-mono); color: var(--sec);
  font-size: 14px; flex: 0 0 20px; text-align: center;
}
.sch-legend {
  margin-top: 16px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .08em; color: var(--gray-500);
  text-transform: uppercase; padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}
.sch-legend .k { color: var(--sec); font-weight: 700; }

/* Phase cells */
.phase-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 18px; }
.phase-cell {
  padding: 14px 14px 16px;
  border-top: 4px solid var(--sec);
  background: #fff;
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  border-left: 1px solid var(--gray-100);
}
.phase-cell .num { font-family: var(--font-mono); font-size: 10px; color: var(--gray-400); letter-spacing: .16em; }
.phase-cell .ttl {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  text-transform: uppercase; color: var(--sec);
  margin: 2px 0 6px; letter-spacing: .04em;
}
.phase-cell p { font-family: var(--font-body); font-size: 10.5px; line-height: 1.5; color: var(--unvc-charcoal); margin: 0; }
.phase-cell.a { opacity: 1; }
.phase-cell.b { filter: brightness(.95); }
.phase-cell.c { filter: brightness(.85); }
.phase-cell.d { filter: brightness(.75); }

/* Swimlane */
.swimlane {
  display: grid;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--unvc-charcoal);
  border: 1px solid var(--gray-200);
  background: #fff;
}
.swimlane .h {
  padding: 8px 10px; background: var(--sec); color: #fff;
  letter-spacing: .1em; font-size: 9.5px;
  border-left: 1px solid rgba(255,255,255,.18);
}
.swimlane .h:first-child { border-left: 0; }
.swimlane .r-lbl {
  padding: 8px 10px; color: var(--sec); font-weight: 700;
  letter-spacing: .08em; border-top: 1px solid var(--gray-100); background: #fff;
}
.swimlane .c {
  padding: 8px 10px; border-top: 1px solid var(--gray-100);
  border-left: 1px solid var(--gray-100); background: #fff;
}
.swimlane .c.alt { background: #fafaf7; }
.swimlane .c.empty { color: var(--gray-300); }

/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--gray-200);
  margin: 12px 0;
}
.kpi {
  padding: 12px 14px;
  border-right: 1px solid var(--gray-200);
}
.kpi:last-child { border-right: 0; }
.kpi .k {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .16em; color: var(--gray-500); text-transform: uppercase;
}
.kpi .v {
  font-family: var(--font-display);
  font-weight: 800; font-size: 24px;
  color: var(--sec); line-height: 1;
  margin-top: 4px; letter-spacing: 0;
}
.kpi .u {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--gray-500); letter-spacing: .12em; margin-left: 4px;
}

/* Misc */
.tiny-note {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--gray-500);
  letter-spacing: .08em;
  margin: 6px 0;
  text-transform: uppercase;
}

.sig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 20px 0; }
.sig-line { border-bottom: 1px solid var(--unvc-charcoal); height: 28px; }
.sig-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--gray-500);
  text-transform: uppercase;
  margin-top: 4px;
}
.sig-row.three { grid-template-columns: repeat(3, 1fr); }
.sig-row.four { grid-template-columns: repeat(4, 1fr); }

/* Check cells */
.check-cell {
  width: 14px; height: 14px;
  border: 1.5px solid var(--sec);
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
  background: #fff;
}
.check-cell.v::after {
  content: "✓"; display: block; text-align: center;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--status-ok); line-height: 12px; font-weight: 700;
}
.check-cell.x::after {
  content: "✕"; display: block; text-align: center;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--sec); line-height: 12px; font-weight: 700;
}

/* Tweaks panel */
.tweaks {
  position: fixed;
  right: 20px; bottom: 20px; width: 280px;
  background: #fff;
  border: 1px solid var(--gray-200);
  box-shadow: 0 12px 36px rgba(24,35,78,.2);
  z-index: 100;
  font-family: var(--font-body);
  font-size: 12px;
  border-radius: 4px;
  overflow: hidden;
}
.tweaks-head {
  background: var(--unvc-deep-navy); color: #fff;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks-body { padding: 12px 14px 14px; }
.tweak-row { margin-bottom: 12px; }
.tweak-row:last-child { margin-bottom: 0; }
.tweak-lbl {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gray-500);
  margin-bottom: 4px;
}
.tweak-seg {
  display: flex; border: 1px solid var(--gray-200);
  border-radius: 3px; overflow: hidden;
}
.tweak-seg button {
  flex: 1; border: 0; background: #fff;
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  color: var(--fg); padding: 6px 4px; cursor: pointer;
  border-right: 1px solid var(--gray-200);
  transition: all var(--dur-fast);
}
.tweak-seg button:last-child { border-right: 0; }
.tweak-seg button.on { background: var(--unvc-mid-navy); color: #fff; }
.tweak-seg button:hover:not(.on) { background: var(--gray-50); }
.tweak-toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.tweak-toggle .sw {
  width: 32px; height: 18px; border-radius: 999px;
  background: var(--gray-300); position: relative;
  transition: background var(--dur-fast);
}
.tweak-toggle .sw::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform var(--dur-fast);
}
.tweak-toggle.on .sw { background: var(--unvc-teal); }
.tweak-toggle.on .sw::after { transform: translateX(14px); }

/* Placeholder token */
.ph { color: var(--gray-400); font-style: italic; font-family: var(--font-body); }

mark { background: #fff4c8; color: #6b4800; padding: 0 2px; }
