/* latin */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/EBGaramond-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/EBGaramond-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/EBGaramond-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../assets/fonts/EBGaramond-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/WorkSans-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../assets/fonts/WorkSans-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/WorkSans-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Stablemaster's Ledger — design tokens & components.
   Source of truth: control/design/stitch-v2/color-tokens.md + stitch-v3 approved screens.
   Daylight pasture + parchment field-ledger. No Tailwind runtime; hand-authored. */

:root {
  --background: #fff9ee;
  --surface: #fff9ee;
  --surface-bright: #fff9ee;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #faf3e5;
  --surface-container: #f4eddf;
  --surface-container-high: #eee8da;
  --surface-container-highest: #e8e2d4;
  --surface-variant: #e8e2d4;
  --surface-dim: #e0d9cc;
  --parchment: #fff8ea;
  --primary: #123318;
  --primary-container: #294a2d;
  --primary-fixed: #c6edc5;
  --primary-fixed-dim: #aad0aa;
  --on-primary: #ffffff;
  --on-primary-fixed: #012109;
  --on-primary-fixed-variant: #2d4e31;
  --on-primary-container: #94b994;
  --secondary: #81551d;
  --secondary-container: #ffc482;
  --secondary-fixed: #ffddba;
  --secondary-fixed-dim: #f6bb7a;
  --on-secondary: #ffffff;
  --on-secondary-fixed: #2b1700;
  --on-secondary-fixed-variant: #653e06;
  --on-secondary-container: #794f17;
  --tertiary: #3f271b;
  --tertiary-container: #583c2f;
  --leather: #5c4033;
  --on-surface: #1e1b13;
  --ink: #1d291e;
  --on-surface-variant: #424841;
  --outline: #727970;
  --outline-variant: #c2c8be;
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --on-error: #ffffff;
  --on-error-container: #93000a;
  --evidence-yellow: #e7c99a;
  --font-headline: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", "Segoe UI", system-ui, sans-serif;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;
  --space-margin: 24px;
  --space-gutter: 20px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; }
a { color: var(--primary-container); }
main { flex-grow: 1; width: 100%; }

/* Typography roles (color-tokens.md §4) */
.display-lg {
  font-family: var(--font-headline);
  font-size: 48px; line-height: 56px; letter-spacing: -0.01em; font-weight: 600;
}
.headline-lg { font-family: var(--font-headline); font-size: 32px; line-height: 40px; font-weight: 600; }
.headline-md { font-family: var(--font-headline); font-size: 24px; line-height: 32px; font-weight: 500; }
.body-lg { font-family: var(--font-body); font-size: 18px; line-height: 28px; font-weight: 400; }
.body-md { font-family: var(--font-body); font-size: 16px; line-height: 24px; font-weight: 400; }
.label-md {
  font-family: var(--font-body); font-size: 14px; line-height: 20px;
  letter-spacing: 0.05em; font-weight: 600;
}
.label-sm { font-family: var(--font-body); font-size: 12px; line-height: 16px; font-weight: 500; }
.text-primary { color: var(--primary); }
.text-tertiary { color: var(--tertiary); }
.text-muted { color: var(--on-surface-variant); }
.text-outline { color: var(--outline); }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.08em; }

@media (max-width: 767px) {
  .display-lg { font-size: 28px; line-height: 36px; }
}

/* Leather/ledger borders */
.leather-border { border: 1px solid var(--leather); }
.leather-border-b { border-bottom: 1px solid var(--leather); }
.ledger-border-double { border: 3px double var(--leather); }

