/* ValleyFill site styles: editorial teal.
 * Contrast (WCAG 2.1, measured): body text 13.5:1 on paper; muted text 7.0:1; links 11.0:1;
 * dark text on mustard buttons 10.1:1; mustard text on deep teal 6.8:1; dark mode text 14.7:1.
 * Form control borders use --color-control (6.3:1+). Decorative borders are not required to reach 3:1.
 */
:root {
  --color-primary: #053b3a;        /* deep teal: headings, header, links */
  --color-primary-dark: #03292a;   /* header and footer ground */
  --color-primary-soft: #d8e8e4;   /* mint wash: eyebrow and focus backgrounds */
  --color-band: #053b3a;           /* fixed deep teal for hero and table headers, same in both modes */
  --color-accent: #f2b705;         /* mustard: buttons and highlights (fills only) */
  --color-accent-hover: #ffc93a;
  --color-accent-text: #7a5c00;    /* darker mustard for text on light backgrounds, 5.5:1 on paper */
  --color-on-accent: #1a1400;      /* text on mustard fills, 10.1:1 */
  --color-text: #0f2a2a;
  --color-muted: #3f5654;
  --color-bg: #f6f1e7;             /* paper */
  --color-surface: #edE6d6;        /* deeper paper for panels */
  --color-card: #fbf8f1;           /* lighter paper for cards */
  --color-border: #d6cdb8;         /* decorative */
  --color-control: #5b6e6b;        /* form control outlines */
  --color-focus: #f2b705;
  --color-on-dark: #f6f1e7;        /* text on teal backgrounds, 11.0:1 */
  --color-on-dark-muted: #d8e8e4;  /* 9.8:1 on teal */
  --radius-sm: 4px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 42, 42, 0.08);
  --shadow: 0 10px 28px -16px rgba(15, 42, 42, 0.35);
  --max-width: 1120px;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #8fd3c9;
    --color-primary-dark: #03292a;
    --color-primary-soft: #132c2c;
    --color-band: #053b3a;
    --color-accent: #f2b705;
    --color-accent-hover: #ffc93a;
    --color-accent-text: #f2b705;
    --color-on-accent: #1a1400;
    --color-text: #f2eee4;
    --color-muted: #b7c7c3;
    --color-bg: #0b1f1f;
    --color-surface: #132c2c;
    --color-card: #102626;
    --color-border: #2c4a48;
    --color-control: #8aa3a0;
    --color-focus: #ffd966;
    --shadow: 0 10px 28px -16px rgba(0, 0, 0, 0.7);
  }
}

:root[data-theme="dark"] {
  --color-primary: #8fd3c9;
  --color-primary-dark: #03292a;
  --color-primary-soft: #132c2c;
  --color-band: #053b3a;
  --color-accent: #f2b705;
  --color-accent-hover: #ffc93a;
  --color-accent-text: #f2b705;
  --color-on-accent: #1a1400;
  --color-text: #f2eee4;
  --color-muted: #b7c7c3;
  --color-bg: #0b1f1f;
  --color-surface: #132c2c;
  --color-card: #102626;
  --color-border: #2c4a48;
  --color-control: #8aa3a0;
  --color-focus: #ffd966;
  --shadow: 0 10px 28px -16px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }

a {
  color: var(--color-primary);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--color-accent-text); }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.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: 1rem;
  top: -4rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-primary-dark);
  color: var(--color-on-dark);
  border-bottom: 3px solid var(--color-accent);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--color-on-dark);
  text-decoration: none;
}
.brand::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--color-accent);
}
.nav-toggle {
  display: none;
  background: transparent;
  color: var(--color-on-dark);
  border: 1px solid var(--color-on-dark-muted);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav li {
  display: flex;
  margin: 0;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  line-height: 1.3;
  color: var(--color-on-dark-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.97rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.site-nav a:hover { color: var(--color-on-dark); background: rgba(246, 241, 231, 0.1); }
.site-nav a[aria-current="page"] {
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 700;
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-nav { width: 100%; display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.25rem; padding-top: 0.5rem; }
  .site-nav a { display: block; }
}

/* Typography: serif headlines, sans body */
h1, h2, h3 {
  line-height: 1.2;
  color: var(--color-primary);
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); margin: 0.6rem 0 1rem; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2.75rem; }
h3 { font-size: 1.25rem; margin-top: 1.75rem; }
p, ul, ol { margin: 0 0 1.1rem; }
li + li { margin-top: 0.35rem; }
.lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--color-muted);
  max-width: 62ch;
}
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--color-accent-text);
  font-weight: 700;
  border-top: 2px solid var(--color-accent);
  padding-top: 0.45rem;
}
main { min-height: 60vh; padding-block: 2.5rem 5rem; }
main.container > h1 + .lead { margin-bottom: 2rem; }

