/* NZ Constitution 2.0 – site styles. Plain CSS, no build step. */

@font-face { font-family: "Source Sans Pro"; src: url(../fonts/SourceSansPro-Regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url(../fonts/SourceSansPro-Italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url(../fonts/SourceSansPro-Semibold.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url(../fonts/SourceSansPro-SemiboldItalic.woff2) format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url(../fonts/SourceSansPro-Bold.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(../fonts/EBGaramond-Regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f1ec;
  --text: #1d1f2b;
  --text-soft: #4a4e5e;
  --muted: #6b6f7d;
  --line: #e2e0d8;
  --brand: #24246b;          /* deep indigo – a nod to the old purple */
  --brand-2: #1e40af;        /* blue */
  --link: #2a44b8;
  --accent: #c8102e;         /* Southern Cross red */
  --mark: #ffe58a;
  --mark-text: #1d1f2b;
  --focus: #f5b301;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 60, .06), 0 4px 16px rgba(20, 20, 60, .06);
  --header-h: 64px;
  --toolbar-h: 76px;
  --font-body: "Source Sans Pro", "Source Sans 3", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "EB Garamond", Georgia, "Times New Roman", serif;
  --measure: 68ch;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12131a;
    --surface: #1a1c26;
    --surface-2: #222533;
    --text: #e8e8ee;
    --text-soft: #c4c6d2;
    --muted: #9a9db0;
    --line: #2e3142;
    --brand: #1b1b4f;
    --brand-2: #23399a;
    --link: #9db1ff;
    --accent: #ff5a6e;
    --mark: #6b5600;
    --mark-text: #fff6cf;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 1.1875rem; line-height: 1.65;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--surface); color: var(--text); padding: .6rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.skip-link:focus { top: 1rem; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  padding: .7em 1.2em; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--brand-2); color: #fff; }
.btn-primary:hover { background: #1a3794; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.92); }
.btn-light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.45); }
.btn-light:hover { background: rgba(255,255,255,.24); }
.btn-ghost { background: transparent; color: var(--link); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }

/* ---------- Header ---------- */
.site-header { background: linear-gradient(110deg, var(--brand) 0%, #2b2f8c 45%, var(--brand-2) 100%); color: #fff; position: relative; z-index: 30; }
.header-inner { max-width: 1240px; margin: 0 auto; padding: 0 1.25rem; min-height: var(--header-h); display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; margin-right: auto; }
.brand img { width: 30px; height: auto; }
.brand-text { font-family: var(--font-display); font-size: 1.45rem; letter-spacing: .01em; white-space: nowrap; }
.brand-nz { letter-spacing: .04em; }
.site-nav { display: flex; align-items: center; gap: 1rem; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .15rem; }
.nav-list > li { position: relative; display: flex; align-items: center; }
.nav-list a { color: #fff; text-decoration: none; font-weight: 600; font-size: 1rem; padding: .5rem .75rem; border-radius: 8px; display: block; }
.nav-list a:hover { background: rgba(255,255,255,.12); }
.nav-list a[aria-current="page"] { background: rgba(255,255,255,.16); box-shadow: inset 0 -2px 0 var(--accent); }
.dd-toggle { background: none; border: 0; color: #fff; padding: .45rem .35rem; min-width: 26px; min-height: 30px; margin-left: -.5rem; cursor: pointer; border-radius: 6px; display: inline-flex; }
.dd-toggle svg { width: 1rem; height: 1rem; }
.dropdown { list-style: none; margin: 0; padding: .5rem; position: absolute; top: 100%; left: 0; min-width: 290px;
  background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(10,10,40,.22); border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s; }
.has-dd:hover .dropdown, .has-dd:focus-within .dropdown, .has-dd.open .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown a { color: var(--text); font-weight: 400; padding: .4rem .7rem; }
.dropdown a:hover { background: var(--surface-2); }
.dd-group { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text); padding: .6rem .7rem .2rem; }
.menu-toggle { display: none; align-items: center; gap: .4rem; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; font: inherit; font-weight: 600; font-size: .95rem; padding: .45rem .9rem; cursor: pointer; }

@media (max-width: 920px) {
  .menu-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); color: var(--text); flex-direction: column; align-items: stretch;
    padding: 1rem 1.25rem 1.25rem; box-shadow: 0 16px 30px rgba(10,10,40,.2); border-top: 1px solid var(--line); max-height: calc(100vh - var(--header-h)); overflow: auto; }
  .site-nav.open { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list > li { flex-wrap: wrap; }
  .nav-list > li > a { flex: 1; color: var(--text); font-size: 1.1rem; padding: .75rem .5rem; }
  .nav-list a:hover { background: var(--surface-2); }
  .nav-list a[aria-current="page"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
  .dd-toggle { color: var(--text); padding: .6rem .8rem; margin: 0; }
  .dropdown { position: static; display: none; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; margin: 0 0 .5rem .6rem; width: 100%; min-width: 0; padding: .2rem .4rem; }
  .has-dd:hover .dropdown, .has-dd:focus-within .dropdown { display: none; }
  .has-dd.open .dropdown { display: block; }
}
@media (max-width: 380px) { .brand-text { font-size: 1.25rem; } .toc-toggle-text { display: none; } }

/* ---------- Footer ---------- */
.site-footer { background: #15163a; color: #d6d8ea; margin-top: 4rem; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 2.25rem 1.25rem 2.5rem; text-align: center; }
.copyright { font-weight: 600; color: #fff; margin-bottom: .5rem; }
.footer-note { max-width: 46rem; margin: 0 auto 1.25rem; font-size: .95rem; color: #b9bcd6; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; font-size: .95rem; }
.footer-nav a { color: #d6d8ea; }

/* ---------- Generic page ---------- */
.page-wrap { max-width: 1240px; margin: 0 auto; padding: 2.5rem 1.25rem 0; }
.prose { max-width: var(--measure); }
.page-head, .doc-hero { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.page-head-inner, .doc-hero-inner { max-width: 1240px; margin: 0 auto; padding: 2.5rem 1.25rem 2rem; }
.page-head h1, .doc-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0; }
.doc-hero-sub { color: var(--text-soft); margin: .5rem 0 0; max-width: 60ch; }

/* ---------- Home ---------- */
.hero { position: relative; color: #fff; text-align: center; overflow: hidden;
  background: linear-gradient(180deg, rgba(20,20,70,.72), rgba(14,18,60,.86)), url(../images/img_5788-1200.jpeg) center / cover no-repeat; }
@media (min-width: 1200px) { .hero { background-image: linear-gradient(180deg, rgba(20,20,70,.72), rgba(14,18,60,.86)), url(../images/img_5788-1920.jpeg); } }
.hero-inner { max-width: 820px; margin: 0 auto; padding: 3.5rem 1.25rem 3.75rem; }
.hero-stars { width: 84px; height: auto; margin-bottom: .75rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.hero-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.6rem, 8vw, 4.4rem); margin: 0 0 .3rem; letter-spacing: .005em; }
.hero-tagline { font-size: clamp(1.15rem, 2.6vw, 1.4rem); color: #e6e8ff; margin: 0 auto 2rem; max-width: 34ch; }
.hero-search { display: flex; align-items: center; gap: .5rem; background: #fff; border-radius: 999px; padding: .35rem .35rem .35rem 1.1rem; max-width: 640px; margin: 0 auto 1.25rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); color: #444; }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 1.1rem; padding: .6rem 0; color: #1d1f2b; background: transparent; }
.hero-search:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.hero-actions { margin: 0; }
.page-essay { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start; }
.essay { font-size: 1.22rem; line-height: 1.72; }
.essay-head { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.essay-head h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 4.5vw, 2.7rem); margin-bottom: .2rem; }
.essay-sub { color: var(--muted); font-style: italic; margin-bottom: 1.25rem; }
.essay-jump { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .95rem; }
.essay-jump a { text-decoration: none; padding: .3rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-soft); }
.essay-jump a:hover { border-color: var(--link); color: var(--link); }
.essay section { margin-bottom: 2.25rem; scroll-margin-top: 1rem; }
.essay h3 { font-size: 1.55rem; font-weight: 600; color: var(--text); margin-bottom: .7rem; display: flex; align-items: center; gap: .6rem; }
.essay h3::before { content: ""; width: .55rem; height: .55rem; background: var(--accent); transform: rotate(45deg); flex: none; border-radius: 1px; }
.essay-part { padding-top: 2rem; border-top: 1px solid var(--line); }
.notes-list { padding-left: 1.2rem; }
.essay-cta { margin-top: 2.5rem; }
.faq-box { position: sticky; top: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); font-size: 1rem; }
.faq-box h2 { font-size: 1.35rem; }
.faq-box .version { color: var(--muted); margin: 1.5rem 0 0; font-size: .95rem; }
@media (max-width: 960px) {
  .page-essay { grid-template-columns: 1fr; gap: 1rem; }
  .faq-box { position: static; }
}

/* ---------- Constitution page ---------- */
.doc-hero-inner { padding-top: 1.75rem; padding-bottom: 1.25rem; }
.results-head { max-width: var(--measure); }
.doc-toolbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
@supports not (background: color-mix(in srgb, red, blue)) { .doc-toolbar { background: var(--bg); } }
.doc-toolbar-inner { max-width: 1240px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: .75rem; }
.doc-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 2px solid var(--line); border-radius: 999px; padding: 0 .4rem 0 1rem; box-shadow: var(--shadow); max-width: 760px; }
.doc-search:focus-within { border-color: var(--brand-2); outline: 3px solid color-mix(in srgb, var(--brand-2) 25%, transparent); }
.doc-search .search-icon { color: var(--muted); }
.doc-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 1.15rem; padding: .7rem 0; }
.doc-search input::-webkit-search-cancel-button { display: none; }
.search-clear { display: inline-flex; align-items: center; gap: .3rem; background: var(--surface-2); border: 0; color: var(--text-soft); font: inherit; font-size: .9rem; font-weight: 600; padding: .4rem .75rem; border-radius: 999px; cursor: pointer; }
.search-clear[hidden] { display: none; }
.search-clear svg { width: 1rem; height: 1rem; }
.search-options { max-width: 1240px; margin: 0 auto; padding: .7rem 1.25rem 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1.5rem; }
.search-options { justify-content: flex-start; }
.whole-words { font-size: .95rem; color: var(--text-soft); display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; cursor: pointer; }
.whole-words input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand-2); }
.search-help { margin: 0; font-size: .92rem; color: var(--muted); max-width: 80ch; }
.searching .search-help { display: none; }
.toc-toggle { display: none; align-items: center; gap: .4rem; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px; font: inherit; font-weight: 600; font-size: .95rem; padding: .6rem .9rem; cursor: pointer; box-shadow: var(--shadow); }

.doc-layout { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.25rem 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 3rem; align-items: start; }
.toc { position: sticky; top: calc(var(--toolbar-h) + 1.25rem); max-height: calc(100vh - var(--toolbar-h) - 2rem); overflow: auto; font-size: .98rem; padding-right: .5rem; scrollbar-width: thin; }
.toc-head { display: flex; justify-content: space-between; align-items: center; }
.toc-title { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }
.toc-close { display: none; background: none; border: 0; color: var(--text); padding: .4rem; cursor: pointer; }
.toc-list, .toc-list ul { list-style: none; margin: 0; padding: 0; }
.toc-section { margin-bottom: 1rem; }
.toc-section-link { display: block; font-weight: 700; color: var(--text); text-decoration: none; padding: .3rem .6rem; font-size: .92rem; letter-spacing: .04em; text-transform: uppercase; }
.toc-list ul a { display: block; text-decoration: none; color: var(--text-soft); padding: .38rem .6rem .38rem .85rem; border-left: 2px solid var(--line); line-height: 1.3; }
.toc-list ul a:hover { color: var(--link); background: var(--surface-2); }
.toc-list ul a.active { color: var(--brand-2); border-left-color: var(--accent); font-weight: 600; background: var(--surface); }
@media (prefers-color-scheme: dark) { .toc-list ul a.active { color: var(--link); } }
.toc-label { display: block; }
.toc-range { display: block; font-size: .82rem; color: var(--muted); font-weight: 400; margin-top: .1rem; }

.doc { max-width: var(--measure); }
.doc-section { margin-bottom: 3rem; }
.section-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 3.6vw, 2.25rem); line-height: 1.15; margin: 0 0 1.5rem; padding-bottom: .9rem; border-bottom: 3px solid var(--brand-2); }
.section-title { width: max-content; max-width: min(862px, calc(100vw - 400px)); text-wrap: balance; } /* section headings may run wider than the article text */
@media (max-width: 1024px) { .section-title { max-width: calc(100vw - 2.5rem); } }
@media (max-width: 640px) { .section-title { max-width: calc(100vw - 2rem); } }
.section-title .eyebrow { display: block; font-family: var(--font-body); font-size: .9rem; font-weight: 700; letter-spacing: .12em; color: var(--accent); margin-bottom: .35rem; }
.topic { margin-bottom: 2.5rem; scroll-margin-top: calc(var(--toolbar-h) + 2rem); }
.topic-title { font-size: 1.45rem; font-weight: 600; margin: 2.25rem 0 1rem; }
.topic-title a { color: inherit; text-decoration: none; }
.topic-title a:hover { text-decoration: underline; }
.article { position: relative; padding: 1rem 0 1.1rem; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--toolbar-h) + 2rem); }
.article-unnumbered { border-top: 0; padding-top: 0; }
.article-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; }
.article-heading { margin: 0; font-size: 1.12rem; line-height: 1.35; font-weight: 600; }
.article-num { font-weight: 700; color: var(--brand-2); text-decoration: none; white-space: nowrap; }
.article-sep { color: var(--muted); font-weight: 400; }
@media (prefers-color-scheme: dark) { .article-num { color: var(--link); } .btn-accent { background: #c8102e; } }
.article-num:hover { text-decoration: underline; }
.article-title { color: var(--text); }
.article-head { align-items: flex-start; }
.article-unnumbered .article-head { margin-top: .25rem; }
.result-head { font-size: 1.12rem; font-weight: 600; line-height: 1.35; margin: 0 0 .15rem; }
.result-head .result-title { color: var(--text); }
.result-meta { margin-bottom: .55rem; }
.anthem-cols .anthem-col p { margin: 0 0 .35rem; }
.anthem-cols .anthem-head { font-weight: 700; letter-spacing: .06em; color: var(--brand-2); margin-bottom: .6rem !important; }
.copy-link { display: inline-flex; align-items: center; gap: .35rem; background: none; border: 1px solid transparent; color: var(--muted); font: inherit; font-size: .85rem; padding: .25rem .6rem; border-radius: 999px; cursor: pointer; }
.copy-link .copy-text { visibility: hidden; }
.article:hover .copy-link .copy-text, .copy-link:focus-visible .copy-text, .copy-link:hover .copy-text { visibility: visible; }
.copy-link svg { width: 1rem; height: 1rem; }
.article:hover .copy-link, .copy-link:focus-visible, .copy-link:hover { opacity: 1; }
.copy-link:hover { border-color: var(--line); color: var(--link); background: var(--surface); }
.copy-link.copied { opacity: 1; color: #137a3a; }
@media (hover: none) { .copy-text { display: none; } }
.article-body > p:last-child { margin-bottom: 0; }
.article-body p { margin-bottom: .7em; }
.clauses { list-style: none; margin: .4em 0 .8em; padding: 0; }
.clauses li { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: .25em; margin-bottom: .45em; }
.clause-label { color: var(--muted); font-variant-numeric: tabular-nums; }
.clause-body > p { margin: 0 0 .45em; }
.clause-body > p:last-child { margin-bottom: 0; }
.clause-body .clauses { margin: .35em 0 .3em; }
.article figure { margin: .5rem 0 1rem; }
.article figure img { border-radius: 6px; border: 1px solid var(--line); width: 320px; }
.article:target, .article.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--mark) 70%, transparent); box-shadow: -14px 0 0 color-mix(in srgb, var(--mark) 70%, transparent), 14px 0 0 color-mix(in srgb, var(--mark) 70%, transparent); } 100% { background: transparent; box-shadow: none; } }
.anthem { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: .5rem 0 1rem; padding: 1.2rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 1.02rem; }
.anthem-verses { margin: 0; padding-left: 1.4rem; }
.anthem-verses li { margin-bottom: 1rem; }
.anthem-verses li::marker { color: var(--muted); }
@media (max-width: 640px) { .anthem { grid-template-columns: 1fr; padding: 1rem; } }

