/* ==========================================================================
   Momivara — Web & Legal Pages
   Shared design system. Warm editorial palette mirroring the Flutter app
   (lib/core/theme/app_colors.dart) and the marketing collateral in /plans.

   Contents
   1. Tokens
   2. Reset & base
   3. Layout primitives
   4. Top bar / navigation
   5. Hero (landing page)
   6. Sections & cards
   7. Prose (legal documents)
   8. Tables, lists, callouts
   9. Table of contents
   10. Footer
   11. Utilities & motion
   12. Print
   ========================================================================== */

/* ── 1. Tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg:          #FAF6F1;
  --bg-tint:     #F5EDE5;
  --surface:     #FFFFFF;
  --surface-2:   #F9ECF1;
  --surface-3:   #FBF7F4;
  --ink:         #2C1A26;
  --ink-2:       #5A3E48;
  --ink-3:       #7A5563;
  --line:        #EDE0D8;
  --line-2:      #F3E9E1;

  --brand:       #9C3256;
  --brand-ink:   #6B1D3B;
  --brand-soft:  #F9ECF1;
  --brand-line:  #EFC9D8;

  --accent:      #4A7C62;
  --accent-soft: #EBF3EF;
  --plum:        #5C3A7A;
  --plum-soft:   #F1ECF7;
  --amber:       #C4773A;
  --amber-soft:  #FBF1E5;
  --danger:      #DC2626;
  --danger-soft: #FDEBEC;

  --on-brand:    #FFFFFF;

  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   22px;

  --shadow-sm:   0 1px 2px rgba(44, 26, 38, .06);
  --shadow:      0 4px 18px rgba(44, 26, 38, .07);
  --shadow-lg:   0 18px 46px rgba(44, 26, 38, .12);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont,
             "Segoe UI", Roboto, sans-serif;

  --wrap:  1180px;
  --read:  74ch;
  --topbar-h: 62px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #1A1218;
    --bg-tint:    #150E13;
    --surface:    #26181F;
    --surface-2:  #3D2730;
    --surface-3:  #2E1E26;
    --ink:        #F5E8EE;
    --ink-2:      #DCC6D2;
    --ink-3:      #B79BA9;
    --line:       #3D2730;
    --line-2:     #34222A;

    --brand:      #E8A0BA;
    --brand-ink:  #F9C8D8;
    --brand-soft: #3A2430;
    --brand-line: #5A3543;

    --accent:     #8FC4A8;
    --accent-soft:#1C2F26;
    --plum:       #C3A8E0;
    --plum-soft:  #2A2038;
    --amber:      #E4A876;
    --amber-soft: #33241A;
    --danger:     #F0868A;
    --danger-soft:#331A1D;

    --on-brand:   #4B0F27;

    --shadow-sm:  0 1px 2px rgba(0, 0, 0, .4);
    --shadow:     0 4px 18px rgba(0, 0, 0, .38);
    --shadow-lg:  0 18px 46px rgba(0, 0, 0, .5);
  }
}

:root[data-theme="dark"] {
  --bg:         #1A1218;
  --bg-tint:    #150E13;
  --surface:    #26181F;
  --surface-2:  #3D2730;
  --surface-3:  #2E1E26;
  --ink:        #F5E8EE;
  --ink-2:      #DCC6D2;
  --ink-3:      #B79BA9;
  --line:       #3D2730;
  --line-2:     #34222A;

  --brand:      #E8A0BA;
  --brand-ink:  #F9C8D8;
  --brand-soft: #3A2430;
  --brand-line: #5A3543;

  --accent:     #8FC4A8;
  --accent-soft:#1C2F26;
  --plum:       #C3A8E0;
  --plum-soft:  #2A2038;
  --amber:      #E4A876;
  --amber-soft: #33241A;
  --danger:     #F0868A;
  --danger-soft:#331A1D;

  --on-brand:   #4B0F27;

  --shadow-sm:  0 1px 2px rgba(0, 0, 0, .4);
  --shadow:     0 4px 18px rgba(0, 0, 0, .38);
  --shadow-lg:  0 18px 46px rgba(0, 0, 0, .5);
}

:root[data-theme="light"] {
  --bg:         #FAF6F1;
  --bg-tint:    #F5EDE5;
  --surface:    #FFFFFF;
  --surface-2:  #F9ECF1;
  --surface-3:  #FBF7F4;
  --ink:        #2C1A26;
  --ink-2:      #5A3E48;
  --ink-3:      #7A5563;
  --line:       #EDE0D8;
  --line-2:     #F3E9E1;

  --brand:      #9C3256;
  --brand-ink:  #6B1D3B;
  --brand-soft: #F9ECF1;
  --brand-line: #EFC9D8;

  --accent:     #4A7C62;
  --accent-soft:#EBF3EF;
  --plum:       #5C3A7A;
  --plum-soft:  #F1ECF7;
  --amber:      #C4773A;
  --amber-soft: #FBF1E5;
  --danger:     #DC2626;
  --danger-soft:#FDEBEC;

  --on-brand:   #FFFFFF;

  --shadow-sm:  0 1px 2px rgba(44, 26, 38, .06);
  --shadow:     0 4px 18px rgba(44, 26, 38, .07);
  --shadow-lg:  0 18px 46px rgba(44, 26, 38, .12);
}

/* ── 2. Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 22px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5 {
  font-family: var(--display);
  line-height: 1.18;
  letter-spacing: -.018em;
  color: var(--ink);
  margin: 0 0 .55em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.05rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.2vw, 2rem); font-weight: 800; }
h3 { font-size: clamp(1.12rem, 1rem + .5vw, 1.35rem); font-weight: 700; }
h4 { font-size: 1.02rem; font-weight: 700; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--brand);
  text-decoration-color: color-mix(in srgb, var(--brand) 32%, transparent);
  text-underline-offset: 3px;
  transition: color .16s var(--ease), text-decoration-color .16s var(--ease);
}
a:hover { color: var(--brand-ink); text-decoration-color: currentColor; }

img, svg { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0 0 1.05em; padding-left: 1.35em; }
li { margin-bottom: .38em; }
li::marker { color: var(--brand); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.4rem 0;
}

code, kbd, samp {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .1em .38em;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--brand-soft); color: var(--brand-ink); }

/* ── 3. Layout primitives ────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.25rem);
}

.wrap--narrow { max-width: 860px; }

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3rem); }
.section--tint { background: var(--bg-tint); }
.section--surface { background: var(--surface); }

.stack > * + * { margin-top: var(--gap, 1rem); }

.grid { display: grid; gap: clamp(.9rem, 2vw, 1.35rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--brand);
  color: var(--on-brand);
  padding: .7rem 1.1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

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

/* ── 4. Top bar ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { color: var(--brand); }

.brand__mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--plum));
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}
.brand__mark svg { width: 17px; height: 17px; }
.brand small {
  display: block;
  font-family: var(--sans);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.1;
  margin-top: 1px;
}

.topbar__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .15rem;
}
.topbar__nav a {
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.topbar__nav a:hover { background: var(--surface-2); color: var(--brand); }
.topbar__nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }

.topbar__tools { display: flex; align-items: center; gap: .35rem; margin-left: .3rem; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  padding: 0;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--brand); border-color: var(--brand-line); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .icon-sun { display: none; }
:root[data-theme="dark"] .icon-btn .icon-sun { display: block; }
:root[data-theme="dark"] .icon-btn .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .icon-moon { display: none; }
}

.nav-toggle { display: none; }

@media (max-width: 940px) {
  .nav-toggle { display: grid; }
  .topbar__nav {
    position: fixed;
    inset: var(--topbar-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: .1rem;
    padding: .8rem clamp(1rem, 4vw, 2.25rem) 1.2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
  }
  .topbar__nav[data-open="true"] { opacity: 1; visibility: visible; transform: none; }
  .topbar__nav a { padding: .65rem .5rem; border-bottom: 1px solid var(--line-2); border-radius: 0; }
}

/* ── 5. Hero ─────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 460px at 12% -12%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 62%),
    radial-gradient(900px 420px at 92% 8%, color-mix(in srgb, var(--plum) 14%, transparent), transparent 60%),
    linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(3rem, 8vw, 6rem);
}
.hero::after {
  content: "";
  position: absolute;
  right: -120px; bottom: -180px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  filter: blur(2px);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  padding: .38rem .8rem;
  border-radius: 100px;
  margin-bottom: 1.1rem;
}
.eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 { margin-bottom: .7rem; }
.hero h1 .accent {
  background: linear-gradient(96deg, var(--brand), var(--plum));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede {
  font-size: clamp(1rem, .96rem + .3vw, 1.12rem);
  color: var(--ink-2);
  max-width: 56ch;
  margin-bottom: 1.7rem;
}

.cta-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.4rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.35rem;
  border-radius: 100px;
  font-family: var(--display);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease),
              background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }

.btn--primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 26%, transparent);
}
.btn--primary:hover { background: var(--brand-ink); color: var(--on-brand); }

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { border-color: var(--brand-line); color: var(--brand); }

.btn--sm { padding: .5rem 1rem; font-size: .84rem; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .9rem;
  font-size: .82rem;
  color: var(--ink-3);
}
.hero__meta span { display: inline-flex; align-items: center; gap: .38rem; }
.hero__meta svg { width: 14px; height: 14px; color: var(--accent); }

.phone {
  position: relative;
  margin-inline: auto;
  max-width: 320px;
  border-radius: 34px;
  padding: 12px;
  background: linear-gradient(160deg, var(--ink) 0%, #3E2733 100%);
  box-shadow: var(--shadow-lg);
}
.phone__screen {
  border-radius: 24px;
  background: var(--bg);
  overflow: hidden;
  padding: 18px 16px 20px;
  min-height: 440px;
}
.phone__notch {
  width: 92px; height: 5px;
  background: color-mix(in srgb, var(--surface) 22%, transparent);
  border-radius: 100px;
  margin: 0 auto 14px;
}
.phone__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .8rem .85rem;
  margin-bottom: .6rem;
  box-shadow: var(--shadow-sm);
}
.phone__card--brand { background: linear-gradient(140deg, var(--brand), var(--plum)); color: #fff; border: none; }
.phone__card h4 { font-size: .82rem; margin-bottom: .15rem; color: inherit; }
.phone__card p { font-size: .68rem; color: var(--ink-3); margin: 0; line-height: 1.45; }
.phone__card--brand p { color: rgba(255,255,255,.82); }
.phone__row { display: flex; gap: .5rem; }
.phone__row > * { flex: 1; }
.phone__tile {
  background: var(--surface-2);
  border-radius: 11px;
  padding: .55rem .5rem;
  font-size: .62rem;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
}

/* ── 6. Sections & cards ─────────────────────────────────────────────────── */
.section__head { max-width: 66ch; margin-bottom: clamp(1.6rem, 3vw, 2.4rem); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__kicker {
  font-family: var(--display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: .6rem;
}
.section__head p { color: var(--ink-2); font-size: 1.02rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-line); }
.card h3 { margin-bottom: .4rem; font-size: 1.05rem; }
.card p { color: var(--ink-2); font-size: .93rem; margin-bottom: 0; }
.card__icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: .85rem;
}
.card__icon svg { width: 20px; height: 20px; }
.card--accent .card__icon { background: var(--accent-soft); color: var(--accent); }
.card--plum .card__icon { background: var(--plum-soft); color: var(--plum); }
.card--amber .card__icon { background: var(--amber-soft); color: var(--amber); }

