/* ===========================================================================
   Woodland Manor Wagon Ride
   A winter night: evergreen and midnight ground, lantern amber, straw bales.
   No external assets, which keeps the CSP strict (default-src 'self').
   =========================================================================== */

:root {
  --night-1: #0a1420;
  --night-2: #0e1e2c;
  --night-3: #14293a;
  --evergreen: #17402f;
  --evergreen-lt: #1f5a41;
  --wood-1: #5a3a22;
  --wood-2: #6d4829;
  --wood-3: #472d1a;
  --straw-1: #e0b866;
  --straw-2: #c99b45;
  --straw-3: #a87c31;
  --straw-ink: #40290a;
  --amber: #ffc76b;
  --cranberry: #b8354a;
  --cranberry-lt: #d94b60;
  --snow: #eef4f8;
  --mist: #9fb4c4;
  --dim: #6c8496;
  --rule: rgba(160, 195, 220, 0.16);
  --card: rgba(18, 36, 50, 0.82);

  --seat: 2.35rem;
  --radius: 14px;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--snow);
  background:
    radial-gradient(1100px 620px at 14% -12%, rgba(27, 58, 82, 0.55) 0%, transparent 60%),
    radial-gradient(900px 520px at 88% 4%, rgba(31, 90, 65, 0.42) 0%, transparent 62%),
    linear-gradient(175deg, var(--night-2) 0%, var(--night-1) 58%, #07101a 100%);
  background-attachment: fixed;
  line-height: 1.55;
}

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

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

a { color: var(--amber); }
a:hover { color: #ffd894; }

/* --- Snow ---------------------------------------------------------------- */

.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.flake {
  position: absolute;
  top: -8vh;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(238, 244, 248, 0.72);
  animation: drift linear infinite;
}

@keyframes drift {
  0%   { transform: translate3d(0, -8vh, 0) scale(0.7); opacity: 0; }
  12%  { opacity: 0.85; }
  88%  { opacity: 0.6; }
  100% { transform: translate3d(28px, 108vh, 0) scale(1); opacity: 0; }
}

.f1  { left:  2%; animation-duration: 15s; animation-delay:  0s;   width: 4px; height: 4px; }
.f2  { left:  7%; animation-duration: 21s; animation-delay: -3s;   }
.f3  { left: 12%; animation-duration: 12s; animation-delay: -7s;   width: 3px; height: 3px; }
.f4  { left: 17%; animation-duration: 24s; animation-delay: -11s;  }
.f5  { left: 21%; animation-duration: 17s; animation-delay: -2s;   width: 5px; height: 5px; }
.f6  { left: 26%; animation-duration: 13s; animation-delay: -14s;  width: 3px; height: 3px; }
.f7  { left: 31%; animation-duration: 26s; animation-delay: -6s;   }
.f8  { left: 36%; animation-duration: 16s; animation-delay: -19s;  width: 4px; height: 4px; }
.f9  { left: 40%; animation-duration: 20s; animation-delay: -9s;   }
.f10 { left: 45%; animation-duration: 14s; animation-delay: -4s;   width: 3px; height: 3px; }
.f11 { left: 50%; animation-duration: 23s; animation-delay: -16s;  }
.f12 { left: 54%; animation-duration: 18s; animation-delay: -1s;   width: 5px; height: 5px; }
.f13 { left: 59%; animation-duration: 15s; animation-delay: -12s;  width: 4px; height: 4px; }
.f14 { left: 64%; animation-duration: 27s; animation-delay: -8s;   }
.f15 { left: 68%; animation-duration: 13s; animation-delay: -21s;  width: 3px; height: 3px; }
.f16 { left: 73%; animation-duration: 19s; animation-delay: -5s;   }
.f17 { left: 77%; animation-duration: 22s; animation-delay: -17s;  width: 4px; height: 4px; }
.f18 { left: 82%; animation-duration: 16s; animation-delay: -10s;  }
.f19 { left: 86%; animation-duration: 25s; animation-delay: -13s;  width: 3px; height: 3px; }
.f20 { left: 90%; animation-duration: 14s; animation-delay: -18s;  width: 5px; height: 5px; }
.f21 { left: 94%; animation-duration: 20s; animation-delay: -2s;   }
.f22 { left: 97%; animation-duration: 17s; animation-delay: -15s;  width: 4px; height: 4px; }
.f23 { left: 33%; animation-duration: 29s; animation-delay: -23s;  width: 3px; height: 3px; }
.f24 { left: 61%; animation-duration: 11s; animation-delay: -20s;  width: 3px; height: 3px; }

/* --- Header -------------------------------------------------------------- */

.site-header {
  position: relative; z-index: 2;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(23, 64, 47, 0.55), rgba(10, 20, 32, 0.25));
  backdrop-filter: blur(6px);
}

