/* ==========================================================================
   HNZ Rad Tools — Explainer suite shared stylesheet
   One stylesheet for all app explainer pages. Each page sets its accent via
   a class on <body>: .theme-profiles (blue), .theme-triage (coral).
   Defaults to teal (service-sizing).
   ========================================================================== */

:root {
  --navy: #15233f;
  --navy-deep: #0e1830;
  --ink: #1c2733;
  --slate: #5a6b7e;
  --line: #e2e8f0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --amber: #d98a1f;
  --red: #cf4b3d;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20,35,63,.06), 0 8px 24px rgba(20,35,63,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* default accent: teal (service-sizing) */
  --accent: #1a8f80;
  --accent-dark: #136b60;
  --accent-light: #e6f4f2;
  --accent-glow: rgba(26,143,128,.32);
  --accent-hero: #6fc7bc;      /* accent tint that reads on navy */
  --accent-ink: #2a4540;       /* body text on accent-light */
}
body.theme-profiles {
  --accent: #2f6fb2;
  --accent-dark: #24568b;
  --accent-light: #e8f1fa;
  --accent-glow: rgba(47,111,178,.32);
  --accent-hero: #8db9e4;
  --accent-ink: #263d52;
}
body.theme-triage {
  --accent: #c05a4e;
  --accent-dark: #9c4238;
  --accent-light: #faecea;
  --accent-glow: rgba(192,90,78,.30);
  --accent-hero: #e8a49b;
  --accent-ink: #4e2f2a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-dark); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Top nav ---------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,24,48,.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
}
.brand .name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand .name span { color: #9fb0c8; font-weight: 500; }
.nav-links { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.nav-links a {
  color: #b4c0d4; text-decoration: none; font-size: 13px;
  padding: 6px 11px; border-radius: 7px; transition: .15s; white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-links a.active { color: #fff; background: var(--accent-dark); }
.nav-links .nav-sep { width: 1px; height: 18px; background: rgba(255,255,255,.15); margin: 0 8px; }
.nav-links .nav-label {
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: #6d7f9a; margin-right: 4px;
}
.nav-links a.nav-app {
  color: #cfd8e6; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  padding: 4px 12px; background: rgba(255,255,255,.04);
}
.nav-links a.nav-app:hover { color: #fff; border-color: var(--accent-hero); background: rgba(255,255,255,.07); }
@media (max-width: 960px) {
  .nav-links > a:not(.nav-app), .nav-links .nav-sep { display: none; }
}

/* ---------- "More apps" dropdown ---------- */
.nav-apps { position: relative; }
.nav-apps-btn {
  display: inline-flex; align-items: center; gap: 7px;
  color: #cfd8e6; font-size: 12px; font-weight: 600; font-family: var(--font);
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  padding: 5px 13px; background: rgba(255,255,255,.04); cursor: pointer;
}
.nav-apps-btn i { font-size: 9px; color: #8fa0b8; transition: transform .15s; }
.nav-apps:hover .nav-apps-btn, .nav-apps:focus-within .nav-apps-btn {
  color: #fff; border-color: var(--accent-hero); background: rgba(255,255,255,.07);
}
.nav-apps:hover .nav-apps-btn i, .nav-apps:focus-within .nav-apps-btn i { transform: rotate(180deg); }
.nav-apps-menu {
  position: absolute; right: 0; top: 100%; padding-top: 10px;
  display: none; z-index: 60;
}
.nav-apps:hover .nav-apps-menu, .nav-apps:focus-within .nav-apps-menu { display: block; }
.nav-apps-panel {
  min-width: 205px; background: #101c36; border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.nav-apps-panel a {
  display: flex; align-items: center; gap: 10px;
  color: #cfd8e6; text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 8px 10px; border-radius: 8px;
}
.nav-apps-panel a:hover { background: rgba(255,255,255,.08); color: #fff; }
.am-mark {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
}
.am-hub { background: #41566f; }
.am-sizing { background: linear-gradient(135deg, #1a8f80, #136b60); }
.am-profiles { background: linear-gradient(135deg, #2f6fb2, #24568b); }
.am-triage { background: linear-gradient(135deg, #c05a4e, #9c4238); }

/* ---------- Layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
section { padding: 64px 0 8px; }
.section-tag {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent-dark);
  margin-bottom: 10px;
}
h2 { font-size: 30px; line-height: 1.25; color: var(--navy); margin-bottom: 12px; letter-spacing: -.4px; }
h3 { font-size: 19px; color: var(--navy); margin-bottom: 8px; }
.lead { font-size: 17px; color: var(--slate); max-width: 720px; margin-bottom: 28px; }
p { margin-bottom: 14px; }
.muted { color: var(--slate); }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(900px 460px at 78% -8%, var(--accent-glow), transparent 62%),
              linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff; padding: 0;
}
.hero-inner { max-width: 1180px; margin: 0 auto; padding: 78px 24px 70px; }
.hero h1 {
  font-size: 46px; line-height: 1.1; letter-spacing: -1px;
  max-width: 780px; margin-bottom: 18px;
}
.hero h1 em { color: var(--accent-hero); font-style: normal; }
.hero p.sub { font-size: 18px; color: #c2cee0; max-width: 640px; margin-bottom: 30px; }
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: #dce4f0; font-size: 13px; padding: 7px 13px; border-radius: 999px;
}
.pill b { color: #fff; }
@media (max-width: 640px) { .hero h1 { font-size: 34px; } }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.icon-badge {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-light); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; margin-bottom: 12px;
}
.card h3 { margin-bottom: 6px; }
.card p { font-size: 14.5px; color: var(--slate); margin-bottom: 0; }

/* ---------- Screenshot frame + lightbox ---------- */
.shot { margin: 16px 0 4px; }
.shot-frame {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  box-shadow: 0 6px 22px rgba(20,35,63,.12); background: #fff; cursor: zoom-in;
}
.shot-bar {
  background: #eef1f5; border-bottom: 1px solid var(--line);
  padding: 8px 11px; display: flex; gap: 6px; align-items: center;
}
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: #cdd5df; display: block; }
.shot-bar .shot-where {
  margin-left: 8px; font-size: 11.5px; color: #8693a5; font-weight: 600;
  letter-spacing: .02em;
}
.shot-frame img { display: block; width: 100%; height: auto; }
.shot figcaption { font-size: 12.5px; color: var(--slate); margin-top: 8px; }
.shot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .shot-pair { grid-template-columns: 1fr; } }
.lightbox {
  position: fixed; inset: 0; background: rgba(14,24,48,.93);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 32px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.lightbox .lb-close {
  position: absolute; top: 20px; right: 26px; color: #fff;
  font-size: 30px; line-height: 1; background: none; border: none; cursor: pointer;
}

/* ---------- Showcase ---------- */
.showcase {
  margin-top: 28px; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-radius: var(--radius); padding: 26px;
}
.showcase .shot { margin: 0; }
.showcase figcaption { color: #9fb0c8; }

/* ---------- Hierarchy diagram ---------- */
.hier { display: flex; flex-direction: column; gap: 0; align-items: center; }
.hier-node {
  border-radius: 10px; padding: 12px 18px; text-align: center;
  font-weight: 600; font-size: 14px; min-width: 150px;
}
.hier-conn { width: 2px; height: 22px; background: var(--line); }
.hn-region { background: var(--navy); color: #fff; }
.hn-district { background: #41566f; color: #fff; }
.hn-grain { background: var(--accent); color: #fff; }
.hn-facility { background: var(--accent-light); color: var(--accent-dark); border: 1px solid var(--line); }
.hier-node small { display: block; font-weight: 400; font-size: 11.5px; opacity: .8; }

/* ---------- Archetype chips ---------- */
.arch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.arch {
  flex: 1; min-width: 92px; text-align: center; border-radius: 10px;
  padding: 14px 8px; border: 1px solid var(--line); background: #fff;
}
.arch .tag {
  display: inline-block; width: 34px; height: 34px; line-height: 34px;
  border-radius: 8px; font-weight: 800; font-size: 14px; margin-bottom: 6px; color: #fff;
}
.arch small { display: block; font-size: 12px; color: var(--slate); }

/* ---------- Flow steps / formula ---------- */
.engine-flow { display: flex; flex-direction: column; gap: 14px; }
.flow-step { display: flex; align-items: flex-start; gap: 16px; }
.flow-num {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.flow-body { flex: 1; }
.flow-body h4 { font-size: 15.5px; color: var(--navy); margin-bottom: 3px; }
.flow-body p { font-size: 14px; color: var(--slate); margin-bottom: 6px; }
.formula {
  font-family: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  background: var(--navy-deep); color: #d8e6e3; font-size: 13px;
  padding: 11px 14px; border-radius: 8px; display: inline-block;
  white-space: pre-wrap; line-height: 1.7;
}
.formula .hl { color: var(--accent-hero); }
.formula .dim { color: #8b9bb4; }

/* ---------- Interactive calculator ---------- */
.calc {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-radius: var(--radius); padding: 26px; color: #fff;
}
.calc h3 { color: #fff; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 760px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-field { margin-bottom: 16px; }
.calc-field label {
  display: flex; justify-content: space-between; font-size: 13px;
  color: #b9c6da; margin-bottom: 6px;
}
.calc-field label b { color: var(--accent-hero); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent); cursor: pointer; }
.readout {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 16px;
}
.readout-line {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,.1);
  font-size: 13.5px; color: #c2cee0;
}
.readout-line:last-child { border-bottom: none; }
.readout-line b { color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
.result-fte { text-align: center; padding: 14px 0 6px; }
.result-fte .big {
  font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
}
.result-fte .label { font-size: 12px; color: #b9c6da; letter-spacing: .08em; text-transform: uppercase; }
.status-badge {
  display: inline-block; margin-top: 10px; padding: 5px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.st-understaffed { background: rgba(207,75,61,.2); color: #ff9d92; }
.st-adequate { background: rgba(26,143,128,.25); color: #6fc7bc; }
.st-overstaffed { background: rgba(217,138,31,.2); color: #f0b760; }

/* ---------- Feature tour ---------- */
.feature {
  display: grid; grid-template-columns: 220px 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #fff; box-shadow: var(--shadow); margin-bottom: 16px;
}
@media (max-width: 720px) { .feature { grid-template-columns: 1fr; } }
.feature-side {
  background: linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff; padding: 20px; display: flex; flex-direction: column; gap: 6px;
}
.feature-side .ftag {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-hero);
}
.feature-side h3 { color: #fff; font-size: 18px; margin: 0; }
.feature-side .who { font-size: 12.5px; color: #9fb0c8; margin-top: auto; padding-top: 10px; }
.feature-main { padding: 20px 22px; }
.feature-main p { font-size: 14.5px; color: var(--slate); margin-bottom: 10px; }
.feature-main ul { margin: 0 0 4px 18px; }
.feature-main li { font-size: 14px; color: var(--slate); margin-bottom: 4px; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; }
.group-head .gline { flex: 1; height: 1px; background: var(--line); }
.group-head span {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--navy); background: var(--accent-light); padding: 4px 12px; border-radius: 999px;
}

/* ---------- Architecture ---------- */
.arch-diagram { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .arch-diagram { grid-template-columns: 1fr; } }
.arch-box { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: #fff; }
.arch-box h4 { font-size: 15px; color: var(--navy); margin-bottom: 4px; }
.arch-box .tech { font-size: 12.5px; color: var(--accent-dark); font-weight: 600; margin-bottom: 8px; }
.arch-box ul { margin-left: 16px; }
.arch-box li { font-size: 13.5px; color: var(--slate); margin-bottom: 3px; }
.arch-link {
  text-align: center; font-size: 13px; color: var(--slate);
  background: var(--accent-light); border-radius: 10px; padding: 10px; margin: 14px 0;
}
.arch-link b { color: var(--accent-dark); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--line); }
th { background: var(--navy); color: #fff; font-weight: 600; font-size: 13px; }
td:first-child { font-weight: 600; color: var(--navy); }
tr:last-child td { border-bottom: none; }
.yes { color: var(--accent-dark); font-weight: 700; }
.no { color: #b9c1cc; }

/* ---------- Callout & tip ---------- */
.callout {
  border-left: 3px solid var(--accent); background: var(--accent-light);
  padding: 14px 18px; border-radius: 0 10px 10px 0; font-size: 14.5px; color: var(--accent-ink);
}
.callout b { color: var(--accent-dark); }
.tip {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-light); border-radius: 8px;
  padding: 11px 13px; font-size: 13.5px; color: var(--accent-ink); margin: 6px 0 12px;
}
.tip i { color: var(--accent-dark); margin-top: 3px; flex-shrink: 0; }
.tip b { color: var(--accent-dark); }

/* ---------- Generic key/value chips ---------- */
.cnr-list { display: flex; flex-direction: column; gap: 8px; }
.cnr-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 13px; font-size: 14px;
  background: #fff;
}
.cnr-item .num {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff;
}
.cnr-item .ktxt { flex: 1; }
.cnr-item .ktxt b { color: var(--navy); }
.cnr-item .ktag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px; }
.tag-rep { background: #e7eef7; color: #41566f; }
.tag-cnr { background: var(--accent-light); color: var(--accent-dark); }

/* ---------- Priority badges (triage) ---------- */
.prio-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.prio {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; padding: 5px 11px; border-radius: 999px;
  font-weight: 800; font-size: 13px; color: #fff;
}
.p1 { background: #b02a1e; }
.p2 { background: #d96a1f; }
.p3 { background: #d9a01f; }
.p4 { background: #2f6fb2; }
.p5 { background: #6b7a8d; }
.ps { background: #41566f; }

/* ---------- Hub (index) cards ---------- */
.hub-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 26px; }
@media (max-width: 900px) { .hub-cards { grid-template-columns: 1fr; } }
.hub-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.hub-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(20,35,63,.16); }
.hub-card .hub-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--navy-deep); }
.hub-card .hub-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.hub-card .hub-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.hub-card .hub-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.hub-card h3 { font-size: 19px; margin: 0; }
.hub-card p { font-size: 14px; color: var(--slate); margin: 0; flex: 1; }
.hub-card .hub-cta { font-size: 13.5px; font-weight: 700; margin-top: 10px; }
.hub-card.hc-sizing .hub-kicker, .hub-card.hc-sizing .hub-cta { color: #136b60; }
.hub-card.hc-profiles .hub-kicker, .hub-card.hc-profiles .hub-cta { color: #24568b; }
.hub-card.hc-triage .hub-kicker, .hub-card.hc-triage .hub-cta { color: #9c4238; }

/* ---------- Footer ---------- */
footer {
  background: var(--navy-deep); color: #8fa0b8; margin-top: 60px;
  padding: 30px 24px; text-align: center; font-size: 13px;
}
footer b { color: #fff; }
footer a { color: #b4c0d4; }