/* Header */
.site-header {
  background: var(--primary);
  border-bottom: 1px solid var(--tertiary-container);
  position: sticky; top: 0; z-index: 50;
  width: 100%;
}
.site-header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  max-width: var(--maxw); margin: 0 auto;
  padding: 4px var(--space-margin);
  min-height: 48px;
}
.brand {
  font-family: var(--font-headline); font-size: 24px; line-height: 32px; font-weight: 500;
  color: var(--on-primary); text-transform: uppercase; letter-spacing: -0.01em;
  text-decoration: none;
}
.main-nav { display: none; gap: 24px; align-items: center; }
.main-nav a {
  color: var(--primary-fixed-dim); text-decoration: none;
  font-family: var(--font-body); font-size: 14px; line-height: 20px; letter-spacing: 0.05em; font-weight: 600;
  padding: 4px 2px;
}
.main-nav a:hover { color: var(--on-primary); }
.main-nav a[aria-current="page"] {
  color: var(--secondary-fixed); font-weight: 700;
  border-bottom: 2px solid var(--secondary-fixed);
}
.header-cta { display: none; }
.nav-toggle {
  background: none; border: 0; color: var(--on-primary); cursor: pointer;
  padding: 8px; display: inline-flex; align-items: center;
}
.nav-toggle svg { width: 24px; height: 24px; }
@media (min-width: 768px) {
  .main-nav { display: flex; }
  .header-cta {
    display: inline-block;
    background: var(--secondary-fixed); color: var(--on-secondary-fixed);
    font-family: var(--font-body); font-size: 14px; line-height: 20px; letter-spacing: 0.05em; font-weight: 600;
    padding: 8px 16px; border: 1px solid var(--leather); border-radius: 2px;
    text-decoration: none;
  }
  .header-cta:hover { background: var(--secondary-container); }
  .nav-toggle { display: none; }
}
.mobile-nav {
  display: none;
  background: var(--primary);
  border-top: 1px solid var(--tertiary-container);
  padding: var(--space-xs) var(--space-margin) var(--space-sm);
}
.mobile-nav.open { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav a {
  color: var(--primary-fixed-dim); text-decoration: none; padding: 10px 4px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--tertiary-container);
}
.mobile-nav a:hover { color: var(--on-primary); }
.mobile-nav a[aria-current="page"] { color: var(--secondary-fixed); }

/* Layout */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-margin); }
.page-main { padding: var(--space-lg) 0 var(--space-xl); }
.stack-sm > * + * { margin-top: var(--space-sm); }
.stack-md > * + * { margin-top: var(--space-md); }
.stack-xl > * + * { margin-top: var(--space-xl); }

/* Surfaces */
.surface { background: var(--surface); }
.surface-lowest { background: var(--surface-container-lowest); }
.surface-low { background: var(--surface-container-low); }
.surface-container { background: var(--surface-container); }
.parchment { background: var(--parchment); }
.evidence-bg { background: var(--evidence-yellow); }
.pad-md { padding: var(--space-md); }
.pad-lg { padding: var(--space-lg); }
.rounded { border-radius: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: 14px; line-height: 20px; letter-spacing: 0.05em; font-weight: 600;
  padding: 12px 24px; border: 1px solid var(--leather); border-radius: 2px;
  cursor: pointer; text-decoration: none;
}
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--secondary-container);
  outline-offset: 2px;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-container); }
.btn-outline { background: transparent; color: var(--on-background); }
.btn-outline:hover { background: var(--surface-container); }
.btn-gold { background: var(--secondary-fixed); color: var(--on-secondary-fixed); }
.btn-gold:hover { background: var(--secondary-fixed-dim); }
.btn-sm { padding: 6px 12px; font-size: 12px; line-height: 16px; font-weight: 500; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-danger { background: var(--error-container); color: var(--on-error-container); }

/* Icons */
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 32px; height: 32px; }

/* Evidence chips & labels */
.evidence-strip {
  background: var(--evidence-yellow);
  border: 1px solid var(--leather);
  padding: 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.evidence-strip .strip-title {
  font-family: var(--font-body); font-size: 14px; line-height: 20px; letter-spacing: 0.05em; font-weight: 600;
  text-transform: uppercase; color: var(--tertiary-container); margin-right: 8px;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--background); color: var(--ink);
  border: 1px solid var(--leather);
  font-size: 12px; line-height: 16px; font-weight: 500;
  padding: 4px 8px;
}
.chip-green { background: var(--primary-fixed); color: var(--on-primary-fixed); font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 12px; }
.stamp-unverified {
  display: inline-block;
  color: var(--error); font-weight: 700; letter-spacing: 0.15em; font-size: 13px;
  border: 2px solid var(--error); padding: 2px 8px; transform: rotate(8deg); opacity: 0.75;
  text-transform: uppercase;
}

