/* ==========================================================================
   WodBuster Booking Worker — brand stylesheet
   --------------------------------------------------------------------------
   Sits on top of Pico.css v2 (loaded before this file). Defines the dark
   palette, the electric-yellow accent, and the signature components
   (hero, feature cards, day chips, preference chain, banners).

   All colours are exposed as CSS variables so a future theme swap only
   touches the ``:root`` block below.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Layered backgrounds — deepest to most elevated. */
  --wb-bg:            #0a0e14;
  --wb-bg-elevated:   #111827;
  --wb-bg-card:       #151d2a;
  --wb-bg-inset:      #0d131c;

  /* Borders */
  --wb-border:        #1f2937;
  --wb-border-strong: #334155;
  --wb-border-focus:  #f8ff40;

  /* Text */
  --wb-text:          #f1f5f9;
  --wb-text-muted:    #94a3b8;
  --wb-text-subtle:   #64748b;

  /* Accent (used sparingly — it is intense at 63% lightness). */
  --wb-accent:        #f8ff40;
  --wb-accent-hover:  #e5ec00;
  --wb-accent-glow:   rgba(248, 255, 64, 0.22);
  --wb-accent-soft:   rgba(248, 255, 64, 0.10);
  --wb-accent-ink:    #0a0e14;  /* text colour to place ON --wb-accent */

  /* Semantic status colours (tuned for dark backgrounds). */
  --wb-success:       #4ade80;
  --wb-warning:       #fbbf24;
  --wb-danger:        #f87171;
  --wb-info:          #60a5fa;

  /* Type + geometry.

     Font stack mimics the condensed athletic feel of wodbuster.com
     (they use the paid Manuka face from Klim Type Foundry, which we
     can't self-host). Oswald is the closest free equivalent on
     Google Fonts — condensed geometric sans with a full weight
     range for body copy and display headings — and is loaded in
     ``base.html``. Impact and the platform sans-serif act as final
     safety nets when Google Fonts is unreachable. */
  --wb-font: "Oswald", "Barlow Condensed", Impact, sans-serif;
  --wb-mono: ui-monospace, "SF Mono", "JetBrains Mono", monospace;
  --wb-radius:      12px;
  --wb-radius-sm:   6px;
  --wb-shadow:      0 1px 2px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.25);
  --wb-shadow-lg:   0 8px 32px rgba(0,0,0,0.5);

  /* Pico variable overrides — applied everywhere Pico paints. */
  --pico-background-color: var(--wb-bg);
  --pico-color: var(--wb-text);
  --pico-h1-color: var(--wb-text);
  --pico-h2-color: var(--wb-text);
  --pico-h3-color: var(--wb-text);
  --pico-primary: var(--wb-accent);
  --pico-primary-background: var(--wb-accent);
  --pico-primary-hover: var(--wb-accent-hover);
  --pico-primary-hover-background: var(--wb-accent-hover);
  --pico-primary-focus: var(--wb-accent-glow);
  --pico-primary-inverse: var(--wb-accent-ink);
  --pico-form-element-background-color: var(--wb-bg-inset);
  --pico-form-element-border-color: var(--wb-border);
  --pico-form-element-active-border-color: var(--wb-accent);
  --pico-form-element-focus-color: var(--wb-accent-glow);
  --pico-card-background-color: var(--wb-bg-card);
  --pico-card-border-color: var(--wb-border);
  --pico-muted-color: var(--wb-text-muted);
  --pico-muted-border-color: var(--wb-border);
  --pico-border-radius: var(--wb-radius);
}

/* --------------------------------------------------------------------------
   Global chrome
   -------------------------------------------------------------------------- */

body {
  background: var(--wb-bg);
  color: var(--wb-text);
  font-family: var(--wb-font);
  min-height: 100vh;
  margin: 0;
}

h1, h2, h3 {
  /* Pin heading colour to the design token instead of inheriting
     Pico's ``--pico-h1-color``. Pico's light theme (higher specificity
     than our ``:root`` overrides) would otherwise tint headings
     dark-grey on light-mode browsers, which reads as muted grey on
     the app's always-dark background. */
  color: var(--wb-text);
  letter-spacing: -0.02em;
}