.site-header-inner {
  max-width: 1140px; margin: 0 auto;
  padding: 1.15rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 0.85rem; }

.brand-mark {
  font-size: 1.9rem; line-height: 1;
  color: var(--snow);
  filter: drop-shadow(0 0 12px rgba(180, 220, 255, 0.55));
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.15rem, 3.4vw, 1.6rem);
  letter-spacing: 0.01em;
}

.brand-date {
  margin: 0.1rem 0 0;
  font-size: 0.85rem; color: var(--amber);
  letter-spacing: 0.06em; text-transform: uppercase;
}

.site-nav { display: flex; align-items: center; gap: 0.5rem; }
.site-nav form { margin: 0; }

.navlink {
  display: inline-block;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--mist);
  text-decoration: none;
  background: rgba(10, 20, 32, 0.4);
}
.navlink:hover { color: var(--snow); border-color: rgba(255, 199, 107, 0.5); }

.navbutton { font-family: inherit; cursor: pointer; }

/* --- Layout -------------------------------------------------------------- */

.wrap {
  position: relative; z-index: 1;
  max-width: 1140px; margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.site-footer {
  position: relative; z-index: 1;
  padding: 1.5rem 1.25rem 2.5rem;
  text-align: center; color: var(--dim); font-size: 0.85rem;
}

/* --- Intro --------------------------------------------------------------- */

.intro { margin-bottom: 2rem; }

.intro-lead {
  margin: 0 0 0.6rem;
  max-width: 54ch;
  font-size: 1.02rem; color: #cfdde7;
}

.tally { margin: 0; font-size: 0.92rem; color: var(--mist); }
.tally strong { color: var(--amber); font-variant-numeric: tabular-nums; }

/* --- Departure sections -------------------------------------------------- */

.departure { margin: 0 0 2.6rem; }

.departure-time {
  display: flex; align-items: center; gap: 0.6rem;
  margin: 0 0 1rem;
  font-size: 1.12rem; font-weight: 650;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--snow);
}

.departure-time::after {
  content: ""; flex: 1 1 auto; height: 1px;
  background: linear-gradient(90deg, var(--rule), transparent);
}

.departure-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 199, 107, 0.16), 0 0 14px rgba(255, 199, 107, 0.7);
}

