/* ==========================================================================
   Dirhami Investment Technology
   World: the firm's methodology document. Green cover, white report pages,
   numbered clauses, ruled tables, tabular figures.
   1. Font & tokens     5. Cover            9. Clauses & rules   13. Forms
   2. Base              6. Contents         10. Rebalance table  14. Prose
   3. Layout            7. Tables           11. Enquiry band     15. Responsive
   4. Running header    8. Buttons & links  12. Footer
   ========================================================================== */

/* 1. Font & tokens -------------------------------------------------------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Ledger green ramp */
  --green-950: #08352a;
  --green-900: #0b4637;
  --green-800: #0f5b45;
  --green-700: #17705a;
  --green-300: #9cc4b5;
  --green-200: #c3dcd2;
  --green-100: #dfece6;
  --green-50: #eff6f3;

  /* One stepped neutral ramp, tinted toward the green */
  --ink-950: #111514;
  --ink-900: #161a19;
  --ink-700: #3a4140;
  --ink-600: #515958;
  --ink-500: #687170;
  --ink-300: #b3b9b8;
  --ink-200: #d5dad8;
  --ink-100: #e8ecea;
  --paper: #f5f7f6;
  --white: #ffffff;
  --error: #a4262c;

  /* Footer text on ink-950 */
  --on-ink: #c9d1ce;
  --on-ink-muted: #a9b3b0;
  --on-ink-line: rgba(255, 255, 255, 0.14);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --narrow: 84%;

  --container: 1280px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-y: clamp(64px, 8vw, 112px);
  --header-h: 64px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
  scrollbar-color: var(--green-800) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--green-800);
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure, table, caption { margin: 0; padding: 0; }
ol, ul { list-style: none; }
table { border-collapse: collapse; width: 100%; }

h1, h2, h3 { font-weight: 600; text-wrap: balance; }
h1 {
  font-size: clamp(2.6rem, 6vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-stretch: 94%;
}
h2 {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-stretch: 96%;
}
h3 {
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

::selection { background: var(--green-200); color: var(--green-950); }

:focus-visible {
  outline: 2px solid var(--green-700);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 300;
  padding: 12px 18px;
  background: var(--green-800);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: square;
  stroke-linejoin: miter;
  flex-shrink: 0;
}

/* 3. Layout --------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* The document grid: clause number | text | margin notes */
.doc {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) minmax(0, 7fr) minmax(0, 3.2fr);
  column-gap: clamp(20px, 3vw, 48px);
}
.doc > .doc__main { grid-column: 2; }
.doc > .doc__notes { grid-column: 3; }
.doc > .doc__wide { grid-column: 2 / -1; }
.doc > .doc__full { grid-column: 1 / -1; }

.page { background: var(--white); }
.page.section + .page.section { padding-top: 0; }
@media (min-width: 1200px) {
  .page {
    width: calc(100% - 2 * var(--gutter));
    max-width: 1360px;
    margin-inline: auto;
    border-inline: 1px solid var(--ink-200);
  }
}

/* 4. Running header ------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--ink-200);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-900);
  text-decoration: none;
  flex-shrink: 0;
}
.brand__mark { width: 24px; height: auto; fill: currentColor; }
.brand__mark circle { fill: var(--green-700); }
.brand__name { font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.brand__name span { font-weight: 400; color: var(--ink-600); }

.running-section {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding-left: 20px;
  margin-left: 4px;
  border-left: 1px solid var(--ink-200);
  font-size: 0.875rem;
  color: var(--ink-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.running-section.is-active { opacity: 1; }
.running-section b { color: var(--green-800); font-weight: 650; }

.site-nav { margin-left: auto; display: flex; align-items: center; }
.site-nav__list { display: flex; align-items: center; gap: 2px; }
.site-nav__list a {
  display: block;
  padding: 8px 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-700);
  text-decoration: none;
}
.site-nav__list a:hover { color: var(--green-800); }
.site-nav__list a[aria-current="page"] {
  color: var(--green-800);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}
.site-nav__list .site-nav__cta { margin-left: 12px; }
.site-nav__list .site-nav__cta a {
  padding: 9px 16px;
  background: var(--green-800);
  color: var(--white);
  font-weight: 600;
}
.site-nav__list .site-nav__cta a:hover { background: var(--green-900); color: var(--white); }
.site-nav__list .site-nav__cta a[aria-current="page"] { text-decoration: none; background: var(--green-950); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink-300);
  background: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--ink-900); }
.nav-toggle .icon { font-size: 1rem; transition: transform 0.3s var(--ease-out); }
.nav-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }

/* 5. Cover ---------------------------------------------------------------- */
.cover {
  background: var(--green-800);
  color: var(--white);
}
.cover__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
  padding-block: clamp(56px, 9vw, 120px) clamp(48px, 6vw, 80px);
}
.cover h1 { max-width: 13ch; }
.cover__lead {
  margin-top: 28px;
  max-width: 46ch;
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  line-height: 1.5;
  color: var(--green-100);
}
.cover__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 40px;
}
.cover__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding-block: 18px 22px;
  border-top: 1px solid rgba(223, 236, 230, 0.28);
  font-size: 0.875rem;
  color: var(--green-200);
}
.cover__foot span:first-child { color: var(--white); font-weight: 600; }