code {
  font-family: var(--wb-mono);
  background: var(--wb-bg-inset);
  color: var(--wb-accent);
  padding: 0.1em 0.4em;
  border-radius: var(--wb-radius-sm);
  font-size: 0.9em;
}

a {
  color: var(--wb-accent);
  text-decoration: none;
}
a:hover {
  color: var(--wb-accent-hover);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

hr {
  border: none;
  border-top: 1px solid var(--wb-border);
  margin: 2rem 0;
}

/* --------------------------------------------------------------------------
   Site nav — top strip, translucent glass with blur
   -------------------------------------------------------------------------- */

.wb-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  /* Three columns pin brand to the left, logout to the right, and
     center the links independently of either side's width. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 1.5rem;
  background: rgba(10, 14, 20, 0.72);
  border-bottom: 1px solid var(--wb-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.wb-nav__brand {
  justify-self: start;
  font-weight: 700;
  color: var(--wb-text);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.wb-nav__brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--wb-accent);
  box-shadow: 0 0 8px var(--wb-accent-glow);
}

.wb-nav__brand:hover {
  text-decoration: none;
  color: var(--wb-text);
}

.wb-nav__links {
  justify-self: center;
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wb-nav__links a {
  color: var(--wb-text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: var(--wb-radius-sm);
  font-size: 0.92rem;
  transition: background 0.15s, color 0.15s;
}
.wb-nav__links a:hover {
  color: var(--wb-text);
  background: var(--wb-bg-elevated);
  text-decoration: none;
}
.wb-nav__links a[aria-current="page"] {
  color: var(--wb-accent);
  background: var(--wb-accent-soft);
}

.wb-nav__spacer { flex-grow: 1; }

.wb-nav form { justify-self: end; margin: 0; }

.wb-nav button.wb-nav__logout {
  background: transparent;
  color: var(--wb-text-muted);
  border: 1px solid var(--wb-border);
  padding: 0.35rem 0.9rem;
  border-radius: var(--wb-radius-sm);
  font-size: 0.88rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.wb-nav button.wb-nav__logout:hover {
  color: var(--wb-text);
  border-color: var(--wb-border-strong);
}

/* --------------------------------------------------------------------------
   Main layout
   -------------------------------------------------------------------------- */

/* Reserve the scrollbar gutter on every page. Without this, a short page
   (e.g. the Telegram binding page) has no vertical scrollbar while taller
   pages do, so the centered layout jumps sideways by the scrollbar width
   as you navigate between them. */
html {
  scrollbar-gutter: stable;
}

.wb-main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.wb-page-title {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}
.wb-page-title__eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--wb-accent);
  margin-bottom: 0.3rem;
}
/* Accent the operator's real name inside the ``Hero, <name>`` greeting
   without also colouring the "Hero," lead-in. Keeps the accent
   applied to a semantic span rather than tinting the whole heading. */
.wb-title-name {
  color: var(--wb-accent);
}
.wb-page-subtitle {
  color: var(--wb-text-muted);
  margin: 0 0 2rem;
  font-size: 1.02rem;
}

/* --------------------------------------------------------------------------
   Cards + feature grid
   -------------------------------------------------------------------------- */

.wb-card {
  background: var(--wb-bg-card);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--wb-shadow);
}