/* search results */
.searching .doc { display: none; }
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.results-summary { font-size: 1.3rem; font-weight: 600; margin: 0; }
.results-summary q { quotes: "“" "”"; color: var(--brand-2); }
@media (prefers-color-scheme: dark) { .results-summary q { color: var(--link); } }
.results-list { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.result-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin-bottom: .5rem; }
.result-num { font-weight: 700; color: var(--brand-2); text-decoration: none; }
.result-where { font-size: .9rem; color: var(--muted); }
.result .article-body { font-size: 1.08rem; }
.result-foot { margin-top: .75rem; display: flex; gap: 1rem; flex-wrap: wrap; font-size: .95rem; }
.result-foot a { font-weight: 600; }
mark { background: var(--mark); color: var(--mark-text); padding: 0 .08em; border-radius: 3px; }
.no-results { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.5rem; max-width: var(--measure); color: var(--text-soft); }
.no-results-title { font-weight: 600; font-size: 1.15rem; color: var(--text); }
.jump-hint { background: var(--surface-2); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; max-width: var(--measure); }
.results[hidden], .no-results[hidden], .jump-hint[hidden] { display: none; }

.back-to-top { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 25; display: inline-flex; align-items: center; gap: .3rem; background: var(--brand-2); color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; padding: .65rem 1rem; border-radius: 999px; box-shadow: 0 6px 20px rgba(10,10,60,.3); }
.back-to-top[hidden] { display: none; }
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 60; background: #15163a; color: #fff; padding: .65rem 1.1rem; border-radius: 999px; font-size: .95rem; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.toast[hidden] { display: none; }