/* Inner-page cover: same material, shorter */
.cover--page .cover__grid { padding-block: clamp(48px, 7vw, 96px) clamp(40px, 5vw, 64px); }
.cover--page h1 { max-width: 16ch; font-size: clamp(2.4rem, 5vw, 4.25rem); }


/* 6. Contents ------------------------------------------------------------- */
.contents li { border-bottom: 1px solid var(--ink-200); }
.contents li:first-child { border-top: 2px solid var(--ink-900); }
.contents a {
  display: grid;
  grid-template-columns: 64px minmax(0, 1.1fr) minmax(0, 1.6fr) 24px;
  gap: 20px;
  align-items: baseline;
  padding: 22px 0;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.25s var(--ease-out);
}
.contents a:hover { background: var(--green-50); }
.contents__num {
  font-weight: 700;
  font-stretch: var(--narrow);
  font-size: 1.1rem;
  color: var(--green-800);
  padding-left: 4px;
}
.contents__title { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.015em; }
.contents__desc { color: var(--ink-600); font-size: 1rem; }
.contents .icon { font-size: 1.1rem; color: var(--green-800); align-self: center; transition: transform 0.35s var(--ease-out); }
.contents a:hover .icon { transform: translateX(4px); }

/* 7. Tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.ruled {
  font-size: 0.975rem;
  border-top: 2px solid var(--ink-900);
}
.ruled caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 12px;
  font-weight: 600;
  font-size: 1rem;
}
.ruled thead th {
  background: var(--green-800);
  color: var(--white);
  font-weight: 600;
  font-stretch: var(--narrow);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  text-align: left;
  padding: 10px 16px;
  white-space: nowrap;
}
.ruled tbody th,
.ruled tbody td {
  padding: 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--ink-200);
}
.ruled tbody th { font-weight: 600; width: 28%; }
.ruled .num { text-align: right; white-space: nowrap; }
.ruled td p + p { margin-top: 6px; }
.ruled .muted { color: var(--ink-600); }
.ruled a { color: var(--green-800); }

/* Key facts table on green */
.facts {
  font-size: 0.975rem;
  border-top: 2px solid var(--white);
}
.facts caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  padding-bottom: 12px;
}
.facts th,
.facts td {
  text-align: left;
  vertical-align: top;
  padding: 11px 0;
  border-bottom: 1px solid rgba(223, 236, 230, 0.28);
}
.facts th {
  width: 38%;
  padding-right: 16px;
  font-weight: 500;
  font-stretch: var(--narrow);
  color: var(--green-200);
}
.facts td { color: var(--white); }
.facts--toc th { width: 3rem; font-weight: 700; color: var(--green-200); }
.facts a { color: var(--white); text-underline-offset: 3px; text-decoration-color: var(--green-300); }
.facts a:hover { text-decoration-color: var(--white); }

/* 8. Buttons & links ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 22px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.btn .icon { font-size: 1.1rem; transition: transform 0.35s var(--ease-out); }
.btn:hover .icon { transform: translateX(4px); }
.btn--green { background: var(--green-800); color: var(--white); }
.btn--green:hover { background: var(--green-950); }
.btn--white { background: var(--white); color: var(--green-900); }
.btn--white:hover { background: var(--green-100); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

a { color: var(--green-800); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

.link {
  color: var(--green-800);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.link:hover { text-decoration-thickness: 2px; }
.link .icon { font-size: 1rem; }
.link--on-green { color: var(--white); text-decoration-color: var(--green-300); }
.link--on-green:hover { text-decoration-color: var(--white); }

sup { line-height: 0; }
sup a { text-decoration: none; font-weight: 600; padding-inline: 1px; }

/* 9. Clauses & rules ------------------------------------------------------ */
.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }

.clause-head {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: baseline;
  padding-bottom: 20px;
  margin-bottom: clamp(32px, 4vw, 48px);
  border-bottom: 3px solid var(--green-800);
}
.clause-head__num {
  grid-column: 1;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  font-weight: 700;
  font-stretch: var(--narrow);
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--green-800);
}
.clause-head h2 { grid-column: 2; }
.clause-head__aside {
  grid-column: 3;
  font-size: 0.9375rem;
  color: var(--ink-600);
  justify-self: start;
}

.intro { font-size: clamp(1.1rem, 1.4vw, 1.25rem); line-height: 1.55; color: var(--ink-700); max-width: 60ch; }
.intro + .intro { margin-top: 16px; }
.intro + .rules,
.intro + .table-wrap,
.intro + .rebalance,
.intro + .definitions { margin-top: 32px; }
#contents-title { margin-bottom: 28px; }
.table-note { margin-top: 16px; }

.rules { display: grid; }
.rule {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--ink-200);
}
.rule:last-child { border-bottom: 1px solid var(--ink-200); }
.rule__num { font-weight: 700; font-stretch: var(--narrow); color: var(--green-800); }
.rule h3 { font-size: 1.15rem; }
.rule p { margin-top: 6px; color: var(--ink-700); max-width: 64ch; }
.rule ul { margin-top: 10px; display: grid; gap: 6px; }
.rule li { position: relative; padding-left: 18px; color: var(--ink-700); }
.rule li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 1.5px;
  background: var(--green-800);
}

.note {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-600);
  padding-top: 14px;
  border-top: 1px solid var(--ink-900);
}
.note + .note { margin-top: 28px; }
.note h3 { font-size: 0.9375rem; color: var(--ink-900); margin-bottom: 6px; }
.note .link { margin-top: 10px; font-size: 0.9375rem; }
.note p + p { margin-top: 8px; }

.after { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }

.definitions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 56px); }
.definitions div { padding: 18px 0; border-top: 1px solid var(--ink-200); }
.definitions dt { font-weight: 650; }
.definitions dd { margin-top: 4px; color: var(--ink-700); }

.footnotes { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--ink-300); display: grid; gap: 6px; }
.footnotes li { display: grid; grid-template-columns: 24px minmax(0, 1fr); font-size: 0.875rem; color: var(--ink-600); }
.footnotes li span:first-child { font-weight: 600; color: var(--green-800); }

/* 10. Rebalance table ----------------------------------------------------- */
.rebalance {
  background: var(--paper);
  border-top: 2px solid var(--ink-900);
  padding: 0 24px 20px;
}
.rebalance__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 18px 0;
}
.rebalance__state { font-size: 0.9375rem; color: var(--ink-600); }
.rebalance__state b { color: var(--ink-900); font-weight: 650; }
.rebalance table { font-size: 0.975rem; }
.rebalance thead th {
  background: var(--green-800);
  color: var(--white);
  font-weight: 600;
  font-stretch: var(--narrow);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  text-align: left;
  padding: 10px 14px;
  white-space: nowrap;
}
.rebalance tbody td {
  padding: 12px 14px;
  background: var(--white);
  border-bottom: 1px solid var(--ink-200);
  white-space: nowrap;
  transition: background-color 0.6s var(--ease-out), color 0.4s var(--ease-out);
}
.rebalance .num,
.rebalance th.num { text-align: right; }
.rebalance tbody tr { position: relative; }
.rebalance__rank { font-weight: 700; font-stretch: var(--narrow); width: 64px; }
.rebalance__sec { font-weight: 600; }
.rebalance__move { display: inline-flex; align-items: center; gap: 4px; min-width: 56px; font-size: 0.875rem; font-weight: 600; }
.rebalance__move .icon { font-size: 0.8rem; stroke-width: 2.25; }
.rebalance__move--up { color: var(--green-800); }
.rebalance__move--down { color: var(--ink-600); }
.rebalance__move--down .icon { transform: rotate(180deg); }
.rebalance tr.is-changed td { background: var(--green-50); }
.rebalance tr.is-new td { background: var(--green-100); }
.rebalance__tag {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 7px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--green-800);
  color: var(--white);
}
.rebalance tr.is-exiting td { color: var(--ink-500); }
.rebalance tr.is-exiting .rebalance__name,
.rebalance tr.is-exiting td.num { text-decoration: line-through; text-decoration-color: var(--ink-500); }
.rebalance tr.is-exiting .rebalance__tag { background: var(--ink-600); }
.rebalance__rank-move { display: none; }
.rebalance__exits { padding-top: 14px; font-size: 0.9375rem; color: var(--ink-600); min-height: 2.6em; }
.rebalance__exits b { color: var(--ink-900); font-weight: 650; }
.rebalance__caption { margin-top: 6px; font-size: 0.875rem; color: var(--ink-600); }