.wb-card--interactive {
  display: block;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.wb-card--interactive:hover {
  transform: translateY(-2px);
  border-color: var(--wb-border-strong);
  box-shadow: var(--wb-shadow-lg);
  text-decoration: none;
  color: inherit;
}
.wb-card--interactive:hover .wb-card__title {
  color: var(--wb-accent);
}

.wb-card__title {
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
  font-weight: 600;
  transition: color 0.15s;
}
.wb-card__body {
  color: var(--wb-text-muted);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.wb-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

/* --------------------------------------------------------------------------
   Landing hero
   -------------------------------------------------------------------------- */

.wb-hero {
  position: relative;
  padding: 5rem 2rem 4rem;
  text-align: center;
  overflow: hidden;
  border-radius: var(--wb-radius);
  margin-bottom: 2rem;
  /* Bare background — the layers stack in ``.wb-hero__bg`` so the
     photo can sit behind the animated conic gradient without any of
     its colour bleed leaking through the radials. */
  background: var(--wb-bg-elevated);
  border: 1px solid var(--wb-border);
}

/* Photo backdrop + colour + dark overlay, all in one absolutely-
   positioned layer so the ``.wb-hero::before`` conic animation stays
   above the image and the text stays above both. The image URL is a
   permissive Unsplash CDN link (Danielle Cerullo — CrossFit box
   action shot). Order of ``background-image`` values (topmost first):

     1. accent radial glow at top-center
     2. cool radial glow at bottom-right
     3. dark linear overlay for contrast against the photo
     4. the photo itself

   Cover-sized so it scales to any hero width. ``saturate(0.6)`` keeps
   the photo from fighting the yellow accent. */
.wb-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1200px 500px at 50% -100px, var(--wb-accent-glow), transparent 60%),
    radial-gradient(700px 400px at 80% 120%, rgba(96, 165, 250, 0.20), transparent 60%),
    linear-gradient(
      180deg,
      rgba(10, 14, 20, 0.55) 0%,
      rgba(10, 14, 20, 0.88) 100%
    ),
    url("https://images.unsplash.com/photo-1517836357463-d25dfeac3438?w=1920&auto=format&fit=crop&q=80");
  background-size: auto, auto, auto, cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(0.6) contrast(1.05);
}

.wb-hero::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 90deg,
    transparent 0deg,
    rgba(248, 255, 64, 0.06) 90deg,
    transparent 180deg,
    rgba(248, 255, 64, 0.06) 270deg,
    transparent 360deg
  );
  animation: wb-spin 24s linear infinite;
  /* Sits ABOVE the photo backdrop but below the text. */
  z-index: 1;
  pointer-events: none;
}

.wb-hero > *:not(.wb-hero__bg) { position: relative; z-index: 2; }

/* Product wordmark. Sits above the eyebrow tagline so unauthenticated
   visitors can identify the app at a glance. Uses the display font
   in a heavier weight with letter-spacing tuned for Oswald's
   condensed proportions. */
.wb-hero__brand {
  font-family: var(--wb-font);
  font-weight: 700;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--wb-text);
  margin: 0 0 1.25rem;
  opacity: 0.92;
}

.wb-hero__eyebrow {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--wb-border-strong);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--wb-accent);
  background: var(--wb-bg-inset);
  margin-bottom: 1.5rem;
}

.wb-hero__title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}
.wb-hero__title .wb-hero__title-accent {
  color: var(--wb-accent);
}

.wb-hero__subtitle {
  color: var(--wb-text-muted);
  font-size: 1.1rem;
  max-width: 34rem;
  margin: 0 auto 2rem;
  line-height: 1.55;
}

.wb-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  background: var(--wb-accent);
  color: var(--wb-accent-ink);
  font-weight: 600;
  border-radius: var(--wb-radius-sm);
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 0 0 var(--wb-accent-glow);
}
.wb-hero__cta:hover {
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--wb-accent-ink);
  box-shadow: 0 6px 20px var(--wb-accent-glow);
}
.wb-hero__cta::after { content: "→"; font-weight: 400; }

