/* ============================================================
   Rally: refined athletic-club / scoreboard aesthetic
   Fraunces (display) · Hanken Grotesk (UI) · Spline Sans Mono (figures)
   ============================================================ */

:root {
  /* Experimental: dark theme retinted to cooliotto.com's code-editor palette
     (near-black canvas, wire blue, comment gray). Signal orange was tried
     first but sat too close to the booked-slot red; wire blue keeps the two
     states visually distinct. Revert to the original scoreboard greens/
     chartreuse below if this doesn't land. */
  --ink:      #0b0e14;
  --court:    #11151c;
  --raised:   #171c25;
  --raised-2: #1e2430;
  --line:     rgba(243, 239, 228, 0.10);
  --line-2:   rgba(243, 239, 228, 0.18);
  /* Opaque equivalent of --line composited over --raised, for the floating grid
     header: a translucent border would show the scrolling rows through it. Built
     from theme vars so it adapts to light/dark without a second declaration. */
  --line-solid: color-mix(in srgb, var(--cream) 10%, var(--raised));
  --cream:    #f3efe4;
  --muted:    #97a39d;
  --faint:    #5b6472;   /* cooliotto.com "comment gray" */
  --ball:     #7c9cf4;   /* cooliotto.com "wire blue" */
  --ball-dim: #6b86d2;
  --red:      #e2503f;   /* service-line red */

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;

  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85);

  --display: "Fraunces", Georgia, serif;
  --ui:      "Hanken Grotesk", system-ui, sans-serif;
  --mono:    "Spline Sans Mono", ui-monospace, monospace;
}

/* Light theme: derived from the same cooliotto.com retint as the dark theme
   above -- neutral surfaces instead of green-tinted, and a deepened "wire
   blue" (the pastel dark-theme value is too light to read on white). */
[data-theme="light"] {
  --ink:      #f5f6f7;
  --court:    #ffffff;
  --raised:   #eef0f2;
  --raised-2: #e2e5e9;
  --line:     rgba(15, 17, 20, 0.12);
  --line-2:   rgba(15, 17, 20, 0.20);
  --cream:    #16201a;
  --muted:    #515b54;
  --faint:    #6b7280;
  --ball:     #3a56c4;
  --ball-dim: #2c4399;
  --red:      #cf3b2b;
  --shadow:   0 24px 60px -30px rgba(20, 40, 30, 0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Only html is pinned to viewport height. Body must be free to grow to content
   height; capping it at 100% shrinks the sticky topbar's containing block to one
   screen, so the bar un-sticks once you scroll past the first viewport. */
html { height: 100%; }

body {
  font-family: var(--ui);
  background: var(--ink);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  position: relative;
  /* clip (not hidden): still prevents sideways page scroll, but unlike hidden it
     doesn't make <body> a scroll container, which would break the sticky topbar. */
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  transition: background-color 0.2s, color 0.2s;
}

/* Atmospheric backdrop: a faint squash-court outline + warm glow. */
.court-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 85% -10%, color-mix(in srgb, var(--ball) 8%, transparent), transparent 55%),
    radial-gradient(90% 70% at 0% 110%, rgba(226, 80, 63, 0.06), transparent 55%);
}
.court-lines::before {
  content: "";
  position: absolute;
  inset: clamp(20px, 5vw, 70px);
  border: 1.5px solid var(--line);
  border-radius: 4px;
}
.court-lines::after {
  /* the "service line": a single red horizontal stroke */
  content: "";
  position: absolute;
  left: clamp(20px, 5vw, 70px);
  right: clamp(20px, 5vw, 70px);
  top: 58%;
  border-top: 1.5px solid rgba(226, 80, 63, 0.16);
}

main, .topbar { position: relative; z-index: 1; }
main { flex: 1 0 auto; }

/* -- Top bar -------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40; /* above page content and the grid's own sticky header */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  /* Opaque: the bar is sticky, so a translucent/frosted background would show the
     rows scrolling behind it (which reads as bleed-through above the pinned grid
     header). Solid --ink looks the same at rest, with nothing showing through. */
  background: var(--ink);
}
/* .topbar's display:flex would otherwise override the UA [hidden] rule, so the
   bar never actually hides on logout. This makes the hidden attribute win. */
.topbar[hidden] { display: none; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--cream);
}
.brand-ball {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--ball);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ball) 14%, transparent), 0 0 18px color-mix(in srgb, var(--ball) 50%, transparent);
}
.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a, .nav button {
  font-family: var(--ui);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  transition: color 0.18s, background 0.18s;
}
.nav a:hover, .nav button:hover { color: var(--cream); background: var(--raised); }
.nav a.active { color: var(--ink); background: var(--ball); }
.nav .who {
  color: var(--faint);
  font-size: 0.82rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--line);
  margin-left: 0.3rem;
}