@media (max-width: 1024px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc-toggle { display: inline-flex; }
  .toc { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: min(88vw, 360px); max-height: none; background: var(--surface); padding: 1rem 1rem 2rem 1.1rem;
    box-shadow: 8px 0 40px rgba(0,0,0,.25); transform: translateX(-105%); transition: transform .2s ease; visibility: hidden; }
  .toc.open { transform: none; visibility: visible; }
  .toc-close { display: inline-flex; }
  .toc-title { font-size: .9rem; margin: 0; }
  .toc-head { margin-bottom: .75rem; }
  .toc-list ul a { padding-top: .55rem; padding-bottom: .55rem; }
  .toc-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(10,10,30,.45); }
  .toc-backdrop[hidden] { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 1.125rem; }
  .doc-toolbar-inner { padding: .55rem .9rem; gap: .5rem; }
  .doc-search { padding-left: .8rem; }
  .doc-search input { font-size: 1.05rem; padding: .6rem 0; }
  .toc-toggle { padding: .6rem .75rem; }
  .search-options { padding: .6rem 1rem 0; }
  .search-help { font-size: .88rem; }
  .doc-hero h1 { font-size: 2rem; }
  .doc-hero-sub { font-size: 1rem; }
  .doc-hero-inner, .page-head-inner { padding: 1.6rem 1rem 1.2rem; }
  .doc-layout, .page-wrap { padding-left: 1rem; padding-right: 1rem; }
  .clauses li { grid-template-columns: 2.2em minmax(0, 1fr); }
  .result { padding: 1rem; }
  .search-clear span { display: none; }
  .back-to-top span { display: none; }
  .back-to-top { padding: .75rem; }
}