.wb-hero__ctas {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

@keyframes wb-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Buttons (dashboard + forms)
   -------------------------------------------------------------------------- */

button, .wb-btn, [role="button"] {
  font-family: var(--wb-font);
  border-radius: var(--wb-radius-sm);
  border: 1px solid var(--wb-border-strong);
  background: var(--wb-bg-elevated);
  color: var(--wb-text);
  padding: 0.55rem 1.1rem;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  /* Anchor icon (emoji / SVG) alongside the label with breathing
     room; matches the app's "icon + word" button style. */
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  /* Guarantee identical box model between ``<a class="wb-btn">``
     and ``<button class="wb-btn">`` — anchors otherwise ship a
     different default line-height and no text-decoration reset,
     which is what made "Edit" and "Delete" appear slightly
     different sizes side-by-side. */
  box-sizing: border-box;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}
button:hover:not(:disabled),
.wb-btn:hover {
  border-color: var(--wb-border-focus);
  background: var(--wb-bg-card);
}
button.wb-btn--primary,
.wb-btn--primary {
  background: var(--wb-accent);
  color: var(--wb-accent-ink);
  border-color: var(--wb-accent);
  font-weight: 600;
}
button.wb-btn--primary:hover,
.wb-btn--primary:hover {
  background: var(--wb-accent-hover);
  border-color: var(--wb-accent-hover);
  color: var(--wb-accent-ink);
}
/* Danger buttons keep the red foreground but wear the same visible
   border + subtle fill as neutral buttons, so a row of "Edit /
   Delete" actions lines up on the same baseline instead of Edit
   looking like a boxed button and Delete looking like a bare link. */
button.wb-btn--danger,
.wb-btn--danger {
  color: var(--wb-danger);
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}
button.wb-btn--danger:hover,
.wb-btn--danger:hover {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.55);
  color: var(--wb-danger);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

form:not(.wb-nav form) label {
  display: block;
  color: var(--wb-text);
  font-weight: 500;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  background: var(--wb-bg-inset);
  color: var(--wb-text);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-sm);
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--wb-accent);
  box-shadow: 0 0 0 3px var(--wb-accent-glow);
}

textarea {
  font-family: var(--wb-mono);
  min-height: 5.5rem;
  resize: vertical;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.2rem;
}
fieldset legend {
  color: var(--wb-text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0;
  margin-bottom: 0.6rem;
}

.wb-field-error {
  color: var(--wb-danger);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.wb-form-error {
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--wb-danger);
  background: rgba(248, 113, 113, 0.10);
  border-radius: var(--wb-radius-sm);
  margin-bottom: 1rem;
  color: var(--wb-text);
}

/* --------------------------------------------------------------------------
   Banners (cookie flow feedback)
   -------------------------------------------------------------------------- */

.banner {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--wb-radius-sm);
  border: 1px solid var(--wb-border);
  border-left-width: 3px;
  background: var(--wb-bg-card);
  color: var(--wb-text);
  font-size: 0.94rem;
}
.banner::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.55em;
  flex-shrink: 0;
}
.banner-valid {
  border-left-color: var(--wb-success);
  background: rgba(74, 222, 128, 0.08);
}
.banner-valid::before   { background: var(--wb-success); box-shadow: 0 0 8px rgba(74,222,128,0.6); }
.banner-rejected {
  border-left-color: var(--wb-danger);
  background: rgba(248, 113, 113, 0.08);
}
.banner-rejected::before { background: var(--wb-danger); box-shadow: 0 0 8px rgba(248,113,113,0.6); }
.banner-unknown {
  border-left-color: var(--wb-warning);
  background: rgba(251, 191, 36, 0.08);
}
.banner-unknown::before  { background: var(--wb-warning); box-shadow: 0 0 8px rgba(251,191,36,0.6); }

/* --------------------------------------------------------------------------
   Status card (cookie page)
   -------------------------------------------------------------------------- */