/* Theme toggle (sun/moon). Placed after .nav rules so it wins the specificity
   tie with `.nav button` on padding/size. */
button.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
}
button.theme-toggle:hover { color: var(--cream); background: var(--raised); }
.theme-toggle-corner { position: absolute; top: 0.8rem; right: 0.8rem; }
.nav-icon { width: 18px; height: 18px; display: block; }

/* 12h / 24h time-format toggle (text). After .nav rules to win the specificity tie. */
button.time-toggle {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.55rem;
  min-width: 3em;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
}
button.time-toggle:hover { color: var(--cream); background: var(--raised); }

/* Footer credit, on every page except the auth page (which has its own
   Cooliotto credit inside the card -- see .auth-built-by). */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 1.6rem 1rem 2.2rem;
}
/* .app-footer's display:flex would otherwise override the UA [hidden] rule,
   the same issue .topbar works around above. */
.app-footer[hidden] { display: none; }
.app-footer img { height: 20px; width: auto; opacity: 0.65; transition: opacity 0.2s; }
.app-footer a:hover img { opacity: 1; }
[data-theme="dark"] .app-footer img { filter: invert(1) brightness(1.15); }
.footer-credit { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--faint); }
.footer-brand { display: inline-flex; align-items: center; gap: 0.32rem; font-family: var(--display); font-weight: 600; font-size: 0.95rem; color: var(--cream); }
.footer-brand .brand-ball { width: 8px; height: 8px; box-shadow: none; }
.footer-dot { color: var(--faint); }
.footer-cooliotto { display: inline-flex; align-items: center; }

/* Whitelabel brand chrome */
.brand-logo { height: 34px; width: auto; max-width: 170px; object-fit: contain; display: block; }
.brand-icon { height: 32px; width: 32px; max-width: 32px; } /* square topbar avatar */
.auth-club { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; text-align: center; }
.auth-club-logo { max-width: 230px; max-height: 96px; width: auto; height: auto; }
.auth-club-name { font-family: var(--display); font-weight: 600; font-size: 1.9rem; letter-spacing: -0.02em; }
.powered-by { font-size: 0.78rem; color: var(--faint); letter-spacing: 0.02em; }
/* Shared "Rally <Product>" wordmark convention: suite name (Rally) in the
   display font with no color override, product name (Courts / Ladder) in
   --ball to set it apart, tagline on its own smaller line. Reused by the
   whitelabel "powered by" credit and the in-app "Runs on" footer credit. */
.brand-word-rally { font-family: var(--display); font-weight: 600; }
.brand-word-product { font-family: var(--display); font-weight: 600; color: var(--ball); }
.brand-word-tagline { display: block; margin-top: 0.15rem; font-size: 0.85em; color: var(--faint); }

/* -- Layout helpers ------------------------------------------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 4vw, 3rem); }
/* The booking page (esp. the week grid) needs more room than reading-width pages. */
.wrap-wide { max-width: min(1640px, 96vw); }
.page-head { margin-bottom: 1.8rem; animation: rise 0.6s both; }
.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.7rem;
  color: var(--ball-dim);
  margin-bottom: 0.7rem;
}
h1.title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
h1.title em { font-style: italic; color: var(--ball); }
.sub { color: var(--muted); margin-top: 0.6rem; max-width: 46ch; }

/* -- Controls --------------------------------------------------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-end;
  padding: 1rem 1.1rem;
  background: var(--court);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 1.6rem;
  animation: rise 0.6s 0.05s both;
}
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--faint);
}
input, select {
  font-family: var(--ui);
  font-size: 0.95rem;
  color: var(--cream);
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.8rem;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input:focus, select:focus { border-color: var(--ball); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ball) 16%, transparent); }
.seg { display: inline-flex; background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 3px; }
.seg button {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  background: none; border: 0; cursor: pointer;
  padding: 0.4rem 0.8rem; border-radius: 6px;
  transition: all 0.15s;
}
.seg button.on { background: var(--ball); color: var(--ink); font-weight: 600; }

/* -- Buttons ---------------------------------------------------- */
.btn {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 0;
  border-radius: var(--r-sm);
  padding: 0.72rem 1.2rem;
  transition: transform 0.12s, filter 0.18s, background 0.18s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ball); color: var(--ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--raised); color: var(--cream); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--line-2); background: var(--raised-2); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(226, 80, 63, 0.4); }
.btn-danger:hover { background: rgba(226, 80, 63, 0.12); }
.btn-block { width: 100%; }