/* Hero (home) */
.hero {
  display: flex; flex-direction: column;
  border: 1px solid var(--leather);
  margin: var(--space-margin) var(--space-margin) 0;
}
.hero-media { position: relative; overflow: hidden; background: var(--tertiary); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.hero-content {
  background: var(--parchment); padding: var(--space-lg);
  display: flex; flex-direction: column; justify-content: center;
}
.eyebrow {
  font-size: 12px; line-height: 16px; font-weight: 500;
  color: var(--tertiary-container); text-transform: uppercase; letter-spacing: 0.08em;
  display: block; margin-bottom: 8px;
}
.hero-content h1 { margin: 0 0 16px; color: var(--on-background); font-size: 40px; line-height: 1.15; }
.hero-content .subhead { margin: 0 0 24px; color: var(--on-surface-variant); }
.hero-ctas { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.hero-caption { margin: 8px 0 0; }
.status-line {
  font-size: 12px; line-height: 16px; font-weight: 500; color: var(--outline);
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
@media (min-width: 640px) { .hero-ctas { flex-direction: row; } }
@media (min-width: 768px) {
  .hero { flex-direction: row; height: 420px; max-width: var(--maxw); margin-left: auto; margin-right: auto; }
  .hero-media { width: 60%; height: 100%; }
  .hero-content { width: 40%; }
}

/* Home dashboard: Hero, the freshness/evidence strip and the Quick Breeding
   Note share the first viewport. DOM order (mobile): hero -> freshness ->
   quick note -> task cards / long content. */
.home-dash {
  max-width: var(--maxw); margin: 0 auto var(--space-xl); padding: 0 var(--space-margin);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-sm);
}
.home-rest, .home-sidebar, .home-evidence { min-width: 0; }
.home-dash .hero { margin: var(--space-sm) 0 0; max-width: none; flex-direction: column; height: auto; min-height: 0; }
.home-dash .hero-media { width: 100%; height: 132px; flex: none; }
.home-dash .hero-content { padding: var(--space-sm) var(--space-margin); }
.home-dash .hero-content h1 { font-size: 24px; line-height: 1.2; margin: 0 0 8px; }
.home-dash .hero-content .subhead { font-size: 14px; line-height: 20px; margin: 0 0 12px; }
.home-dash .hero-ctas { flex-direction: row; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.home-dash .hero-ctas .btn { padding: 8px 12px; font-size: 12px; line-height: 16px; }
.home-dash .hero-caption { font-size: 11px; line-height: 14px; margin: 6px 0 0; }
.home-evidence .evidence-strip { flex-wrap: nowrap; overflow-x: auto; }
.home-evidence .evidence-strip > * { flex: none; }
@media (max-width: 899px) {
  .home-dash { gap: 6px; padding: 0 12px; }
  .home-dash .hero { margin-top: 6px; }
  /* Mobile hero is a real image area, not a decorative strip: at 160px the
     object-cover band shows ~320 source px (of the 600px-tall validated
     mobile crop), covering the horse head/torso density zone (y 33-60%)
     plus merchant/stable context, while the Quick Note still fits 390x844. */
  .home-dash .hero-media { height: 160px; }
  .home-dash .hero-media img { object-position: center 45%; }
  .home-dash .hero-content { padding: 10px 12px; }
  /* Eyebrow kicker stays in DOM/SEO copy; hidden on mobile (like the hero
     caption) to buy vertical room for the taller image band without pushing
     any Quick Note field out of the first viewport. */
  .home-dash .hero .eyebrow { display: none; }
  .home-dash .hero-content h1 { font-size: 19px; line-height: 1.2; margin-bottom: 6px; }
  .home-dash .hero-content .subhead { font-size: 13px; line-height: 18px; margin-bottom: 8px; }
  .home-dash .hero-ctas { gap: 6px; margin-bottom: 8px; }
  .home-dash .hero-ctas .btn { padding: 5px 7px; font-size: 10px; line-height: 15px; gap: 4px; }
  .home-dash .status-line { font-size: 11px; line-height: 14px; }
  /* Caption stays in DOM/alt/inventory; hidden on mobile to keep the Quick
     Note fully operable in the 390x844 first viewport. */
  .home-dash .hero-caption { display: none; }
  .home-evidence .evidence-strip { padding: 6px 8px; }
  .home-dash .quick-note { padding: 10px 14px 4px; }
  .home-dash .quick-note .qn-head { padding-bottom: 4px; margin-bottom: 4px; }
  .home-dash .quick-note .qn-head h2 { font-size: 18px; line-height: 24px; }
  .home-dash .quick-note .qn-intro { font-size: 12.5px; line-height: 17px; margin-bottom: 4px; }
  .home-dash .quick-note .field label { font-size: 11px; line-height: 14px; }
  .home-dash .quick-note .ledger-input { font-size: 13px; line-height: 18px; padding: 2px 0; }
  .home-dash .quick-note textarea.ledger-input { height: 36px; }
  .home-dash .qn-grid { gap: 6px 10px; }
  .home-dash .quick-note .btn-block { padding: 6px 14px; }
  .home-dash .quick-note .disclosure { font-size: 11px; line-height: 14px; margin-top: 4px; }
}
@media (min-width: 900px) {
  .home-dash {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-areas:
      "hero qn"
      "ev qn"
      "rest rest";
    column-gap: var(--space-md);
  }
  /* Desktop reuses the validated V3 full-width focal crop (1264:848).
     The Quick Note remains in the adjacent grid column, so the image can keep
     its approved landscape composition without clipping horse/merchant/stable
     clues into a portrait sliver. */
  .home-dash .hero { grid-area: hero; flex-direction: column; align-self: start; margin-top: var(--space-margin); }
  .home-dash .hero-media { width: 100%; height: auto; aspect-ratio: 1264 / 848; }
  .home-dash .hero-content { width: 100%; padding: var(--space-md); }
  .home-dash .hero-content h1 { font-size: 32px; line-height: 1.2; }
  .home-dash .hero-content .subhead { font-size: 16px; line-height: 24px; }
  .home-dash .hero-ctas { flex-direction: column; }
  .home-dash .hero-ctas .btn { padding: 10px 16px; font-size: 14px; line-height: 20px; }
  .home-evidence { grid-area: ev; }
  .home-evidence .evidence-strip { flex-wrap: wrap; overflow-x: visible; }
  .home-sidebar { grid-area: qn; position: sticky; top: 64px; align-self: start; margin-top: var(--space-margin); }
  .home-rest { grid-area: rest; }
}

/* Task cards */
.section-title {
  font-family: var(--font-headline); font-size: 24px; line-height: 32px; font-weight: 500;
  border-bottom: 2px solid var(--tertiary-container); padding-bottom: 8px; margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px;
}
.task-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 640px) { .task-cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .task-cards { grid-template-columns: repeat(5, 1fr); } }
.task-card {
  background: var(--parchment); border: 1px solid var(--leather); padding: 8px;
  text-align: center; text-decoration: none; color: var(--ink); display: block;
}
.task-card:hover { background: var(--surface-container); }
.task-card .thumb { width: 100%; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--leather); margin-bottom: 8px; }
.task-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.task-card span { font-size: 12px; line-height: 16px; font-weight: 500; display: block; }

/* Mobile task list variant */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-list a {
  display: flex; align-items: center; gap: 12px; padding: 8px;
  border: 1px solid var(--leather); background: var(--surface-container-low);
  text-decoration: none; color: var(--ink);
  font-size: 14px; font-weight: 600; letter-spacing: 0.05em;
}
.task-list a:hover { background: var(--secondary-fixed); }
.task-list img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--leather); flex: none; }
.task-list .chev { margin-left: auto; color: var(--leather); }