/* Hero: solid teal, no gradients */
.hero {
  background: var(--color-band);
  color: var(--color-on-dark);
  padding-block: clamp(3.5rem, 8vw, 6rem);
}
.hero h1 { color: var(--color-on-dark); max-width: 18ch; }
.hero .lead { color: var(--color-on-dark-muted); }
.hero .eyebrow { color: var(--color-accent); }
.hero .button.secondary {
  color: var(--color-on-dark);
  border-color: var(--color-on-dark);
}
.hero .button.secondary:hover { background: rgba(246, 241, 231, 0.1); color: var(--color-on-dark); }

/* Stats strip */
.stat-strip {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: -2.5rem auto 0;
  position: relative;
  z-index: 2;
}
.stat {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
}
.stat strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--color-primary);
}

/* Sections and cards */
.section { padding-block: 2rem; }
.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-block: 1.75rem;
}
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--color-primary);
}
.card h2, .card h3 { margin-top: 0; font-size: 1.3rem; }
.card p:last-child { margin-bottom: 0; }
.card a { font-weight: 700; text-decoration: none; }
.card a:hover { text-decoration: underline; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  margin: 0.25rem 0.5rem 0.25rem 0;
}
.button:hover { background: var(--color-accent-hover); color: var(--color-on-accent); transform: translateY(-1px); }
.button.secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: currentColor;
}
.button.secondary:hover { background: var(--color-primary-soft); color: var(--color-primary-dark); }

/* Tables */
.table-wrap { overflow-x: auto; margin-block: 1rem 1.75rem; border-radius: var(--radius); border: 1px solid var(--color-border); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
  margin: 0;
  background: var(--color-card);
}
th, td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
tr:last-child th, tr:last-child td { border-bottom: 0; }
thead th {
  background: var(--color-band);
  color: var(--color-on-dark);
  font-weight: 700;
}
tbody th { font-weight: 600; }
caption {
  text-align: left;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0 0 0.6rem;
  color: var(--color-primary);
}

/* Forms */
fieldset {
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem 0.5rem;
  margin: 0 0 1.25rem;
  background: var(--color-card);
  box-shadow: var(--shadow-sm);
}
legend {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--color-primary);
  padding: 0 0.4rem;
  font-size: 1.1rem;
}
label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.hint { color: var(--color-muted); font-size: 0.92rem; margin: 0.1rem 0 0.5rem; }
input[type="number"],
input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  max-width: 30rem;
  padding: 0.7rem 0.85rem;
  font: inherit;
  border: 1.5px solid var(--color-control);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  margin-bottom: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-accent);
  outline: none;
}
textarea { min-height: 7rem; }
.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 500;
  margin-bottom: 0.7rem;
}
.check input { margin-top: 0.3rem; width: 1.15rem; height: 1.15rem; accent-color: var(--color-primary); }
.grid-2 {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

/* Quote output */
.quote-output {
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  box-shadow: var(--shadow);
  position: sticky;
  top: 6rem;
}
.quote-output h3 { margin-top: 0; }
.quote-output table { font-size: 0.93rem; }
.quote-output .total {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  font-weight: 700;
  color: var(--color-primary);
  margin: 1rem 0 0.5rem;
}
.notice {
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface);
  padding: 0.9rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-block: 1rem 1.5rem;
  color: var(--color-text);
}