/* -- Availability grid (the centrepiece) ------------------------ */
/* Horizontal scroll only (the wide week table); the page owns vertical scroll,
   so there's no nested vertical scrollbar. The header is floated on scroll via
   JS (applyHeader) using a transform rather than position:sticky, because this
   horizontal-overflow container would otherwise capture vertical sticking. */
.grid-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--court); animation: rise 0.6s 0.1s both; }
/* Fixed layout so column widths are defined by the colgroup, letting booked cells
   fill their column and ellipsize long names instead of widening the column. */
.slot-grid { width: 100%; border-collapse: collapse; min-width: 480px; table-layout: fixed; }
.slot-grid col.col-time { width: 80px; }
/* Week grid: explicit per-column widths. min-width:100% makes the table fill the
   container when the columns don't add up to its width (so the header reaches the
   rounded right edge instead of stopping short); when there are enough courts to
   exceed the width, it grows past and the grid-scroll wrapper scrolls sideways. */
.slot-grid.week { width: auto; min-width: 100%; }
.slot-grid.week col.col-time-week { width: 64px; }
.slot-grid.week col.col-day { width: 104px; }
.slot-grid th, .slot-grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.slot-grid th:last-child, .slot-grid td:last-child { border-right: 0; }
.slot-grid tr:last-child td { border-bottom: 0; }
.slot-grid thead th {
  /* Floated on scroll: applyHeader sets --head-y so the whole header (both rows
     in the week view) slides down to stay pinned just below the top nav. */
  position: relative;
  z-index: 5;
  transform: translateY(var(--head-y, 0px));
  background: var(--raised);
  /* No cell borders on the header: with border-collapse the browser paints the
     translucent body-cell border at the seam (and a transform makes it worse), so
     rows bleed through. Draw the gridlines as an opaque inset box-shadow instead,
     since it paints with the cell, moves with the transform, and can't be overridden. */
  border: 0;
  box-shadow: inset -1px -1px 0 var(--line-solid);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  padding: 0.85rem 0.6rem;
  text-align: center;
  color: var(--cream);
}
.slot-grid thead th:first-child { text-align: left; padding-left: 1.1rem; }
.time-col {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  text-align: center;
  padding: 0 0.5rem;
  background: rgba(0,0,0,0.12);
}
.slot-cell { padding: 0.4rem; text-align: center; }
.slot {
  display: block;
  box-sizing: border-box;
  width: 100%;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ball);
  background: color-mix(in srgb, var(--ball) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--ball) 22%, transparent);
  border-radius: 7px;
  padding: 0.55rem 0.4rem;
  cursor: pointer;
  white-space: nowrap; /* keep "12:00 PM" on one line in the dense week grid */
  transition: background 0.15s, transform 0.1s, color 0.15s;
}
button.slot:hover { background: var(--ball); color: var(--ink); transform: translateY(-1px); }
.slot-empty { color: var(--faint); font-family: var(--mono); font-size: 1rem; opacity: 0.5; }

/* Booked: red, non-interactive (admins see the booker name). Carries the same
   disabled affordance as past slots: not pickable, slightly dimmed. */
