/*
 * eeMGe design system.
 *
 * The palette is lifted from the cut-paper robin collage: a warm linen ground,
 * layered forest/leaf/olive greens, warm bark brown, and a single high-chroma
 * amber that the eye lands on first (the birds' faces). That amber is reserved
 * for the one action a screen wants you to take -- everything else stays in the
 * muted range so the hierarchy does the work instead of the colour.
 *
 * Sections:
 *   1. Fonts
 *   2. Tokens (light + dark)
 *   3. Reset and base
 *   4. Canvas -- the layered background and paper grain
 *   5. Layout
 *   6. Navigation
 *   7. Typography
 *   8. Buttons and links
 *   9. Cards, tiles and sections
 *  10. Flow -- hero, stepper, summary
 *  11. Forms
 *  12. Tables
 *  13. Flash and status
 *  14. Utilities (kept for existing views)
 *  15. Responsive
 */

/* ---------------------------------------------------------------- 1. Fonts */

@font-face {
  font-family: 'Inter-Variable';
  src: url("/assets/Inter-Variable-c6876acd.ttf") format('truetype');
  font-display: swap;
}

/* Merienda was referenced throughout the old stylesheet but never declared, so
   every rule asking for it silently fell back to the default serif. */
@font-face {
  font-family: 'Merienda-Variable';
  src: url("/assets/Merienda-Variable-612fa39b.ttf") format('truetype');
  font-display: swap;
}

/* --------------------------------------------------------------- 2. Tokens */

:root {
  /* Surfaces -- warm linen, the collage's ground */
  --canvas: #e7d6c6;
  --raised: #f6ede3;
  --raised-soft: #f0e3d6;
  --sunken: #dcc7b4;

  /* Ink */
  --ink: #241b14;
  --ink-soft: #5b4a3d;
  --ink-faint: #8a7666;
  --line: rgba(36, 27, 20, 0.16);
  --line-strong: rgba(36, 27, 20, 0.3);

  /* Collage accents */
  --forest: #1f4632;
  --leaf: #2f8f2c;
  --olive: #77873a;
  --bark: #4a2f1d;
  --amber: #d98f22;
  --amber-ink: #2a1a05;
  --rose: #c48376;
  --slate-blue: #4f7d99;
  --cream: #e9e3c2;

  /* Semantic */
  --accent: var(--forest);
  --accent-contrast: #f6ede3;
  --focus: var(--slate-blue);

  /* Shape -- cut-paper corners, one soft edge to break the symmetry */
  --radius-sm: 0.5rem;
  --radius: 0.9rem;
  --radius-lg: 1.4rem;
  --leaf-corner: var(--radius-lg) var(--radius-lg) var(--radius-lg) 0.4rem;

  /* Space */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;

  --shadow: 0 1px 2px rgba(36, 27, 20, 0.06), 0 8px 24px -12px rgba(36, 27, 20, 0.28);
  --shadow-lift: 0 2px 4px rgba(36, 27, 20, 0.08), 0 18px 40px -18px rgba(36, 27, 20, 0.4);

  --grain-opacity: 0.4;
  --wash-opacity: 1;

  --content-width: 60rem;
  --reading-width: 34rem;
}

/* Dark is the same collage after dusk: the forest greens become the ground and
   the linen becomes the ink. Accents are lifted so they keep their contrast. */
:root.dark-mode,
body.dark-mode {
  --canvas: #10170f;
  --raised: #1b2a1d;
  --raised-soft: #182319;
  --sunken: #0b100a;

  --ink: #f0e5d6;
  --ink-soft: #bfb2a1;
  --ink-faint: #8e8474;
  --line: rgba(240, 229, 214, 0.16);
  --line-strong: rgba(240, 229, 214, 0.32);

  --forest: #63a97b;
  --leaf: #6cc45f;
  --olive: #a8b45e;
  --bark: #b3835b;
  --amber: #e9a63c;
  --amber-ink: #241704;
  --rose: #dda294;
  --slate-blue: #79a8c2;
  --cream: #efe9cb;

  --accent: var(--leaf);
  --accent-contrast: #0d140c;
  --focus: var(--slate-blue);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px -12px rgba(0, 0, 0, 0.8);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.55), 0 18px 40px -18px rgba(0, 0, 0, 0.9);

  --grain-opacity: 0.22;
  --wash-opacity: 0.85;
}

