:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f4f8;
  --border: #dbe2ea;
  --border-strong: #c3ceda;
  --text: #1a2430;
  --text-muted: #5a6b7b;
  --text-faint: #8595a5;
  --brand: #1f5f8b;
  --brand-dark: #164964;
  --brand-tint: #e8f1f8;
  --accent: #0e8a7d;
  --shadow: 0 1px 2px rgba(16,36,56,.06), 0 4px 16px rgba(16,36,56,.06);
  --radius: 10px;
  --radius-sm: 7px;
  --maxw: 1080px;

  /* classification / status colours */
  --c-requirement: #1f5f8b;
  --c-guidance: #0e8a7d;
  --c-draft: #b5730b;
  --c-industry: #6b5ca5;
  --c-interpretation: #4a5568;
  --s-met: #1a7f52;
  --s-met-bg: #e5f4ec;
  --s-gap: #c0392b;
  --s-gap-bg: #fdece9;
  --s-consider: #1f5f8b;
  --s-consider-bg: #e8f1f8;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--text); }
h1 { font-size: 1.9rem; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.08rem; margin: 1.25rem 0 .5rem; }
p { margin: .5rem 0; }
small { color: var(--text-muted); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 80px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.center { text-align: center; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.site-header .container { display: flex; align-items: center; gap: 20px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--brand-dark); font-size: 1.15rem; }
.logo:hover { text-decoration: none; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; display: grid; place-items: center; font-size: .95rem; font-weight: 800;
}
.logo .tld { color: var(--accent); }
.nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav a { color: var(--text-muted); padding: 8px 12px; border-radius: 7px; font-weight: 500; font-size: .95rem; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { color: var(--brand-dark); background: var(--brand-tint); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: all .12s ease; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-lg { padding: 13px 26px; font-size: 1.02rem; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card.narrow { max-width: 460px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px){ .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.badge-requirement { color: #fff; background: var(--c-requirement); }
.badge-guidance { color: #fff; background: var(--c-guidance); }
.badge-draft { color: #fff; background: var(--c-draft); }
.badge-industry { color: #fff; background: var(--c-industry); }
.badge-interpretation { color: #fff; background: var(--c-interpretation); }

.badge-soft { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); text-transform: none; font-weight: 600; letter-spacing: 0; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.status-met { color: var(--s-met); background: var(--s-met-bg); }
.status-gap { color: var(--s-gap); background: var(--s-gap-bg); }
.status-consider { color: var(--s-consider); background: var(--s-consider-bg); }

/* ---------- Hero / home ---------- */
.hero {
  background: linear-gradient(160deg, #163a52 0%, #1f5f8b 60%, #0e8a7d 130%);
  color: #fff;
}
.hero .wrap { padding-top: 60px; padding-bottom: 60px; }
.hero h1 { color: #fff; font-size: 2.5rem; max-width: 18ch; letter-spacing: -.02em; }
.hero p.lede { color: #dbe9f2; font-size: 1.2rem; max-width: 60ch; margin-top: 14px; }
.hero .cta { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn { border: none; }
.hero .btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.4); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); }

.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); }
.hero .eyebrow { color: #8fe3d8; }

/* ---------- Flow steps ---------- */
.flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.flow .step {
  flex: 1 1 150px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; position: relative;
}
.flow .step .n { font-size: .75rem; font-weight: 700; color: var(--accent); }
.flow .step .t { font-weight: 600; margin-top: 2px; font-size: .95rem; }

/* ---------- Assessment ---------- */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
@media (max-width: 960px){ .layout { grid-template-columns: 1fr; } }
.sidebar { position: sticky; top: 78px; }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 10px 16px; border: none; background: none; cursor: pointer; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; font-size: .98rem;
}
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.tab .count { font-size: .78rem; background: var(--surface-2); border-radius: 999px; padding: 1px 8px; margin-left: 6px; color: var(--text-muted); }
.tab.active .count { background: var(--brand-tint); color: var(--brand-dark); }

.q-area-header { margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.q-area-header:first-child { margin-top: 0; }
.q-area-header h3 { margin: 0; color: var(--brand-dark); }
.q-area-header p { margin: 2px 0 0; font-size: .88rem; color: var(--text-muted); }

.question { padding: 16px 0; border-bottom: 1px solid var(--border); }
.question:last-child { border-bottom: none; }
.question .q-text { font-weight: 600; }
.question .q-adaptive { font-size: .7rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; margin-left: 8px; }
.options { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface);
}
.option:hover { border-color: var(--border-strong); background: var(--surface-2); }
.option.selected { border-color: var(--brand); background: var(--brand-tint); }
.option input { margin-top: 3px; }
.q-input { padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; width: 100%; max-width: 340px; }
textarea.q-input { max-width: 100%; min-height: 76px; resize: vertical; }

.why {
  margin-top: 10px; font-size: .86rem; color: var(--text-muted);
  background: var(--surface-2); border-left: 3px solid var(--brand); border-radius: 0 6px 6px 0; padding: 8px 12px;
}
.why .why-label { font-weight: 700; color: var(--brand-dark); }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip { font-size: .74rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; color: var(--text-muted); }

/* progress */
.progress { margin-bottom: 14px; }
.progress .bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress .fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); width: 0; transition: width .3s ease; }
.progress .label { font-size: .84rem; color: var(--text-muted); margin-top: 6px; display: flex; justify-content: space-between; }

.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  flex: 1 1 90px; text-align: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 8px;
}
.stat .num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat .lbl { font-size: .76rem; color: var(--text-muted); margin-top: 4px; }
.stat.gap .num { color: var(--s-gap); }
.stat.met .num { color: var(--s-met); }
.stat.docs .num { color: var(--brand); }

/* result items */
.result-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; background: var(--surface); }
.result-item.gap { border-left: 4px solid var(--s-gap); }
.result-item.met { border-left: 4px solid var(--s-met); }
.result-item.consider { border-left: 4px solid var(--s-consider); }
.result-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-head .title { font-weight: 700; }
.result-item .statement { color: var(--text); margin: 8px 0; }
.advice { background: var(--s-gap-bg); border-radius: 6px; padding: 10px 12px; font-size: .9rem; margin-top: 8px; }
.advice .a-label { font-weight: 700; color: var(--s-gap); }

details.trace { margin-top: 10px; }
details.trace > summary { cursor: pointer; font-size: .85rem; color: var(--brand); font-weight: 600; }
details.trace .trace-body { margin-top: 8px; font-size: .86rem; }
.trace-line { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.trace-line:last-child { border-bottom: none; }
.trace-line .ans { font-weight: 600; }

.sources { margin-top: 10px; font-size: .85rem; }
.sources .src { display: inline-flex; align-items: center; gap: 6px; margin: 3px 8px 3px 0; }
.sources .src .loc { color: var(--text-muted); }

/* doc items */
.doc-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; margin-bottom: 14px; background: var(--surface); }
.doc-item.high { border-top: 3px solid var(--s-gap); }
.doc-sections { list-style: none; padding: 0; margin: 10px 0; }
.doc-sections li { padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.doc-sections li:last-child { border-bottom: none; }
.doc-sections .s-title { font-weight: 600; }
.review-note { background: #fff8e8; border: 1px solid #f0dca8; border-radius: 6px; padding: 10px 12px; font-size: .88rem; margin-top: 10px; }
.review-note .rn-label { font-weight: 700; color: var(--c-draft); }

/* library */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-bar select, .filter-bar input { padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 7px; font: inherit; }

/* misc */
.notice { background: var(--brand-tint); border: 1px solid #c7dcec; border-radius: var(--radius-sm); padding: 14px 16px; font-size: .92rem; }
.disclaimer { background: #fff8e8; border: 1px solid #f0dca8; border-radius: var(--radius-sm); padding: 14px 16px; font-size: .9rem; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; margin: 10px 0; }
.legend .item { display: flex; align-items: center; gap: 6px; }
.hidden { display: none !important; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
footer.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: .85rem; }
footer.site-footer .container { padding: 22px 20px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