.status-card {
  background: var(--wb-bg-card);
  border: 1px solid var(--wb-border);
  padding: 1.2rem 1.4rem;
  border-radius: var(--wb-radius);
  margin-bottom: 1.5rem;
}
.status-card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.5rem;
  margin: 0;
}
.status-card dt {
  color: var(--wb-text-muted);
  font-weight: 500;
  font-size: 0.86rem;
}
.status-card dd {
  margin: 0;
  color: var(--wb-text);
  font-variant-numeric: tabular-nums;
}
.status-empty {
  color: var(--wb-text-muted);
  font-style: italic;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Rules — list table + form
   -------------------------------------------------------------------------- */

.wb-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.wb-table-wrap {
  /* Horizontal scroll container for wide data grids. On desktop the
     table fits and nothing scrolls; on phones the grid scrolls inside
     this box instead of forcing the whole page wider than the
     viewport. */
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wb-rules-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--wb-bg-card);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  overflow: hidden;
}
.wb-rules-table th,
.wb-rules-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--wb-border);
  vertical-align: top;
}
.wb-rules-table thead th {
  background: var(--wb-bg-inset);
  color: var(--wb-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.wb-rules-table tbody tr:last-child td { border-bottom: none; }
.wb-rules-table tbody tr:hover { background: rgba(248, 255, 64, 0.03); }
.wb-rules-table .wb-cell-actions {
  /* Keep this a real table cell. Setting display:flex on a <td> pulls it
     out of the table's cell layout into an anonymous cell; when the cell
     is empty (most history rows are not cancellable) that anonymous cell
     renders as a stray dark box at the row's right edge. A plain
     right-aligned cell stays cleanly empty and still lines the action
     buttons up on the right, and the inline-flex buttons keep their
     natural height so Edit and Delete match in size. */
  text-align: right;
  white-space: nowrap;
}
.wb-rules-table .wb-cell-actions .wb-inline-form {
  margin-left: 0.4rem;
}
/* Compact the in-table action buttons (rules Edit/Delete, history
   Cancel). At full size the six-column rules table grew wider than its
   container, so the horizontal-scroll wrapper clipped the trailing
   Delete button at the right edge (the red fill looked cut off).
   Smaller padding keeps the Edit/Delete pair inside the table width. */
.wb-rules-table .wb-cell-actions .wb-btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

/* Class-type value inside the rules table. Uses the brand font rather
   than the monospace ``<code>`` treatment, which read as an out-of-place
   chip next to the rest of the condensed UI type. */
.wb-class-name {
  font-family: var(--wb-font);
  font-weight: 600;
}

.wb-preflist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.wb-preflist li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
}
.wb-preflist li::before {
  content: attr(data-index);
  display: inline-block;
  min-width: 1.4rem;
  text-align: center;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: var(--wb-bg-inset);
  color: var(--wb-text-muted);
  font-family: var(--wb-mono);
  font-size: 0.72rem;
}

.wb-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--wb-bg-card);
  border: 1px dashed var(--wb-border-strong);
  border-radius: var(--wb-radius);
  color: var(--wb-text-muted);
}
.wb-empty-state__title { color: var(--wb-text); font-size: 1.05rem; margin: 0 0 0.35rem; }

/* --------------------------------------------------------------------------
   Chips + badges
   -------------------------------------------------------------------------- */

.wb-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  background: var(--wb-bg-inset);
  border: 1px solid var(--wb-border);
  border-radius: 999px;
  color: var(--wb-text);
  font-size: 0.82rem;
  font-weight: 500;
}
.wb-chip--accent {
  background: var(--wb-accent-soft);
  border-color: rgba(248, 255, 64, 0.35);
  color: var(--wb-accent);
}
.wb-chip--muted {
  color: var(--wb-text-muted);
}

/* --------------------------------------------------------------------------
   Denial / error pages
   -------------------------------------------------------------------------- */

.wb-denied {
  text-align: center;
  padding: 5rem 1.5rem;
  max-width: 32rem;
  margin: 0 auto;
}
.wb-denied h1 {
  color: var(--wb-danger);
  margin: 0 0 1rem;
}
.wb-denied p {
  color: var(--wb-text-muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.wb-mono { font-family: var(--wb-mono); }
.wb-muted { color: var(--wb-text-muted); }
.wb-tabular { font-variant-numeric: tabular-nums; }
.wb-mb-0 { margin-bottom: 0 !important; }
.wb-mb-lg { margin-bottom: 2rem; }

/* Respect users who prefer no motion. */
@media (prefers-reduced-motion: reduce) {
  .wb-hero::before,
  .wb-hero__cta {
    animation: none !important;
  }
  .wb-card--interactive {
    transition: none;
  }
}


/* --------------------------------------------------------------------------
   Alert banner stack (dashboard, US2.7)
   -------------------------------------------------------------------------- */

.wb-banner-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 2rem;
}

.wb-banner {
  display: flex;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--wb-radius);
  border: 1px solid var(--wb-border);
  background: var(--wb-bg-card);
  border-left-width: 4px;
}

.wb-banner__body {
  flex: 1;
  min-width: 0;
}

.wb-banner__heading {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--wb-text);
}