.wagon-pair {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

/* --- Wagon --------------------------------------------------------------- */

.wagon {
  display: flex; flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 90px;
}

.wagon.is-full { border-color: rgba(184, 53, 74, 0.45); }

.wagon-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.wagon-name { margin: 0; font-size: 1.05rem; letter-spacing: 0.02em; }

.wagon-count {
  margin: 0; font-size: 0.82rem; color: var(--mist);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.count-big { font-size: 1.25rem; font-weight: 700; color: var(--amber); }
.count-sep { opacity: 0.5; margin: 0 0.1rem; }
.count-word { margin-left: 0.3rem; text-transform: uppercase; letter-spacing: 0.07em; font-size: 0.7rem; }

.is-full .count-big { color: var(--cranberry-lt); }

.wagon-figure { padding: 0.5rem 1.1rem 0; }

/* Evergreen garland along the top rail, with a few lit bulbs. */

.garland {
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-between;
  height: 20px; margin: 0 -0.25rem -3px;
}

.bough {
  flex: 1 1 auto; height: 13px; margin: 0 1px;
  border-radius: 50% 50% 40% 40% / 70% 70% 30% 30%;
  background: linear-gradient(180deg, var(--evergreen-lt), var(--evergreen));
}
.bough.b0 { height: 16px; }
.bough.b1 { height: 11px; }
.bough.b2 { height: 14px; }

.lights {
  position: absolute; inset: auto 0 -2px 0;
  display: flex; justify-content: space-around;
}

.bulb {
  width: 5px; height: 5px; border-radius: 50%;
  animation: twinkle 3.2s ease-in-out infinite;
}
.bulb.l0 { background: var(--amber);        box-shadow: 0 0 8px var(--amber);        animation-delay: 0s; }
.bulb.l1 { background: var(--cranberry-lt); box-shadow: 0 0 8px var(--cranberry-lt); animation-delay: .8s; }
.bulb.l2 { background: #7fd8c0;             box-shadow: 0 0 8px #7fd8c0;             animation-delay: 1.6s; }
.bulb.l3 { background: #fff0c9;             box-shadow: 0 0 8px #fff0c9;             animation-delay: 2.4s; }

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* The wagon bed: planked wood with a rail, holding the hay bales. */

.wagon-bed {
  position: relative;
  min-height: 132px;
  padding: 0.7rem 0.65rem;
  border: 3px solid var(--wood-3);
  border-radius: 6px 6px 10px 10px;
  background-color: var(--wood-1);
  background-image:
    repeating-linear-gradient(90deg,
      rgba(0, 0, 0, 0.16) 0 1px,
      rgba(255, 255, 255, 0.04) 1px 3px,
      transparent 3px 26px),
    linear-gradient(180deg, var(--wood-2), var(--wood-3));
  box-shadow: inset 0 2px 0 rgba(255, 220, 170, 0.14),
              inset 0 -10px 22px rgba(0, 0, 0, 0.4);
}

/* --- Hay bales ----------------------------------------------------------- */
/* Each family is one bale. Its width is proportional to the party size
   (--n seats wide), so a bigger family visibly takes more of the wagon.
   --n comes from the .n1 .. .n25 classes below, which keeps every style out
   of inline attributes and lets the CSP stay at style-src 'self'.          */

.bales {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 5px;
  margin: 0; padding: 0; list-style: none;
}

.bale {
  --n: 1;
  position: relative;
  flex: 0 0 auto;
  width: calc(var(--n) * var(--seat));
  min-width: 5.1rem;
  max-width: 100%;
  height: 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.3rem;
  padding: 0 0.45rem;
  border-radius: 5px;
  background-color: var(--straw-1);
  background-image:
    repeating-linear-gradient(74deg,
      rgba(255, 255, 255, 0.28) 0 1px,
      transparent 1px 4px),
    linear-gradient(180deg, var(--straw-1), var(--straw-2) 70%, var(--straw-3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4),
              inset 0 -2px 3px rgba(0, 0, 0, 0.22),
              0 2px 5px rgba(0, 0, 0, 0.3);
  color: var(--straw-ink);
  overflow: hidden;
}

/* Two lines of baling twine, painted across the full width of the bale. */
.bale-twine {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(180deg, rgba(90, 58, 34, 0.5) 0 3px, transparent 3px 6px),
    repeating-linear-gradient(180deg, rgba(90, 58, 34, 0.5) 0 3px, transparent 3px 6px);
  background-size: 3px 100%, 3px 100%;
  background-position: 26% 0, 74% 0;
  background-repeat: no-repeat;
}

.bale-name {
  position: relative; z-index: 1;
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.bale-size {
  position: relative; z-index: 1;
  flex: 0 0 auto;
  min-width: 1.25rem; height: 1.25rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(64, 41, 10, 0.82);
  color: var(--straw-1);
  font-size: 0.7rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Unclaimed seats are deliberately not drawn. Rendering 25 placeholder bales
   made a lightly-booked wagon taller than a full one on a phone, for no
   information the header count and the "N seats left" line do not already
   give. The bed keeps its min-height so wagons stay a uniform size until
   they genuinely need to grow. */

.n1  { --n: 1; }  .n2  { --n: 2; }  .n3  { --n: 3; }  .n4  { --n: 4; }
.n5  { --n: 5; }  .n6  { --n: 6; }  .n7  { --n: 7; }  .n8  { --n: 8; }
.n9  { --n: 9; }  .n10 { --n: 10; } .n11 { --n: 11; } .n12 { --n: 12; }
.n13 { --n: 13; } .n14 { --n: 14; } .n15 { --n: 15; } .n16 { --n: 16; }
.n17 { --n: 17; } .n18 { --n: 18; } .n19 { --n: 19; } .n20 { --n: 20; }
.n21 { --n: 21; } .n22 { --n: 22; } .n23 { --n: 23; } .n24 { --n: 24; }
.n25 { --n: 25; }

.bed-empty {
  margin: 0; padding: 1.6rem 0.5rem;
  text-align: center;
  color: #e8d5b0; font-size: 0.9rem; font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.full-stamp {
  position: absolute; top: 50%; left: 50%;
  margin: 0;
  transform: translate(-50%, -50%) rotate(-11deg);
  padding: 0.2rem 1.4rem;
  border: 4px double var(--cranberry-lt);
  border-radius: 8px;
  color: var(--cranberry-lt);
  background: rgba(10, 20, 32, 0.72);
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: 0.22em; text-transform: uppercase;
  pointer-events: none;
}

/* --- Wheels -------------------------------------------------------------- */

.undercarriage { position: relative; height: 44px; margin: 0 0.4rem; }

.axle {
  position: absolute; top: 6px; left: 13%; right: 13%;
  height: 5px; border-radius: 3px;
  background: linear-gradient(180deg, var(--wood-2), var(--wood-3));
}

.wheel { position: absolute; top: 0; width: 46px; height: 46px; }
.wheel-front { left: 6%; }
.wheel-rear  { right: 6%; }

.wheel-rim   { fill: none; stroke: #7d5330; stroke-width: 7; }
.wheel-inner { fill: rgba(10, 20, 32, 0.35); stroke: #5a3a22; stroke-width: 3; }
.wheel-spoke { stroke: #8a5c36; stroke-width: 4; stroke-linecap: round; }
.wheel-hub   { fill: #9c6a3f; stroke: #472d1a; stroke-width: 2.5; }

/* --- Wagon footer -------------------------------------------------------- */

.wagon-foot {
  margin-top: auto;
  padding: 0.5rem 1.1rem 1.1rem;
  text-align: center;
}

.signup-btn {
  width: 100%;
  padding: 0.72rem 1rem;
  border: 0; border-radius: 10px;
  font-family: inherit; font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.02em;
  color: #24160a;
  background: linear-gradient(180deg, #ffd88c, var(--amber) 55%, #e6a63f);
  box-shadow: 0 3px 0 #a9701f, 0 8px 18px rgba(255, 175, 60, 0.22);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.signup-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.signup-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #a9701f; }

.seats-left {
  margin: 0.55rem 0 0;
  font-size: 0.78rem; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.08em;
}

.wagon-closed {
  margin: 0; padding: 0.72rem;
  border: 1px dashed rgba(184, 53, 74, 0.5);
  border-radius: 10px;
  color: var(--cranberry-lt); font-size: 0.86rem; font-weight: 600;
}

/* --- Flash messages ------------------------------------------------------ */

.flashes { margin: 0 0 1.5rem; display: grid; gap: 0.55rem; }

.flash {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border-left: 4px solid;
  font-size: 0.93rem;
  background: var(--card);
}
.flash-ok    { border-color: #4fbf8b; color: #b9f0d4; }
.flash-error { border-color: var(--cranberry-lt); color: #ffc9d1; }

/* --- Forms and buttons --------------------------------------------------- */

.field { display: block; margin-bottom: 1.1rem; text-align: left; }

.field-label {
  display: block; margin-bottom: 0.35rem;
  font-size: 0.82rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--mist);
}

/* One look for every control in a .field -- text inputs, selects, textareas.
   Keep these together: when the select and textarea rules lived in their own
   section they drifted out of step with the inputs. */
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background-color: rgba(7, 16, 26, 0.72);
  color: var(--snow);
  font-family: inherit; font-size: 1rem;
  line-height: 1.4;
}

/* appearance:none is the load-bearing line for selects and textareas. Without
   it the browser draws its own widget and ignores the background, border and
   radius above -- which is why the dropdowns looked like raw browser chrome
   sitting next to a styled text field. */
.field select,
.field textarea,
.row-wagon {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Native arrow goes with the native widget, so draw our own in amber.
   An inline SVG keeps this a 'self'/data: asset, so the CSP stays strict. */
.field select,
.row-wagon {
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.75 6 6.5l5-4.75' fill='none' stroke='%23ffc76b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 11px 7px;
  cursor: pointer;
  text-overflow: ellipsis;
}

.field textarea {
  resize: vertical;
  min-height: 4.75rem;
}

/* The dropdown list itself is drawn by the OS, so the options need their own
   colors or they come back white-on-white in a dark theme. */
.field select option,
.row-wagon option {
  background-color: #0e1e2c;
  color: var(--snow);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--dim);
  opacity: 1;                 /* Firefox dims placeholders by default. */
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
  border-color: var(--amber);
}

.field select:hover,
.row-wagon:hover { border-color: rgba(255, 199, 107, 0.45); }

.field-hint { display: block; margin-top: 0.3rem; font-size: 0.78rem; color: var(--dim); }

.field-error {
  margin: -0.4rem 0 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(184, 53, 74, 0.18);
  border-left: 3px solid var(--cranberry-lt);
  color: #ffc9d1; font-size: 0.86rem;
}

.btn-primary, .btn-ghost, .btn-danger {
  padding: 0.68rem 1.2rem;
  border-radius: 10px;
  font-family: inherit; font-size: 0.93rem; font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  border: 0;
  color: #24160a;
  background: linear-gradient(180deg, #ffd88c, var(--amber) 55%, #e6a63f);
  box-shadow: 0 3px 0 #a9701f;
}
.btn-primary:hover { filter: brightness(1.06); color: #24160a; }

.btn-wide { width: 100%; }

.btn-ghost {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--mist);
}
.btn-ghost:hover { color: var(--snow); border-color: var(--mist); }

.btn-danger {
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(184, 53, 74, 0.55);
  background: rgba(184, 53, 74, 0.14);
  color: #ffc9d1;
  font-size: 0.8rem;
}
.btn-danger:hover { background: rgba(184, 53, 74, 0.3); }

:where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* --- Modal --------------------------------------------------------------- */

.modal {
  width: min(27rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #14293a, #0c1a28);
  color: var(--snow);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.modal::backdrop {
  background: rgba(4, 10, 18, 0.72);
  backdrop-filter: blur(3px);
}

.modal-form { padding: 1.4rem 1.4rem 1.2rem; margin: 0; }

.modal-title { margin: 0 0 0.25rem; font-size: 1.2rem; }

.modal-sub {
  margin: 0 0 1.2rem;
  font-size: 0.88rem; color: var(--amber);
  letter-spacing: 0.04em; text-transform: uppercase;
}

.modal-actions {
  display: flex; gap: 0.6rem; justify-content: flex-end;
  padding-top: 0.3rem;
}

/* --- Gate (login / error) ------------------------------------------------ */

.gate { display: grid; place-items: center; padding: 2.5rem 0; }

.gate-card {
  width: min(25rem, 100%);
  padding: 2rem 1.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.gate-mark { font-size: 2.4rem; line-height: 1; display: block; margin-bottom: 0.5rem; }
.gate-card h2 { margin: 0 0 0.5rem; font-size: 1.35rem; }
.gate-note { margin: 0 0 1.5rem; color: var(--mist); font-size: 0.92rem; }
.gate-form { text-align: left; }
.gate-back { margin: 1.25rem 0 0; font-size: 0.86rem; }

/* --- Admin roster -------------------------------------------------------- */

.admin-head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.admin-head h2 { margin: 0; font-size: 1.3rem; }
.admin-sub { margin: 0.2rem 0 0; color: var(--mist); font-size: 0.9rem; }

.delete-form { margin: 0; }

/* --- "Yours" markers on the board ---------------------------------------- */

.intro-mine {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0.7rem 0 0;
  font-size: 0.9rem; color: #cfdde7;
}

.mine-dot {
  flex: 0 0 auto;
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--straw-1);
  box-shadow: 0 0 0 2px rgba(255, 199, 107, 0.28);
}

/* Your own bale gets a lantern-lit edge so it stands out from the rest. */
.bale-mine {
  /* Room for the name, the Change button and the count side by side. */
  min-width: 8.6rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45),
              inset 0 -2px 3px rgba(0, 0, 0, 0.22),
              0 0 0 2px var(--amber),
              0 3px 10px rgba(255, 175, 60, 0.35);
}

.bale-edit {
  position: relative; z-index: 2;
  flex: 0 0 auto;
  padding: 0.12rem 0.4rem;
  border: 1px solid rgba(64, 41, 10, 0.5);
  border-radius: 5px;
  background: rgba(64, 41, 10, 0.86);
  color: var(--straw-1);
  font-family: inherit; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.bale-edit:hover { background: var(--straw-ink); color: #fff; }

/* --- Manage-my-signup modal --------------------------------------------- */

.manage-cancel {
  margin: 1.1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.manage-cancel .btn-danger { padding: 0.55rem 1rem; font-size: 0.86rem; }

/* --- Change-request form ------------------------------------------------- */

.change-request {
  margin: 2.5rem 0 0;
  padding: 1.5rem 1.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  scroll-margin-top: 90px;
}

.cr-title { margin: 0 0 0.4rem; font-size: 1.1rem; }

.cr-lead {
  margin: 0 0 1.4rem;
  max-width: 62ch;
  font-size: 0.92rem; color: var(--mist);
}

.cr-grid {
  display: grid; gap: 0 1rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.cr-count { color: var(--amber); }

/* The three narrow fields sit in a row on wide screens; the Details textarea
   below them spans the full width. Every control's look comes from the shared
   .field rules in "Forms and buttons" -- nothing is restyled here. */

/* --- Admin: add a family ------------------------------------------------- */

.admin-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.admin-add {
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.2rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
}

.admin-add-title {
  margin: 0 0 0.9rem;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--mist);
}

.admin-add-row {
  display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end;
}
.admin-add-row .field { flex: 1 1 11rem; }
.admin-add-row .field-narrow { flex: 0 0 6.5rem; }
.admin-add-row .btn-primary { margin-bottom: 1.1rem; }

.admin-note {
  margin: 0 0 1rem;
  font-size: 0.86rem; color: var(--mist);
}

/* --- Admin: roster rows -------------------------------------------------- */

.roster-list { margin: 0 0 2rem; padding: 0; list-style: none; }

.roster-head, .roster-row {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: minmax(11rem, 1.3fr) minmax(8rem, 1.6fr) 5.5rem auto auto;
  align-items: center;
}

.roster-head {
  padding: 0 0.85rem 0.4rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--mist);
}

.roster-row {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
  margin-bottom: 0.5rem;
}
.roster-row:hover { border-color: rgba(255, 199, 107, 0.3); }

/* The edit form spans the first four grid tracks; Remove sits in the fifth. */
.row-edit {
  display: grid;
  grid-column: 1 / 5;
  grid-template-columns: subgrid;
  gap: 0.6rem;
  align-items: center;
  margin: 0;
}

/* Roster controls are the compact version of the same look. background-color
   rather than the background shorthand, which would reset the select's chevron
   image to none; and padding split so padding-right keeps room for it. */
.row-wagon, .row-size {
  padding-block: 0.42rem;
  padding-left: 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background-color: rgba(7, 16, 26, 0.72);
  color: var(--snow);
  font-family: inherit; font-size: 0.86rem;
  min-width: 0;
}

.row-wagon {
  padding-right: 1.9rem;
  background-position: right 0.55rem center;
  background-size: 10px 6px;
}

.row-size {
  padding-right: 0.55rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row-wagon:focus-visible, .row-size:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
  border-color: var(--amber);
}

.row-name {
  display: flex; flex-direction: column;
  font-weight: 650; font-size: 0.92rem;
  min-width: 0;
}

.row-stamp { font-size: 0.72rem; font-weight: 400; color: var(--dim); }

.btn-small { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

.row-remove { margin: 0; justify-self: end; }

/* Browsers without grid `subgrid` fall back to a plain flex row, which still
   lines the controls up sensibly even if columns do not align across rows. */
@supports not (grid-template-columns: subgrid) {
  .roster-head { display: none; }
  .row-edit {
    display: flex; flex-wrap: wrap; align-items: center;
  }
  .row-edit .row-wagon { flex: 1 1 11rem; }
  .row-edit .row-name  { flex: 1 1 8rem; }
  .row-edit .row-size  { flex: 0 0 4.5rem; }
  .roster-row { grid-template-columns: 1fr auto; }
}

/* --- Admin: change requests --------------------------------------------- */

.requests { margin: 2.5rem 0 0; scroll-margin-top: 90px; }

.requests h3 {
  display: flex; align-items: center; gap: 0.7rem;
  margin: 0 0 1rem; font-size: 1.05rem;
}

.req-count, .req-badge {
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: rgba(184, 53, 74, 0.2);
  border: 1px solid rgba(217, 75, 96, 0.5);
  color: #ffc9d1;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  text-decoration: none;
}
.req-badge:hover { background: rgba(184, 53, 74, 0.34); color: #fff; }

.req-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }

.req {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  align-items: flex-start; justify-content: space-between;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  background: var(--card);
}

.req-done { border-left-color: var(--dim); opacity: 0.6; }

.req-main { flex: 1 1 18rem; min-width: 0; }
.req-main p { margin: 0; }

.req-who {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem;
  font-size: 0.98rem;
}

.req-wagon {
  font-size: 0.76rem; color: var(--amber);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.req-wagon-none { color: var(--dim); }

.req-kind { margin-top: 0.15rem; font-size: 0.88rem; color: #cfdde7; }

.req-note {
  margin-top: 0.45rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(7, 16, 26, 0.5);
  font-size: 0.88rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.req-when { margin-top: 0.45rem; font-size: 0.74rem; color: var(--dim); }

.req-side { flex: 0 0 auto; }
.req-side form { margin: 0; }

.req-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--dim);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 760px) {
  /* Roster rows stack into labelled blocks rather than squeezing 5 columns. */
  .roster-head { display: none; }
  .roster-row { grid-template-columns: 1fr; gap: 0.55rem; }
  .row-edit {
    display: flex; flex-wrap: wrap; grid-column: auto;
    align-items: center; gap: 0.5rem;
  }
  .row-edit .row-name { flex: 1 1 100%; order: -1; }
  .row-edit .row-wagon { flex: 1 1 9rem; }
  .row-edit .row-size { flex: 0 0 4.2rem; }
  .row-remove { justify-self: start; }
  .admin-add-row .btn-primary { margin-bottom: 1.1rem; width: 100%; }
}

@media (max-width: 620px) {
  :root { --seat: 2.1rem; }
  .wagon-pair { grid-template-columns: 1fr; }
  .site-header-inner { padding: 0.9rem 1rem; }
  .wrap { padding: 1.25rem 1rem 2.5rem; }
  .bale { min-width: 4.6rem; height: 2.3rem; }
  /* A bale carrying a Change button needs a little more room for the label. */
  .bale-mine { min-width: 7.6rem; }
  .full-stamp { font-size: 1.2rem; }
  .change-request { padding: 1.2rem 1rem; }
  .admin-head { align-items: flex-start; }
}

/* --- Motion and contrast preferences ------------------------------------- */

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

@media print {
  .snow, .site-nav, .signup-btn, .site-footer,
  .bale-edit, .change-request, .admin-add,
  .row-remove, .row-edit button, .req-side { display: none; }
  body { background: #fff; color: #000; }
}