/* Quote callout */
.quote-callout {
  background: var(--parchment); border: 1px solid var(--leather); padding: var(--space-lg);
  text-align: center; display: flex; flex-direction: column; align-items: center;
}
.quote-callout p {
  font-family: var(--font-headline); font-size: 24px; line-height: 32px; font-weight: 500;
  color: var(--tertiary-container); max-width: 600px; font-style: italic; margin: 16px 0 0;
}

/* Ledger rows (latest updates / patch list) */
.ledger-rows { border-top: 1px solid var(--leather); }
.ledger-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 8px; border-bottom: 1px solid var(--leather);
}
.ledger-row:hover { background: var(--surface-container-high); }
.ledger-row h3 { margin: 0; font-size: 18px; font-weight: 600; }
.ledger-row .meta { color: var(--on-surface-variant); font-size: 14px; margin: 0; }
.ledger-row .row-side { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
@media (min-width: 640px) {
  .ledger-row { flex-direction: row; justify-content: space-between; align-items: center; }
}
.link-strong { font-weight: 600; font-size: 14px; letter-spacing: 0.05em; color: var(--primary); }

/* Forms — ledger inputs */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 14px; line-height: 20px; letter-spacing: 0.05em; font-weight: 600; color: var(--on-surface); }
.field .hint { font-size: 12px; color: var(--on-surface-variant); }
.ledger-input {
  border: 0; border-bottom: 1px solid var(--leather); border-radius: 0;
  background: transparent; padding: 4px 0; width: 100%;
  font-family: var(--font-body); font-size: 16px; line-height: 24px; color: var(--ink);
}
.ledger-input::placeholder { color: var(--on-surface-variant); }
.ledger-input:focus { outline: none; border-bottom-color: var(--primary-container); border-bottom-width: 2px; }
textarea.ledger-input { resize: vertical; }
select.ledger-input { appearance: auto; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: span 2; } }