/* Visitors who have never touched the toggle get their system preference. The
   server writes .light-mode once a choice exists, which switches this off. */
@media (prefers-color-scheme: dark) {
  body:not(.light-mode) {
    --canvas: #10170f;
    --raised: #1b2a1d;
    --raised-soft: #182319;
    --sunken: #0b100a;

    --ink: #f0e5d6;
    --ink-soft: #bfb2a1;
    --ink-faint: #8e8474;
    --line: rgba(240, 229, 214, 0.16);
    --line-strong: rgba(240, 229, 214, 0.32);

    --forest: #63a97b;
    --leaf: #6cc45f;
    --olive: #a8b45e;
    --bark: #b3835b;
    --amber: #e9a63c;
    --amber-ink: #241704;
    --rose: #dda294;
    --slate-blue: #79a8c2;
    --cream: #efe9cb;

    --accent: var(--leaf);
    --accent-contrast: #0d140c;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px -12px rgba(0, 0, 0, 0.8);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.55), 0 18px 40px -18px rgba(0, 0, 0, 0.9);

    --grain-opacity: 0.22;
    --wash-opacity: 0.85;
  }
}

/* -------------------------------------------------------- 3. Reset and base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: 'Inter-Variable', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--canvas);
  transition: background-color 0.5s ease, color 0.5s ease;
}

img {
  max-width: 100%;
  height: auto;
}

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

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

/* ------------------------------------------------------------- 4. Canvas */

/* Two fixed layers stand in for the collage: soft colour masses roughly where
   the greens sit in the artwork, and the canvas grain over the top. Both are
   pure CSS so they cost nothing and follow the theme. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  opacity: var(--wash-opacity);
  background:
    radial-gradient(58% 46% at 76% 18%, color-mix(in srgb, var(--forest) 26%, transparent), transparent 68%),
    radial-gradient(46% 38% at 88% 62%, color-mix(in srgb, var(--olive) 22%, transparent), transparent 70%),
    radial-gradient(50% 42% at 12% 86%, color-mix(in srgb, var(--leaf) 18%, transparent), transparent 72%),
    radial-gradient(38% 30% at 6% 12%, color-mix(in srgb, var(--rose) 16%, transparent), transparent 70%);
}

body::after {
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.5'/%3E%3C/svg%3E");
}

body.dark-mode::after,
body:not(.light-mode)::after {
  mix-blend-mode: normal;
}

@media (prefers-color-scheme: light) {
  body:not(.dark-mode)::after {
    mix-blend-mode: multiply;
  }
}

/* ------------------------------------------------------------- 5. Layout */

.yield {
  display: block;
}

.cap {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: calc(var(--s8) + var(--s2)) var(--s5) var(--s8);
}