/* ---------- Donate ---------- */
.donate-intro { margin-bottom: 1.5rem; }
.donate-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.donate-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem; }
.coin { display: flex; align-items: center; gap: .6rem; }
.coin h2 { margin: 0; font-size: 1.35rem; }
.coin h2 span { font-weight: 400; color: var(--muted); font-size: 1rem; margin-left: .2rem; }
.qr { display: block; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
.qr img { display: block; width: 170px; height: 170px; }
.addr { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; background: var(--surface-2); border-radius: 8px; padding: .6rem .7rem; word-break: break-all; width: 100%; user-select: all; }
.donate-more { text-align: center; color: var(--muted); margin-top: 2rem; }
.qr-dialog { border: 0; border-radius: 14px; padding: 1.25rem; text-align: center; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.qr-dialog::backdrop { background: rgba(10,10,30,.6); }
.qr-dialog img { display: block; width: min(339px, 80vw); height: auto; margin: 0 auto 1rem; }

/* ---------- Contact ---------- */
.contact-form { max-width: 40rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.75rem; box-shadow: var(--shadow); }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: 1rem; }
.field input[type=text], .field input[type=email], .field textarea { width: 100%; font: inherit; font-size: 1.05rem; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .85rem; }
.field input:focus, .field textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand-2) 30%, transparent); border-color: var(--brand-2); }
.field textarea { resize: vertical; min-height: 9rem; }
.field-check { display: flex; align-items: center; gap: .6rem; }
.field-check label { margin: 0; font-weight: 400; }
.field-check input { width: 1.2rem; height: 1.2rem; accent-color: var(--brand-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 1rem 0 0; min-height: 1.5em; color: var(--text-soft); }
.form-status.error { color: var(--accent); }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer .footer-nav, .doc-toolbar, .toc, .back-to-top, .copy-link, .hero-search, .essay-jump, .toast { display: none !important; }
  .doc-layout { display: block; }
  body { font-size: 11pt; background: #fff; color: #000; }
  .article { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* QA fixes 20 Oct 2026 */
.results-summary { overflow-wrap: anywhere; }
.result-num, .article-num { display: inline-block; padding-block: .1rem; }
@media (prefers-color-scheme: dark) { .result-num { color: var(--link); } }