/* Cards & panels */
.panel { background: var(--surface-container-lowest); border: 1px solid var(--leather); padding: var(--space-md); }
.panel-double { background: var(--surface-container-lowest); border: 3px double var(--leather); padding: var(--space-md); }
.panel-title { font-family: var(--font-headline); font-size: 24px; line-height: 32px; font-weight: 500; color: var(--primary); margin: 0 0 16px; }
.freshness-strip { border-left: 4px solid var(--evidence-yellow); }
.sidebar-note { background: var(--evidence-yellow); border: 1px solid var(--leather); padding: var(--space-md); }
.sidebar-note h4, .panel h4 {
  font-family: var(--font-headline); font-size: 24px; line-height: 32px; font-weight: 500;
  margin: 0 0 8px; display: flex; align-items: center; gap: 8px;
}

/* Quick note widget — compact: the full form, Save Locally and the local
   disclosure must fit the first viewport at 1440x900, 1280x720 and 390x844. */
.quick-note {
  background: var(--parchment); border: 1px solid var(--leather); padding: 14px 16px;
  position: relative;
}
.quick-note::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--secondary-fixed);
}
.quick-note .qn-head {
  display: flex; align-items: center; gap: 8px;
  border-bottom: 2px solid var(--tertiary-container); padding-bottom: 6px; margin-bottom: 8px;
}
.quick-note .qn-head h2 { margin: 0; font-family: var(--font-headline); font-size: 20px; line-height: 26px; font-weight: 500; }
.quick-note .qn-intro { font-size: 13px; line-height: 18px; margin: 0 0 10px; }
.qn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.qn-grid .span-2 { grid-column: span 2; }
.quick-note .field label { font-size: 12px; line-height: 16px; letter-spacing: 0.03em; }
.quick-note .ledger-input { font-size: 14px; line-height: 20px; padding: 2px 0; }
.quick-note textarea.ledger-input { height: 46px; }
.quick-note .btn-block { padding: 8px 16px; }
.disclosure { font-size: 12px; line-height: 16px; font-weight: 500; text-align: center; color: var(--ink); margin: 6px 0 0; }

/* System messages (states) */
.msg {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px;
  border: 1px solid var(--leather); font-size: 14px; line-height: 20px;
}
.msg svg { margin-top: 2px; flex: none; }
.msg p { margin: 0; }
.msg-success { background: var(--primary-fixed); color: var(--on-primary-fixed-variant); }
.msg-error { background: var(--error-container); color: var(--on-error-container); }
.msg-neutral { background: var(--surface-variant); color: var(--on-surface-variant); }
.msg[hidden] { display: none; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.ledger-table { width: 100%; border-collapse: collapse; min-width: 700px; text-align: left; }
table.ledger-table th {
  font-size: 14px; letter-spacing: 0.05em; font-weight: 600; color: var(--tertiary);
  background: var(--surface-container-low); padding: 12px; border-bottom: 1px solid var(--leather);
}
table.ledger-table td { padding: 12px; border-bottom: 1px solid var(--leather); vertical-align: top; }
table.ledger-table tbody tr:hover { background: var(--evidence-yellow); }

/* Cards grid for records (mobile-friendly default) */
.record-cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .record-cards { grid-template-columns: 1fr 1fr; } }
.record-card { background: var(--surface-container-lowest); border: 1px solid var(--leather); padding: 16px; }
.record-card h3 { margin: 0 0 8px; font-family: var(--font-headline); font-size: 24px; font-weight: 500; color: var(--primary); }
.record-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: 14px; }
.record-card dt { font-weight: 600; color: var(--tertiary); }
.record-card dd { margin: 0; }
.record-card .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Breadcrumbs */
.breadcrumbs { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--outline); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--outline); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { color: var(--outline-variant); }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 500; }