.steps { display: grid; }
.steps li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px;
  padding: 12px 10px;
  border-top: 1px solid var(--ink-200);
  font-size: 0.9375rem;
  color: var(--ink-600);
  transition: color 0.4s var(--ease-out), background-color 0.4s var(--ease-out);
}
.steps li:last-child { border-bottom: 1px solid var(--ink-200); }
.steps b { display: block; color: var(--ink-900); font-weight: 650; }
.steps span:first-child { font-weight: 700; font-stretch: var(--narrow); color: var(--green-800); }
.steps li.is-lit { color: var(--ink-900); background: var(--green-50); }
.steps__ref { display: block; margin-top: 4px; font-size: 0.875rem; color: var(--green-800); font-weight: 600; }

/* 11. Enquiry band -------------------------------------------------------- */
.enquiry {
  background: var(--green-900);
  color: var(--white);
  padding-block: clamp(64px, 8vw, 104px);
}
.enquiry .clause-head { border-bottom-color: var(--green-300); }
.enquiry .clause-head__num { color: var(--green-300); }
.enquiry .intro { color: var(--green-100); }
.enquiry .facts { border-top-color: var(--green-300); }
.enquiry .after { margin-top: 36px; }

/* 12. Footer -------------------------------------------------------------- */
.site-footer {
  background: var(--ink-950);
  color: var(--on-ink);
  font-size: 0.9375rem;
  padding-block: 56px 32px;
}
.site-footer a { color: var(--white); text-decoration-color: rgba(255, 255, 255, 0.35); }
.site-footer a:hover { text-decoration-color: var(--white); }
.site-footer .brand { color: var(--white); }
.site-footer .brand__name span { color: var(--on-ink); }
.site-footer .brand__mark circle { fill: var(--green-300); }
.site-footer__about { margin-top: 18px; max-width: 38ch; color: var(--on-ink); }

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 40px clamp(32px, 6vw, 96px);
  padding-bottom: 40px;
}
.control { font-size: 0.9375rem; border-top: 2px solid var(--on-ink); table-layout: fixed; }
.control caption { caption-side: top; text-align: left; font-weight: 600; color: var(--white); padding-bottom: 10px; }
.control th,
.control td { text-align: left; vertical-align: top; padding: 10px 0; border-bottom: 1px solid var(--on-ink-line); }
.control th { width: 30%; padding-right: 16px; font-weight: 500; font-stretch: var(--narrow); color: var(--on-ink-muted); }
.control td { color: var(--white); overflow-wrap: break-word; }
.control td a { margin-right: 18px; }

.site-footer__notes { display: grid; gap: 8px; padding-block: 28px; border-top: 1px solid var(--on-ink-line); }
.site-footer__notes li { display: grid; grid-template-columns: 24px minmax(0, 1fr); font-size: 0.875rem; line-height: 1.55; color: var(--on-ink-muted); max-width: 110ch; }
.site-footer__notes li span:first-child { color: var(--green-300); font-weight: 600; }
.site-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; border-top: 1px solid var(--on-ink-line); font-size: 0.875rem; color: var(--on-ink-muted); }

/* 13. Forms --------------------------------------------------------------- */
.form { border-top: 2px solid var(--ink-900); }
.form-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--ink-200);
}
.form-row__num { font-weight: 700; font-stretch: var(--narrow); color: var(--green-800); padding-top: 2px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; }
.field .hint { font-weight: 400; color: var(--ink-600); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--ink-300);
  border-radius: 0;
  font-size: 1rem;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.field textarea { min-height: 160px; resize: vertical; line-height: 1.55; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f5b45' stroke-width='2' stroke-linecap='square'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-500); }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--ink-600); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green-800);
  box-shadow: 0 0 0 3px var(--green-100);
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--error); }
.field__error { font-size: 0.875rem; color: var(--error); font-weight: 500; }
.field__error:empty { display: none; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.consent { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-700); font-size: 0.9375rem; }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green-800); flex-shrink: 0; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding-top: 28px; }
.form-actions p { font-size: 0.9375rem; color: var(--ink-600); }
.form-status {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  color: var(--ink-900);
}
.form-status[hidden] { display: none; }