.no-cap {
  width: 100%;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

.stack-tight {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
}

.skip-link:focus {
  left: var(--s4);
  top: var(--s4);
  padding: var(--s2) var(--s4);
  background: var(--raised);
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------- 6. Navigation */

.top-links {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.links {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: 0;
}

.links-1 {
  justify-self: start;
}

.links-2 {
  justify-self: center;
  margin: 0;
}

.links-3 {
  justify-self: end;
  margin: 0;
}

.root-name {
  font-family: 'Merienda-Variable', 'Inter-Variable', serif;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 0;
  padding: var(--s1) var(--s2);
}

.root-name:hover {
  color: var(--accent);
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-button:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-color: var(--line);
  color: var(--ink);
}

.nav-link {
  margin: 0;
  padding: var(--s1) var(--s3);
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.nav-link:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.link-icon {
  height: 1.4rem;
  width: auto;
}

/* --------------------------------------------------------- 7. Typography */

h1, h2, h3, h4 {
  font-family: 'Merienda-Variable', 'Inter-Variable', serif;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  text-wrap: pretty;
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: var(--reading-width);
}

.eyebrow {
  font-family: 'Inter-Variable', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.muted {
  color: var(--ink-soft);
}

.form-heading {
  font-family: 'Merienda-Variable', 'Inter-Variable', serif;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: var(--s5);
}

/* The animated wave-through-text effect the app was built around, kept as an
   opt-in flourish rather than the default for every link and button. */
.wave-text {
  background-image: url("/assets/wave5-a05157fb.svg");
  background-size: auto 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: color-mix(in srgb, var(--forest) 55%, transparent);
  animation: scroll-bg 15s linear infinite;
}

@keyframes scroll-bg {
  0% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------- 8. Buttons and links */

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Shared shape for anything that behaves like a button. */
.btn,
.link,
input[type="submit"],
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--raised);
  color: var(--ink);
  font-family: 'Inter-Variable', sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover,
.link:hover,
input[type="submit"]:hover,
button.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active,
.link:active,
input[type="submit"]:active {
  transform: translateY(0);
}

/* The one amber action per screen. */
.btn-primary,
.actions input[type="submit"] {
  background: var(--amber);
  border-color: transparent;
  color: var(--amber-ink);
  font-weight: 600;
}

.btn-primary:hover,
.actions input[type="submit"]:hover {
  background: color-mix(in srgb, var(--amber) 88%, var(--ink));
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1.05rem;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  padding-left: var(--s3);
  padding-right: var(--s3);
}

.btn-quiet:hover {
  color: var(--ink);
  box-shadow: none;
}

.btn-danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--rose) 70%, transparent);
  color: color-mix(in srgb, var(--rose) 85%, var(--ink));
}

/* ------------------------------------------- 9. Cards, tiles and sections */

/* .tile is the app's universal wrapper -- indexes, shows and forms all reach
   for it -- so it has to read as a card without any markup changes. */
.tile {
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--leaf-corner);
  background: color-mix(in srgb, var(--raised) 88%, transparent);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.2s ease;
}

/* Selects and other controls pick up .tile in several forms; they should not
   inherit card padding and shadow. */
select.tile,
input.tile,
textarea.tile {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  box-shadow: none;
  background: var(--raised);
}

table.tile {
  padding: var(--s2) var(--s4);
}

.card {
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--leaf-corner);
  background: color-mix(in srgb, var(--raised) 90%, transparent);
  box-shadow: var(--shadow);
}

/* A grid of secondary destinations -- calm, uniform, never competing with the
   hero above it. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: var(--s3);
}

.action-card {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--raised) 82%, transparent);
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.3;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.action-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.action-card img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex: none;
}

.action-card-label {
  display: block;
}

.action-card-note {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* Progressive disclosure. Settings has two dozen destinations; they live in
   collapsed groups so a screen only ever shows what was asked for. */
.section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--raised) 55%, transparent);
  overflow: hidden;
}

.section > summary {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  cursor: pointer;
  list-style: none;
  font-family: 'Merienda-Variable', 'Inter-Variable', serif;
  font-size: 1.1rem;
  color: var(--ink);
}

.section > summary::-webkit-details-marker {
  display: none;
}

.section > summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin-left: auto;
  border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.section[open] > summary::after {
  transform: rotate(-135deg);
}

.section > summary:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.section-count {
  font-family: 'Inter-Variable', sans-serif;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.section-body {
  padding: 0 var(--s5) var(--s5);
}

/* ---------------------------------------------- 10. Flow: hero and stepper */

/* One screen, one obvious next move. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: var(--s7) var(--s6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--s6);
  background:
    linear-gradient(150deg,
      color-mix(in srgb, var(--raised) 92%, transparent),
      color-mix(in srgb, var(--raised) 72%, transparent));
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}

/* Two cut-paper leaves overlapping in the corner, the way the collage layers
   its shapes -- one forest, one olive, neither quite symmetrical. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero::before {
  right: 4.5rem;
  bottom: -5rem;
  width: 12rem;
  height: 12rem;
  border-radius: 38% 62% 60% 40% / 56% 38% 62% 44%;
  background: color-mix(in srgb, var(--olive) 26%, transparent);
  transform: rotate(-12deg);
}

.hero::after {
  right: -3rem;
  bottom: -4rem;
  width: 15rem;
  height: 15rem;
  border-radius: 68% 32% 55% 45% / 44% 60% 40% 56%;
  background: color-mix(in srgb, var(--forest) 24%, transparent);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-title {
  max-width: 22ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s2);
}

/* Live status inside the hero: the request currently in flight. */
.hero-status {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
}

.hero-status-text {
  min-width: 12rem;
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  list-style: none;
  margin-bottom: var(--s5);
}

.stepper li {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s1) var(--s3) var(--s1) var(--s1);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.stepper .step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 0.8rem;
  font-weight: 600;
}