.wb-banner__text {
  margin: 0;
  color: var(--wb-text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.wb-banner--warning {
  border-left-color: var(--wb-warning);
  background: rgba(251, 191, 36, 0.06);
}

.wb-banner--error {
  border-left-color: var(--wb-danger);
  background: rgba(248, 113, 113, 0.06);
}


/* --------------------------------------------------------------------------
   24h time picker wrapper (Flatpickr-enhanced input)

   The visible <input> lives inside .wb-time-picker. Icon and popover
   styling come from static/flatpickr-theme.css so this file stays
   framework-agnostic.
   -------------------------------------------------------------------------- */

.wb-time-picker {
  /* Fill the grid cell so the class-time control lines up exactly with
     the full-width <select> next to it (both sit in equal 1fr columns). */
  display: flex;
  width: 100%;
  align-items: center;
}


/* ==========================================================================
   UI polish pass — mobile legibility, chips, custom modal, countdown
   ========================================================================== */

/* -- Font family safety net ---------------------------------------------- */

body {
  /* Force our stack regardless of what Pico or a stray sheet sets.
     Inter loads from rsms.me; if the CDN is slow the fallback is a
     modern OS UI font, never Times. */
  font-family: var(--wb-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* -- Chips: extra semantic variants -------------------------------------- */

.wb-chip--success {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--wb-success);
}

.wb-chip--danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--wb-danger);
}

.wb-chip--info {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.45);
  color: var(--wb-info);
}

/* -- Custom confirmation modal (<dialog>) -------------------------------- */

dialog.wb-confirm {
  padding: 0;
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius);
  background: var(--wb-bg-card);
  color: var(--wb-text);
  box-shadow: var(--wb-shadow-lg);
  max-width: min(24rem, calc(100vw - 2rem));
  width: 100%;
}

dialog.wb-confirm::backdrop {
  background: rgba(4, 6, 10, 0.7);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.wb-confirm__form {
  margin: 0;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.wb-confirm__title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--wb-text);
}

.wb-confirm__body {
  margin: 0;
  color: var(--wb-text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.wb-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

/* Cancel button inside the confirm modal.
   Rendered as a solid-red "STOP this operation" button — the operator
   reads red as "abort", not as "the destructive choice". Locked with
   a strong selector so the shared ``.wb-btn:hover`` accent (yellow
   border-focus) cannot leak in and desaturate the fill. */
button.wb-confirm__cancel,
.wb-confirm__cancel {
  background: var(--wb-danger);
  color: #0a0e14;
  border-color: var(--wb-danger);
  font-weight: 600;
}
button.wb-confirm__cancel:hover,
.wb-confirm__cancel:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #0a0e14;
}
button.wb-confirm__cancel:focus,
.wb-confirm__cancel:focus,
button.wb-confirm__cancel:focus-visible,
.wb-confirm__cancel:focus-visible {
  border-color: var(--wb-danger);
  outline: none;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.35);
}

/* -- Countdown block on the dashboard ------------------------------------ */

