/* NP FHIR IG Conformance Sandbox — portal styles.
   Hand-written; no framework. Design tokens on :root, light + dark.
   Visual language follows Government of Nepal (GIWMS) portals such as opmcm.gov.np:
   theme blue #0447AF, top-strip blue #2460B9, accent red #CC1424, light band #F4F8FF,
   Poppins (Latin) + Mukta (Devanagari). See ../../DESIGN-REFERENCE.md. */
@import url("../../fonts/fonts.ed2a5aeda57c.css");

:root {
  --np-crimson: #cc1424;          /* GIWMS --secondary-color */
  --np-crimson-strong: #a80f1d;
  --np-navy: #0447af;             /* GIWMS --theme-color */
  --np-navy-strong: #03358a;
  --np-topstrip: #2460b9;         /* GIWMS --updated-theme */
  --np-band: #f4f8ff;             /* GIWMS --theme-light-color */
  --np-header-brand: #264f8b;     /* computed: .header-7-top .top__group background */
  --footer-bg: #2460b9;           /* computed: .footer-8 background */
  --footer-bg-2: #2460b9;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e6e9ee;
  --text: #1a1f2b;
  --text-muted: #4f5868;
  --border: #d5dae2;
  --border-strong: #b5bdc9;
  --band: #f4f8ff;
  --link: #0447af;
  --link-hover: #a80f1d;
  --focus: #0447af;
  --primary: #0447af;
  --primary-hover: #03358a;
  --primary-text: #ffffff;
  --danger: #b00020;
  --danger-bg: #fdecee;
  --danger-border: #f2b8c0;
  --warn: #7a4d00;
  --warn-bg: #fff4d6;
  --warn-border: #f0d48a;
  --ok: #0f6b3a;
  --ok-bg: #e5f5ec;
  --ok-border: #a8dbbd;
  --info: #0b4f8a;
  --info-bg: #e7f1fb;
  --info-border: #b3d1ef;
  --code-bg: #f3f4f7;
  --code-text: #1a1f2b;
  --shadow: 0 2px 10px rgba(4, 71, 175, .08);
  --radius: 4px;
  --radius-lg: 6px;
  --maxw: 1280px;
  --font: "Poppins", "Mukta", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", Arial, sans-serif;
  --font-ne: "Mukta", "Poppins", "Noto Sans Devanagari", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131c;
    --surface: #161d29;
    --surface-2: #1c2433;
    --surface-3: #243045;
    --band: #142039;
    --text: #e7eaf0;
    --text-muted: #a6afbf;
    --border: #2c3747;
    --border-strong: #3d4a5e;
    --link: #9dbbff;
    --link-hover: #ff8c9c;
    --focus: #79a8ff;
    --primary: #3d6fd6;
    --primary-hover: #5583e6;
    --primary-text: #ffffff;
    --danger: #ff8a96;
    --danger-bg: #3a1419;
    --danger-border: #6e2530;
    --warn: #f4c96b;
    --warn-bg: #33270d;
    --warn-border: #6a5219;
    --ok: #7fd8a5;
    --ok-bg: #0f2c1d;
    --ok-border: #1f5a3a;
    --info: #9cc8f5;
    --info-bg: #0f2338;
    --info-border: #24476b;
    --code-bg: #10161f;
    --code-text: #e7eaf0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131c;
  --surface: #161d29;
  --surface-2: #1c2433;
  --surface-3: #243045;
  --band: #142039;
  --text: #e7eaf0;
  --text-muted: #a6afbf;
  --border: #2c3747;
  --border-strong: #3d4a5e;
  --link: #9dbbff;
  --link-hover: #ff8c9c;
  --focus: #79a8ff;
  --primary: #3d6fd6;
  --primary-hover: #5583e6;
  --primary-text: #ffffff;
  --danger: #ff8a96;
  --danger-bg: #3a1419;
  --danger-border: #6e2530;
  --warn: #f4c96b;
  --warn-bg: #33270d;
  --warn-border: #6a5219;
  --ok: #7fd8a5;
  --ok-bg: #0f2c1d;
  --ok-border: #1f5a3a;
  --info: #9cc8f5;
  --info-bg: #0f2338;
  --info-border: #24476b;
  --code-bg: #10161f;
  --code-text: #e7eaf0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
:lang(ne) { font-family: var(--font-ne); }
h1, h2, h3, h4 { line-height: 1.3; margin: 1.4em 0 .5em; font-weight: 600; }
h1 { font-size: 1.75rem; margin-top: .4em; font-weight: 700; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
code, kbd, pre, samp { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; border: 1px solid var(--border); overflow-wrap: anywhere; }
pre { background: var(--code-bg); color: var(--code-text); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; overflow: auto; line-height: 1.45; max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; background: var(--surface-2); font-size: .92rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: .5rem; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.break { overflow-wrap: anywhere; word-break: break-word; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1rem; }

/* ---------- government header (GIWMS header-7: blue band = darker emblem/title block + notice area, then white nav) ---------- */
.site-header { background: var(--surface); }
.header-top { background: var(--np-topstrip); color: #fff; display: flex; align-items: stretch; flex-wrap: wrap; min-height: 143px; }
.header-top .brand-block { background: var(--np-header-brand); padding: 20px 35px; display: flex; align-items: center; flex: 0 1 auto; }
.header-top .header-aside { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 12px 35px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: #fff; min-width: 0; }
.brand:hover { color: #fff; }
.monogram {
  flex: none; width: 80px; height: 80px; border-radius: 50%;
  display: grid; place-items: center;
  border: 3px solid var(--np-crimson); color: var(--np-navy); background: #fff;
  font-weight: 700; font-size: 1.35rem; letter-spacing: .02em;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--np-navy);
}
.brand-logo { flex: none; width: 80px; height: 80px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-gov { font-family: var(--font-ne); font-weight: 500; font-size: 1rem; }
.brand-gov .en, .brand-ministry .en { font-family: var(--font); }
.brand-gov .en { font-size: .85rem; opacity: .95; }
.brand-ministry { font-family: var(--font-ne); font-weight: 700; font-size: 1.25rem; line-height: 1.2; margin: .15rem 0; }
.brand-ministry .en { display: block; font-size: .95rem; font-weight: 600; margin-top: .1rem; }
.brand-title { font-weight: 500; font-size: .88rem; opacity: .95; }
.product-chip { display: flex; flex-direction: column; border-left: 2px solid rgba(255,255,255,.6); padding: .1rem 0 .1rem .9rem; }
.product-chip strong { font-size: 1.05rem; font-weight: 600; color: #fff; }
.product-chip span { font-size: .82rem; color: #e6eeff; }
.header-tools { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.header-tools .pill, .gov-bar .pill { border: 1px solid rgba(255,255,255,.7); border-radius: 100px; padding: .1rem .7rem; color: #fff; text-decoration: none; font-size: .82rem; }
.header-tools .lang-switch { display: flex; gap: .3rem; }
.header-tools button.linklike { color: #fff; }
.header-tools .pill[aria-current="true"] { background: #fff; color: var(--np-navy); }
.notice-bar { background: var(--band); border-radius: 5px; display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; margin: .9rem 0 0; font-size: .92rem; }
.notice-bar .label { color: var(--np-navy); font-weight: 700; border-right: 2px solid var(--border-strong); padding-right: .75rem; white-space: nowrap; }
:root[data-theme="dark"] .notice-bar .label { color: #cfe0ff; }
.nav-bar { background: var(--surface); box-shadow: 0 4px 12px rgba(0,0,0,.06); position: relative; z-index: 2; }
.nav-bar .container { border-bottom: 1px solid var(--border); }
.nav-bar .container { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.nav-toggle { display: none; }
.main-nav { flex: 1; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 .25rem; align-items: center; }
.main-nav li.push { margin-left: auto; }
.main-nav a, .main-nav button.linklike { display: block; padding: 1.05rem .8rem; text-decoration: none; color: #000; font-weight: 500; font-size: 1rem; border-bottom: 3px solid transparent; }
:root[data-theme="dark"] .main-nav a, :root[data-theme="dark"] .main-nav button.linklike { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .main-nav a, :root:not([data-theme="light"]) .main-nav button.linklike { color: var(--text); } }
.main-nav a:hover, .main-nav button.linklike:hover { color: var(--np-navy); }
.main-nav a[aria-current="page"] { color: var(--np-navy); border-bottom-color: var(--np-navy); }
:root[data-theme="dark"] .main-nav a[aria-current="page"], :root[data-theme="dark"] .main-nav a:hover { color: #9dbbff; border-bottom-color: #9dbbff; }
.main-nav a.btn-primary { color: #fff; border-bottom: 0; padding: .45rem 1rem; border-radius: var(--radius); }
.subnav { background: var(--band); border-bottom: 1px solid var(--border); }
.subnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; overflow-x: auto; }
.subnav a { display: block; padding: .6rem .8rem; text-decoration: none; color: var(--text-muted); white-space: nowrap; font-size: .9rem; border-bottom: 2px solid transparent; }
.subnav a:hover { color: var(--np-navy); }
.subnav a[aria-current="page"] { color: var(--np-navy); border-bottom-color: var(--np-crimson); font-weight: 600; }
:root[data-theme="dark"] .subnav a[aria-current="page"] { color: #cfe0ff; }
@media (max-width: 860px) {
  .header-top { min-height: 0; }
  .header-top .brand-block { padding: 14px 16px; flex: 1 1 100%; }
  .header-top .header-aside { padding: 8px 16px; }
  .product-chip { display: none; }
  .monogram, .brand-logo { width: 56px; height: 56px; font-size: 1rem; }
  .brand-ministry { font-size: 1.1rem; }
  .nav-toggle { display: inline-flex; margin: .4rem 0; }
  .main-nav { display: none; width: 100%; flex-basis: 100%; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .main-nav li.push { margin-left: 0; }
  .main-nav a, .main-nav button.linklike { border-bottom: 0; border-left: 3px solid transparent; padding: .6rem .75rem; }
  .main-nav a[aria-current="page"] { border-left-color: var(--np-navy); background: var(--band); }
}
@media (max-width: 420px) {
  .brand-ministry .en, .brand-gov .en { display: none; }
}

/* ---------- page title band (light blue, breadcrumb + title) ---------- */
.page > .breadcrumbs:first-child, .page > .breadcrumbs:first-child + .page-head, .page > .page-head:first-child, .page > .messages:first-child + .page-head,
.band {
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(0 -100vmax);
}
.page > .breadcrumbs:first-child, .page > .page-head:first-child { margin-top: -1.5rem; padding-top: 1.1rem; }
.page > .breadcrumbs:first-child { margin-bottom: 0; padding-bottom: .25rem; }
.page > .breadcrumbs:first-child + .page-head, .page > .page-head:first-child { padding-bottom: 1.1rem; margin-bottom: 1.5rem; border-bottom: 0; }
.page-head h1 { color: var(--np-navy); }
:root[data-theme="dark"] .page-head h1 { color: #cfe0ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .page-head h1 { color: #cfe0ff; } }

/* Section title: blue, 2px red rule 100px wide (GIWMS title-6) */
.section-title, .section > h2, .prose h2 { color: var(--np-navy); font-weight: 700; font-size: 1.25rem; position: relative; padding-bottom: .4rem; border-bottom: 0; }
.section-title::after, .section > h2::after, .prose h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100px; height: 2px; background: var(--np-crimson); }
:root[data-theme="dark"] .section-title, :root[data-theme="dark"] .section > h2, :root[data-theme="dark"] .prose h2 { color: #cfe0ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .section-title, :root:not([data-theme="light"]) .section > h2, :root:not([data-theme="light"]) .prose h2 { color: #cfe0ff; } }

/* ---------- footer (GIWMS footer-8: theme-blue band, emblem row, columns, "|" link markers) ---------- */
.site-footer { margin-top: 3rem; background: var(--footer-bg); color: #eee; font-size: 1rem; padding-top: 50px; }
.site-footer a { color: #eee; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .footer-brand { display: flex; gap: 1rem; align-items: center; padding-bottom: 1.5rem; }
.site-footer .footer-brand .monogram { width: 80px; height: 80px; }
.site-footer .footer-brand h2 { color: #fff; font-family: var(--font-ne); font-size: 21px; font-weight: 500; margin: 0; line-height: 1.4; }
.site-footer .footer-brand p { margin: 0; color: #eee; }
.site-footer .footer-cols { padding-top: .5rem; padding-bottom: 2rem; display: grid; gap: 1.75rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.site-footer h3 { font-size: 20px; margin: 0 0 1rem; color: #fff; font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .45rem 0; }
.site-footer li a { border-left: 3px solid #fff; padding-left: .7rem; display: inline-block; line-height: 1.1; }
.site-footer p { color: #eee; }
.footer-strip { border-top: 1px solid rgba(255,255,255,.25); color: #eee; padding: 1rem 0 1.25rem; font-size: .9rem; }
.footer-strip .container { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* ---------- components ---------- */
.page { padding-top: 1.5rem; padding-bottom: 2rem; }
.page-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--text-muted); }
.breadcrumbs { font-size: .875rem; margin-bottom: .5rem; color: var(--text-muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.breadcrumbs li + li::before { content: "/"; margin-right: .3rem; color: var(--border-strong); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.15rem 1.25rem; box-shadow: var(--shadow); min-width: 0; }
.card-accent { border-top: 3px solid var(--np-navy); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2, .card h3 { margin-top: 0; }
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover { color: inherit; border-color: var(--border-strong); }
.card-link:hover h3 { color: var(--link-hover); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--np-navy);
  background: var(--surface); color: var(--np-navy); font: inherit; font-weight: 600; font-size: .92rem;
  text-decoration: none; cursor: pointer; line-height: 1.2; min-height: 40px;
}
.btn:hover { background: var(--band); color: var(--np-navy); border-color: var(--np-navy); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-text); }
.btn-danger { background: var(--surface); border-color: var(--danger-border); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: .3rem .6rem; font-size: .85rem; min-height: 32px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
button.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.alert { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); padding: .85rem 1rem; background: var(--surface); margin: 0 0 1rem; }
.alert > :last-child { margin-bottom: 0; }
.alert-title { font-weight: 650; margin: 0 0 .25rem; }
.alert-ok { border-color: var(--ok-border); border-left-color: var(--ok); background: var(--ok-bg); }
.alert-warn { border-color: var(--warn-border); border-left-color: var(--warn); background: var(--warn-bg); }
.alert-danger { border-color: var(--danger-border); border-left-color: var(--danger); background: var(--danger-bg); }
.alert-info { border-color: var(--info-border); border-left-color: var(--info); background: var(--info-bg); }
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table-wrap table { min-width: 560px; }
.table-wrap th:first-child, .table-wrap td:first-child { padding-left: 1rem; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--text-muted); }
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--text-muted); font-size: .88rem; }
.progress { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--np-navy); }
:root[data-theme="dark"] .progress > span { background: #5583e6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .progress > span { background: #5583e6; } }
.progress.ok > span { background: var(--ok); }
details.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
details.disclosure > summary { cursor: pointer; padding: .6rem .9rem; font-weight: 600; }
details.disclosure[open] > summary { border-bottom: 1px solid var(--border); }
details.disclosure > div { padding: .8rem .9rem; }
dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: .4rem 1rem; margin: 0; }
dl.kv dt { color: var(--text-muted); font-size: .92rem; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { dl.kv { grid-template-columns: 1fr; } dl.kv dd { margin-bottom: .4rem; } }

/* ---------- forms ---------- */
.form { max-width: 640px; }
.form-wide { max-width: none; }
.field { margin-bottom: 1rem; }
.field label, .label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
.field .help { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }
.field .errorlist, .errorlist { list-style: none; padding: 0; margin: .3rem 0 0; color: var(--danger); font-size: .88rem; font-weight: 550; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=search], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: .5rem .65rem; min-height: 40px;
}
textarea { min-height: 6rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.field-invalid input, .field-invalid select, .field-invalid textarea { border-color: var(--danger); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 650; padding: 0 .35rem; }
.required-mark { color: var(--danger); }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }

/* ---------- home ---------- */
.hero { background: var(--band); border-bottom: 1px solid var(--border); }
.hero .container { padding-top: 2.5rem; padding-bottom: 2.5rem; display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; }
.hero h1 { font-size: 2.1rem; margin: .2rem 0 .8rem; }
.hero .lead { font-size: 1.12rem; color: var(--text-muted); max-width: 60ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--np-crimson-strong); }
:root[data-theme="dark"] .eyebrow { color: #ff9aa8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: #ff9aa8; } }
.hero-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); padding: 1.1rem 1.2rem; font-size: .92rem; }
.hero-panel dl { margin: 0; }
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; } .hero h1 { font-size: 1.7rem; } }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.1rem 1.1rem; position: relative; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--np-navy); color: #fff; font-weight: 700; margin-bottom: .6rem; }
.steps h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--text-muted); font-size: .94rem; }
.section { padding: 2rem 0 .5rem; }
.section > h2:first-child { margin-top: 0; }

/* ---------- status banner ---------- */
.status-banner { display: flex; gap: 1rem; align-items: flex-start; }
.status-banner .status-icon { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; }
.alert-ok .status-icon { background: var(--ok); }
.alert-warn .status-icon { background: var(--warn); }
.alert-danger .status-icon { background: var(--danger); }
.alert-info .status-icon { background: var(--info); }
:root[data-theme="dark"] .status-banner .status-icon { color: #111; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .status-banner .status-icon { color: #111; } }

/* ---------- validator ---------- */
.validator-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .validator-layout { grid-template-columns: 1fr; } }
.editor-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: .6rem; }
.editor-toolbar .field { margin: 0; flex: 1 1 220px; }
.editor-shell { border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.editor-shell .cm-editor { height: 560px; font-size: 13.5px; }
.editor-shell .cm-editor.cm-focused { outline: 3px solid var(--focus); outline-offset: -1px; }
.editor-shell textarea.fallback { border: 0; border-radius: 0; min-height: 560px; font-family: var(--mono); font-size: 13.5px; resize: vertical; }
.cm-np-highlight { background: rgba(200, 16, 46, .18); }
.cm-np-highlight-line { background: rgba(255, 196, 0, .22) !important; }
.drop-hint { font-size: .85rem; color: var(--text-muted); margin-top: .35rem; }
.editor-shell.dragover { outline: 3px dashed var(--focus); outline-offset: -3px; }
.results-panel { min-height: 200px; }
.results-placeholder { border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 2rem 1.25rem; text-align: center; color: var(--text-muted); background: var(--surface); }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-flex; }
.spinner { width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.summary-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: .75rem 0 1rem; }
@media (max-width: 480px) { .summary-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.summary-cell { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .7rem; background: var(--surface); }
.summary-cell .n { font-size: 1.5rem; font-weight: 700; line-height: 1.1; display: block; }
.summary-cell .l { font-size: .8rem; color: var(--text-muted); text-transform: capitalize; }
.summary-cell.fatal .n, .summary-cell.error .n { color: var(--danger); }
.summary-cell.warning .n { color: var(--warn); }
.summary-cell.information .n { color: var(--info); }
.verdict { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.verdict h2 { margin: 0; font-size: 1.25rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--border-strong); border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; background: var(--surface); cursor: pointer; user-select: none; }
.chip input { margin: 0; }
.chip:has(input:checked) { background: var(--surface-3); border-color: var(--text-muted); }
.issue-group { margin: 1rem 0 .5rem; font-size: 1rem; display: flex; gap: .5rem; align-items: center; }
.issue {
  border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); padding: .85rem 1rem; margin-bottom: .75rem;
}
.issue.sev-fatal, .issue.sev-error { border-left-color: var(--danger); }
.issue.sev-warning { border-left-color: var(--warn); }
.issue.sev-information { border-left-color: var(--info); }
.issue-head { display: flex; gap: .5rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.issue-title { font-size: 1rem; margin: 0; font-weight: 650; }
.issue-loc { font-family: var(--mono); font-size: .83rem; overflow-wrap: anywhere; }
.issue-loc button { font-family: var(--mono); font-size: .83rem; text-align: left; }
.issue dl { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: .35rem .8rem; margin: .6rem 0 0; font-size: .94rem; }
.issue dt { font-weight: 600; color: var(--text-muted); }
.issue dd { margin: 0; min-width: 0; }
.issue dd > p:last-child { margin-bottom: 0; }
@media (max-width: 520px) { .issue dl { grid-template-columns: 1fr; } .issue dd { margin-bottom: .3rem; } }
.issue pre { margin: .35rem 0 0; font-size: .82rem; max-height: 260px; }
.issue .raw { margin-top: .6rem; font-size: .88rem; }
.issue .raw summary { cursor: pointer; color: var(--text-muted); }
.issue .raw pre { white-space: pre-wrap; }
.issue-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.example-wrap { position: relative; }
.example-wrap .copy-btn { position: absolute; top: .4rem; right: .4rem; }

/* ---------- scenarios ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .7rem .2rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.checklist li:last-child { border-bottom: 0; }
.checklist .name { display: flex; gap: .6rem; align-items: center; min-width: 0; }
.status-dot { flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: #fff; background: var(--border-strong); }
.status-dot.passed { background: var(--ok); }
.status-dot.failed { background: var(--danger); }
:root[data-theme="dark"] .status-dot { color: #111; }

/* ---------- docs / tutorial ---------- */
.docs-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (max-width: 900px) { .docs-layout { grid-template-columns: 1fr; gap: 1rem; } }
.docs-nav { position: sticky; top: 1rem; font-size: .93rem; }
@media (max-width: 900px) { .docs-nav { position: static; } }
.docs-nav ol, .docs-nav ul { list-style: none; padding: 0; margin: 0; }
.docs-nav a { display: block; padding: .35rem .6rem; border-radius: var(--radius); text-decoration: none; color: var(--text); border-left: 3px solid transparent; }
.docs-nav a:hover { background: var(--surface-2); }
.docs-nav a[aria-current="page"] { background: var(--surface-2); border-left-color: var(--np-crimson); font-weight: 600; }
.docs-nav .toc { margin: .25rem 0 .5rem .9rem; font-size: .86rem; }
.docs-nav .toc a { padding: .15rem .5rem; color: var(--text-muted); }
.docs-nav details summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }
.prose { max-width: 80ch; }
.prose h2 { margin-top: 2rem; }
.prose table { margin: 1rem 0; font-size: .93rem; display: block; overflow-x: auto; }
.prose img { border: 1px solid var(--border); border-radius: var(--radius); }
.prose blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 4px solid var(--info); background: var(--info-bg); border-radius: 0 var(--radius) var(--radius) 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose .admonition { border: 1px solid var(--border); border-left: 4px solid var(--info); background: var(--info-bg); padding: .7rem 1rem; border-radius: var(--radius); margin: 1rem 0; }
.prose .admonition.warning { border-left-color: var(--warn); background: var(--warn-bg); }
.prose .admonition.danger { border-left-color: var(--danger); background: var(--danger-bg); }
.prose .admonition.tip { border-left-color: var(--ok); background: var(--ok-bg); }
.prose .admonition-title { font-weight: 700; margin: 0 0 .3rem; }
.prose .admonition > :last-child { margin-bottom: 0; }
.prose .headerlink { visibility: hidden; text-decoration: none; margin-left: .3rem; color: var(--text-muted); }
.prose h2:hover .headerlink, .prose h3:hover .headerlink { visibility: visible; }
.prose li { margin: .25rem 0; }
.prose .codehilite { position: relative; }
.prose .codehilite pre { margin: 0 0 1rem; }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.prev-next a { display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem 1rem; text-decoration: none; background: var(--surface); }
.prev-next a:hover { border-color: var(--border-strong); }
.prev-next .dir { display: block; font-size: .8rem; color: var(--text-muted); }
.prev-next .next { text-align: right; grid-column: 2; }
@media (max-width: 520px) { .prev-next { grid-template-columns: 1fr; } .prev-next .next { grid-column: 1; } }
.ig-missing { border-bottom: 1px dotted var(--warn); color: var(--warn); }
pre .copy-btn, .codehilite .copy-btn { position: absolute; top: .4rem; right: .4rem; opacity: .85; }
.code-tabs [role=tablist] { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: .5rem; }
.code-tabs [role=tab] { background: none; border: 1px solid transparent; border-bottom: 0; padding: .4rem .8rem; cursor: pointer; font: inherit; color: var(--text-muted); border-radius: var(--radius) var(--radius) 0 0; }
.code-tabs [role=tab][aria-selected=true] { color: var(--text); border-color: var(--border); background: var(--surface); font-weight: 600; }

/* Pygments (light). Generated palette kept small & AA-contrast. */
.codehilite { background: var(--code-bg); border-radius: var(--radius); }
.codehilite .c, .codehilite .c1, .codehilite .cm, .codehilite .ch, .codehilite .cs { color: #5c6370; font-style: italic; }
.codehilite .k, .codehilite .kn, .codehilite .kd, .codehilite .kc, .codehilite .kr, .codehilite .kt, .codehilite .nt { color: #8a1538; font-weight: 600; }
.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .sb, .codehilite .sd, .codehilite .sh, .codehilite .si, .codehilite .sx { color: #1d6b2c; }
.codehilite .m, .codehilite .mi, .codehilite .mf, .codehilite .mh { color: #9a4f00; }
.codehilite .nf, .codehilite .fm, .codehilite .nc, .codehilite .nn { color: #003893; }
.codehilite .na, .codehilite .nb, .codehilite .bp { color: #0b5c8a; }
.codehilite .nv, .codehilite .vg, .codehilite .vi { color: #6a3f9a; }
.codehilite .o, .codehilite .ow, .codehilite .p { color: inherit; }
.codehilite .err { color: inherit; background: none; }
:root[data-theme="dark"] .codehilite .c, :root[data-theme="dark"] .codehilite .c1, :root[data-theme="dark"] .codehilite .cm { color: #8b95a7; }
:root[data-theme="dark"] .codehilite .k, :root[data-theme="dark"] .codehilite .kn, :root[data-theme="dark"] .codehilite .kd, :root[data-theme="dark"] .codehilite .kc, :root[data-theme="dark"] .codehilite .kr, :root[data-theme="dark"] .codehilite .kt, :root[data-theme="dark"] .codehilite .nt { color: #ff9eb0; }
:root[data-theme="dark"] .codehilite .s, :root[data-theme="dark"] .codehilite .s1, :root[data-theme="dark"] .codehilite .s2, :root[data-theme="dark"] .codehilite .sb, :root[data-theme="dark"] .codehilite .sd, :root[data-theme="dark"] .codehilite .sh, :root[data-theme="dark"] .codehilite .si { color: #9be2a9; }
:root[data-theme="dark"] .codehilite .m, :root[data-theme="dark"] .codehilite .mi, :root[data-theme="dark"] .codehilite .mf { color: #f6c177; }
:root[data-theme="dark"] .codehilite .nf, :root[data-theme="dark"] .codehilite .nc, :root[data-theme="dark"] .codehilite .nn { color: #9dbbff; }
:root[data-theme="dark"] .codehilite .na, :root[data-theme="dark"] .codehilite .nb { color: #8fd3ff; }
:root[data-theme="dark"] .codehilite .nv, :root[data-theme="dark"] .codehilite .vg { color: #d3b0ff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .codehilite .c, :root:not([data-theme="light"]) .codehilite .c1, :root:not([data-theme="light"]) .codehilite .cm { color: #8b95a7; }
  :root:not([data-theme="light"]) .codehilite .k, :root:not([data-theme="light"]) .codehilite .kn, :root:not([data-theme="light"]) .codehilite .kd, :root:not([data-theme="light"]) .codehilite .kc, :root:not([data-theme="light"]) .codehilite .kr, :root:not([data-theme="light"]) .codehilite .kt, :root:not([data-theme="light"]) .codehilite .nt { color: #ff9eb0; }
  :root:not([data-theme="light"]) .codehilite .s, :root:not([data-theme="light"]) .codehilite .s1, :root:not([data-theme="light"]) .codehilite .s2, :root:not([data-theme="light"]) .codehilite .sb, :root:not([data-theme="light"]) .codehilite .sd, :root:not([data-theme="light"]) .codehilite .sh, :root:not([data-theme="light"]) .codehilite .si { color: #9be2a9; }
  :root:not([data-theme="light"]) .codehilite .m, :root:not([data-theme="light"]) .codehilite .mi, :root:not([data-theme="light"]) .codehilite .mf { color: #f6c177; }
  :root:not([data-theme="light"]) .codehilite .nf, :root:not([data-theme="light"]) .codehilite .nc, :root:not([data-theme="light"]) .codehilite .nn { color: #9dbbff; }
  :root:not([data-theme="light"]) .codehilite .na, :root:not([data-theme="light"]) .codehilite .nb { color: #8fd3ff; }
  :root:not([data-theme="light"]) .codehilite .nv, :root:not([data-theme="light"]) .codehilite .vg { color: #d3b0ff; }
}

/* ---------- report / print ---------- */
.report-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.disclaimer { border: 2px solid var(--np-crimson); color: var(--text); background: var(--surface); padding: .7rem 1rem; border-radius: var(--radius); font-weight: 600; }
.print-only { display: none; }
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --text: #000; --text-muted: #333; --border: #bbb; --code-bg: #f6f6f6; }
  body { background: #fff; font-size: 11pt; }
  .header-aside, .site-header nav, .notice-bar, .nav-toggle, .subnav, .site-footer, .no-print, .filters, .issue-actions, .btn, .skip-link, .docs-nav, .prev-next { display: none !important; }
  .print-only { display: block; }
  .site-header { border-bottom: 2px solid #000; }
  .card, .issue { box-shadow: none; break-inside: avoid; }
  .validator-layout { grid-template-columns: 1fr; }
  .editor-col { display: none; }
  a { color: #000; }
  .issue .raw { display: none; }
  .issue[hidden] { display: block !important; }
  pre { white-space: pre-wrap; }
}

/* ---------- layout helpers ---------- */
.layout-aside { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.aside-offset { margin-top: 4.2rem; }
@media (max-width: 860px) { .layout-aside { grid-template-columns: 1fr; } .aside-offset { margin-top: 0; } }

/* dark-mode adjustments for GIWMS-blue outline buttons */
:root[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger) { color: var(--link); border-color: var(--border-strong); }
:root[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger):hover { background: var(--surface-2); color: var(--text); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn:not(.btn-primary):not(.btn-danger) { color: var(--link); border-color: var(--border-strong); }
  :root:not([data-theme="light"]) .btn:not(.btn-primary):not(.btn-danger):hover { background: var(--surface-2); color: var(--text); }
}
.btn-danger { border-color: var(--danger-border); }
.nav-bar .nav-toggle { display: none; }
@media (max-width: 860px) { .nav-bar .nav-toggle { display: inline-flex; } }
/* keep grid children from forcing horizontal scroll on small screens */
.validator-layout > *, .docs-layout > *, .layout-aside > *, .grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
.editor-shell .cm-editor { max-width: 100%; }
.prose pre, .prose .codehilite { max-width: 100%; overflow-x: auto; }
.prose code { overflow-wrap: anywhere; }
.mono { overflow-wrap: anywhere; }
.table-wrap .mono { overflow-wrap: normal; }
.table-wrap, .subnav ul, details { position: relative; }
details.disclosure { overflow: hidden; } details.disclosure pre { max-width: 100%; }
@media print { .header-top, .header-top .brand-block { background: #fff !important; color: #000 !important; min-height: 0; } .brand, .brand:hover { color: #000; } }
@media (min-width: 861px) { .brand-title { display: none; } }