/* Evidence header block on guides */
.evidence-header { display: flex; flex-wrap: wrap; gap: 12px; }

/* Page hero (inner pages) */
.page-hero { display: grid; grid-template-columns: 1fr; gap: var(--space-gutter); align-items: start; }
@media (min-width: 768px) { .page-hero { grid-template-columns: 5fr 7fr; } }
.page-hero figure { margin: 0; border: 1px solid var(--leather); padding: 8px; background: var(--surface-container-lowest); position: relative; }
.page-hero figcaption { font-size: 12px; color: var(--outline); margin-top: 8px; text-align: right; font-style: italic; }
.page-hero .intro-panel { background: var(--surface); border: 1px solid var(--leather); padding: var(--space-md); }

/* Two-col splits */
.split-2 { display: grid; grid-template-columns: 1fr; gap: var(--space-gutter); }
@media (min-width: 768px) { .split-2 { grid-template-columns: 1fr 1fr; } }
.accent-left { position: relative; }
.accent-left::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--secondary-fixed); }

/* CTA row */
.cta-row {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: var(--space-lg) var(--space-md);
  border-top: 1px solid var(--leather); border-bottom: 1px solid var(--leather);
  background: var(--surface-container-low); text-align: center;
}
@media (min-width: 768px) { .cta-row { flex-direction: row; text-align: left; } }

/* Checklist */
.progress-bar-wrap { background: var(--surface-container); border: 1px solid var(--leather); height: 20px; width: 100%; max-width: 480px; }
.progress-bar { background: var(--primary-container); height: 100%; width: 0%; transition: width 200ms ease-out; }
.checklist-group { border: 1px solid var(--leather); background: var(--surface-container-lowest); padding: var(--space-md); }
.checklist-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px;
  border-bottom: 1px solid var(--outline-variant);
}
.checklist-item:last-child { border-bottom: 0; }
.checklist-item input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary-container); flex: none; }
.checklist-item .item-body { flex: 1; }
.checklist-item .item-label { font-weight: 600; font-size: 14px; }
.checklist-item input[type="checkbox"]:checked + .item-body .item-label { text-decoration: line-through; color: var(--on-surface-variant); }
.checklist-item .item-note { margin-top: 6px; }
.checklist-item .item-note input { font-size: 14px; }

/* Footer */
.site-footer { background: var(--primary); border-top: 1px solid var(--tertiary-container); width: 100%; margin-top: auto; }
.site-footer .wrap {
  display: flex; flex-direction: column; gap: var(--space-md);
  max-width: var(--maxw); margin: 0 auto; padding: var(--space-lg) var(--space-margin);
  align-items: center; text-align: center;
}
@media (min-width: 768px) { .site-footer .wrap { flex-direction: row; justify-content: space-between; align-items: flex-start; text-align: left; } }
.site-footer .fbrand { font-family: var(--font-headline); font-size: 24px; line-height: 32px; font-weight: 500; color: var(--secondary-fixed); }
.site-footer .fan-notice { color: var(--on-primary); font-size: 14px; line-height: 22px; max-width: 640px; margin: 8px 0 0; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.site-footer nav a { color: var(--primary-fixed-dim); font-size: 12px; font-weight: 500; text-decoration: none; }
.site-footer nav a:hover { color: var(--on-primary); }
.site-footer .copyright { color: var(--primary-fixed-dim); font-size: 12px; margin: 8px 0 0; }

/* Utilities */
.grid { display: grid; gap: var(--space-gutter); }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-main-sidebar { grid-template-columns: 1fr; }
@media (min-width: 1024px) { .grid-main-sidebar { grid-template-columns: 8fr 4fr; } }
.mt-sm { margin-top: 16px; } .mt-md { margin-top: 24px; } .mt-xl { margin-top: 64px; }
.mb-sm { margin-bottom: 16px; } .mb-xl { margin-bottom: 64px; }
.center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--primary-fixed); color: var(--on-primary-fixed); padding: 8px 16px;
  font-weight: 600; text-decoration: none; border: 1px solid var(--leather);
}
.skip-link:focus { top: 8px; }

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