@charset "utf-8";
/* Layout: a single 1060px document column on a quiet ground.
   Official register: Sarabun (the Thai government document face) for running text,
   Noto Serif Thai for headings, hairline rules instead of shadows, 6px radii.
   Colour carries meaning only - the CWIE form codes, the three work stages,
   and one wine accent drawn from the NEU mark for actions and active state. */
:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #EDEFF3;
  --fg: #141A2A;
  --fg-2: #39415A;
  --fg-muted: #656D86;
  --line: #DCDFE7;
  --line-2: #C3C8D4;
  --ink: #15213F;
  --ink-fg: #FFFFFF;
  --ink-muted: #A8B2CC;
  --accent: #9E1B4F;
  --accent-fg: #FFFFFF;
  --accent-soft: #F7E8EE;
  --teal: #0B5F5F;
  --teal-soft: #E2EFEE;
  --amber: #80530C;
  --amber-soft: #F7EEDD;
  --r: 6px;
  --f-display: "Noto Serif Thai", Georgia, "Times New Roman", serif;
  --f-body: "Sarabun", -apple-system, "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --col: 1060px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101420;
    --surface: #181D2C;
    --surface-2: #212736;
    --fg: #ECEEF4;
    --fg-2: #C2C7D6;
    --fg-muted: #8E95A9;
    --line: #2A3044;
    --line-2: #3B4258;
    --ink: #0B0F1C;
    --ink-fg: #ECEEF4;
    --ink-muted: #8E95A9;
    --accent: #F58CB4;
    --accent-fg: #2B0A19;
    --accent-soft: #33131F;
    --teal: #5CC3BB;
    --teal-soft: #0E2A29;
    --amber: #DCA158;
    --amber-soft: #302312;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101420;
  --surface: #181D2C;
  --surface-2: #212736;
  --fg: #ECEEF4;
  --fg-2: #C2C7D6;
  --fg-muted: #8E95A9;
  --line: #2A3044;
  --line-2: #3B4258;
  --ink: #0B0F1C;
  --ink-fg: #ECEEF4;
  --ink-muted: #8E95A9;
  --accent: #F58CB4;
  --accent-fg: #2B0A19;
  --accent-soft: #33131F;
  --teal: #5CC3BB;
  --teal-soft: #0E2A29;
  --amber: #DCA158;
  --amber-soft: #302312;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 16.5px;
  line-height: 1.85;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.45; text-wrap: balance; margin: 0; color: var(--fg); }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.9vw, 2.3rem); line-height: 1.35; letter-spacing: -.01em; }
h2 { font-size: clamp(1.25rem, 1.08rem + .7vw, 1.55rem); }
h3 { font-size: 1.05rem; }
p { margin: 0; }
ul, ol { margin: 0; padding-inline-start: 1.3em; }
li + li { margin-top: 5px; }
strong { font-weight: 600; }

/* ===== prototype bar (review only - not part of the site) ===== */
.proto-bar { background: var(--ink); color: var(--ink-muted); font-size: .78rem; line-height: 1.5; }
.proto-inner {
  max-width: var(--col); margin: 0 auto; padding: 7px 24px;
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between;
}
.proto-tag { display: inline-flex; align-items: center; gap: 8px; }
.proto-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); flex: none; }
.proto-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.proto-link { color: var(--ink-fg); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.3); }
.proto-link:hover { border-bottom-color: var(--ink-fg); }
.note-switch {
  font: inherit; font-size: .78rem; background: transparent;
  border: 1px solid rgba(255, 255, 255, .25); color: var(--ink-fg);
  padding: 3px 12px; border-radius: var(--r); cursor: pointer; white-space: nowrap;
}
.note-switch:hover { background: rgba(255, 255, 255, .1); }
.note-switch[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

/* ===== header ===== */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line-2); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; }
.header-inner { max-width: var(--col); margin: 0 auto; padding: 11px 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fg); margin-inline-end: auto; min-width: 0; }
.brand-mark { width: 42px; height: 42px; flex: none; object-fit: contain; }
.footer-mark { width: 56px; height: 56px; object-fit: contain; margin-bottom: 14px; }
.identity { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.identity img { width: 190px; height: auto; flex: none; }
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: .97rem; line-height: 1.3; display: block; }
.brand-sub { font-size: .74rem; color: var(--fg-muted); line-height: 1.4; display: block; }