/* 14. Prose (legal) ------------------------------------------------------- */
.prose { max-width: 70ch; }
.prose h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); margin-top: 44px; margin-bottom: 12px; display: flex; gap: 16px; }
.prose h2 span { color: var(--green-800); font-stretch: var(--narrow); font-weight: 700; min-width: 32px; }
.prose h2:first-of-type { margin-top: 0; }
.prose p, .prose li { color: var(--ink-700); }
.prose p + p { margin-top: 12px; }
.prose ul { margin-top: 10px; display: grid; gap: 8px; }
.prose li { position: relative; padding-left: 18px; }
.prose li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 1.5px; background: var(--green-800); }
.prose__meta { margin-bottom: 36px; color: var(--ink-600); font-size: 0.9375rem; }

/* 15. Responsive ---------------------------------------------------------- */
@media (min-width: 961px) and (max-width: 1100px) {
  .site-nav__list a { padding-inline: 9px; }
  .running-section { display: none; }
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .site-nav__list {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--white);
    border-bottom: 2px solid var(--ink-900);
    box-shadow: 0 24px 40px -24px rgba(17, 21, 20, 0.35);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path 0.45s var(--ease-out), visibility 0s linear 0.45s;
  }
  .site-nav.is-open .site-nav__list {
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition: clip-path 0.45s var(--ease-out), visibility 0s;
  }
  .site-nav__list li { border-bottom: 1px solid var(--ink-200); }
  .site-nav__list a { display: flex; gap: 16px; padding: 16px 0; font-size: 1.125rem; }
  .site-header__inner { gap: 14px; }
  .running-section { flex: 1 1 auto; padding-left: 14px; margin-left: 0; font-size: 0.8125rem; }
  .site-nav__list a[aria-current="page"] { text-decoration: none; }
  .site-nav__list .site-nav__cta { margin: 20px 0 0; border: 0; }
  .site-nav__list .site-nav__cta a { justify-content: center; padding: 16px; }

  .cover__grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc > .doc__main,
  .doc > .doc__notes,
  .doc > .doc__wide,
  .doc > .doc__full { grid-column: 1; }
  .doc > .doc__notes { margin-top: 40px; }
  .clause-head { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; }
  .clause-head__num { grid-column: 1; }
  .clause-head h2 { grid-column: 2; }
  .clause-head__aside { grid-column: 1 / -1; margin-top: 10px; }

  .contents a { grid-template-columns: 44px minmax(0, 1fr) 20px; }
  .contents__desc { grid-column: 2; }
  .contents .icon { grid-column: 3; grid-row: 1; }

  .definitions { grid-template-columns: minmax(0, 1fr); }
  .site-footer__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .brand__name span { display: none; }
  .rule { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .field-pair { grid-template-columns: minmax(0, 1fr); }
  .ruled tbody th { width: auto; }
  .ruled.stack-sm thead { display: none; }
  .ruled.stack-sm tbody tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--ink-200); }
  .ruled.stack-sm tbody th,
  .ruled.stack-sm tbody td { display: block; padding: 2px 0; border: 0; }
  .ruled.stack-sm tbody th { font-size: 1.05rem; margin-bottom: 4px; }
  .ruled.stack-sm td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--ink-900); }
  .rebalance { padding: 0 12px 16px; }
  .rebalance tbody td,
  .rebalance thead th { padding-inline: 8px; }
  .rebalance .col-score,
  .rebalance .col-move { display: none; }
  .rebalance__sec { white-space: normal !important; }
  .rebalance thead th { white-space: normal; vertical-align: bottom; }
  .rebalance__tag { display: block; width: max-content; margin: 4px 0 0; }
  .rebalance__rank-move { display: block; margin-top: 2px; }
  .rebalance__rank-move .rebalance__move { min-width: 0; font-size: 0.75rem; white-space: nowrap; }
  .facts th { width: 40%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