.stepper .is-current {
  color: var(--ink);
  background: color-mix(in srgb, var(--amber) 20%, transparent);
}

.stepper .is-current .step-index {
  background: var(--amber);
  border-color: transparent;
  color: var(--amber-ink);
}

.stepper .is-done {
  color: var(--ink-soft);
}

.stepper .is-done .step-index {
  background: color-mix(in srgb, var(--forest) 75%, transparent);
  border-color: transparent;
  color: var(--accent-contrast);
}

.stepper a {
  color: inherit;
}

/* Radio cards -- picking a service should feel like picking a thing, not
   filling a dropdown. */
.choice-list {
  display: grid;
  gap: var(--s3);
}

/* The radio stays a real, visible radio -- the card is the hit area, not a
   replacement for the control. */
.choice {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--raised) 70%, transparent);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.choice:hover {
  border-color: var(--line-strong);
}

.choice input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.25rem;
  accent-color: var(--amber);
  cursor: pointer;
}

.choice-body {
  display: block;
  min-width: 0;
}

.choice-title {
  display: block;
  font-weight: 600;
}

.choice-note {
  display: block;
  margin-top: var(--s1);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.choice:has(input:checked) {
  border-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, var(--raised));
  box-shadow: var(--shadow);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.choice-tag {
  display: inline-block;
  margin-left: var(--s2);
  padding: 0 var(--s2);
  border-radius: 999px;
  background: color-mix(in srgb, var(--olive) 25%, transparent);
  font-size: 0.75rem;
  color: var(--ink-soft);
  vertical-align: middle;
}

/* Step 3 review list. */
.summary-list {
  display: grid;
  gap: var(--s3);
  margin: 0;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}

.summary-list dt {
  color: var(--ink-faint);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: none;
}

.summary-list dd {
  text-align: right;
}

.flow-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s6);
}

.flow-actions .btn-quiet {
  margin-right: auto;
}

/* ------------------------------------------------------------- 11. Forms */

.form-container {
  width: 100%;
  max-width: var(--reading-width);
}

.centered-content {
  display: flex;
  justify-content: center;
}

.field {
  margin-bottom: var(--s4);
}

.form-label,
label {
  display: block;
  margin-bottom: var(--s1);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--forest);
}

.checkbox-field,
.form-radio-group {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.checkbox-field label,
.form-radio-label,
.form-checkbox-label {
  display: inline;
  margin: 0;
  font-weight: 400;
  color: var(--ink-soft);
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  margin-top: var(--s5);
}

.field-hint {
  margin-top: var(--s1);
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.form-errors {
  padding: var(--s4);
  margin-bottom: var(--s5);
  border: 1px solid color-mix(in srgb, var(--rose) 60%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--rose) 16%, transparent);
  color: var(--ink);
}

.form-errors ul {
  margin: var(--s2) 0 0 var(--s5);
}

.links-container {
  margin-top: var(--s5);
  text-align: center;
}

.auth-links {
  background: color-mix(in srgb, var(--raised) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s4);
  margin-top: var(--s5);
}

.auth-link {
  display: block;
  margin-bottom: var(--s2);
  font-size: 0.92rem;
  color: var(--accent);
}

.auth-omniauth {
  margin-top: var(--s3);
}

.collection-select {
  margin-top: var(--s1);
}

/* ------------------------------------------------------------ 12. Tables */

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: var(--s3);
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 4;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--canvas);
}

tr:last-child td {
  border-bottom: none;
}

/* Wide tables scroll inside themselves rather than pushing the page sideways. */
.table-scroll {
  width: 100%;
  overflow-x: auto;
}

/* -------------------------------------------------- 13. Flash and status */

#flash-messages {
  position: relative;
  z-index: 5;
  max-width: var(--content-width);
  margin: calc(var(--s8) + var(--s2)) auto 0;
  padding: 0 var(--s5);
}

#flash-messages:empty {
  display: none;
  margin: 0;
}

#flash-messages + .yield .cap {
  padding-top: var(--s5);
}