.nav-toggle { display: none; background: transparent; border: 1px solid var(--line-2); color: var(--fg); border-radius: var(--r); padding: 9px 14px; font: inherit; font-size: .88rem; cursor: pointer; }
.site-nav { display: flex; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav-list li + li { margin-top: 0; }
.nav-item { position: relative; }
.nav-link, .nav-btn {
  display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 0;
  color: var(--fg-2); font: inherit; font-size: .9rem; font-weight: 500;
  padding: 9px 12px; border-radius: var(--r); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.nav-link:hover, .nav-btn:hover { background: var(--surface-2); color: var(--fg); }
.nav-item[data-current="true"] > .nav-link,
.nav-item[data-current="true"] > .nav-btn { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav-btn::after {
  content: ""; width: 5px; height: 5px;
  border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg) translate(-1px, -2px); opacity: .65;
}
.nav-panel {
  position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 60; min-width: 286px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 6px; list-style: none; margin: 0;
}
.nav-panel a { display: block; padding: 10px 12px; border-radius: var(--r); color: var(--fg); text-decoration: none; font-size: .92rem; line-height: 1.5; }
.nav-panel a:hover { background: var(--surface-2); }
.np-note { display: block; font-size: .77rem; color: var(--fg-muted); line-height: 1.45; }

@media (max-width: 1080px) {
  .nav-toggle { display: inline-block; }
  .site-header { position: static; }
  .header-inner { flex-wrap: wrap; }
  .site-nav { width: 100%; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; }
  .site-nav[data-open="false"] { display: none; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-link, .nav-btn { width: 100%; justify-content: space-between; padding: 12px; }
  .nav-panel { position: static; min-width: 0; border: 0; background: var(--surface-2); margin: 2px 0 6px; }
}

/* ===== shell ===== */
.wrap { max-width: var(--col); margin: 0 auto; padding-inline: 24px; }
.block { padding-block: clamp(38px, 5vw, 64px); }
.block-tint { background: var(--surface-2); }
.stack { display: grid; gap: 22px; }
.stack-sm { display: grid; gap: 9px; }
/* grid items default to max-content: without this a wide table blows the page out */
.stack > *, .stack-sm > *, .grid > * { min-width: 0; }
.prose { max-width: 64ch; display: grid; gap: 17px; color: var(--fg-2); }
.prose h3 { color: var(--fg); margin-top: 6px; }
.lede { font-size: 1.07rem; line-height: 1.8; color: var(--fg-2); max-width: 58ch; }

.eyebrow { font-family: var(--f-mono); font-size: .69rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent); font-weight: 500; }

.page-head { background: var(--surface); border-bottom: 1px solid var(--line-2); }
.page-head .wrap { padding-block: clamp(28px, 3.6vw, 46px); }
.crumbs { font-size: .8rem; color: var(--fg-muted); display: flex; flex-wrap: wrap; gap: 7px; }
.crumbs a { color: var(--fg-muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

/* ===== hero ===== */
.hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .26; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(104deg, rgba(21,33,63,.97) 0%, rgba(21,33,63,.9) 46%, rgba(21,33,63,.62) 100%);
}
.hero .wrap { position: relative; padding-block: clamp(52px, 7vw, 88px); }
.hero-inner { max-width: 42rem; display: grid; gap: 18px; }
.hero h1 { color: #fff; }
.hero p { color: #C5CDE3; font-size: 1.07rem; line-height: 1.8; }
.hero .eyebrow { color: #F0A8C4; }

/* ===== grids ===== */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 880px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }

/* ===== cards ===== */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 22px; display: grid; gap: 9px; align-content: start; min-width: 0;
}
.card h3 { font-size: 1.02rem; }
.card p { font-size: .94rem; color: var(--fg-muted); }
.card ul, .card ol { font-size: .94rem; color: var(--fg-2); }

a.card { text-decoration: none; color: inherit; transition: border-color .15s; }
a.card:hover { border-color: var(--accent); }
a.card h3 { color: var(--fg); }
a.card:hover h3 { color: var(--accent); }

.card-photo { padding: 0; overflow: hidden; gap: 0; }
.card-photo > img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.cp-body { padding: 15px 18px 19px; display: grid; gap: 7px; }
.arrow { font-size: .87rem; color: var(--accent); font-weight: 500; }

/* ===== tables ===== */
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.table-scroll table { min-width: 560px; }
caption { text-align: start; padding: 14px 18px 2px; color: var(--fg-muted); font-size: .85rem; line-height: 1.6; }
th, td { text-align: start; padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--fg-2); }
thead th {
  background: var(--surface-2); font-weight: 600; font-size: .79rem;
  letter-spacing: .03em; color: var(--fg-muted); white-space: nowrap;
  position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line-2);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== chips ===== */
.code { font-family: var(--f-mono); font-size: .75rem; font-weight: 500; background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 2px 7px; white-space: nowrap; display: inline-block; text-decoration: none; }
a.code:hover { background: var(--accent); color: var(--accent-fg); }
.code.is-missing { background: var(--surface-2); color: var(--fg-muted); text-decoration: line-through; }

.tag { font-size: .76rem; font-weight: 500; border-radius: 3px; padding: 2px 9px; white-space: nowrap; display: inline-block; }
.tag-before { background: var(--teal-soft); color: var(--teal); }
.tag-during { background: var(--amber-soft); color: var(--amber); }
.tag-after { background: var(--accent-soft); color: var(--accent); }
.tag-quiet { background: var(--surface-2); color: var(--fg-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: .95rem; font-weight: 500;
  padding: 11px 20px; border-radius: var(--r); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; background: var(--accent); color: var(--accent-fg);
}
.btn:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--surface); color: var(--fg); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .38); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-row { display: flex; flex-wrap: wrap; gap: 11px; }

.filebtn {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-mono); font-size: .73rem; font-weight: 500;
  padding: 5px 11px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--fg-2);
  text-decoration: none; background: var(--surface); cursor: pointer;
}
.filebtn:hover { border-color: var(--accent); color: var(--accent); }
.filebtn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ===== stats ===== */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; display: grid; gap: 3px; min-width: 0; }
.stat-num { font-family: var(--f-mono); font-size: 2rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--fg); }
.stat-label { font-size: .88rem; color: var(--fg-muted); line-height: 1.55; }