/* Footer */
.site-footer {
  background: var(--color-primary-dark);
  color: var(--color-on-dark-muted);
  padding-block: 2.25rem;
  font-size: 0.95rem;
  margin-top: 2rem;
}
.site-footer ul { list-style: none; padding: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.site-footer a { color: var(--color-on-dark); }
.site-footer a:hover { color: var(--color-accent); }

/* Illustrations and layout for the hero, cards, and sections */
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-art {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-art {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 0 0 1rem;
}
.section-art {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  border-radius: var(--radius);
  margin: 0.5rem 0 1.25rem;
}
.request {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 3px solid var(--color-accent);
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

/* Small screens: tables scroll inside their own box, panels stop being sticky */
@media (max-width: 640px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  th, td { padding: 0.65rem 0.7rem; min-width: 8rem; }
  .quote-output { position: static; padding: 1.25rem; }
  .quote-output .total { font-size: 1.7rem; }
  .hero h1 { max-width: none; }
  .stat-strip { margin-top: 1rem; }
  .card { padding: 1.25rem; }
  fieldset { padding: 1rem 1rem 0.25rem; }
  .button { padding: 0.75rem 1.1rem; }
  .site-footer ul { gap: 0.75rem 1rem; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .card:hover, .button:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .quote-output { position: static; box-shadow: none; border: 1px solid #000; background: #fff; }
  .hero { background: #fff; color: #000; }
  .hero h1, .hero .lead { color: #000; }
}

/* Website assistant widget */
.vf-chat-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  background: var(--color-accent);
  color: var(--color-on-accent);
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.vf-chat-toggle:hover { background: var(--color-accent-hover); }
.vf-chat-panel {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  z-index: 61;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(560px, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.vf-chat-panel[hidden] { display: none; }
.vf-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem 0.2rem;
}
.vf-chat-head h2 { font-size: 1.1rem; margin: 0; }
.vf-chat-close {
  background: transparent;
  border: 1px solid var(--color-control);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.7rem;
  font: inherit;
  color: var(--color-text);
  cursor: pointer;
}
.vf-chat-note { font-size: 0.82rem; color: var(--color-muted); padding: 0 1rem; margin: 0.3rem 0 0.6rem; }
.vf-chat-log {
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.vf-chat-msg {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  max-width: 92%;
  font-size: 0.95rem;
  line-height: 1.5;
}
.vf-chat-user { align-self: flex-end; background: var(--color-primary); color: var(--color-on-dark); }
.vf-chat-bot { align-self: flex-start; background: var(--color-surface); color: var(--color-text); }
.vf-chat-form { display: flex; gap: 0.5rem; padding: 0.8rem 1rem 1rem; }
.vf-chat-form input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  font: inherit;
  border: 1.5px solid var(--color-control);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
}
.vf-chat-form .button { padding: 0.55rem 1rem; margin: 0; }
.vf-chat-form button:disabled { opacity: 0.6; cursor: wait; }

/* Accessibility options panel and visitor display modes */
.vf-a11y-toggle {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 60;
  background: var(--color-primary-dark);
  color: var(--color-on-dark);
  border: 2px solid var(--color-on-dark-muted);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.vf-a11y-panel {
  position: fixed;
  left: 1rem;
  bottom: 4.2rem;
  z-index: 61;
  width: min(340px, calc(100vw - 2rem));
  max-height: min(560px, calc(100vh - 6rem));
  overflow-y: auto;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}
.vf-a11y-panel[hidden] { display: none; }
.vf-a11y-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.vf-a11y-head h2 { font-size: 1.1rem; margin: 0; }
.vf-a11y-panel .vf-a11y-note { font-size: 0.85rem; color: var(--color-muted); margin: 0.4rem 0 0.8rem; }
.vf-a11y-panel fieldset { padding: 0.7rem 0.8rem; margin-bottom: 0.8rem; box-shadow: none; }
.vf-a11y-panel fieldset button,
.vf-a11y-close,
.vf-a11y-reset {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-control);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  font: inherit;
  cursor: pointer;
  margin: 0.2rem 0.3rem 0.2rem 0;
}
.vf-a11y-panel button[aria-pressed="true"] { background: var(--color-accent); color: var(--color-on-accent); border-color: var(--color-accent); }
.vf-a11y-panel label { font-weight: 500; display: flex; gap: 0.5rem; align-items: center; margin: 0.4rem 0; }
.vf-a11y-reset { width: 100%; }
/* Display modes */
html.a11y-size-1 { font-size: 118%; }
html.a11y-size-2 { font-size: 138%; }
html.a11y-links a { text-decoration: underline; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}
html.a11y-contrast {
  --color-text: #000000;
  --color-muted: #000000;
  --color-bg: #ffffff;
  --color-card: #ffffff;
  --color-surface: #ffffff;
  --color-border: #000000;
  --color-control: #000000;
  --color-primary: #000000;
  --color-accent-text: #5a3d00;
  --color-on-dark: #ffffff;
  --color-on-dark-muted: #ffffff;
}
html.a11y-contrast body { background: #ffffff; color: #000000; }
/* Light surfaces keep black text. Only table headers and the current menu item go dark, with white text. */
html.a11y-contrast .hero,
html.a11y-contrast .site-header,
html.a11y-contrast .site-footer { background: #ffffff; color: #000000; }
html.a11y-contrast .site-header { border-bottom: 3px solid #000000; }
html.a11y-contrast .site-footer { border-top: 3px solid #000000; }
html.a11y-contrast .hero { border-bottom: 2px solid #000000; }
html.a11y-contrast .hero h1,
html.a11y-contrast .brand,
html.a11y-contrast .site-nav a,
html.a11y-contrast .hero .lead,
html.a11y-contrast .site-footer a { color: #000000; }
html.a11y-contrast .site-nav a[aria-current="page"],
html.a11y-contrast thead th { background: #000000; color: #ffffff; }
html.a11y-contrast .button { background: #000000; color: #ffffff; border-color: #000000; }
html.a11y-contrast .button:hover { background: #333333; color: #ffffff; }
html.a11y-contrast .button.secondary { background: #ffffff; color: #000000; border: 2px solid #000000; }
html.a11y-contrast .eyebrow { color: #000000; background: #ffffff; }
html.a11y-contrast a { color: #000000; text-decoration: underline; }
/* Standards page */
.std { border: 1px solid var(--color-border); border-left: 4px solid var(--color-accent); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 0.6rem 0; background: var(--color-card); }
.std summary { cursor: pointer; font-weight: 700; color: var(--color-primary); font-family: var(--font-serif); font-size: 1.15rem; list-style: none; position: relative; padding-left: 1.5rem; }
.std summary::-webkit-details-marker { display: none; }
.std summary::before { content: "B8"; position: absolute; left: 0; top: 0; transition: transform 0.2s ease; }
.std[open] summary::before { transform: rotate(90deg); }
.std summary:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.contrast-form { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; align-items: center; max-width: 520px; }
.contrast-form label { margin: 0; }
.contrast-form input { margin: 0; max-width: none; }
.contrast-form .button { grid-column: 1 / -1; justify-self: start; }
.contrast-sample { font-size: 1.2rem; font-weight: 700; margin-top: 1rem; }
kbd { font-family: var(--font); border: 1px solid var(--color-control); border-bottom-width: 3px; border-radius: 4px; padding: 0 0.35rem; background: var(--color-card); }
.key-demo { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }

/* ===== Palette v8: white-led, navy text, red and blue accents (adjusted for AA) =====
 * Source colors: red #E63946, mist #F1FAEE, aqua #A8DADC, steel #457B9D, navy #1D3557.
 * Red is darkened to #C1121F for text and buttons (6.2:1 with white). Steel is used for focus
 * outlines and aqua for soft fills, not for body text. */
:root {
  --color-primary: #1d3557;
  --color-primary-dark: #14213d;
  --color-primary-soft: #e6f2f3;
  --color-band: #1d3557;
  --color-accent: #c1121f;
  --color-accent-hover: #a10e19;
  --color-accent-text: #c1121f;
  --color-on-accent: #ffffff;
  --color-text: #14213d;
  --color-muted: #4a5568;
  --color-bg: #ffffff;
  --color-surface: #f1faee;
  --color-card: #ffffff;
  --color-border: #d5e3e6;
  --color-control: #4a5568;
  --color-focus: #457b9d;
  --color-on-dark: #f1faee;
  --color-on-dark-muted: #a8dadc;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #a8dada;
    --color-primary-dark: #0a1426;
    --color-primary-soft: #16243f;
    --color-band: #1d3557;
    --color-accent: #c1121f;
    --color-accent-hover: #e63946;
    --color-accent-text: #ff6b76;
    --color-on-accent: #ffffff;
    --color-text: #f1faee;
    --color-muted: #b8c4d6;
    --color-bg: #0f1b30;
    --color-surface: #16243f;
    --color-card: #13203a;
    --color-border: #2a3d5c;
    --color-control: #8fa3bf;
    --color-focus: #a8dada;
    --color-on-dark: #f1faee;
    --color-on-dark-muted: #a8dada;
  }
}
:root[data-theme="dark"] {
  --color-primary: #a8dada;
  --color-primary-dark: #0a1426;
  --color-primary-soft: #16243f;
  --color-band: #1d3557;
  --color-accent: #c1121f;
  --color-accent-hover: #e63946;
  --color-accent-text: #ff6b76;
  --color-on-accent: #ffffff;
  --color-text: #f1faee;
  --color-muted: #b8c4d6;
  --color-bg: #0f1b30;
  --color-surface: #16243f;
  --color-card: #13203a;
  --color-border: #2a3d5c;
  --color-control: #8fa3bf;
  --color-focus: #a8dada;
  --color-on-dark: #f1faee;
  --color-on-dark-muted: #a8dada;
}

/* Header: white with a red rule and navy navigation */
.site-header { background: var(--color-bg); color: var(--color-text); border-bottom: 3px solid var(--color-accent); }
.brand { color: var(--color-primary); }
.nav-toggle { color: var(--color-primary); border-color: var(--color-control); }
.site-nav a { color: var(--color-muted); }
.site-nav a:hover { color: var(--color-primary); background: var(--color-primary-soft); }
.site-nav a[aria-current="page"] { background: var(--color-primary); color: var(--color-on-dark); }

/* Hero: mist panel, navy headline, red eyebrow */
.hero { background: var(--color-bg); color: var(--color-text); border-bottom: 1px solid var(--color-border); }
.hero h1 { color: var(--color-primary); }
.hero .lead { color: var(--color-muted); }
.hero .eyebrow { color: var(--color-accent-text); background: var(--color-bg); }
.hero .button.secondary { color: var(--color-primary); border-color: var(--color-primary); }
.hero .button.secondary:hover { background: var(--color-primary-soft); color: var(--color-primary); }

/* Footer: mist with navy links */
.site-footer { background: var(--color-surface); color: var(--color-muted); border-top: 3px solid var(--color-accent); }
.site-footer a { color: var(--color-primary); }
.site-footer a:hover { color: var(--color-accent-text); }

/* Cards and small details use a blue hover rule */
.card:hover { border-color: var(--color-focus); }
.eyebrow { background: var(--color-bg); border-top-color: var(--color-accent); }

/* Floating buttons: short labels on phones so the two never overlap. Full names stay for screen readers. */
.vf-short { display: none; }
@media (max-width: 560px) {
  .vf-long {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .vf-short { display: inline; }
  .vf-a11y-toggle, .vf-chat-toggle {
    min-width: 3.25rem;
    min-height: 3.25rem;
    padding: 0.6rem 0.9rem;
    text-align: center;
  }
  .vf-a11y-toggle { left: 0.75rem; bottom: 0.75rem; }
  .vf-chat-toggle { right: 0.75rem; bottom: 0.75rem; }
  .vf-a11y-panel { bottom: 4.6rem; left: 0.75rem; }
  .vf-chat-panel { bottom: 4.6rem; right: 0.75rem; }
}

/* Footer: centred block */
.site-footer .container { text-align: center; }
.site-footer ul { justify-content: center; }
.site-footer p { margin: 0.4rem 0; }