.notice, .alert {
  position: relative;
  padding: var(--s3) var(--s4);
  margin-bottom: var(--s3);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: opacity 0.5s ease-out;
}

#flash-messages .notice {
  background: color-mix(in srgb, var(--leaf) 18%, var(--raised));
  border-color: color-mix(in srgb, var(--leaf) 40%, transparent);
  color: var(--ink);
}

#flash-messages .alert {
  background: color-mix(in srgb, var(--rose) 22%, var(--raised));
  border-color: color-mix(in srgb, var(--rose) 55%, transparent);
  color: var(--ink);
}

.notice2 {
  color: var(--forest);
  font-size: 1.2rem;
  text-align: center;
  margin: var(--s4);
}

.flash-close {
  position: absolute;
  right: var(--s3);
  top: var(--s2);
  cursor: pointer;
  font-weight: 700;
}

.progress-circle {
  --percentage: 0%;
  width: 3.25rem;
  height: 3.25rem;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--forest) calc(var(--percentage) * 1%), color-mix(in srgb, var(--ink) 12%, transparent) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Punch the middle out so it reads as a ring. */
.progress-circle::before {
  content: "";
  position: absolute;
  inset: 0.42rem;
  border-radius: 50%;
  background: var(--raised);
}

.progress-circle span {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.call-button {
  display: inline-block;
  margin-left: var(--s2);
  padding: 0.15rem var(--s2);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--forest) 85%, transparent);
  color: var(--accent-contrast);
  font-size: 0.85rem;
  text-decoration: none;
}

.call-button:hover {
  text-decoration: none;
  background: var(--forest);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 0.1rem var(--s3);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* Notification opt-in is an aside, not the first thing on the page. */
.push-prompt {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--s3);
}

/* ---------------------------------------------------------- 14. Utilities */

.hidden { display: none; }

/* The [hidden] attribute is only "display: none" in the UA stylesheet, so any
   author rule that sets display wins over it -- .btn's inline-flex is why a
   <button hidden> was still on screen. This puts the attribute back in charge. */
[hidden] { display: none !important; }

.centered-text { text-align: center; }
.right-text { text-align: right; }
.no-border { border: none; }
.black { color: var(--ink); }
.bottom { bottom: 0; }
.line-text-1 { line-height: 1.35; }
.link-spacer { margin-top: var(--s6); }
.negative-bottom { margin-bottom: calc(var(--s5) * -1); }
.round-margin-half { margin: var(--s2); }
.round-margin { margin: var(--s4); }
.round-padding-half { padding: var(--s2); }

.row-wrap {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--s3);
}

.row-stretch {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: var(--s3);
}

.column-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s1);
}

.small-cell {
  font-size: 0.9rem;
  max-width: 45ch;
}

.location-description {
  padding: var(--s1);
  max-width: 60ch;
}

.service-description {
  max-width: 40ch;
  white-space: normal;
  word-wrap: break-word;
  padding: var(--s1) 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.base-icon {
  height: 3.25rem;
  width: auto;
  margin-bottom: var(--s2);
}

.tiny-icon {
  height: 1.1rem;
  width: auto;
  vertical-align: -0.15rem;
  flex: none;
}

.zone-link.active {
  font-weight: 600;
  color: var(--ink);
}

/* --------------------------------------------------------- 15. Responsive */

@media (max-width: 900px) {
  .cap {
    padding-left: var(--s4);
    padding-right: var(--s4);
  }

  #flash-messages {
    padding-left: var(--s4);
    padding-right: var(--s4);
  }
}

@media (max-width: 620px) {
  body {
    font-size: 1rem;
  }

  .top-links {
    padding: var(--s2) var(--s3);
  }

  .links-3 .nav-link {
    padding: var(--s1) var(--s2);
  }

  .hero {
    padding: var(--s6) var(--s4);
    border-bottom-left-radius: var(--s5);
  }

  .hero::after {
    width: 10rem;
    height: 10rem;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  }

  .section > summary,
  .section-body {
    padding-left: var(--s4);
    padding-right: var(--s4);
  }

  .summary-list div {
    flex-direction: column;
    gap: var(--s1);
  }

  .summary-list dd {
    text-align: left;
  }

  .flow-actions {
    flex-wrap: wrap;
  }
}