/* ===== timeline ===== */
.timeline { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; counter-reset: step; }
.tl-step { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.tl-step:last-child { border-bottom: 0; }
.tl-num { counter-increment: step; width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; font-family: var(--f-mono); font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--fg-muted); }
.tl-step[data-stage="before"] .tl-num { background: var(--teal-soft); color: var(--teal); }
.tl-step[data-stage="during"] .tl-num { background: var(--amber-soft); color: var(--amber); }
.tl-step[data-stage="after"] .tl-num { background: var(--accent-soft); color: var(--accent); }
.tl-num::before { content: counter(step); }
.tl-body { display: grid; gap: 7px; min-width: 0; }
.tl-body h3 { font-size: 1.01rem; }
.tl-body p { font-size: .94rem; color: var(--fg-muted); }
.tl-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

/* ===== filters ===== */
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.field { display: grid; gap: 6px; min-width: 0; flex: 1 1 250px; }
.field-label, .field label { font-size: .79rem; color: var(--fg-muted); font-weight: 500; }
input[type="search"], select {
  font: inherit; font-size: .94rem; padding: 10px 13px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); width: 100%; min-width: 0;
}
input[type="search"]:focus { border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { font: inherit; font-size: .89rem; padding: 10px 16px; border: 0; background: var(--surface); color: var(--fg-muted); cursor: pointer; white-space: nowrap; }
.seg button + button { border-inline-start: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.result-count { font-size: .87rem; color: var(--fg-muted); }

/* ===== notes ===== */
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 7px; font-size: .94rem; }
.note h3, .note-h { font-size: .97rem; font-family: var(--f-body); font-weight: 600; margin: 0; }
.note-ask .note-h, .note-new .note-h { color: inherit; }
.note p, .note li { color: var(--fg-muted); }
.note-ask { border-color: var(--amber); border-inline-start-width: 3px; background: var(--amber-soft); }
.note-ask h3, .note-ask p, .note-ask li { color: var(--amber); }
.note-new { border-color: var(--teal); border-inline-start-width: 3px; background: var(--teal-soft); }
.note-new h3, .note-new p, .note-new li { color: var(--teal); }
.note-ask::before, .note-new::before {
  content: "\0E2B \0E21 \0E32 \0E22 \0E40 \0E2B \0E15 \0E38 \0E2A \0E33 \0E2B \0E23 \0E31 \0E1A \0E1C \0E39 \0E49 \0E1E \0E34 \0E08 \0E32 \0E23 \0E13 \0E32";
  font-family: var(--f-mono); font-size: .63rem; letter-spacing: .1em; text-transform: uppercase; opacity: .7;
}

/* ===== gallery ===== */
.album { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: grid; align-content: start; }
.album img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.album-body { padding: 16px 20px 20px; display: grid; gap: 8px; }
.album-body h3 { font-size: 1rem; }
.album-body p { font-size: .93rem; color: var(--fg-muted); }
.album-meta { font-size: .8rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; }

/* ===== news ===== */
.news-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.news-item { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 22px; padding: 20px 22px; border-bottom: 1px solid var(--line); align-items: start; }
.news-item:last-child { border-bottom: 0; }
.news-item img { aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; width: 100%; }
@media (max-width: 640px) { .news-item { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.news-date { font-family: var(--f-mono); font-size: .78rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.news-item h3 { font-size: 1.04rem; }
.news-item p { font-size: .94rem; color: var(--fg-muted); }
.news-body { display: grid; gap: 7px; min-width: 0; }

/* ===== org chart ===== */
.org { display: grid; gap: 10px; justify-items: center; text-align: center; }
.org-node { background: var(--bg); border: 1px solid var(--line-2); border-radius: 4px; padding: 9px 16px; font-size: .93rem; max-width: 100%; color: var(--fg-2); }
.org-node.is-head { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.org-line { width: 1px; height: 18px; background: var(--line-2); }
.org-row { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
@media (max-width: 700px) { .org-row { grid-template-columns: minmax(0, 1fr); } }
.org-branch { display: grid; gap: 8px; align-content: start; text-align: start; }
.org-branch ul { font-size: .87rem; color: var(--fg-muted); display: grid; gap: 5px; }

.person { display: grid; gap: 3px; }
.person-name { font-weight: 600; color: var(--fg); }
.person-role { font-size: .91rem; color: var(--fg-muted); }

/* ===== comparison table (review page) ===== */
.cmp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row > * { padding: 14px 18px; min-width: 0; }
.cmp-head { background: var(--surface-2); font-weight: 600; font-size: .8rem; letter-spacing: .03em; color: var(--fg-muted); }
.cmp-what { font-weight: 500; color: var(--fg); font-size: .95rem; }
.cmp-old { color: var(--fg-muted); font-size: .93rem; border-inline-start: 1px solid var(--line); }
.cmp-new { color: var(--fg-2); font-size: .93rem; border-inline-start: 1px solid var(--line); }
.cmp-new strong { color: var(--teal); }
@media (max-width: 720px) {
  .cmp-row { grid-template-columns: minmax(0, 1fr); }
  .cmp-row > * { padding: 8px 18px; }
  .cmp-what { padding-top: 18px; }
  .cmp-new { padding-bottom: 18px; }
  .cmp-old, .cmp-new { border-inline-start: 0; }
  .cmp-old::before { content: "\0E40 \0E27 \0E47 \0E1A \0E40 \0E14 \0E34 \0E21  \2014 \00A0"; font-weight: 600; }
  .cmp-new::before { content: "\0E41 \0E1A \0E1A \0E43 \0E2B \0E21 \0E48  \2014 \00A0"; font-weight: 600; color: var(--teal); }
  .cmp-head { display: none; }
}

/* ===== footer ===== */
.site-footer { background: var(--ink); color: var(--ink-muted); }
.site-footer .wrap { padding-block: 44px 26px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
@media (max-width: 880px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
.footer-grid h3 { font-family: var(--f-body); font-size: .79rem; font-weight: 600; color: #fff; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 11px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .91rem; }
.footer-grid li + li { margin-top: 0; }
.footer-grid a { color: var(--ink-muted); text-decoration: none; }
.footer-grid a:hover { color: #fff; text-decoration: underline; }
.footer-grid p { font-size: .91rem; line-height: 1.85; }
.copy-line { margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .13); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; }
.selectable { font-family: var(--f-mono); color: #fff; user-select: all; }

.skip { position: absolute; inset-inline-start: -9999px; background: var(--accent); color: var(--accent-fg); padding: 10px 18px; border-radius: 0 0 var(--r) 0; z-index: 99; }
.skip:focus { inset-inline-start: 0; }

/* ===== site search ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.search { position: relative; flex: 0 1 190px; min-width: 0; }
.search input[type="search"] { font-size: .88rem; padding: 9px 13px; background: var(--bg); }
.search-panel {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 70;
  min-width: 310px; max-width: 86vw; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
}
.search-panel li + li { margin-top: 0; }
.search-panel a { display: block; padding: 10px 12px; border-radius: var(--r); color: var(--fg); text-decoration: none; font-size: .91rem; line-height: 1.5; }
.search-panel a:hover, .search-panel a:focus { background: var(--surface-2); color: var(--accent); }
.sp-empty { padding: 10px 12px; font-size: .89rem; color: var(--fg-muted); }
@media (max-width: 1080px) {
  .search { order: 3; flex: 0 1 180px; width: 180px; }
  .search-panel { inset-inline: 0; min-width: 0; }
}

/* header fits its row: the brand keeps one line, the nav gets the space */
.brand-name, .brand-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1081px) and (max-width: 1420px) {
  .brand-sub { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: .89rem; }
  .brand { gap: 9px; }
  .search { flex: 0 1 170px; }
  .header-inner { gap: 10px; }
  .nav-link, .nav-btn { padding: 9px 8px; font-size: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ===== consent step (wellbeing) ===== */
.consent-line { display: flex; gap: 11px; align-items: flex-start; font-size: .95rem; color: var(--fg); line-height: 1.7; }
.consent-line input[type="checkbox"] { width: 20px; height: 20px; flex: none; margin-top: 5px; accent-color: var(--accent); cursor: pointer; }
.consent-line label { cursor: pointer; }
[data-consent-root] { border-color: var(--line-2); }
.btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* filter chips wrap on phones instead of widening the page */
@media (max-width: 640px) {
  .filters { padding: 16px; gap: 14px; }
  .filters .field { flex: 1 1 100% !important; }
  .seg { flex-wrap: wrap; border: 0; border-radius: 0; gap: 8px; }
  .seg button { border: 1px solid var(--line-2); border-radius: var(--r); flex: 1 1 calc(50% - 4px); padding: 10px 8px; }
  .seg button + button { border-inline-start: 1px solid var(--line-2); }
}

/* Keep the complete identity and search in separate, usable slots. */
.header-inner .brand-text { min-width: 0; }
.header-inner .brand-name,
.header-inner .brand-sub { white-space: normal; overflow: visible; text-overflow: clip; }
.header-inner .brand-sub { display: block; }
.header-inner .search input[type="search"] { width: 100%; min-height: 42px; }

@media (min-width: 1081px) {
  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
    gap: 8px 16px;
  }
  .header-inner .brand { grid-column: 1; grid-row: 1; margin-inline-end: 0; }
  .header-inner .search { grid-column: 2; grid-row: 1; width: 100%; flex: none; }
  .header-inner .site-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; min-width: 0; }
}

@media (max-width: 1080px) {
  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
  }
  .header-inner .brand { grid-column: 1; grid-row: 1; margin-inline-end: 0; }
  .header-inner .nav-toggle { grid-column: 2; grid-row: 1; }
  .header-inner .search { grid-column: 1 / -1; grid-row: 2; order: initial; width: min(260px, 100%); flex: none; }
  .header-inner .site-nav { grid-column: 1 / -1; grid-row: 3; }
}

@media (max-width: 420px) {
  .header-inner { padding-inline: 16px; gap: 9px 10px; }
  .header-inner .brand { gap: 8px; }
  .header-inner .brand-mark { width: 36px; height: 36px; }
  .header-inner .brand-name { font-size: .88rem; }
  .header-inner .brand-sub { font-size: .68rem; }
}

/* Institutional header with a clear identity row and a restrained menu bar. */
.site-header { background: #fff; box-shadow: 0 3px 15px rgba(21, 58, 99, .05); }
.header-inner .brand-name { color: #12365d; font-size: 1.07rem; font-weight: 700; line-height: 1.35; }
.header-inner .brand-sub { margin-top: 2px; color: #56718b; font-size: .75rem; }
.header-inner .search input[type="search"] { border: 1px solid #c9d6e4; border-radius: 8px; background: #f8fbfe; font-size: .9rem; }
.header-inner .search input[type="search"]:focus { border-color: #277bb5; box-shadow: 0 0 0 3px rgba(39, 123, 181, .13); outline: none; }

@media (min-width: 1081px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) 220px; gap: 0 24px; padding-block: 13px 0; }
  .header-inner .brand { gap: 13px; padding-bottom: 13px; }
  .header-inner .brand-mark { width: 52px; height: 52px; }
  .header-inner .search { align-self:center; margin-bottom: 13px; }
  .header-inner .site-nav { justify-content: flex-start; border-top: 1px solid #e3ebf3; }
  .header-inner .nav-list { width: 100%; justify-content: space-between; gap: 5px; }
  .header-inner .nav-link,
  .header-inner .nav-btn { min-height: 46px; padding: 10px 9px; color: #294761; font-size: .87rem; font-weight: 600; }
  .header-inner .nav-item[data-current="true"] > .nav-link,
  .header-inner .nav-item[data-current="true"] > .nav-btn { color: #0b6fa7; box-shadow: inset 0 -3px 0 #0b82b8; }
}

@media (max-width: 1080px) {
  .header-inner { padding-block: 12px; }
  .header-inner .brand-name { font-size: .96rem; }
  .header-inner .search { width: min(320px, 100%); }
  .header-inner .site-nav { border-top-color: #e3ebf3; }
}

@media (max-width: 420px) {
  .header-inner .brand-name { font-size: .87rem; }
  .header-inner .brand-sub { font-size: .67rem; }
}