.slot-booked {
  color: var(--red);
  background: rgba(226, 80, 63, 0.13);
  border-color: rgba(226, 80, 63, 0.45);
  cursor: not-allowed;
  opacity: 0.55;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.slot-name {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot-type-pill {
  width: 100%;
  max-width: 100%;
  font-size: 0.68rem;
  font-weight: 600;
  color: #1a1f1d;
  padding: 0.1rem 0.4rem;
  border-radius: var(--r-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
/* Past: greyed, non-bookable */
.slot-past {
  color: var(--faint);
  background: transparent;
  border-color: var(--line);
  cursor: not-allowed;
  opacity: 0.55;
}

/* Week grid: two-row header (day labels over their courts). Both rows inherit
   the --head-y transform above, so they float together as one block. */
.day-head {
  font-family: var(--display);
  font-weight: 600;
  text-align: center;
}
.court-head {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
  padding: 0.45rem 0.5rem;
}

/* Week navigation */
.week-nav { display: inline-flex; align-items: center; gap: 0.5rem; }
.week-nav .btn { padding: 0.45rem 0.75rem; font-size: 1.05rem; line-height: 1; }
.week-label { font-family: var(--mono); font-size: 0.85rem; color: var(--cream); min-width: 13ch; text-align: center; }

/* -- Cards / bookings list --------------------------------------- */
.cards { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  background: var(--court);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: rise 0.5s both;
  position: relative;
  overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ball); }
.card .court-name { font-family: var(--display); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.01em; }
.card .when { color: var(--muted); font-size: 0.92rem; }
.card .time { font-family: var(--mono); font-size: 1.1rem; color: var(--cream); }
.card .card-actions { margin-top: 0.4rem; }

/* -- Admin: courts & hours --------------------------------------- */
.admin-section {
  margin-bottom: 2.4rem;
  animation: rise 0.5s both;
}
.section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.sub-title {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  margin: 1.4rem 0 0.7rem;
}
.court-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  background: var(--court);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 0.8rem;
}
.court-form .field { flex: 1; min-width: 140px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  color: var(--cream);
  cursor: pointer;
  white-space: nowrap;
  padding-bottom: 0.6rem;
}
.check input { width: auto; }
.swatch-picker { display: flex; gap: 0.4rem; align-items: center; }
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.swatch.selected { border-color: var(--cream); }
.hours-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.hours-row .check { min-width: 9rem; padding-bottom: 0; }
.hours-row .dash { color: var(--faint); }
#hoursEditor { margin-bottom: 1.2rem; }

/* -- Auth backdrop ------------------------------------------------ */
/* Fixed behind the login card; toggled via .hidden in renderAuth/renderChrome.
   z-index 0 puts it below main's z-index 1 (see "main, .topbar" above), same
   trick used for .court-lines. */
#authBackdrop { position: fixed; inset: 0; z-index: 0; isolation: isolate; }
.login-bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.login-bg-overlay { position: absolute; inset: 0; background: rgba(11, 14, 20, 0.6); z-index: 1; }

/* -- Auth screen ------------------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card {
  position: relative;
  width: 100%; max-width: 410px;
  background: var(--court);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  box-shadow: var(--shadow);
  animation: rise 0.6s both;
}
.auth-brand-block { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-align: center; }
.auth-brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-tagline {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  margin-bottom: 1.6rem;
}
.auth-built-by {
  display: flex;
  justify-content: center;
  padding-top: 1.2rem;
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.auth-built-by img { height: 20px; width: auto; opacity: 0.65; transition: opacity 0.2s; }
.auth-built-by a:hover img { opacity: 1; }
[data-theme="dark"] .auth-built-by img { filter: invert(1) brightness(1.15); }
.auth h1 { font-family: var(--display); font-weight: 600; font-size: 2rem; letter-spacing: -0.02em; line-height: 1.05; }
.auth h1 em { font-style: italic; color: var(--ball); }
.auth p.lead { color: var(--muted); margin: 0.5rem 0 1.6rem; }
.form { display: flex; flex-direction: column; gap: 0.9rem; }
.form .row { display: flex; gap: 0.7rem; }
.form .row .field { flex: 1; }
.form .field { display: flex; flex-direction: column; gap: 0.35rem; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--faint);
  font-size: 0.8rem;
  margin-top: 1.2rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.btn-ladder { display: flex; align-items: center; justify-content: center; gap: 0.55rem; margin-top: 0.9rem; }
.btn-ladder .brand-ball { box-shadow: none; }
.auth-registration-note { margin-top: 1.2rem; font-size: 0.8125rem; color: var(--muted); text-align: center; }
.form-error {
  font-size: 0.88rem;
  color: var(--red);
  background: rgba(226, 80, 63, 0.1);
  border: 1px solid rgba(226, 80, 63, 0.3);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.8rem;
}

/* -- States ------------------------------------------------------ */
.empty, .loading {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  animation: rise 0.5s both;
}
.empty .big { font-family: var(--display); font-size: 1.5rem; color: var(--cream); margin-bottom: 0.4rem; }

/* -- Toasts ------------------------------------------------------ */
.toasts { position: fixed; bottom: 1.4rem; right: 1.4rem; z-index: 50; display: flex; flex-direction: column; gap: 0.6rem; }
.toast {
  font-size: 0.92rem;
  background: var(--raised-2);
  color: var(--cream);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--ball);
  border-radius: var(--r-sm);
  padding: 0.8rem 1.1rem;
  box-shadow: var(--shadow);
  animation: slide-in 0.3s both;
  max-width: 320px;
}
.toast.err { border-left-color: var(--red); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* -- Modal / themed confirm dialog -------------------------------- */
.hidden { display: none !important; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--ink) 68%, transparent);
  backdrop-filter: blur(3px);
  animation: fade 0.15s both;
}
.modal-box {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem;
  animation: rise 0.22s both;
}
.modal-sm { max-width: 380px; }
.modal-box h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.modal-subtitle { color: var(--muted); font-size: 0.92rem; line-height: 1.5; margin-top: 0.5rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.5rem; }

.muted-note { color: var(--faint); font-family: var(--mono); font-size: 0.72rem; margin-top: 0.8rem; letter-spacing: 0.04em; }

@media (max-width: 560px) {
  .nav .who { display: none; }
  .controls { flex-direction: column; align-items: stretch; }
}