.card__list { list-style: none; padding: 0; margin: .8rem 0 0; }
.card__list li {
  position: relative;
  padding-left: 1.35rem;
  font-size: .88rem;
  color: var(--ink-2);
  margin-bottom: .42rem;
}
.card__list li::before {
  content: "";
  position: absolute;
  left: .18rem; top: .62em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.persona {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.persona__top {
  padding: 1.5rem 1.5rem 1.3rem;
  background: linear-gradient(150deg, var(--brand-soft), var(--surface));
  border-bottom: 1px solid var(--line);
}
.persona--staff .persona__top { background: linear-gradient(150deg, var(--accent-soft), var(--surface)); }
.persona--clinic .persona__top { background: linear-gradient(150deg, var(--plum-soft), var(--surface)); }
.persona__avatar {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brand);
  margin-bottom: .85rem;
}
.persona--staff .persona__avatar { color: var(--accent); }
.persona--clinic .persona__avatar { color: var(--plum); }
.persona__avatar svg { width: 22px; height: 22px; }
.persona__top h3 { margin-bottom: .25rem; }
.persona__top p { font-size: .87rem; color: var(--ink-3); margin: 0; }
.persona__body { padding: 1.15rem 1.5rem 1.4rem; }

.pill-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.pill {
  font-size: .74rem;
  font-weight: 600;
  padding: .28rem .68rem;
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.pill--brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.pill--accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }

.plan {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.plan--featured { border-color: var(--brand); box-shadow: var(--shadow); }
.plan__flag {
  position: absolute;
  top: -11px; left: 1.35rem;
  font-family: var(--display);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--brand);
  color: var(--on-brand);
  padding: .22rem .7rem;
  border-radius: 100px;
}
.plan h3 { font-size: 1.1rem; margin-bottom: .1rem; }
.plan__price { font-family: var(--display); font-weight: 800; font-size: 1.9rem; letter-spacing: -.03em; margin: .2rem 0 .05rem; }
.plan__price small { font-size: .8rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.plan__note { font-size: .78rem; color: var(--ink-3); margin-bottom: 1rem; }
.plan__features { list-style: none; padding: 0; margin: 0 0 1.2rem; flex: 1; }
.plan__features li {
  font-size: .85rem;
  color: var(--ink-2);
  padding: .34rem 0 .34rem 1.4rem;
  position: relative;
  border-bottom: 1px dashed var(--line-2);
}
.plan__features li:last-child { border-bottom: 0; }
.plan__features li::before {
  content: "✓";
  position: absolute; left: 0; top: .34rem;
  color: var(--accent);
  font-weight: 800;
  font-size: .82rem;
}
.plan .btn { width: 100%; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat-strip div { background: var(--surface); padding: 1.1rem 1.2rem; }
.stat-strip b { display: block; font-family: var(--display); font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--brand); }
.stat-strip span { font-size: .8rem; color: var(--ink-3); }

/* ── 7. Prose (legal documents) ──────────────────────────────────────────── */
.doc {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding-block: clamp(2rem, 4vw, 3.2rem) clamp(3rem, 7vw, 5rem);
}
@media (max-width: 1000px) { .doc { grid-template-columns: 1fr; } }

.doc__main { min-width: 0; }

.doc-head { margin-bottom: 2rem; }
.doc-head h1 { margin-bottom: .5rem; }
.doc-head__lede { font-size: 1.05rem; color: var(--ink-2); max-width: 62ch; }

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  font-size: .8rem;
  color: var(--ink-3);
  margin-top: 1.1rem;
}
.doc-meta span { display: inline-flex; align-items: center; gap: .38rem; }
.doc-meta svg { width: 14px; height: 14px; color: var(--brand); }

.doc-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  padding: .34rem .78rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.prose { max-width: var(--read); }
.prose > h2 {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.prose > h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { margin-top: 1.9rem; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.prose h4 { margin-top: 1.4rem; color: var(--ink-2); }

.prose p, .prose li { color: var(--ink-2); }
.prose p { font-size: .97rem; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose ol { counter-reset: item; list-style: none; padding-left: 0; }
.prose ol > li {
  counter-increment: item;
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: .7rem;
}
.prose ol > li::before {
  content: counter(item, decimal) ".";
  position: absolute;
  left: .2rem; top: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: .85rem;
  color: var(--brand);
  min-width: 1.6rem;
}
.prose ul > li { margin-bottom: .42rem; }

/* Cards and callouts nested inside a legal document keep their own rhythm
   rather than inheriting the document's paragraph spacing. */
.prose .card { margin-block: 1.6rem; }
.prose .card h3 { margin-top: 0; }
.prose .card p { font-size: .93rem; margin-bottom: 0; }
.prose .card__list { margin: .8rem 0 0; padding: 0; }
.prose .callout--info .callout__title { color: var(--plum); }
.prose .callout--accent .callout__title { color: var(--accent); }
.prose .callout--warn .callout__title { color: var(--amber); }
.prose .callout--danger .callout__title { color: var(--danger); }

.prose a { font-weight: 500; }

.lede-box {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 1.05rem 1.2rem;
  margin-bottom: 2rem;
}
.lede-box p { color: var(--ink-2); font-size: .93rem; margin: 0; }
.lede-box strong { color: var(--brand-ink); }

.callout {
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin: 1.6rem 0;
  border: 1px solid var(--line);
  background: var(--surface-3);
  font-size: .92rem;
}
.callout > :last-child { margin-bottom: 0; }
.callout .callout__title {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: .45rem;
  color: var(--ink);
}
.callout__title svg { width: 16px; height: 16px; flex: 0 0 auto; }
.callout p { color: var(--ink-2); font-size: .92rem; }
.callout--info { background: var(--surface-3); border-color: var(--line); }
.callout--info .callout__title { color: var(--plum); }
.callout--accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 24%, transparent); }
.callout--accent .callout__title { color: var(--accent); }
.callout--warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.callout--warn .callout__title { color: var(--amber); }
.callout--danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.callout--danger .callout__title { color: var(--danger); }

.inline-note {
  font-size: .82rem;
  color: var(--ink-3);
  font-style: italic;
}

/* ── 8. Tables, lists, callouts ─────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin: 1.6rem 0;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .89rem;
  min-width: 540px;
}
thead th {
  text-align: left;
  font-family: var(--display);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--surface-2);
  padding: .72rem .9rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-3); }
td strong { color: var(--ink); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: .5rem;
  color: var(--ink-2);
  font-size: .92rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: .45em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

/* ── 9. Table of contents ────────────────────────────────────────────────── */
.toc {
  position: sticky;
  top: calc(var(--topbar-h) + 22px);
  font-size: .855rem;
  max-height: calc(100vh - var(--topbar-h) - 48px);
  overflow-y: auto;
  padding-right: .4rem;
}
@media (max-width: 1000px) {
  .toc {
    position: static;
    max-height: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1rem 1.15rem;
  }
  .toc__title { margin-bottom: .5rem; }
}
.toc__title {
  font-family: var(--display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .75rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 0; }
.toc a {
  display: block;
  padding: .34rem 0 .34rem 1.9rem;
  color: var(--ink-3);
  text-decoration: none;
  border-left: 2px solid var(--line);
  position: relative;
  line-height: 1.45;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.toc a::before {
  content: counter(toc);
  position: absolute;
  left: .55rem;
  font-family: var(--display);
  font-size: .68rem;
  font-weight: 700;
  color: var(--ink-3);
  top: .42rem;
}
.toc a:hover { color: var(--brand); border-left-color: var(--brand-line); }
.toc a.is-active {
  color: var(--brand);
  font-weight: 600;
  border-left-color: var(--brand);
}
.toc a.is-active::before { color: var(--brand); }

.toc__more {
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.toc__more a {
  border-left: 0;
  padding: .3rem 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.toc__more a::before { content: none; }
.toc__more svg { width: 13px; height: 13px; }

/* ── 10. Footer ──────────────────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-block: clamp(2.4rem, 5vw, 3.4rem) 1.6rem;
  margin-top: auto;
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(140px, 1fr));
  gap: 2rem 1.5rem;
}
.footer h4 {
  font-family: var(--display);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .85rem;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .5rem; }
.footer a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: .89rem;
}
.footer a:hover { color: var(--brand); text-decoration: underline; }
.footer__about p { color: var(--ink-3); font-size: .88rem; max-width: 40ch; margin-top: .8rem; }
.footer__bottom {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.2rem;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--ink-3);
}
.footer__bottom a { color: var(--ink-3); text-decoration: none; }
.footer__bottom a:hover { color: var(--brand); }
.footer__social { display: flex; gap: .5rem; }
.footer__social a {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.footer__social a:hover { color: var(--brand); border-color: var(--brand-line); }
.footer__social svg { width: 15px; height: 15px; }

/* ── 11. Utilities & motion ──────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .6rem; }
.mt-2 { margin-top: 1.2rem; }
.mt-3 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.divider-label {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-family: var(--display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.4rem;
}
.divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.policy-cards { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.policy-card {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.policy-card:hover {
  border-color: var(--brand-line);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: inherit;
}
.policy-card .policy-card__icon {
  width: 36px; height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.policy-card__icon svg { width: 18px; height: 18px; }
.policy-card strong { display: block; font-family: var(--display); font-size: .95rem; margin-bottom: .15rem; }
.policy-card span { font-size: .83rem; color: var(--ink-3); line-height: 1.5; display: block; }
.policy-card .policy-card__icon span { color: inherit; }

/* Scroll reveal. The hidden state is gated behind the `js` class that the
   inline head script adds, so content is never trapped at opacity 0 when
   scripting is unavailable or slow. */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ── 12. Print ───────────────────────────────────────────────────────────── */
@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --ink-2: #222; --ink-3: #444; --line: #ccc; }
  .topbar, .footer, .toc, .btn, .icon-btn, .no-print { display: none !important; }
  body { font-size: 11pt; }
  .doc { display: block; padding: 0; }
  .prose { max-width: none; }
  .prose > h2 { page-break-after: avoid; }
  .table-wrap { overflow: visible; }
  a { color: #000; text-decoration: underline; }
  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
}