.wb-countdown {
  margin: 0 0 2rem;
  padding: 1.15rem 1.35rem;
  background: var(--wb-bg-card);
  border: 1px solid var(--wb-border);
  border-left: 4px solid var(--wb-accent);
  border-radius: var(--wb-radius);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wb-countdown--firing {
  border-left-color: var(--wb-success);
}

.wb-countdown--empty {
  border-left-color: var(--wb-border-strong);
}

.wb-countdown__label {
  color: var(--wb-text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wb-countdown__timer {
  color: var(--wb-accent);
  font-family: var(--wb-mono);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.1;
}

.wb-countdown--empty .wb-countdown__timer {
  color: var(--wb-text-subtle);
}

.wb-countdown--firing .wb-countdown__timer {
  color: var(--wb-success);
}

.wb-countdown__hint {
  color: var(--wb-text-muted);
  font-size: 0.85rem;
}

/* -- Nav brand: short label on narrow screens, full label otherwise ------ */

.wb-nav__brand-short {
  display: none;
}

@media (max-width: 640px) {
  .wb-nav__brand-full {
    display: none;
  }
  .wb-nav__brand-short {
    display: inline;
  }
}

/* -- Mobile-specific tweaks: contrast + readable metrics ----------------- */

@media (max-width: 720px) {
  :root {
    /* Lift the muted text one notch so low-brightness phone screens
       and outdoor readers still hit ~5:1 contrast on cards. */
    --wb-text-muted:  #b0bbca;
    --wb-text-subtle: #7a8699;
  }

  .wb-page-title {
    font-size: 1.55rem;
    line-height: 1.2;
  }
  .wb-page-subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
  }
  .wb-nav {
    /* Two-tier layout on phones: brand + logout share the top row,
       and the nav links wrap onto full-width rows below so every
       destination is visible and tappable without horizontal
       scrolling. */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.7rem 1rem;
    gap: 0.6rem 0.75rem;
  }
  .wb-nav__brand {
    order: 1;
    margin-right: auto;
  }
  .wb-nav form {
    order: 2;
  }
  .wb-nav__links {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    justify-self: auto;
    flex-wrap: wrap;
    overflow: visible;
    gap: 0.4rem;
    margin-top: 0.2rem;
  }
  .wb-nav__links a {
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
    white-space: nowrap;
    border: 1px solid var(--wb-border);
  }
  .wb-nav__links a[aria-current="page"] {
    border-color: rgba(248, 255, 64, 0.35);
  }
  .wb-nav__logout {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
  }

  /* Wide data grids scroll inside their frame instead of forcing the
     whole page wider than the viewport. Single-line cells keep the
     columns predictable while the operator swipes across. */
  .wb-rules-table th,
  .wb-rules-table td {
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------------------
   Utility classes (replaces one-off ``style="..."`` attributes)
   -------------------------------------------------------------------------- */

/* Small muted note under a form field or paragraph.
   Two sizes so a single class covers the two densities the pages use. */
.wb-note {
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
}
.wb-note--framed {
  /* Under a section title, needs bottom breathing room. */
  margin: 0.5rem 0 1rem;
}
.wb-note--xs {
  font-size: 0.78rem;
}

/* Row of form actions (Save + Cancel) at the bottom of a form. */
.wb-form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

/* ``<form>`` used purely as a CSRF wrapper around a single button
   inside a table cell — kept inline so the button lines up with
   neighbouring anchors instead of breaking to a new row. */
.wb-inline-form {
  display: inline;
  margin: 0;
}

/* Standalone paragraph anchored below a hero title on plain pages
   (e.g. auth/denied). */
.wb-hero-note {
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   Upcoming bookings (history H.1 full)
   -------------------------------------------------------------------------- */

.wb-section-title {
  font-size: 1.1rem;
  margin: 0 0 0.85rem;
  color: var(--wb-text);
}
.wb-section-title--spaced {
  margin-top: 2.5rem;
}

.wb-upcoming {
  margin-bottom: 2rem;
}

.wb-upcoming__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.wb-upcoming__day {
  padding: 0.9rem 1rem;
  background: var(--wb-bg-card);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
}

.wb-upcoming__date {
  font-weight: 600;
  color: var(--wb-accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.wb-upcoming__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wb-upcoming__item {
  /* Stack each slot vertically — time, then class, then status — so the
     layout stays identical regardless of the class name length. Short
     names no longer sit inline with the time while long ones wrap. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--wb-border);
}
.wb-upcoming__item:first-child {
  border-top: none;
  padding-top: 0;
}

.wb-upcoming__time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--wb-text);
  min-width: 3.2rem;
}

.wb-upcoming__class {
  /* Match the time label's font (brand, not monospace) so the class name
     and the hour read as one coherent tile. */
  font-family: var(--wb-font);
  color: var(--wb-text);
}

.wb-upcoming__cancel {
  margin-left: 0;
}
.wb-upcoming__cancel .wb-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
}

/* Small status chip inside an upcoming slot (granted vs pending). */
.wb-upcoming__chip {
  font-size: 0.72rem;
  padding: 0.12rem 0.5rem;
}
/* ``.wb-chip--pending`` is scoped to the upcoming grid — no other
   surface uses a "pending" state today. Muted blue to avoid
   competing with the accent yellow used by the "granted" chip. */
.wb-chip--pending {
  background: rgba(96, 165, 250, 0.10);
  color: var(--wb-info);
  border-color: var(--wb-info);
}
/* In the stacked column layout the status chip sits on its own row and
   left-aligns with the time and class above it. */
.wb-upcoming__item--pending .wb-upcoming__chip {
  margin-left: 0;
}
