@font-face {
  font-family: 'Telegraf';
  src: url('/fonts/telegraf-ultrabold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Light Upon Light, Turkey 2027
 * Theme: refined-hospitality. Accent: champagne gold #B89B5E.
 * Accessibility: skip-link, landmarks, aria-current, aria-live flash, focus-ring,
 * reduced-motion.
 *
 * Visual language (champagne, cream, ink):
 *   - Cream paper background (#FAF7F0); warm card surface (#FBF6EA)
 *   - Champagne-gold primary accent (#B89B5E); moss for paid/confirmed (#3A5F4A)
 *   - Geist for headlines and body; JetBrains Mono for refs, dates and amounts
 *   - Type scale: 11 (eyebrow) / 13 / 14 / 16 / 19 / 26 / 32 / 48 px
 *   - 8px rounded rectangles, 10–12px cards, sun-disc decorative motif
 *   - Heavy use of near-black brand surfaces ("ink") for primary CTAs and admin sidebar
 */

:root {
  /* ---- Champagne palette tokens ----
     `--ink` / `--paper` are CONTENT tokens - they flip in dark mode so body
     text and backgrounds invert correctly. `--brand-*` tokens are CHROME
     tokens - fixed regardless of theme, used on always-dark surfaces (admin
     sidebar, ink CTAs, ref-hero, hero-dark, chat fab). Otherwise dark mode
     would invert those surfaces too and the sidebar would render in cream. */
  --ink:        #1A1814;
  --ink-2:      #332E26;
  --ink-3:      #807968;
  --paper:      #FAF7F0;
  --paper-2:    #F1ECDF;
  --paper-3:    #E6DDCA;
  --card:       #FBF6EA;
  --line:       #DBD1BC;
  --line-2:     #B9AD8F;
  --champagne:   #B89B5E;
  --champagne-2: #8E7642;
  --teal:       #3A5F4A;
  --teal-2:     #1F3A2D;
  --saffron:    #A88746;
  --sky:        #E2DAC6;
  --ok:         #3A5F4A;
  --warn:       #8E7642;
  --bad:        #9A5642;

  /* Brand-fixed tokens - DO NOT redefine in the dark-mode block. */
  --brand-ink:       #1A1814;
  --brand-ink-2:     #2A2620;
  --brand-paper:     #FAF7F0;
  --brand-paper-2:   #F1ECDF;
  --brand-champagne: #B89B5E;
  --brand-line:      rgba(245,240,230,0.1);

  /* Legacy palette aliases, re-pointed at the active tokens so older
     templates rebrand for free. */
  --color-stormcloud-ink: var(--ink);
  --color-deep-slate:     var(--ink-2);
  --color-slate-text:     var(--ink-2);
  --color-light-slate:    var(--ink-3);
  --color-ash-border:     var(--line);
  --color-page-background:var(--paper);
  --color-pure-white:     var(--card);

  /* The "sage" alias is what every legacy view binds its accent to. */
  --color-sage:        var(--champagne);
  --color-sage-dark:   var(--champagne-2);
  --color-sage-tint:   var(--paper-2);
  --color-sage-soft:   var(--paper-3);

  --color-mist:    var(--paper-3);
  --color-stone:   #E6DDCA;
  --color-pine:    var(--teal);
  --color-clay:    #C6A78A;

  /* Semantic statuses (warm hospitality, not saturated dashboards) */
  --color-ok-fg:   #1F3A2D;  --color-ok-bg:   #E2EBE3;  --color-ok-line:  #B7CFBE;
  --color-warn-fg: #5A4319;  --color-warn-bg: #F2E4C5;  --color-warn-line:#DDC692;
  --color-err-fg:  #5A2418;  --color-err-bg:  #EFD9CF;  --color-err-line: #D9B3A2;
  --color-info-fg: var(--ink-2); --color-info-bg: var(--paper-2); --color-info-line: var(--line);

  /* ---- Typography ---- */
  --font-display: 'Geist', 'Söhne', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body:    'Geist', 'Söhne', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans:    var(--font-body);
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-caption:    11px;
  --text-body-sm:    13px;
  --text-body:       14px;
  --text-subheading: 19px;
  --text-heading:    26px;
  --text-heading-lg: 32px;
  --text-display:    48px;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 500;
  --fw-bold:     500; /* The design uses 500 as its "strong" weight throughout */

  /* ---- Spacing ---- */
  --s-8: 8px;   --s-16: 16px;  --s-24: 24px;
  --s-32: 32px; --s-40: 40px;  --s-48: 48px;  --s-64: 64px;

  /* ---- Radii ---- */
  --r-input:  8px;
  --r-card:   10px;
  --r-md:     8px;
  --r-pill:   4px;
  --r-sm:     6px;
  --r-lg:     12px;
  --radius:   var(--r-input);
  --radius-lg:var(--r-card);

  /* ---- Shadows ---- */
  --shadow-sm:     0 1px 0 rgba(26,24,20,.04), 0 1px 2px rgba(26,24,20,.06);
  --shadow-md:     0 1px 0 rgba(26,24,20,.04), 0 10px 30px -12px rgba(26,24,20,.18);
  --shadow-card:   0 1px 0 rgba(26,24,20,.04), 0 24px 60px -24px rgba(26,24,20,.22);
  --shadow-focus:  0 0 0 3px rgba(184,155,94,.32);

  /* ---- Layout ---- */
  --maxw: 1240px;
  --nav-h: 72px;
  --section-gap: 48px;

  /* Aliases for legacy class refs */
  --bg: var(--paper);
  --bg-alt: var(--paper-2);
  --bg-soft: var(--paper-3);
  --accent: var(--champagne);
  --accent-2: var(--champagne-2);
  --accent-tint: var(--paper-2);
  --warn-bg: var(--color-warn-bg);
  --ok-bg: var(--color-ok-bg);
  --err: var(--color-err-fg); --err-bg: var(--color-err-bg);
  --info: var(--color-info-fg); --info-bg: var(--color-info-bg);
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* overflow-x:hidden is only on body. Putting it on html as well makes html
   a scrolling container and breaks `position: sticky` on the page header
   in mobile Safari/Chrome (sticky element resolves to the html scroll
   container instead of the viewport, and never engages). */
body { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > footer { margin-top: auto; }

img, svg { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--champagne-2); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 .5em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(32px, 5vw, var(--text-display)); line-height: 1.05; letter-spacing: -0.025em; }
h2 { font-size: clamp(24px, 3vw, var(--text-heading-lg)); line-height: 1.1; }
h3 { font-size: var(--text-subheading); line-height: 1.25; }
h4 { font-size: var(--text-body); line-height: 1.43; }
p  { margin: 0 0 1em; color: var(--ink-2); line-height: 1.55; text-wrap: pretty; }
small, .muted { color: var(--ink-3); font-size: var(--text-body-sm); }
.text-soft { color: var(--ink-3); }

.mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1, 'zero' 1; }
.num  { font-feature-settings: 'tnum' 1, 'lnum' 1; }
.eyebrow {
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.divider { height: 1px; background: var(--line); width: 100%; }
.divider-dash {
  height: 1px; width: 100%;
  background-image: linear-gradient(to right, var(--line-2) 50%, transparent 0%);
  background-size: 8px 1px; background-repeat: repeat-x;
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: absolute; width: auto; height: auto;
  padding: 10px 16px; margin: 0;
  overflow: visible; clip: auto;
  top: 8px; left: 8px;
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-md); z-index: 100;
  text-decoration: none; font-weight: var(--fw-medium);
}
.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; }
:focus-visible { outline: 2px solid var(--champagne); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

.container, .wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; width: 100%; }
@media (min-width: 600px) { .container, .wrap { padding: 0 24px; } }
.wrap { padding-top: var(--s-24); padding-bottom: var(--s-48); }
@media (min-width: 760px) { .wrap { padding-top: var(--s-40); padding-bottom: var(--s-64); } }

/* On desktop the wrap does NOT clip/scroll, so the PAGE (window) is the scroll
   container and the table header can stick to the top of the viewport (see
   `.table th` below). On mobile we switch this to overflow-x:auto so wide tables
   scroll sideways instead of cramming (overridden in the mobile block). */
.table-wrap { max-width: 100%; }
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-track { background: var(--paper); border-radius: 999px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 2px solid var(--paper); }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
pre, code { overflow-wrap: anywhere; word-break: break-word; }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }
.pagination .is-disabled { opacity: .45; pointer-events: none; cursor: default; }

/* ---------- Nav (top bar, fixed) ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(250, 247, 240, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-16); padding: 0 16px;
  max-width: var(--maxw); margin: 0 auto;
  height: var(--nav-h);
}
@media (min-width: 600px) { .nav-inner { padding: 0 24px; } }

/* Brand lockup - champagne L-tile + serif-feeling sans wordmark */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand .mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: url("/logo.png") center/contain no-repeat;
  flex-shrink: 0; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.brand:hover .mark { transform: rotate(-4deg) scale(1.04); }
.brand strong { font-family: 'Telegraf', var(--font-display); font-weight: 800; letter-spacing: -0.015em; font-size: 17px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; font-weight: var(--fw-regular); font-size: 11px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.005em; }
/* Hide the brand subtitle whenever the mobile burger menu is showing, so the
   wordmark sits at the optical centre of the bar instead of being pushed up
   by the (stacked-below) subtitle. Breakpoint matches the .nav-burger
   media query at 760px. */
@media (max-width: 760px) { .brand small { display: none; } }

.nav-links { display: none; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--ink); font-weight: var(--fw-regular); font-size: 13px;
  text-decoration: none; position: relative; opacity: 0.7;
  transition: opacity .15s ease;
}
.nav-links a:hover { opacity: 1; }
.nav-links a[aria-current="page"] { opacity: 1; font-weight: var(--fw-medium); }
.nav-cta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
@media (min-width: 760px) { .nav-links { display: flex; } }

/* ---------- BUTTONS ----------
   Primary = ink. Champagne (.btn-pom / .btn-accent) is used on the lead
   booking CTA. Soft and ghost provide secondary and tertiary variants.
*/
.btn {
  --mx: 50%; --my: 50%;
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-md);
  font-family: inherit; font-weight: var(--fw-medium);
  border: 1px solid transparent; cursor: pointer;
  font-size: 13.5px; line-height: 1.25;
  text-decoration: none; white-space: nowrap;
  overflow: hidden;
  letter-spacing: -0.005em;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease,
              transform .15s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--shadow-focus); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.btn-primary, .btn-ink {
  background: var(--brand-ink); color: var(--brand-paper);
}
.btn-primary:hover, .btn-ink:hover { background: var(--brand-ink-2); color: var(--brand-paper); text-decoration: none; }

.btn-pom, .btn-accent {
  background: var(--brand-champagne); color: var(--brand-ink);
}
.btn-pom:hover, .btn-accent:hover { background: var(--champagne-2); color: var(--brand-paper); text-decoration: none; }

.btn-ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.btn-soft {
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
}
.btn-soft:hover { background: var(--paper-2); border-color: var(--line-2); text-decoration: none; }

.btn-danger { background: var(--bad); color: var(--paper); }
.btn-danger:hover { background: #7c4434; color: var(--paper); text-decoration: none; }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 12px; line-height: 1.25; }
.btn-lg { padding: 16px 26px; font-size: 15px; line-height: 1.25; }

.btn.is-pressed { animation: btn-bounce 320ms cubic-bezier(.34, 1.56, .64, 1); }
@keyframes btn-bounce { 0% { transform: scale(0.94); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { max-width: var(--maxw); margin: 0 auto; padding: var(--s-16) 16px 0; width: 100%; }
@media (min-width: 600px) { .breadcrumbs { padding-left: 24px; padding-right: 24px; } }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumbs li + li::before { content: "/"; color: var(--ink-3); margin: 0 4px; }
.breadcrumbs a { color: var(--ink-3); text-decoration: none; padding: 4px 0; transition: color .15s ease; }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: var(--fw-medium); }

/* ---------- HERO - dark champagne treatment (landing) ---------- */
/* The main marketing hero. Dark ink background, hero image slot, stat strip. */
.hero-dark {
  background: #16140F;
  color: var(--brand-paper);
  margin: 16px; border-radius: var(--r-card);
  overflow: hidden; position: relative;
  isolation: isolate;
}
.hero-dark::before {
  /* Sun-disc accent - a single restrained motif from the design. */
  content: ""; position: absolute;
  right: -120px; top: -120px;
  width: 280px; height: 280px; border-radius: 50%;
  background: var(--champagne); opacity: 0.6;
  z-index: 0;
}

/* Ring layer: the big resort-photo circle plus a constellation of smaller
   solid + outline circles. Sits behind the title text (z-index 0) so the
   hero-dark-inner content reads through it. Hidden on narrow screens where
   the title needs the whole frame. */
.hero-rings {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; /* Safari < 14.1 lacks `inset` shorthand */
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.hero-ring {
  position: absolute;
  border-radius: 50%;
  display: block;
}
.hero-ring-photo {
  /* The "big" circle - resort photo in a cropped disc with a soft champagne
     halo so it sits inside the dark hero without a hard edge. */
  right: clamp(-160px, -8vw, -40px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(360px, 46vw, 620px);
  height: clamp(360px, 46vw, 620px);
  overflow: hidden;
  box-shadow:
    0 0 0 8px rgba(245,240,230,0.05),
    0 0 0 18px rgba(184,155,94,0.18),
    0 30px 80px -20px rgba(0,0,0,0.6);
}
.hero-ring-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.92) saturate(1.05);
}
.hero-ring-photo-empty {
  background:
    radial-gradient(circle at 30% 30%, rgba(245,240,230,0.06), transparent 60%),
    linear-gradient(135deg, #2a2520 0%, #1a1812 100%);
}
.hero-ring-accent {
  background: var(--champagne);
  opacity: 0.35;
}
.hero-ring-accent-a {
  /* Small champagne disc tucked low-right, near the photo's bottom curve. */
  right: clamp(80px, 18vw, 220px);
  bottom: -40px;
  width: 110px; height: 110px;
  opacity: 0.55;
}
.hero-ring-accent-b {
  /* Tiny floating accent above the stats strip. */
  right: clamp(220px, 28vw, 380px);
  top: clamp(40px, 8vw, 90px);
  width: 56px; height: 56px;
  background: var(--teal-2);
  opacity: 0.7;
}
.hero-ring-accent-c {
  /* Pinprick highlight off to the upper-left of the photo. */
  right: clamp(360px, 40vw, 520px);
  top: clamp(160px, 22vw, 260px);
  width: 22px; height: 22px;
  background: var(--brand-paper);
  opacity: 0.6;
}
.hero-ring-outline {
  background: transparent;
  border: 1px solid rgba(245,240,230,0.16);
}
.hero-ring-outline-a {
  /* Big ring that frames the photo with breathing room. */
  right: clamp(-220px, -12vw, -100px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(440px, 56vw, 760px);
  height: clamp(440px, 56vw, 760px);
}
.hero-ring-outline-b {
  /* Smaller ring drifting in from bottom-left. */
  left: clamp(-60px, -4vw, 0px);
  bottom: clamp(-100px, -8vw, -40px);
  width: clamp(140px, 18vw, 220px);
  height: clamp(140px, 18vw, 220px);
  border-color: rgba(184,155,94,0.4);
}

/* On narrow screens the rings would crowd the headline - fade them out and
   keep only a small accent in the corner. */
@media (max-width: 760px) {
  .hero-ring-photo,
  .hero-ring-outline-a { display: none; }
  .hero-ring-accent-a { right: -30px; bottom: -50px; width: 130px; height: 130px; opacity: 0.4; }
  .hero-ring-accent-b,
  .hero-ring-accent-c,
  .hero-ring-outline-b { display: none; }
}
.hero-dark-inner {
  position: relative; z-index: 1;
  padding: clamp(32px, 6vw, 64px) clamp(24px, 4vw, 48px);
  min-height: 540px;
  display: flex; flex-direction: column; gap: 22px;
  background:
    linear-gradient(180deg, rgba(22,20,15,0.55) 0%, rgba(22,20,15,0.25) 40%, rgba(22,20,15,0.85) 100%),
    linear-gradient(90deg, rgba(22,20,15,0.65) 0%, rgba(22,20,15,0.10) 50%, rgba(22,20,15,0.30) 100%);
}
.hero-dark .eyebrow { color: rgba(245,240,230,0.75); letter-spacing: 0.14em; }
.hero-dark h1 {
  color: var(--brand-paper);
  font-size: clamp(40px, 7vw, 84px);
  font-weight: var(--fw-medium); letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 2px 24px rgba(0,0,0,0.4);
  max-width: 780px;
}
.hero-dark .lede {
  color: rgba(245,240,230,0.88);
  font-size: 16px; line-height: 1.55;
  max-width: 480px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.4);
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.hero-cta .btn-glass {
  background: rgba(245,240,230,0.1); color: var(--brand-paper);
  border: 1px solid rgba(245,240,230,0.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hero-cta .btn-glass:hover { background: rgba(245,240,230,0.18); color: var(--brand-paper); }

/* Stat strip across the bottom of the hero */
.hero-stats {
  margin-top: auto;
  border-top: 1px solid rgba(245,240,230,0.22);
  padding-top: 18px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.hero-stats > div {
  padding: 0 16px;
  border-left: 1px solid rgba(245,240,230,0.18);
}
.hero-stats > div:first-child { border-left: 0; padding-left: 0; }
.hero-stats strong {
  display: block; font-family: var(--font-display);
  font-size: 24px; letter-spacing: -0.02em; font-weight: var(--fw-medium);
}
.hero-stats span {
  display: block; font-size: 12px;
  color: rgba(245,240,230,0.7); margin-top: 4px;
}
@media (max-width: 760px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 18px 16px; }
  .hero-stats > div:nth-child(odd) { border-left: 0; padding-left: 0; }
}

/* Legacy hero (used by search-card on /rooms) keeps a paper variant */
.hero { padding: var(--s-32) 0 var(--s-32); background: var(--paper); }
.hero .lede { font-size: 18px; max-width: 640px; color: var(--ink-3); margin-bottom: 8px; line-height: 1.45; }
.hero .label {
  display: inline-block; padding: 4px 10px;
  background: var(--paper-2); color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: var(--fw-medium);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: var(--s-24);
}
.hero-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; margin-top: var(--s-40); max-width: 720px; }
.hero-meta > div {
  font-size: 12px; color: var(--ink-3);
  border-top: 1px solid var(--line); padding-top: 12px;
}
.hero-meta strong {
  display: block; font-family: var(--font-display);
  font-size: 22px; color: var(--ink);
  font-weight: var(--fw-medium); letter-spacing: -0.02em;
  margin-bottom: 2px;
}
@media (min-width: 760px) { .hero-meta { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Search card ---------- */
.search-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: var(--s-16);
  margin-top: var(--s-32);
  box-shadow: var(--shadow-sm);
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-16); align-items: end;
}
@media (min-width: 760px) {
  .search-card { grid-template-columns: 1fr 1fr 1fr 1fr auto; padding: var(--s-24); gap: var(--s-16); }
}
.search-card label, .search-card .search-label {
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: var(--fw-medium); display: block; margin-bottom: 6px;
}
/* Fixed retreat dates: shown as plain, non-interactive text (not a date input)
   so they read as a stated fact, never as an editable / clickable control.
   No border, no cursor pointer, no focus ring, no hover affordance. */
.search-card .search-static {
  margin: 0; padding: 12px 0;
  font: inherit; color: var(--ink); font-weight: var(--fw-medium);
  background: transparent; border: 0;
  cursor: default; user-select: none; pointer-events: none;
}
.search-card input, .search-card select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-input);
  font: inherit; background: var(--card); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-card input:focus, .search-card select:focus { outline: none; border-color: var(--ink); box-shadow: var(--shadow-focus); }
.search-card button { grid-column: 1/-1; }
@media (min-width: 760px) { .search-card button { grid-column: auto; } }

/* ---------- Sections ---------- */
.section { padding: var(--s-48) 0; }
@media (min-width: 760px) { .section { padding: var(--s-64) 0; } }
.section.alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { margin-bottom: 10px; }
.section .lede { color: var(--ink-3); margin-bottom: var(--s-32); max-width: 640px; font-size: 18px; line-height: 1.45; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: var(--s-24); }
@media (min-width: 600px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .cards { grid-template-columns: 1fr 1fr 1fr; } }
@media (min-width: 960px) { .cards.two  { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .cards.four { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, transform .25s cubic-bezier(.34, 1.2, .64, 1), border-color .15s ease;
  text-decoration: none; color: inherit; display: block;
}
/* Only anchor cards are clickable; static div/form/details panels keep flat. */
a.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-2); }
a.card:active { transform: translateY(0) scale(0.997); transition-duration: .1s; }
.card-img-wrap { aspect-ratio: 4/3; overflow: hidden; background: var(--paper-3); position: relative; }
.card-img-wrap::after {
  /* faint diagonal hatching - matches the design's placeholder ribbon */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(135deg, rgba(20,18,16,.04) 0 1px, transparent 1px 14px);
}
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.22, .61, .36, 1); position: relative; z-index: 1; }
a.card:hover .card-img-wrap img { transform: scale(1.04); }
.card-body { padding: var(--s-16) var(--s-24) var(--s-24); }
.card-body h3 { margin: 0 0 6px; font-weight: var(--fw-medium); font-size: var(--text-subheading); color: var(--ink); }
.card-body .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; line-height: 1.5; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-price { font-family: var(--font-display); font-weight: var(--fw-medium); font-size: var(--text-subheading); color: var(--ink); }
.card-price small { font-weight: var(--fw-regular); font-size: 11px; color: var(--ink-3); display: block; margin-top: 2px; }

/* ---------- Room listing cards (/rooms) ---------- */
.room-cards { gap: var(--s-24); }
.room-card { display: flex; flex-direction: column; }
.room-card .card-img-wrap { aspect-ratio: 3/2; }
/* Availability / bundle badges float over the photo, top-left. */
.room-card-badges { position: absolute; z-index: 2; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.room-card-badges .pill { box-shadow: 0 1px 3px rgba(26,24,20,.18); backdrop-filter: saturate(1.1); }
.room-card-body { display: flex; flex-direction: column; flex: 1; padding: var(--s-16) var(--s-24) var(--s-24); }
.room-card-title { margin: 0 0 4px; font-size: 21px; font-weight: var(--fw-medium); letter-spacing: -0.015em; line-height: 1.2; }
.room-card-sub { margin: 0; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.room-card-foot { margin-top: auto; padding-top: var(--s-16); }
.room-card-meta {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.room-card-sleeps { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.room-card-sleeps svg { color: var(--ink-3); opacity: .8; }
.room-card-price { text-align: right; line-height: 1; }
.room-card-price small { display: block; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.room-card-price strong { font-family: var(--font-display); font-size: 22px; font-weight: var(--fw-medium); letter-spacing: -0.02em; color: var(--ink); }
.room-card-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 13px; font-weight: var(--fw-medium); color: var(--teal-2);
}
.room-card-cta span { transition: transform .25s cubic-bezier(.22,.61,.36,1); }
a.room-card:hover .room-card-cta span { transform: translateX(3px); }

/* ---------- Results list - Booking.com pattern room cards ---------- */
.variation {
  display: grid; grid-template-columns: 1fr;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  margin-bottom: var(--s-16);
  transition: border-color .15s ease, box-shadow .2s ease;
}
.variation:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
@media (min-width: 760px) {
  .variation { grid-template-columns: 200px 1fr 220px; align-items: stretch; }
}
.variation .v-img {
  position: relative;
  aspect-ratio: 4/3; background: var(--paper-3); overflow: hidden;
}
.variation .v-img::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(135deg, rgba(20,18,16,.04) 0 1px, transparent 1px 14px);
}
.variation .v-img img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
@media (min-width: 760px) { .variation .v-img { aspect-ratio: auto; min-height: 180px; } }
.variation > div:nth-child(2) { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.variation h3 { margin: 0 0 2px; font-weight: var(--fw-medium); font-size: var(--text-subheading); }
.variation .v-sub { color: var(--ink-3); font-size: 13px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper-2); color: var(--ink-2);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-body); font-weight: var(--fw-medium);
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line);
}
.pill-ink { background: var(--brand-ink); color: var(--brand-paper); border-color: var(--brand-ink); }
.pill-pom { background: var(--brand-champagne); color: var(--brand-ink); border-color: var(--brand-champagne); }
.pill-teal{ background: var(--teal); color: var(--brand-paper); border-color: var(--teal); }
.pill-ok  { background: var(--color-ok-bg); color: var(--color-ok-fg); border-color: var(--color-ok-line); }
.pill-warn{ background: var(--color-warn-bg); color: var(--color-warn-fg); border-color: var(--color-warn-line); }
.pill-bad { background: var(--color-err-bg); color: var(--color-err-fg); border-color: var(--color-err-line); }
.variation .price {
  padding: 18px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between;
  gap: 12px;
}
@media (min-width: 760px) {
  .variation .price { border-top: 0; border-left: 1px solid var(--line); background: var(--paper-2); }
}
.variation .price strong {
  display: block; font-family: var(--font-display);
  font-size: 28px; font-weight: var(--fw-medium);
  color: var(--ink); letter-spacing: -0.02em; line-height: 1;
}
.variation .price small { color: var(--ink-3); font-size: 11px; margin-top: 4px; }
.variation .price .v-note { max-width: 200px; text-align: right; line-height: 1.35; margin-top: 8px; }
.v-instalment {
  display: inline-flex; align-items: center; margin-top: 8px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--paper-3); color: var(--teal-2);
  font-size: 11px; font-weight: var(--fw-medium); letter-spacing: 0.01em;
}

/* ---------- Room detail ---------- */
.detail-hero { display: grid; gap: 8px; grid-template-columns: 1fr; margin: var(--s-16) 0 var(--s-32); }
.detail-hero .main { grid-column: 1/-1; aspect-ratio: 16/9; border-radius: var(--r-card); overflow: hidden; background: var(--paper-3); box-shadow: var(--shadow-sm); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero .thumb { aspect-ratio: 1/1; border-radius: var(--r-card); overflow: hidden; background: var(--paper-3); display: none; }
@media (min-width: 760px) {
  .detail-hero { grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
  .detail-hero .main { grid-column: 1/2; grid-row: 1/3; aspect-ratio: auto; height: 480px; }
  .detail-hero .thumb { display: block; height: 236px; aspect-ratio: auto; }
}
.detail-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-32); }
@media (min-width: 960px) { .detail-grid { grid-template-columns: 1fr 360px; } }
.detail-meta {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-16);
  padding: var(--s-24) 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin: var(--s-24) 0;
}
@media (min-width: 600px) { .detail-meta { grid-template-columns: repeat(4, 1fr); } }
.detail-meta .item small {
  color: var(--ink-3); font-size: 11px;
  display: block; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--fw-medium);
}
.detail-meta .item strong { font-family: var(--font-display); font-weight: var(--fw-medium); color: var(--ink); font-size: 17px; }
.amenity-list { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 0; margin: 0; }
@media (min-width: 500px) { .amenity-list { grid-template-columns: 1fr 1fr; } }
.amenity-list li {
  list-style: none; padding-left: 22px; position: relative;
  color: var(--ink-2); font-size: 13px;
}
.amenity-list li::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 10px; height: 5px;
  border-left: 2px solid var(--champagne); border-bottom: 2px solid var(--champagne);
  transform: rotate(-45deg);
}

/* Reserve panel - each party/price configuration as a mini-card */
.reserve-option {
  margin-top: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--r-input);
  background: var(--paper);
  transition: border-color .15s ease, box-shadow .2s ease;
}
.reserve-option:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.reserve-option-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.reserve-option-party { font-weight: var(--fw-medium); }
.reserve-option-price { font-family: var(--font-display); font-size: 22px; font-weight: var(--fw-medium); letter-spacing: -0.02em; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-16); }
@media (min-width: 600px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s-16); }
.form-row:last-child { margin-bottom: 0; }
.form-row label, .form-row > label {
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.form-row .hint { font-size: 11px; color: var(--ink-3); font-weight: var(--fw-regular); text-transform: none; letter-spacing: 0; }
.form-row input, .form-row select, .form-row textarea {
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-input);
  font: inherit; background: var(--card); color: var(--ink);
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: var(--shadow-focus);
}
.form-row input[aria-invalid="true"], .form-row select[aria-invalid="true"], .form-row textarea[aria-invalid="true"] {
  border-color: var(--bad); box-shadow: 0 0 0 3px rgba(154,86,66,0.18);
}
.form-grid > .span2,
.form-grid > .form-row.span2 { grid-column: 1 / -1; }

/* ---------- Admin filter bars + form action rows ----------
   One consistent pattern for every admin search/filter form, and for the
   submit row of data-entry forms, so inputs and their buttons share a baseline
   and same-purpose buttons share one size. */

/* Horizontal filter/search bar: fields flow and wrap, all bottom-aligned so a
   field's label pushes its input down to the shared baseline the buttons meet.
   Zeroing the .form-row margin here is what stops the action buttons sitting a
   row-gap lower than the inputs they line up with. */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.filter-bar .form-row { margin-bottom: 0; flex: 1 1 180px; min-width: 150px; }
.filter-bar .form-row.grow { flex: 3 1 260px; }            /* the wide search field */
.filter-bar .filter-actions { display: flex; gap: 8px; align-items: flex-end; flex: 0 0 auto; }

/* A filter button sits directly beside its input on one baseline, so the two
   must share an exact height. Inputs/selects compute to ~47px from their
   padding + body line-height, while a bare `.btn-sm` is only ~33px - which
   reads as a visibly short button next to the field. Pin every control in the
   bar (fields and their action buttons) to one height so they line up flush. */
.filter-bar .form-row input,
.filter-bar .form-row select,
.filter-bar .filter-actions .btn { height: 44px; }

/* Mobile: the action buttons span the full bar and fill the row. A lone button
   stretches to 100%; two share the row 50/50; a third wraps to a new row and
   grows to full width (and so on). `flex-grow:1` on a 50%-basis child is what
   makes a row's last/only button expand to fill the space left beside it. */
@media (max-width: 600px) {
  .filter-bar .filter-actions { flex: 1 1 100%; flex-wrap: wrap; }
  .filter-bar .filter-actions .btn { flex: 1 1 calc(50% - 4px); }
}

/* Submit row for stacked data-entry forms (invite, settings, …): a full-width
   row under the fields so a primary button never sits half-aligned beside one
   input. Spans both columns inside a .form-grid. */
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: var(--s-8); }
.form-grid > .form-actions { grid-column: 1 / -1; }

/* ---------- Safari date-input legibility ----------
   On WebKit/Safari, <input type="date"> renders its value through a stack of
   `::-webkit-datetime-edit*` pseudo-elements rather than a normal text node, so
   it ignores the input's `color` and falls back to the OS grey. The symptom the
   client hit: empty fields showed a greyed-out today's date, and filled fields
   were grey too. We force every part of the field - and the dd/mm/yyyy
   placeholder fields shown when empty - to the ink colour so the value reads
   black. The browser still renders the real "dd/mm/yyyy" mask for empty fields;
   we just recolour it. (Chrome/Firefox honour plain `color` and are unaffected;
   these pseudo-elements are simply ignored there.) */
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"] {
  color: var(--ink);
}
input[type="date"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit,
input[type="month"]::-webkit-datetime-edit,
input[type="week"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit { color: var(--ink); padding: 0; }
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
input[type="month"]::-webkit-datetime-edit-fields-wrapper,
input[type="week"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper { color: var(--ink); }
/* Each editable sub-field + the literal separators ("/" ":"). Colour them all
   to ink so neither the filled value nor the empty dd/mm/yyyy mask renders grey. */
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-text,
input[type="datetime-local"]::-webkit-datetime-edit-day-field,
input[type="datetime-local"]::-webkit-datetime-edit-month-field,
input[type="datetime-local"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
input[type="month"]::-webkit-datetime-edit-text,
input[type="month"]::-webkit-datetime-edit-month-field,
input[type="month"]::-webkit-datetime-edit-year-field,
input[type="time"]::-webkit-datetime-edit-text,
input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field {
  color: var(--ink);
}
/* The whole value container Safari exposes; keep it ink and vertically tidy. */
input[type="date"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value,
input[type="week"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  color: var(--ink); text-align: left; margin: 0;
}
/* Empty state: the unfilled dd/mm/yyyy placeholder fields. WebKit applies
   `:-webkit-datetime-edit-*:empty`-ish styling we can't hook directly, but
   colouring the edit stack above already turns the mask from grey to ink.
   Keep the calendar picker indicator on-brand instead of OS-blue. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
input[type="month"]:hover::-webkit-calendar-picker-indicator { opacity: .85; }
/* A genuinely empty Safari date field (no user value yet) gets a sentinel class
   from main.js; render its mask in the muted ink so "dd/mm/yyyy" reads as a
   placeholder, while a chosen value stays full-strength ink. Both are far darker
   than Safari's default grey, satisfying the "black dd/mm/yyyy" requirement. */
input[type="date"].is-date-empty::-webkit-datetime-edit { color: var(--ink-2); }

/* Sub-tabs - horizontal section nav within a single admin page (e.g. Settings).
   Each tab is its own route; the active one is highlighted. Scrolls on narrow
   screens rather than wrapping into an uneven block. */
/* Tabs stick directly under the page header bar (--stick-top). Opaque background
   + z-index below .admin-head (20) but above table headers (3) so the stacking
   reads header > tabs > table. main.js folds the tab height into
   --table-stick-top so table headers pin beneath the tabs (see `.table th`). */
.subtabs {
  position: sticky; top: var(--stick-top, 0px); z-index: 19;
  display: flex; gap: 4px; margin: 0 0 var(--s-24);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  overflow-x: auto; scrollbar-width: none;
}
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a {
  flex: 0 0 auto; padding: 10px 14px; font-size: 13px; font-weight: var(--fw-medium);
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtabs a:hover { color: var(--ink); }
.subtabs a.active { color: var(--teal); border-bottom-color: var(--teal); }
.subtabs a { cursor: pointer; }

/* Client-side tabs (public/js/tabs.js): a hidden panel must stay hidden even
   when its base class (.panel, .content-section) sets its own display. */
[data-tabpanel][hidden] { display: none !important; }

/* ========== Admin & account design system ==========
   One shared vocabulary for every admin page and the signed-in account/payment
   pages, so they read as one product. The settings page (views/admin/settings.
   ejs) is the reference implementation; lib/settings-schema.js drives its fields.

   Primitives (use these instead of inline styles / ad-hoc markup):
     .admin-lede / .page-lede  - intro paragraph under a page title
     .panel                    - the canonical content card (defined elsewhere)
     .section-head             - a card's title + description block
     .callout(-info|warn|danger|ok) - an inline notice
     .meta-grid / .meta-item   - a grid of label/value readouts
     .switch                   - segmented On/Off control (settings forms)
     .admin-head-text/-actions - page-header title-stack + right-aligned actions */

/* Intro paragraph under a page title. .page-lede is the user-facing alias. */
.admin-lede, .page-lede {
  color: var(--ink-3); font-size: 13.5px; line-height: 1.55;
  margin: -6px 0 var(--s-24); max-width: 72ch;
}
.page-lede { font-size: 15px; }

/* Page-header helpers: a title stack on the left, actions on the right. Pairs
   with the existing .admin-head (sticky bar) so every page header is built the
   same way instead of with bespoke inline flex. */
.admin-head-text { min-width: 0; }
.admin-head-text h1 { margin: 0; }
.admin-head-text .admin-lede,
.admin-head-text .page-lede { margin: 6px 0 0; }
.admin-head-actions, .head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Generic horizontal button/control row - replaces the ubiquitous inline
   `display:flex; gap:8px; flex-wrap:wrap`. Use for action rows under a panel or
   beside a heading. .btn-row.end right-aligns; .btn-row.center centres. */
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-row.end { justify-content: flex-end; }
.btn-row.center { justify-content: center; }

/* A card's header: a title (h2/h3/h4) plus an optional description line. Works
   inside a .panel or a .settings-section, or standalone above a grid. */
.section-head { margin-bottom: var(--s-16); }
.section-head > :is(h2, h3, h4) {
  font-size: 15px; font-weight: var(--fw-medium); letter-spacing: -0.01em;
  margin: 0;
}
.section-head .section-desc,
.section-head .hint {
  display: block; margin-top: 5px;
  font-size: 12.5px; color: var(--ink-3); line-height: 1.5; max-width: 72ch;
}
/* A section header that carries its own actions (e.g. an "Add" button). */
.section-head.spread { margin-bottom: var(--s-16); }

/* Label/value readout grid - the "small grey label over a strong value" pattern
   used across account, payment, booking and customer pages. Replaces dozens of
   bespoke <div><small>..</small><br><strong>..</strong></div> blocks. */
.meta-grid {
  display: grid; gap: var(--s-16);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.meta-item { min-width: 0; }
.meta-label {
  display: block; font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--fw-medium);
  margin-bottom: 4px;
}
.meta-value { font-weight: var(--fw-medium); font-size: 15px; color: var(--ink); }
.meta-value.lg { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.02em; }

/* A table sitting flush inside a .panel (no outer frame, since the panel is the
   frame). Replaces inline `style="border:0"` on embedded tables. */
.table.table-flush { border: 0; }

/* A panel whose children sit flush to its edges (rows draw their own padding). */
.panel-flush { padding: 0; overflow: hidden; }
/* A .spread row whose columns top-align rather than centre. */
.spread.spread-top { align-items: flex-start; }
/* A standalone section title with breathing room above a following block. */
.section-title-lg { margin: var(--s-32) 0 var(--s-16); }

/* One labelled sub-section (a card). Sections stack with a small gap. The
   settings forms use .settings-section; it's an alias of .panel's look. */
.settings-form { display: flex; flex-direction: column; gap: var(--s-16); }
.settings-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--s-24);
}

/* Sticky save bar at the foot of each tab's form. Sits flush with the page
   bottom, just above the viewport edge, so Save is reachable on a long form
   without scrolling all the way down. Only one tab panel is visible at a time,
   so only one bar shows. */
.settings-savebar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 16px; margin: var(--s-8) 0 0;
  background: var(--paper); /* fallback for no color-mix support */
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--r-card);
}
.settings-savebar-hint {
  margin-right: auto; font-size: 12.5px; color: var(--warn);
  display: inline-flex; align-items: center; gap: 6px;
}
.settings-savebar-hint::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn); flex: 0 0 auto;
}

/* Gated field: dimmed when its parent toggle is Off (set by settings.js). The
   value still submits - this is purely a visual "currently ignored" cue. */
.form-row.is-gated-off { opacity: 0.5; }
.form-row.is-gated-off label { color: var(--ink-3); }

/* Money / percent affix: a leading symbol inside the input frame. */
.input-affix { position: relative; display: block; }
.input-affix::before {
  content: attr(data-affix);
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 13px; pointer-events: none;
}
.input-affix input { padding-left: 26px; }

/* Segmented On/Off switch (two same-named radios; the checked one lights up).
   Replaces the old <select> toggle - clearer state, single value submitted. */
.switch {
  display: inline-flex; align-self: flex-start;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 3px; gap: 2px;
}
.switch-radio { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.switch-opt {
  cursor: pointer; padding: 5px 16px; border-radius: 6px;
  font-size: 13px; font-weight: var(--fw-medium); color: var(--ink-3);
  line-height: 1.2; user-select: none;
  transition: background .15s ease, color .15s ease;
}
.switch-opt:hover { color: var(--ink); }
.switch-radio:focus-visible + .switch-opt { box-shadow: var(--shadow-focus); }
input.switch-radio[value="1"]:checked + .switch-on {
  background: var(--ok); color: #fff;
}
input.switch-radio[value="0"]:checked + .switch-off {
  background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(26,24,20,.12);
}

/* Small status tag (sender-identity descriptors). */
.tag {
  display: inline-block; font-size: 11px; font-weight: var(--fw-medium);
  padding: 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--line);
  color: var(--ink-3); background: var(--paper-2); letter-spacing: 0.01em;
}
.tag-ok { color: var(--color-ok-fg); background: var(--color-ok-bg); border-color: var(--color-ok-line); }
.tag-muted { color: var(--ink-3); }

/* Email sender-identity block: a labelled row inside the senders section. */
.sender-id { padding-top: var(--s-16); border-top: 1px solid var(--line); margin-top: var(--s-16); }
.sender-id:first-of-type { padding-top: 0; border-top: 0; margin-top: 0; }
.sender-id-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sender-id-head strong { font-weight: var(--fw-medium); }

/* Callout: an inline notice (info / warn / danger / ok). Reusable on any admin
   or account page above a form or section. */
.callout {
  border: 1px solid var(--line); border-left-width: 3px;
  border-radius: var(--r-md); padding: 14px 16px; margin-bottom: var(--s-16);
  background: var(--paper-2);
}
.callout :is(h3, h4) { margin: 0 0 4px; font-size: 13.5px; font-weight: var(--fw-medium); }
.callout p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.callout p + p { margin-top: 8px; }
.callout-info   { border-left-color: var(--line-2); }
.callout-ok     { background: var(--color-ok-bg); border-color: var(--color-ok-line); border-left-color: var(--ok); }
.callout-ok :is(h3, h4), .callout-ok p { color: var(--color-ok-fg); }
.callout-warn   { background: var(--color-warn-bg); border-color: var(--color-warn-line); border-left-color: var(--warn); }
.callout-warn :is(h3, h4), .callout-warn p { color: var(--color-warn-fg); }
.callout-danger { background: var(--color-err-bg); border-color: var(--color-err-line); border-left-color: var(--bad); }
.callout-danger :is(h3, h4), .callout-danger p { color: var(--color-err-fg); }

/* Danger zone: red-edged cards with a typed-confirmation action row. Reusable
   anywhere a destructive bulk action needs guarding (settings maintenance, etc). */
.danger-zone { display: flex; flex-direction: column; gap: var(--s-16); }
.danger-card { border-color: var(--color-err-line); }
.danger-card .section-head > :is(h2, h3, h4) { color: var(--color-err-fg); }
.danger-action { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.danger-action .confirm-input { max-width: 180px; height: 40px; }
.danger-action .hint { font-size: 12px; }

/* Auth page */
.auth-panel { padding: 30px 28px; box-shadow: var(--shadow-md); }
@media (max-width: 420px) { .auth-panel { padding: 24px 20px; } }

/* Auth redesign - centred head, segmented toggle, OTP field.
   Shared by login / register / magic / verify / forgot / reset / confirmed. */
.auth-head { text-align: center; margin-bottom: var(--s-24); }
.auth-head h1 { font-size: var(--text-heading); margin: 0 0 6px; }
.auth-head p { margin: 0; color: var(--ink-3); font-size: 14px; line-height: 1.5; }

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; margin-bottom: var(--s-24);
}
.seg a {
  text-align: center; padding: 9px 8px; border-radius: 7px;
  font-size: 13.5px; font-weight: var(--fw-medium); text-decoration: none; color: var(--ink-3);
}
.seg a:hover { color: var(--ink); text-decoration: none; }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(26, 24, 20, .08); }

.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label-row > label { margin: 0; }
.label-row a { font-size: 12.5px; color: var(--ink-3); text-transform: none; letter-spacing: 0; font-weight: var(--fw-regular); }

.code-input {
  letter-spacing: .5em; font-variant-numeric: tabular-nums; text-align: center;
  font-size: 22px; font-weight: var(--fw-medium);
}

.success-emblem {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto 18px;
  background: var(--ok); color: #fff;
}
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-form .form-row { margin-bottom: var(--s-16); }
.auth-form button[type="submit"] { margin-top: var(--s-8); }
.auth-foot { text-align: center; margin: var(--s-16) 0 0; font-size: 13px; }

.oauth-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--s-16); }
.oauth-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: var(--fw-medium); border-radius: var(--r-md);
  padding: 11px 16px; justify-content: center;
}
.oauth-btn:hover { background: var(--paper-2); border-color: var(--line-2); }
/* SSO buttons stay visibly inert until the Turnstile check is solved. Pointer
   events remain on so the click handler can nudge the user to the widget. */
.oauth-btn.is-gated { opacity: .5; cursor: not-allowed; }
.oauth-btn.is-gated:hover { background: var(--card); border-color: var(--line); }
.oauth-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper-2); color: var(--ink);
  font-weight: var(--fw-medium); font-size: 12px;
  margin-right: 8px;
}
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; margin: var(--s-16) 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Account-settings page: in-page section nav + linked-accounts list */
.settings-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-nav a {
  font-size: .85rem; font-weight: var(--fw-medium); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 5px 12px; background: var(--card); text-decoration: none;
}
.settings-nav a:hover { background: var(--paper-2); border-color: var(--line-2); }
.linked-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.linked-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--card);
}
.linked-row .oauth-glyph { margin-right: 0; flex: 0 0 auto; }
.linked-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.linked-meta strong { font-weight: var(--fw-medium); }
.linked-meta .text-soft { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.phone-input { display: grid; grid-template-columns: 130px 1fr; gap: 8px; }
.phone-input select, .phone-input input {
  padding: 12px 12px; border: 1px solid var(--line); border-radius: var(--r-input);
  font: inherit; background: var(--card); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.phone-input select:focus, .phone-input input:focus {
  outline: none; border-color: var(--ink); box-shadow: var(--shadow-focus);
}
@media (max-width: 380px) { .phone-input { grid-template-columns: 110px 1fr; } }

.pw-checks { list-style: none; padding: 8px 0 0; margin: 0; display: grid; gap: 4px; }
.pw-checks li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.pw-checks li .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex-shrink: 0; transition: background-color .2s ease; }
.pw-checks li.ok { color: var(--ok); }
.pw-checks li.ok .dot { background: var(--ok); }
.pw-checks li.bonus { color: var(--ink-3); }
.pw-checks li.bonus.ok { color: var(--ok); }

/* ---------- Panel / Summary ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--s-24);
  margin-bottom: var(--s-24);
}
.panel h2 { margin-bottom: var(--s-16); font-size: var(--text-heading); font-weight: var(--fw-medium); }
.panel h3 { margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-16); gap: 12px; flex-wrap: wrap; }

/* ---------- Content accordion (Admin -> Website content) ----------
   Each public page is a collapsible <details> so the editor opens one page
   at a time instead of scrolling past every form. Built on native
   <details>/<summary> (keyboard + screen-reader accessible, no JS), styled
   to read like a panel. The chevron mirrors the sidebar nav-group pattern:
   points down when collapsed, up when open. */
.content-accordion { display: flex; flex-direction: column; gap: var(--s-16); }
.content-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
}
.content-section > summary {
  list-style: none;            /* hide default disclosure triangle (standards) */
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: var(--s-16) var(--s-24);
  cursor: pointer; user-select: none;
  transition: background .15s ease;
}
.content-section > summary::-webkit-details-marker { display: none; } /* hide default triangle (WebKit) */
.content-section > summary:hover { background: var(--paper-2); }
.content-section > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.content-section-title { font-size: var(--text-heading); font-weight: var(--fw-medium); }
.content-section-sub { color: var(--ink-3); font-size: 13px; }
.content-section-chevron {
  margin-left: auto; align-self: center;
  font-size: 14px; line-height: 1; color: var(--ink-3);
  transition: transform .2s ease;
  transform: rotate(180deg);   /* collapsed: chevron points down */
}
.content-section[open] > summary .content-section-chevron { transform: rotate(0deg); }
.content-section[open] > summary { border-bottom: 1px solid var(--line); }
.content-section-body { padding: var(--s-24); }
.content-section-body > form:last-child > .btn:last-child,
.content-section-body > form > button:last-child { margin-bottom: 0; }

.checkout { display: grid; grid-template-columns: 1fr; gap: var(--s-24); }
@media (min-width: 960px) { .checkout { grid-template-columns: 1fr 340px; } }
.summary {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--s-24);
  position: sticky; top: calc(var(--nav-h) + 16px); align-self: start;
}
.summary h3 { margin-bottom: var(--s-16); font-size: var(--text-subheading); font-weight: var(--fw-medium); }
.summary .line { display: flex; justify-content: space-between; padding: 6px 0; color: var(--ink-3); font-size: 13px; }
.summary .line strong { color: var(--ink); font-weight: var(--fw-medium); }
.summary hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.summary .total { font-family: var(--font-display); font-size: 22px; font-weight: var(--fw-medium); color: var(--ink); letter-spacing: -0.02em; }

/* ---------- Steps / Stepper ---------- */
.steps {
  display: flex; align-items: center;
  gap: 8px; margin-bottom: var(--s-24);
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  margin-left: -16px; margin-right: -16px;
  padding-left: 16px; padding-right: 16px;
}
@media (min-width: 600px) { .steps { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; } }
.step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0;
  background: transparent; border: 0;
  color: var(--ink-3);
  font-size: 11px; font-weight: var(--fw-regular);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.step .num {
  display: inline-flex; width: 22px; height: 22px; border-radius: 50%;
  background: transparent; color: var(--ink-3);
  border: 1px solid var(--line-2);
  align-items: center; justify-content: center;
  font-family: var(--font-body); font-size: 11px; font-weight: var(--fw-medium);
}
.step.active { color: var(--ink); font-weight: var(--fw-medium); }
.step.active .num { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.step.done { color: var(--teal-2); }
.step.done .num { background: var(--teal); color: var(--paper); border-color: var(--teal); }
.step + .step::before {
  content: ""; display: inline-block;
  width: 24px; height: 1px; background: var(--line-2);
  margin: 0 4px 0 -4px; vertical-align: middle;
}
a.step { text-decoration: none; cursor: pointer; }

/* ---------- Tables ---------- */
/* No overflow:hidden here - it would make the TABLE itself the sticky
   scroll-container and the header would pin to the table top instead of the
   window. Radius dropped for the same reason (it needs overflow to clip). */
/* border-collapse:separate (not collapse) is deliberate: Chromium does not paint
   a sticky th's background/border over scrolling rows when the table is
   border-collapse:collapse, so content bleeds through the pinned header. With
   `separate` + zero spacing it looks identical but the sticky header stays opaque. */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); min-width: 560px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
/* Sticky column headers, pinned to the top of the VIEWPORT - just below the
   sticky page header bar (.admin-head / .nav). --stick-top is that bar's height,
   measured in main.js and set on <html> (falls back to 0). The header has a
   fixed height so the per-room subheader (variations) can pin exactly beneath
   it. nowrap stops narrow columns wrapping "ACTIVE" into stacked letters.
   border-collapse drops the cell border when stuck, so the divider is an inset
   box-shadow that travels with the cell. */
.table th {
  /* --table-stick-top = page-bar height (+ sticky tabs, if any). Falls back to
     the bare page-bar height on tab-less pages. Set in main.js. */
  position: sticky; top: var(--table-stick-top, var(--stick-top, 0px)); z-index: 3;
  height: 40px; white-space: nowrap;
  background: var(--paper-2);
  color: var(--ink-3);
  font-weight: var(--fw-medium);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: inset 0 -1px 0 var(--line);
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--paper-2); }
.table .mono, .table code { font-family: var(--font-mono); font-size: 12px; }

/* ---------- Bulk-action bar (multi-select tables) ---------- */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 10px 14px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px;
}
.bulk-bar .bulk-count { margin-right: auto; }

/* ---------- Variations editor ---------- */
.help-panel > summary { cursor: pointer; font-weight: var(--fw-medium); }
.help-panel .help-grid {
  display: grid; gap: 18px; margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.help-panel .help-grid h4 { margin: 0 0 5px; font-size: 13px; }
.help-panel .help-grid p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
/* Per-room subheader rows stick directly under the (also-sticky) 40px column
   header, themselves under the page bar (--stick-top). The -1px overlaps the
   header bottom by a pixel so no scrolled row can peek through the seam. */
.variations-table .group-row td {
  position: sticky; top: calc(var(--table-stick-top, var(--stick-top, 0px)) + 39px); z-index: 2;
  background: var(--paper-3); padding-top: 9px; padding-bottom: 9px;
  box-shadow: inset 0 -1px 0 var(--line);
}
.variations-table .group-row:hover td { background: var(--paper-3); }
.variations-table .row-inactive { opacity: .55; }
.variations-table .party-edit { display: flex; gap: 8px; }
.variations-table .party-edit label { display: flex; flex-direction: column; gap: 3px; }
.variations-table .party-edit label span { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.variations-table .party-edit input { width: 64px; }
.variations-table .hint { font-size: 11px; color: var(--ink-3); }
.variations-table .band-readout { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; max-width: 220px; }
.variations-table .band-readout .pill { font-size: 9.5px; padding: 2px 7px; text-transform: none; letter-spacing: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-body); font-weight: var(--fw-medium);
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-ok    { background: var(--color-ok-bg);   color: var(--color-ok-fg);   border-color: var(--color-ok-line); }
.badge-warn  { background: var(--color-warn-bg); color: var(--color-warn-fg); border-color: var(--color-warn-line); }
.badge-err   { background: var(--color-err-bg);  color: var(--color-err-fg);  border-color: var(--color-err-line); }
.badge-soft  { background: var(--paper-2); color: var(--ink-3); border-color: var(--line); }
.badge-info  { background: var(--paper-2); color: var(--ink-2); border-color: var(--line); }

/* ---------- Image lightbox ---------- */
.is-zoomable { cursor: zoom-in; }
.lightbox {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; /* Safari < 14.1 lacks `inset` shorthand */
  inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12, 11, 9, 0.92); padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox-stage { margin: 0; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox-img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lightbox-caption { color: rgba(245,240,230,0.8); font-size: 13px; text-align: center; }
.lightbox-caption[hidden] { display: none; }
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(245,240,230,0.1); color: #f5f0e6;
  border: 1px solid rgba(245,240,230,0.2); border-radius: 50%;
  width: 44px; height: 44px; font-size: 26px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(245,240,230,0.2); }
.lightbox-close { top: 18px; right: 18px; }
.lightbox-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-nav[hidden] { display: none; }
.lightbox-counter { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(245,240,230,0.7); font-size: 12px; letter-spacing: 0.05em; }
@media (max-width: 640px) {
  .lightbox-close, .lightbox-nav { width: 38px; height: 38px; font-size: 22px; }
  .lightbox-prev { left: 8px; } .lightbox-next { right: 8px; }
}

/* ---------- Ticket cards (collapsible <details>) ---------- */
.tier-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-2);
  border-radius: var(--r-card);
  padding: 0;
  overflow: hidden;
}
/* Priority accent down the left edge. */
.tier-card.p1  { border-left-color: var(--color-err-line); }
.tier-card.p2  { border-left-color: var(--color-warn-line); }
.tier-card.p3  { border-left-color: var(--teal); }
.tier-card.std { border-left-color: var(--line-2); }

.ticket-sum {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}
.ticket-sum::-webkit-details-marker { display: none; }
.ticket-sum:hover { background: var(--paper-2); }
.tier-card[open] > .ticket-sum { border-bottom: 1px solid var(--line); }
/* A caret that flips when the card opens. */
.ticket-sum::after {
  content: "";
  flex: none;
  align-self: center;
  width: 8px; height: 8px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.tier-card[open] > .ticket-sum::after { transform: rotate(-135deg); }
.ticket-sum-main { min-width: 0; }
.ticket-sum-main strong { display: inline; }
.ticket-sum-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }

.tier {
  display: inline-block;
  font-size: 11px; font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  padding: 2px 7px; margin-right: 8px;
  border-radius: var(--r-sm, 6px);
  background: var(--paper-3); color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.tier-card.p1 .tier { background: var(--color-err-bg); color: var(--color-err-fg); border-color: var(--color-err-line); }
.tier-card.p2 .tier { background: var(--color-warn-bg); color: var(--color-warn-fg); border-color: var(--color-warn-line); }

.ticket-body { padding: 14px 16px 16px; }
.ticket-action-note {
  background: var(--color-warn-bg); color: var(--color-warn-fg);
  border: 1px solid var(--color-warn-line); border-radius: var(--r-md);
  padding: 8px 12px; font-size: 13px; margin-bottom: 10px;
}
.ticket-triage {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  padding: 12px; margin-top: 4px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md);
}
.ticket-triage .form-row { margin-bottom: 0; }
@media (min-width: 700px) {
  .ticket-triage { grid-template-columns: 160px 1fr auto auto; align-items: end; }
}
/* Beat `.form-row label` (which forces uppercase 11px) when an inline checkbox
   label sits inside a form row. */
.check-inline,
.form-row label.check-inline {
  display: flex; gap: 6px; align-items: center;
  font-size: 13px; color: var(--ink-2);
  text-transform: none; letter-spacing: 0; font-weight: var(--fw-regular);
}
.check-inline input { width: auto; }

/* ---------- Ticket thread ---------- */
.ticket-msg { margin-top: 10px; padding: 10px 13px; border-radius: var(--r-md); border: 1px solid var(--line); font-size: 14px; max-width: 86%; }
.ticket-msg-in  { background: var(--paper-2); }
.ticket-msg-out { background: var(--color-ok-bg); border-color: var(--color-ok-line); margin-left: auto; }

/* ---------- Flash ---------- */
.flash { padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 18px; font-size: 13px; border: 1px solid; }
.flash-ok   { background: var(--color-ok-bg);   color: var(--color-ok-fg);   border-color: var(--color-ok-line); }
.flash-err  { background: var(--color-err-bg);  color: var(--color-err-fg);  border-color: var(--color-err-line); }
.flash-info { background: var(--paper-2);       color: var(--ink-2);         border-color: var(--line); }
.flash-warn { background: var(--color-warn-bg);  color: var(--color-warn-fg);  border-color: var(--color-warn-line); }

/* Persistent failed-payment alert banner (admin shell, every page). Red, full
   width, links to the bookings needing a chase. The dot gently pulses to draw
   the eye without being obnoxious (respects prefers-reduced-motion globally). */
.admin-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin-bottom: 18px;
  border: 1px solid var(--color-err-line); border-radius: var(--r-md);
  background: var(--color-err-bg); color: var(--color-err-fg);
  font-size: 13px; text-decoration: none;
}
.admin-alert:hover { filter: brightness(0.98); }
.admin-alert strong { font-weight: var(--fw-medium); }
.admin-alert-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); animation: admin-alert-pulse 2s ease-in-out infinite; }
.admin-alert-cta { margin-left: auto; white-space: nowrap; font-weight: var(--fw-medium); }
@keyframes admin-alert-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Footer ---------- */
/* Footer is brand chrome - always-dark surface - so it uses --brand-* tokens
   that don't flip in dark mode. Otherwise the bg would invert to cream while
   the text (hard-coded light) stayed cream too. */
footer { background: var(--brand-ink); color: rgba(245,240,230,0.7); padding: var(--s-40) 0 var(--s-24); margin-top: var(--s-64); width: 100%; border-top: 1px solid var(--brand-ink-2); }
footer .brand, footer .brand:hover { color: var(--brand-paper); }
footer .brand strong { color: var(--brand-paper); }
footer .brand small { color: rgba(245,240,230,0.55); }
@media (min-width: 760px) { footer { padding: var(--s-48) 0 var(--s-32); } }
footer .container { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-24); }
@media (max-width: 480px) { footer .container { grid-template-columns: 1fr; gap: var(--s-16); } }
@media (min-width: 760px) { footer .container { grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-32); } }
footer h4 { margin-bottom: 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(245,240,230,0.55); font-weight: var(--fw-medium); font-family: var(--font-body); }
footer a, footer .footer-link-btn { color: rgba(245,240,230,0.78); display: block; padding: 4px 0; font-size: 13px; text-decoration: none; transition: color .15s ease, transform .15s ease; word-break: break-word; }
footer a:hover, footer .footer-link-btn:hover { color: var(--brand-paper); }
footer .footer-link-btn { background: none; border: 0; font: inherit; text-align: left; cursor: pointer; width: 100%; }
footer .legal { grid-column: 1/-1; padding-top: var(--s-24); margin-top: var(--s-24); border-top: 1px solid rgba(245,240,230,0.1); font-size: 11px; color: rgba(245,240,230,0.5); word-break: break-word; }
/* Bottom row: editable legal line on the left, fixed build credit on the right.
   Spans the grid and carries the divider; the inner .legal drops its own. */
footer .footer-bottom { grid-column: 1/-1; padding-top: var(--s-24); margin-top: var(--s-24); border-top: 1px solid rgba(245,240,230,0.1); display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; align-items: baseline; }
footer .footer-bottom .legal { grid-column: auto; padding-top: 0; margin-top: 0; border-top: 0; flex: 1 1 320px; }
footer .footer-credit { margin: 0; font-size: 11px; color: rgba(245,240,230,0.5); white-space: nowrap; }
footer .footer-credit a { display: inline; padding: 0; color: rgba(245,240,230,0.78); text-decoration: underline; }
footer .footer-credit a:hover { color: var(--brand-paper); }
footer p, footer small, footer .muted { color: rgba(245,240,230,0.55); }

/* ---------- Admin shell ---------- */
.admin-shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; background: var(--paper); }
@media (min-width: 880px) { .admin-shell { grid-template-columns: 220px 1fr; } }
.admin-topbar {
  display: none;
  position: sticky; top: 0; z-index: 30;
  background: var(--brand-ink); color: var(--brand-paper);
  border-bottom: 1px solid var(--brand-ink-2);
  padding: 10px 14px;
  align-items: center; justify-content: space-between;
}
.admin-topbar-brand { display: flex; align-items: center; gap: 8px; color: var(--brand-paper); text-decoration: none; font-weight: var(--fw-medium); }
.admin-topbar-brand strong { font-family: 'Telegraf', var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.015em; line-height: 1.1; }
.admin-topbar-brand .mark { width: 22px; height: 22px; background: url("/logo.png") center/contain no-repeat; border-radius: 6px; }
.admin-burger {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid rgba(245,240,230,0.2);
  border-radius: var(--r-md);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer;
}
.admin-burger span { display: block; width: 16px; height: 2px; background: var(--brand-paper); transition: transform .2s ease, opacity .2s ease; }
.admin-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.admin-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.admin-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.admin-sidebar {
  background: var(--brand-ink); color: var(--brand-paper);
  padding: 20px 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
  border-right: 1px solid var(--brand-ink-2);
}
/* Lock the sidebar to the viewport on desktop. position:fixed is more
   reliable than position:sticky inside a grid item - sticky was failing
   intermittently on long admin pages, leaving the sidebar to scroll away
   with the content. The grid still reserves 220px on the left (the
   .admin-shell template), so .admin-main starts in the right place. */
@media (min-width: 880px) {
  .admin-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 220px;
    overflow: hidden;
    z-index: 5;
  }
}
/* The nav list is the ONLY scrolling region: brand (above) and .sb-foot (below)
   are fixed flex siblings, so they stay put when every group is expanded.
   min-height:0 lets this flex child actually shrink-and-scroll instead of
   pushing the footer off the bottom. */
.admin-sidebar .sb-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex; flex-direction: column; gap: 2px;
}
/* Custom scrollbar so the dark sidebar doesn't expose the OS scrollbar
   gutter (and accompanying light track) in dark surroundings. */
.admin-sidebar .sb-nav::-webkit-scrollbar { width: 6px; }
.admin-sidebar .sb-nav::-webkit-scrollbar-thumb { background: rgba(245,240,230,0.18); border-radius: 999px; }
.admin-sidebar .sb-nav::-webkit-scrollbar-track { background: transparent; }

/* Collapsible group sections inside the sidebar. The .group element is a
   button by markup; its .open class flips the chevron and reveals the
   sibling .nav-section-items list. State is persisted per-group label in
   localStorage by main.js so the user's choice survives navigation. */
.admin-sidebar .nav-section { display: flex; flex-direction: column; }
.admin-sidebar .nav-section + .nav-section { margin-top: 4px; }
.admin-sidebar button.group {
  font-family: inherit;
  font-size: 10px; text-transform: uppercase;
  color: rgba(245,240,230,0.45);
  letter-spacing: 0.08em;
  padding: 12px 10px 6px;
  font-weight: var(--fw-medium);
  background: transparent; border: 0;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; text-align: left;
  transition: color .15s ease;
}
.admin-sidebar button.group:hover { color: var(--brand-paper); }
.admin-sidebar button.group::after {
  content: "⌃"; /* up-chevron - rotates 180deg when collapsed */
  font-size: 12px; line-height: 1; opacity: 0.6;
  transition: transform .15s ease;
  transform: rotate(180deg);
}
.admin-sidebar .nav-section.open button.group::after { transform: rotate(0deg); }
.admin-sidebar .nav-section-items {
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden; max-height: 0;
  transition: max-height .25s ease;
}
.admin-sidebar .nav-section.open .nav-section-items { max-height: 600px; }

/* Below 880px the admin shell collapses to one column and the sidebar
   becomes a slide-in drawer (toggled by the admin-topbar burger). The
   desktop fixed-position rule is media-gated above so it never fires here. */
@media (max-width: 879.98px) {
  .admin-shell { display: block; grid-template-columns: 1fr; }
  .admin-topbar { display: flex; }
  /* Sit the sticky page header below the now-visible sticky topbar (~56px)
     instead of scrolling behind it. */
  .admin-head { top: 56px; }
  .admin-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(280px, 86vw);
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 50;
    overflow: hidden;
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-sidebar .desktop-only-theme { display: none; }
}
.admin-sidebar .brand {
  color: var(--brand-paper);
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--brand-line);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  /* Fixed header: a flex sibling that doesn't scroll (the .sb-nav list does). */
  flex: 0 0 auto;
}
.admin-sidebar .brand .mark {
  width: 22px; height: 22px; background: url("/logo.png") center/contain no-repeat; border-radius: 4px;
  flex-shrink: 0;
}
.admin-sidebar .brand strong { color: var(--brand-paper); font-family: var(--font-display); font-weight: var(--fw-medium); font-size: 13px; }
.admin-sidebar .brand small { color: rgba(245,240,230,0.5); display: block; font-size: 10px; }
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: rgba(245,240,230,0.55);
  font-size: 13px; text-decoration: none;
  font-weight: var(--fw-regular);
  transition: background-color .12s ease, color .12s ease;
}
.admin-sidebar a:hover { background: rgba(245,240,230,0.05); color: var(--brand-paper); }
.admin-sidebar a.active, .admin-sidebar a[aria-current="page"] {
  background: rgba(245,240,230,0.08); color: var(--brand-paper);
  font-weight: var(--fw-medium);
}
/* Minimalist nav icon + right-aligned count badge. The icon sits flush-left at
   a calmer opacity than the label; the badge is pushed to the far right with
   margin-left:auto so the label can wrap/ellipsis between them. */
.admin-sidebar .nav-ico { flex: 0 0 16px; opacity: 0.7; }
.admin-sidebar a:hover .nav-ico,
.admin-sidebar a.active .nav-ico { opacity: 1; }
.admin-sidebar .nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-sidebar .nav-badge {
  flex: 0 0 auto; margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  background: rgba(245,240,230,0.14); color: var(--brand-paper);
  font-size: 10px; font-weight: var(--fw-medium); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.admin-sidebar a.active .nav-badge { background: var(--accent); color: var(--teal-2); }
/* Alert variant: a failed-payment count that needs attention. Stays red even on
   the active link so it reads as a warning, not a neutral tally. */
.admin-sidebar .nav-badge.nav-badge-alert,
.admin-sidebar a.active .nav-badge.nav-badge-alert { background: var(--bad); color: var(--paper); }
.admin-sidebar .group {
  font-size: 10px; text-transform: uppercase;
  color: rgba(245,240,230,0.4);
  letter-spacing: 0.08em; padding: 14px 10px 6px;
  font-weight: var(--fw-medium);
}
.admin-sidebar .theme-toggle { background: transparent; border-color: rgba(245,240,230,0.15); color: var(--paper); }
.admin-sidebar .theme-toggle:hover { background: rgba(245,240,230,0.06); }

/* Sidebar footer (user chip + quick links + collapse toggle). Styling lives
   here rather than inline so the collapsed-to-icons mode can re-flow it.
   The .sb-foot wrapper is a fixed flex sibling at the sidebar's bottom edge: it
   doesn't scroll, so it never disappears when every nav group is expanded. The
   middle .sb-nav list is the only scrolling region. */
.admin-sidebar .sb-foot { flex: 0 0 auto; }
.admin-sidebar .sb-foot-user { padding-top: 14px; border-top: 1px solid var(--brand-line); display: flex; align-items: center; gap: 10px; }
.admin-sidebar .sb-foot-meta { flex: 1; min-width: 0; font-size: 12px; line-height: 1.3; overflow: hidden; }
.admin-sidebar .sb-foot-meta .nm { color: var(--brand-paper); font-weight: 500; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.admin-sidebar .sb-foot-meta .rl { color: rgba(245,240,230,0.5); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.admin-sidebar .sb-foot-actions { display: flex; gap: 6px; margin-top: 8px; }
.admin-sidebar .sb-foot-link {
  flex: 1; padding: 7px 10px; border-radius: 6px;
  background: rgba(245,240,230,0.06); color: rgba(245,240,230,0.65);
  font-size: 11px; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.admin-sidebar .sb-foot-link:hover { background: rgba(245,240,230,0.1); color: var(--brand-paper); }
.admin-sidebar .sb-foot-link svg { flex: 0 0 14px; }
/* Collapse toggle: desktop only (the sidebar is a drawer below 880px). */
.admin-sidebar .sb-collapse-btn { display: none; }
@media (min-width: 880px) {
  .admin-sidebar .sb-collapse-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 8px; width: 100%; padding: 7px 10px; border-radius: 6px;
    background: transparent; border: 1px solid rgba(245,240,230,0.12);
    color: rgba(245,240,230,0.55); font-size: 11px; font-family: inherit; cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
  }
  .admin-sidebar .sb-collapse-btn:hover { background: rgba(245,240,230,0.06); color: var(--brand-paper); }
  .admin-sidebar .sb-collapse-btn svg { transition: transform .2s ease; }
}

/* ----- Collapsed-to-icons sidebar (desktop ≥880px) ----------------------
   `html.admin-nav-collapsed` is set early (admin-shell head) + toggled by
   the .sb-collapse-btn. The sidebar narrows to a 64px icon rail: labels
   become hover tooltips, count badges become corner dots, group headers
   disappear (their items stay shown), and the footer stacks to icons. */
@media (min-width: 880px) {
  html.admin-nav-collapsed .admin-shell { grid-template-columns: 64px 1fr; }
  html.admin-nav-collapsed .admin-sidebar { width: 64px; padding-left: 10px; padding-right: 10px; }

  html.admin-nav-collapsed .admin-sidebar .brand { justify-content: center; padding: 4px 0 14px; gap: 0; }
  html.admin-nav-collapsed .admin-sidebar .brand strong,
  html.admin-nav-collapsed .admin-sidebar .brand small,
  html.admin-nav-collapsed .admin-sidebar button.group { display: none; }

  /* Always reveal group items - the collapsing chevron header is hidden. */
  html.admin-nav-collapsed .admin-sidebar .nav-section-items { max-height: none !important; overflow: visible; }
  html.admin-nav-collapsed .admin-sidebar .nav-section + .nav-section { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--brand-line); }

  /* Centre every nav row on its icon. */
  html.admin-nav-collapsed .admin-sidebar a { justify-content: center; gap: 0; padding: 9px 0; position: relative; }

  /* The label rides out as a hover tooltip to the right of the rail. */
  html.admin-nav-collapsed .admin-sidebar a .nav-label {
    position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    flex: none; overflow: visible; white-space: nowrap;
    background: var(--brand-ink-2); color: var(--brand-paper);
    padding: 5px 9px; border-radius: 6px; font-size: 12px;
    pointer-events: none; opacity: 0; visibility: hidden;
    transition: opacity .12s ease; z-index: 60;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
  }
  html.admin-nav-collapsed .admin-sidebar a:hover .nav-label { opacity: 1; visibility: visible; }

  /* Count badge shrinks to a corner dot (the number won't fit). */
  html.admin-nav-collapsed .admin-sidebar .nav-badge {
    position: absolute; top: 5px; right: 9px; margin: 0;
    min-width: 7px; width: 7px; height: 7px; padding: 0;
    font-size: 0; border-radius: 50%;
  }

  /* Footer stacks to an icon column. */
  html.admin-nav-collapsed .admin-sidebar .sb-foot-user { flex-direction: column; gap: 8px; }
  html.admin-nav-collapsed .admin-sidebar .sb-foot-meta { display: none !important; }
  html.admin-nav-collapsed .admin-sidebar .sb-foot-actions { flex-direction: column; }
  html.admin-nav-collapsed .admin-sidebar .sb-foot-link { gap: 0; padding: 8px 0; }
  html.admin-nav-collapsed .admin-sidebar .sb-link-label { display: none; }
  html.admin-nav-collapsed .admin-sidebar .sb-collapse-btn svg { transform: rotate(180deg); }
}

.admin-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: rgba(0,0,0,.5); z-index: 40; cursor: pointer; }
.admin-overlay[hidden] { display: none; }

/* overflow-x must be `clip`, not `hidden`: `hidden` makes overflow-y compute
   to `auto`, turning .admin-main into a scroll container, so .admin-head's
   position:sticky resolves against this (non-scrolling) box and scrolls away
   with the page instead of pinning. `clip` contains horizontal overflow
   without establishing a scroll container, so sticky engages on the viewport. */
.admin-main { padding: var(--s-24) var(--s-16) var(--s-48); background: var(--paper); min-height: 100vh; min-width: 0; overflow-x: clip; }
@media (min-width: 760px) { .admin-main { padding: var(--s-24) var(--s-32) var(--s-48); } }
/* Sidebar is position:fixed on desktop (removed from grid flow), so
   auto-placement would drop .admin-main into column 1 and hide it under
   the sidebar. Pin it to column 2 explicitly. */
@media (min-width: 880px) { .admin-main { grid-column: 2; } }
/* Pin the page header to the top so the h1 + primary actions stay in view
   while the page body scrolls. On desktop there's no topbar, so it sticks to
   the viewport top; on mobile it sits just below the sticky .admin-topbar
   (offset re-set in the <880px block). The paper background covers content
   scrolling underneath; padding-top gives a small band when stuck. */
.admin-head { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-24); gap: 12px; flex-wrap: wrap; padding-top: var(--s-16); padding-bottom: 22px; border-bottom: 1px solid var(--line); background: var(--paper); }
.admin-head h1 { margin: 0; font-size: var(--text-heading); }
.admin-head .subtitle { font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; font-weight: var(--fw-medium); margin-bottom: 6px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: var(--s-24); }
@media (min-width: 760px) { .admin-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 20px;
  position: relative; overflow: hidden;
}
.stat .label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--fw-medium); margin-bottom: 14px; }
.stat .val { font-family: var(--font-display); font-size: 30px; font-weight: var(--fw-medium); letter-spacing: -0.025em; color: var(--ink); }

/* ---------- Admin form-control baseline ----------
   Every bare <input>/<select>/<textarea> inside the admin panel - chiefly the
   inline-edit controls in admin tables (variations, discounts, inventory,
   users, booking-detail occupants/payments) and a few standalone selects -
   used to fall through to raw browser styling: system font, grey square
   borders, no champagne focus ring. This gives them the same look as the
   site's `.form-row` fields.

   The selectors are wrapped in `:where(...)` so their specificity collapses to
   that of the bare element (0,0,1). That means:
     - it always beats the user-agent default, but
     - it NEVER overrides the already-themed wrappers (`.form-row`,
       `.search-card`, `.phone-input`, `.md-editor` - all (0,1,1) or higher) or
       any inline `style=""` an individual control already carries.
   So this is purely additive - it dresses the controls nothing else reaches. */
:where(.admin-main) input:where(
    [type="text"], [type="email"], [type="number"], [type="date"],
    [type="datetime-local"], [type="month"], [type="week"], [type="time"],
    [type="search"], [type="tel"], [type="url"], [type="password"], :not([type])),
:where(.admin-main) select,
:where(.admin-main) textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  font: inherit;
  color: var(--ink);
  background: var(--card);
  max-width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
:where(.admin-main) textarea { resize: vertical; line-height: 1.55; }
:where(.admin-main) input:where(
    [type="text"], [type="email"], [type="number"], [type="date"],
    [type="datetime-local"], [type="month"], [type="week"], [type="time"],
    [type="search"], [type="tel"], [type="url"], [type="password"], :not([type])):focus,
:where(.admin-main) select:focus,
:where(.admin-main) textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: var(--shadow-focus);
}
:where(.admin-main) input:disabled,
:where(.admin-main) select:disabled,
:where(.admin-main) textarea:disabled,
:where(.admin-main) input:read-only:not([type="checkbox"]):not([type="radio"]) {
  background: var(--paper-2);
  color: var(--ink-3);
  cursor: not-allowed;
}
/* Checkboxes / radios: just tint them with the brand accent. */
:where(.admin-main) input[type="checkbox"],
:where(.admin-main) input[type="radio"] { accent-color: var(--champagne); }

/* Inline-edit controls live inside dense table cells - tighten them so a row
   of inputs stays a comfortable height. (Same low specificity; declared after
   the baseline so the compact padding wins.) */
:where(.admin-main .table) input,
:where(.admin-main .table) select { padding: 7px 9px; min-height: 0; }

/* File pickers - dress the native "Choose file" button to match `.btn-soft`
   instead of the OS-grey default. */
:where(.admin-main) input[type="file"] { font-size: 13px; color: var(--ink-2); }
:where(.admin-main) input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
  font: inherit; font-weight: var(--fw-medium); font-size: 12px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
:where(.admin-main) input[type="file"]:hover::file-selector-button {
  background: var(--paper-2); border-color: var(--line-2);
}

/* ---------- Chat (in-house fallback) ---------- */
.chat-fab {
  position: fixed; bottom: 20px; right: 20px; z-index: 60;
  background: var(--brand-ink); color: var(--brand-paper);
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer; font-size: 22px; font-weight: var(--fw-medium);
  box-shadow: var(--shadow-md); transition: transform .15s ease, background-color .15s ease;
}
.chat-fab:hover { background: var(--brand-ink-2); transform: scale(1.04); }
.chat-fab:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.chat-panel {
  position: fixed; bottom: 88px; right: 20px; width: 340px; max-width: calc(100vw - 24px); height: 460px; max-height: calc(100vh - 130px);
  background: var(--brand-ink); color: var(--brand-paper); border-radius: var(--r-card); box-shadow: var(--shadow-card);
  display: none; flex-direction: column; z-index: 60; overflow: hidden;
  border: 1px solid var(--brand-ink-2);
}
.chat-panel.open { display: flex; }
.chat-head { padding: 14px 16px; background: var(--brand-ink); color: var(--brand-paper); border-bottom: 1px solid rgba(245,240,230,0.08); }
.chat-head strong { display: block; font-family: var(--font-display); font-size: 14px; font-weight: var(--fw-medium); }
.chat-head small { font-size: 11px; opacity: 0.65; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 16px; background: var(--brand-ink); }
.chat-msg { padding: 9px 13px; border-radius: 10px; margin-bottom: 8px; font-size: 13px; max-width: 84%; line-height: 1.45; }
.chat-msg.bot { background: #1F1D18; color: var(--brand-paper); border-radius: 10px 10px 10px 2px; }
.chat-msg.user { background: var(--brand-champagne); color: var(--brand-ink); margin-left: auto; border-radius: 10px 10px 2px 10px; }
.chat-input { display: flex; padding: 10px; border-top: 1px solid rgba(245,240,230,0.08); background: #1F1D18; gap: 8px; }
.chat-input input {
  flex: 1; padding: 9px 14px;
  border: 1px solid rgba(245,240,230,0.2); border-radius: var(--r-md);
  font: inherit; background: #16140F; color: var(--brand-paper);
}
.chat-input input:focus { outline: none; border-color: var(--brand-champagne); box-shadow: 0 0 0 2px rgba(184,155,94,.25); }
.chat-input button { background: var(--brand-champagne); color: var(--brand-ink); border: 0; border-radius: var(--r-md); padding: 0 18px; cursor: pointer; font-weight: var(--fw-medium); }

/* ---------- Misc helpers ---------- */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: var(--s-16); flex-wrap: wrap; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
hr.div { border: 0; border-top: 1px solid var(--line); margin: var(--s-24) 0; }
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li { padding: 12px 0; border-bottom: 1px solid var(--line); }
ul.clean li:last-child { border-bottom: 0; }

/* ---------- FAQ accordion-style ---------- */
.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px 22px;
  margin-bottom: 8px;
  transition: border-color .15s ease, background .15s ease;
}
.faq-item:hover { border-color: var(--line-2); }
.faq-item.open { background: var(--card); border-color: var(--ink); border-width: 1.5px; padding: 17.5px 22px; }
.faq-item h4 { margin-bottom: 0; font-size: 16px; font-weight: var(--fw-medium); display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.faq-item h4::after { content: "+"; color: var(--ink-3); font-weight: var(--fw-regular); flex-shrink: 0; font-size: 18px; transition: transform .15s ease; }
.faq-item.open h4::after { content: "–"; }
/* Collapse the body when the card isn't .open. The JS just toggles .open;
   visibility is driven entirely from here. */
.faq-item p { margin: 0; font-size: 14px; color: var(--ink-3); max-width: 640px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .25s ease, opacity .2s ease, margin-top .2s ease; }
.faq-item.open p { margin-top: 12px; max-height: 480px; opacity: 1; }

/* ---------- Choice cards (payment plan, transfer) ---------- */
.choice {
  display: flex; gap: 14px; align-items: flex-start; cursor: pointer;
  padding: 18px; border: 1.5px solid var(--line);
  border-radius: var(--r-card); margin-bottom: 10px;
  background: var(--card);
  transition: border-color .15s ease, background-color .15s ease;
}
.choice:hover { border-color: var(--line-2); }
.choice input { margin-top: 4px; accent-color: var(--champagne); }
/* Selected-state tint. `:has()` is the right tool (the input is a CHILD of the
   label, so no sibling combinator can reach the card), but it is unsupported on
   Safari < 15.4. Guard with @supports so we only rely on it where it works; the
   checkbox's own checked styling still communicates state where it doesn't. */
@supports selector(:has(*)) {
  .choice:has(input:checked) { background: var(--paper-2); border-color: var(--ink); }
}
/* Fallback for browsers without :has() - at least flag the card while the
   control inside it has keyboard focus. */
@supports not selector(:has(*)) {
  .choice:focus-within { background: var(--paper-2); border-color: var(--ink); }
}
.choice .label { flex: 1; }
.choice strong { font-weight: var(--fw-medium); }

/* ---------- Payment mode cards (full vs instalment) ---------- */
.pay-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
@media (max-width: 600px) { .pay-modes { grid-template-columns: 1fr; } }
.pay-mode {
  text-align: left; background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--r-card); padding: 22px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 12px;
  font-family: inherit;
}
.pay-mode .pay-mode-top { display: flex; justify-content: space-between; align-items: center; }
.pay-mode .pay-mode-radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.pay-mode .pay-mode-radio::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: transparent;
}
/* The global `h1..h4` rule binds color to var(--ink) - explicitly inherit it
   here so .pay-mode.active (dark ink background, paper text) doesn't ship a
   near-invisible dark-on-dark heading. */
.pay-mode h3, .pay-mode .pay-mode-lines, .pay-mode .pay-mode-lines * { color: inherit; }
.pay-mode h3 { font-size: 22px; font-weight: var(--fw-medium); margin-bottom: 0; }
.pay-mode .pay-mode-lines { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.pay-mode .pay-mode-lines > div { display: flex; justify-content: space-between; font-size: 13px; }
.pay-mode .pay-mode-lines > div span:first-child { opacity: 0.65; }
.pay-mode .pay-mode-lines > div span:last-child { font-weight: var(--fw-medium); }
.pay-mode.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.pay-mode.active .pay-mode-radio { border-color: var(--paper); }
.pay-mode.active .pay-mode-radio::after { background: var(--champagne); }
.pay-mode.active .pill { background: rgba(245,240,230,0.12); color: var(--paper); border-color: rgba(245,240,230,0.18); }

/* ---------- Payment schedule timeline ---------- */
.pay-schedule { display: flex; flex-direction: column; }
.pay-schedule-row {
  display: grid; grid-template-columns: 40px 1fr 1fr 110px;
  gap: 14px; align-items: center;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.pay-schedule-row:last-child { border-bottom: 0; }
.pay-schedule-row .num-circle {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px dashed var(--line-2);
  background: transparent; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px;
}
.pay-schedule-row.now .num-circle { background: var(--ink); color: var(--paper); border: none; }
.pay-schedule-row.paid .num-circle { background: var(--teal); color: var(--paper); border: none; }
.pay-schedule-row .pay-label { font-weight: var(--fw-medium); font-size: 14px; }
.pay-schedule-row .pay-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pay-schedule-row .pay-amount { font-family: var(--font-display); font-size: 20px; text-align: right; letter-spacing: -0.02em; font-weight: var(--fw-medium); }
.pay-schedule-row .pay-status { text-align: right; }
/* Padded variant: rows sit inside a flush panel with solid separators instead of
   the dashed timeline look (used on the payment page schedule). */
.pay-schedule-row-padded { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.pay-schedule-row-padded:last-child { border-bottom: 0; }
.pay-schedule-error { padding: 0 22px 14px; font-size: 12px; color: var(--bad); }
@media (max-width: 600px) {
  .pay-schedule-row { grid-template-columns: 28px 1fr auto; gap: 10px; }
  .pay-schedule-row > .pay-cell-meta { display: none; }
}

/* ---------- Booking reference hero ---------- */
.ref-hero {
  background: var(--brand-ink); color: var(--brand-paper);
  border-radius: var(--r-lg); padding: 28px;
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 24px;
  position: relative; overflow: hidden;
}
@media (max-width: 600px) { .ref-hero { grid-template-columns: 1fr; gap: 18px; } }
.ref-hero .ref-eyebrow {
  font-size: 11px; color: rgba(245,240,230,0.6);
  letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: var(--fw-medium);
}
.ref-hero .ref-code {
  font-family: var(--font-mono); font-size: clamp(28px, 5vw, 48px);
  margin-top: 10px; letter-spacing: -0.01em; line-height: 1.05; font-weight: var(--fw-medium);
}
.ref-hero .ref-code .accent { color: var(--brand-champagne); }
.ref-hero .ref-note { margin-top: 10px; font-size: 13px; opacity: 0.7; max-width: 540px; }
.ref-hero h2 { color: var(--brand-paper); }
/* Right-aligned balance readout on the reference hero (e.g. the payment page). */
.ref-hero-balance { text-align: right; }
.ref-hero-balance .ref-balance-value {
  font-family: var(--font-display); font-size: 32px; margin-top: 4px;
  letter-spacing: -0.025em; font-weight: var(--fw-medium);
}
.ref-hero-balance .ref-balance-of { font-size: 13px; color: rgba(245,240,230,0.55); font-weight: var(--fw-regular); }
@media (max-width: 600px) { .ref-hero-balance { text-align: left; } }

/* ---------- Booking confirmation page ---------- */
/* Status line: a coloured dot + label + timestamp above the headline. */
.status-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin-bottom: 14px; }
.status-line .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex: 0 0 auto; }
.status-line .status-label { font-weight: var(--fw-medium); text-transform: uppercase; letter-spacing: 0.08em; }
.confirm-hero-title { font-size: clamp(36px, 5vw, 48px); max-width: 720px; }
.confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
@media (max-width: 760px) { .confirm-grid { grid-template-columns: 1fr; } }
.confirm-grid > .panel { margin-bottom: 0; }
/* Room thumbnail (confirmation summary). */
.room-thumb { width: 88px; height: 88px; background: var(--paper-2); border-radius: var(--r-md); flex-shrink: 0; overflow: hidden; position: relative; }
.room-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-thumb-fallback { position: absolute; inset: 0; background: var(--champagne); background-image: repeating-linear-gradient(135deg, rgba(20,18,16,.06) 0 1px, transparent 1px 12px); }
.room-summary { display: flex; gap: 16px; margin-bottom: 18px; }
.room-summary .room-stay { font-family: var(--font-display); font-size: 20px; margin-top: 8px; letter-spacing: -0.02em; font-weight: var(--fw-medium); }
.room-summary .room-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
/* Guest list rows. */
.guest-list { display: flex; flex-direction: column; gap: 10px; }
.guest-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.guest-row .g-name { font-weight: var(--fw-medium); }
.guest-row .g-meta { color: var(--ink-3); font-size: 11px; }
/* Confirmation payment ledger rows. */
.confirm-total { font-family: var(--font-display); font-size: 26px; letter-spacing: -0.02em; font-weight: var(--fw-medium); }
.confirm-pay-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.confirm-pay-row:last-child { border-bottom: 0; }
.confirm-pay-row .cp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: 0 0 auto; }
.confirm-pay-row.paid .cp-dot { background: var(--teal); }
.confirm-pay-row .cp-date { font-size: 12px; color: var(--ink-3); width: 110px; }
.confirm-pay-row .cp-amt { flex: 1; font-weight: var(--fw-medium); font-size: 14px; }
/* Soft inset note (receipt / reminder copy). */
.soft-note { margin-top: 14px; padding: 14px; background: var(--paper-2); border-radius: var(--r-md); font-size: 12px; color: var(--ink-2); }
.soft-note.with-tag { display: flex; gap: 10px; }
.soft-note .note-tag { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; padding-top: 2px; flex: 0 0 auto; }
/* "What's next" step cards. */
.whats-next { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .whats-next { grid-template-columns: 1fr; } }
.step-card { padding: 20px; background: var(--paper-2); border-radius: var(--r-md); }
.step-card .step-num { font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; font-weight: var(--fw-medium); }
.step-card h4 { font-size: 17px; margin-bottom: 6px; }
.step-card p { font-size: 13px; color: var(--ink-3); margin: 0; }

/* ---------- Activity feed grid (admin) ---------- */
.activity-row {
  display: grid; grid-template-columns: 56px 130px 130px 1fr;
  gap: 14px; align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.activity-row:last-child { border-bottom: 0; }
.activity-row .activity-t { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.activity-row .activity-e {
  font-size: 11px; font-weight: var(--fw-medium); letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 6px;
}
.activity-row .activity-e .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.activity-row .activity-ref { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }
.activity-row .activity-detail { font-size: 13px; color: var(--ink-3); }
.activity-row .activity-detail strong { color: var(--ink); font-weight: var(--fw-medium); }
@media (max-width: 760px) {
  .activity-row { grid-template-columns: 1fr; gap: 4px; }
  .activity-row .activity-t { font-size: 10px; }
}

/* ---------- Stripe Elements ---------- */
.stripe-mount { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-input); padding: 14px; min-height: 60px; }
#stripe-error { color: var(--bad); font-size: 13px; margin-top: 8px; min-height: 1.2em; }
.kbd { font-family: var(--font-mono); background: var(--paper-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: var(--r-pill); font-size: 12px; }

/* ---------- Avatar circles (occupants) ---------- */
.avatar-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-ink); color: var(--brand-paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 13px; font-weight: var(--fw-medium);
  flex-shrink: 0;
}
.avatar-circle.tone-champagne { background: var(--brand-champagne); color: var(--brand-ink); }
.avatar-circle.tone-teal { background: var(--teal); color: var(--brand-paper); }
.avatar-circle.tone-saffron { background: var(--saffron); color: var(--brand-ink); }
.avatar-circle.tone-ink { background: var(--brand-ink); color: var(--brand-paper); }
.avatar-circle.lg { width: 44px; height: 44px; font-size: 16px; }

/* ---------- Admin -> Users ---------- */
/* Collapsible invite panel: a plain <details class="panel"> with a styled
   summary so it stays out of the way until an admin needs it. */
.invite-panel { padding: 0; }
.invite-panel > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; font-weight: var(--fw-medium);
}
.invite-panel > summary::-webkit-details-marker { display: none; }
.invite-panel > summary:hover { background: var(--paper-2); }
.invite-panel-chevron { font-size: 18px; color: var(--ink-3); line-height: 1; transition: transform .15s ease; }
.invite-panel[open] > summary { border-bottom: 1px solid var(--line); }
.invite-panel[open] .invite-panel-chevron { transform: rotate(45deg); }
.invite-panel-body { padding: 18px; }

/* Search + role tabs + follow-up toggle bar. */
.users-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px;
}
.users-search { flex: 1 1 240px; min-width: 200px; }
.users-search input { width: 100%; height: 40px; }
.users-rolebar { position: static; margin: 0; border-bottom: 0; flex: 1 1 auto; }
.rolebar-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px;
  font-size: 11px; line-height: 17px; text-align: center;
  border-radius: 999px; background: var(--paper-2); color: var(--ink-3);
}
.subtabs a.active .rolebar-count { background: var(--teal); color: var(--brand-paper); }
.users-followup-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.users-followup-toggle input { width: 16px; height: 16px; margin: 0; }

/* Roomy, scannable rows. */
.users-table td { vertical-align: middle; }
.user-identity { display: flex; align-items: center; gap: 12px; }
.user-identity-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-identity-text strong { line-height: 1.25; }
.user-identity-text .muted { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
.user-identity-text .badge { align-self: flex-start; margin-top: 2px; }

/* Per-row "Manage" editor, revealed under the row by admin-users.js. */
.urow-manage > td { background: var(--paper-2); padding: 16px 18px; }
.manage-grid { display: flex; flex-wrap: wrap; gap: 18px 28px; }
.manage-block { display: flex; flex-direction: column; gap: 6px; }
.manage-label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: var(--fw-medium);
}
.manage-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.manage-form select, .manage-form input { height: 36px; }
.manage-form input[name="phone"] { width: 150px; }

@media (max-width: 720px) {
  .manage-grid { flex-direction: column; gap: 14px; }
}

/* Segmented control (gender, etc.) */
.segmented {
  display: flex; gap: 4px;
  background: var(--paper-2);
  border-radius: var(--r-md); padding: 4px;
}
.segmented button, .segmented label {
  flex: 1; padding: 8px 10px; border-radius: 6px;
  border: none; background: transparent;
  color: var(--ink); font-family: inherit; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.segmented button.active, .segmented label.active,
.segmented input:checked + label {
  background: var(--ink); color: var(--paper);
}

/* ---------- Reveal-on-scroll ---------- */
.lul-reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s cubic-bezier(.22, .61, .36, 1); will-change: opacity, transform; }
.lul-reveal.lul-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .lul-reveal { opacity: 1; transform: none; } }

input, select, textarea { transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }

/* ------------------------------------------------------------------ */
/* Skeleton loaders                                                   */
/* ------------------------------------------------------------------ */
.skeleton {
  position: relative;
  background: linear-gradient(90deg, var(--paper-2) 0%, var(--paper-3) 50%, var(--paper-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  overflow: hidden;
}
@keyframes skeleton-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.skeleton img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; position: absolute; top: 0; left: 0; inset: 0; }
.skeleton img.is-loaded, .skeleton img[loading="eager"] { opacity: 1; }
.skeleton-line { display: block; height: 14px; background: linear-gradient(90deg, var(--paper-2) 0%, var(--paper-3) 50%, var(--paper-2) 100%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s ease-in-out infinite; border-radius: 4px; margin-bottom: 8px; }
.skeleton-line.sm { width: 30%; height: 10px; }
.skeleton-line.md { width: 60%; }
.skeleton-line.lg { width: 100%; }

/* Room-card grid (admin /rooms etc.) */
.cards-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.room-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.room-card-img { aspect-ratio: 3 / 2; background: var(--paper-3); position: relative; }
.room-card-body { padding: 12px 14px 14px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery-item { display: flex; flex-direction: column; gap: 6px; }
.gallery-img { aspect-ratio: 4 / 3; background: var(--paper-3); border-radius: var(--r-input); overflow: hidden; position: relative; }

/* ------------------------------------------------------------------ */
/* KPI cards                                                           */
/* ------------------------------------------------------------------ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 360px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 20px;
  position: relative; overflow: hidden;
}
.kpi::after {
  /* The design's accent stripe on the right edge of each KPI tile. Stays
     near-black in both themes so it reads as the "neutral" accent next to
     the coloured semantic variants below. */
  content: ""; position: absolute; top: 0; right: 0;
  width: 4px; height: 100%; background: var(--brand-ink);
}
.kpi.kpi-ok::after   { background: var(--teal); }
.kpi.kpi-warn::after { background: var(--saffron); }
.kpi.kpi-err::after  { background: var(--bad); }
.kpi-label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--fw-medium); margin-bottom: 14px; }
.kpi-value { font-family: var(--font-display); font-size: 30px; font-weight: var(--fw-medium); letter-spacing: -0.025em; color: var(--ink); }
.kpi-sub   { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

.chart-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; margin-bottom: 18px; }
.chart-wrap canvas { max-height: 280px; }
@media (max-width: 768px) { .dashboard-chart-row { grid-template-columns: 1fr !important; } }

/* ------------------------------------------------------------------ */
/* Mobile nav burger + drawer                                          */
/* ------------------------------------------------------------------ */
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}
.nav-burger span { display: block; width: 18px; height: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  display: none;
  padding: 12px 16px 18px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.mobile-menu a:not(.btn) {
  display: block; padding: 12px 4px;
  font-size: 16px; font-weight: var(--fw-medium);
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mobile-menu a:not(.btn):last-child { border-bottom: 0; }
.mobile-menu a:not(.btn)[aria-current="page"] { color: var(--champagne-2); }
.mobile-menu a.btn { margin-top: 10px; }

@media (max-width: 760px) {
  .nav-burger { display: inline-flex; }
  .hide-on-mobile { display: none !important; }
  .mobile-menu:not([hidden]) { display: block; }
}

/* ---------- Theme toggle button ---------- */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  width: 36px; height: 36px;
  /* Zero the browser-default button padding (1px top/bottom, 6px sides) and
     collapse line-height - otherwise the `☀`/`☾` glyphs sit in the lower
     half of the button because their em-box is taller than their visual
     centre. With padding:0 + line-height:1 + flex centring, the glyph's
     bounding box matches the button's optical centre. */
  padding: 0;
  font-size: 16px;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: inherit;
  transition: background-color .15s ease, transform .15s ease;
}
.theme-toggle:hover { background: var(--paper-2); }
.theme-toggle .sun,
.theme-toggle .moon { display: none; line-height: 1; }
.theme-toggle .sun { display: inline; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: inline; }

/* ---------- Sticky-bottom mobile CTA (used on guest + payment flows) ---------- */
.sticky-cta {
  position: sticky; bottom: 0;
  padding: 12px 16px 30px;
  background: linear-gradient(180deg, rgba(250,247,240,0) 0%, var(--paper) 30%);
  margin: 0 -16px -16px;
  z-index: 5;
}
@media (min-width: 600px) { .sticky-cta { margin: 0 -24px -24px; padding-left: 24px; padding-right: 24px; } }
.sticky-cta .btn { width: 100%; justify-content: center; font-size: 15px; min-height: 52px; }
.sticky-cta .sticky-cta-note { text-align: center; font-size: 11px; color: var(--ink-3); margin-top: 8px; }

/* ---------- Mobile app-bar pattern (back arrow + title + action) ----------
   Used on every checkout step on mobile. Sits where the nav would be on the
   page but visually pops out as a top sheet. */
.mobile-appbar {
  display: none;
  align-items: center; gap: 14px;
  padding: 8px 16px 14px;
}
.mobile-appbar .mobile-appbar-back,
.mobile-appbar .mobile-appbar-action {
  width: 38px; height: 38px; border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  text-decoration: none; font-size: 16px;
}
.mobile-appbar .mobile-appbar-title { flex: 1; min-width: 0; }
.mobile-appbar .mobile-appbar-title h1 { font-size: 18px; font-weight: 500; margin: 0; }
.mobile-appbar .mobile-appbar-title .sub { font-size: 11px; color: var(--ink-3); }
@media (max-width: 600px) { .mobile-appbar { display: flex; } }

/* ---------- Guest avatar carousel (mobile occupants) ----------
   On mobile the design shows one guest card at a time with a thumb-friendly
   avatar carousel above it. Wide screens keep the current stacked layout. */
.avatar-carousel {
  display: none;
  gap: 8px; padding: 0 0 14px;
}
.avatar-carousel .avatar-slot { flex: 1; text-align: center; }
.avatar-carousel .avatar-slot .avatar-circle {
  margin: 0 auto;
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--paper);
}
.avatar-carousel .avatar-slot.active .avatar-circle { border-color: var(--ink); }
.avatar-carousel .avatar-slot .name {
  font-size: 10px; margin-top: 6px;
  color: var(--ink-3);
}
.avatar-carousel .avatar-slot.active .name { color: var(--ink); font-weight: 500; }
@media (max-width: 600px) { .avatar-carousel { display: flex; } }

/* ---------- Mobile-specific tweaks for the design's signature surfaces ---------- */
@media (max-width: 600px) {
  /* Ref hero stacks gracefully on mobile and the giant code stays readable. */
  .ref-hero .ref-code { font-size: clamp(24px, 8vw, 36px); }
  /* Pay-mode cards stack 1-col automatically; tighten paddings. */
  .pay-mode { padding: 16px; }
  .pay-mode h3 { font-size: 18px; }
  /* Hide the meta column in schedule rows on small screens. */
  .pay-schedule-row { grid-template-columns: 28px 1fr auto !important; }
  .pay-schedule-row > .pay-cell-meta { display: none; }
  /* Booking summary in checkout stops being sticky on mobile so it doesn't
     pin a tall card to the bottom of the screen. */
  .summary { position: static !important; }
  /* Hero stat strip stacks to 2x2 cleanly. */
  .hero-dark h1 { font-size: clamp(36px, 11vw, 56px); }
  /* Tighten panel padding on mobile so cards don't dwarf the content. */
  .panel { padding: 18px; }
}

/* ---------- Dark hero on mobile uses an ink background bleed ---------- */
body.has-dark-hero { background: #16140F; }
body.has-dark-hero .nav { background: rgba(22,20,15,0.85); border-color: rgba(245,240,230,0.08); }
/* Nav sits over a fixed-dark hero, so text must stay cream regardless of theme.
   --paper would flip to ink in dark mode and disappear against the dark bg. */
body.has-dark-hero .nav .brand,
body.has-dark-hero .nav .brand strong { color: var(--brand-paper); }
body.has-dark-hero .nav .brand small { color: rgba(245,240,230,0.55); }
body.has-dark-hero .nav-links a { color: var(--brand-paper); }
body.has-dark-hero .nav .btn-ghost { color: var(--brand-paper); border-color: rgba(245,240,230,0.35); }
body.has-dark-hero .nav .btn-ghost:hover { background: rgba(245,240,230,0.1); color: var(--brand-paper); }
body.has-dark-hero .nav-burger { border-color: rgba(245,240,230,0.2); }
body.has-dark-hero .nav-burger span { background: var(--brand-paper); }
body.has-dark-hero .theme-toggle { border-color: rgba(245,240,230,0.2); color: var(--brand-paper); }
body.has-dark-hero main { background: var(--paper); border-radius: 0; }

/* ------------------------------------------------------------------ */
/* Mobile-first overrides                                              */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .panel { padding: 16px; min-width: 0; }
  .wrap { padding: 16px; }
  .spread { flex-wrap: wrap; }
  .row { flex-wrap: wrap; }
  .btn { max-width: 100%; white-space: normal; }

  .checkout { display: block; }
  .checkout .summary { margin-top: 16px; position: static; }

  .form-grid { grid-template-columns: 1fr !important; }
  .form-row.span2 { grid-column: span 1 !important; }

  /* Mobile: keep the table at a readable width and scroll it sideways rather
     than cramming columns into stacked single letters. (Window-level sticky
     headers are a desktop affordance; here the wrap is the horizontal scroller.) */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 480px; }
  /* overflow-x:auto makes .table-wrap a scroll container on BOTH axes (the spec
     forces overflow-y from `visible` to `auto`). The desktop header rule
     `position: sticky; top: var(--table-stick-top)` then resolves against the
     wrap and pins the row that many px DOWN from its top - so the header floats
     in the MIDDLE of the table over the data rows. Drop sticky on mobile: the
     header sits in normal flow at the top of the table and scrolls with it
     (sideways + with the page). Covers the variation subheader (tbody th) too. */
  .table th, .table tbody th { position: static; top: auto; box-shadow: inset 0 -1px 0 var(--line); }
  .variations-table .group-row td { position: static; top: auto; }

  .steps { padding: 12px 16px; }
  .step { font-size: 10px; }
  .step + .step::before { width: 12px; margin: 0 2px 0 -2px; }

  .admin-shell { display: block; }
  .admin-topbar { display: flex; }
  .admin-main { padding: 16px; }

  .cards-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: repeat(2, 1fr); }

  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }

  .ref-hero { padding: 22px; }
  .activity-row { padding: 14px 16px; }
}

@media (max-width: 420px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .hero-dark { margin: 0; border-radius: 0; }
}

/* ------------------------------------------------------------------ */
/* Dark mode (kept - flips palette without reshaping layout)           */
/* ------------------------------------------------------------------ */
html[data-theme="dark"] {
  --ink:        #F2EBDB;
  --ink-2:      #CFC4AC;
  --ink-3:      #948775;
  --paper:      #14120E;
  --paper-2:    #1C1A14;
  --paper-3:    #24211A;
  --card:       #1A1812;
  --line:       #2E2A20;
  --line-2:     #4A4332;
  --champagne:   #C9AC6F;
  --champagne-2: #E0C58A;
  --teal:       #6BA48A;
  --teal-2:     #8FC4AB;
  --saffron:    #C9A35B;
  --ok:         #6BA48A;
  --warn:       #C9A35B;
  --bad:        #C58468;

  --color-stormcloud-ink: var(--ink);
  --color-deep-slate:     var(--ink-2);
  --color-slate-text:     var(--ink-2);
  --color-light-slate:    var(--ink-3);
  --color-ash-border:     var(--line);
  --color-page-background:var(--paper);
  --color-pure-white:     var(--card);
  --color-sage:        var(--champagne);
  --color-sage-dark:   var(--champagne-2);
  --color-sage-tint:   var(--paper-2);
  --color-sage-soft:   var(--paper-3);

  --color-ok-fg:   #94d4b0; --color-ok-bg:   #18271f; --color-ok-line:  #224431;
  --color-warn-fg: #e6c489; --color-warn-bg: #2a2417; --color-warn-line:#4a3d20;
  --color-err-fg:  #e8a8a8; --color-err-bg:  #2a1818; --color-err-line: #4a2424;

  --shadow-sm:     rgba(0,0,0,0.40) 0 2px 4px 0;
  --shadow-md:     rgba(0,0,0,0.55) 0 4px 16px 0;
  --shadow-focus:  0 0 0 3px rgba(201,172,111,.32);
}

html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .nav { background: rgba(20,18,14,0.92); }
html[data-theme="dark"] .nav-burger span { background: var(--ink); }
html[data-theme="dark"] .mobile-menu { background: var(--card); }
html[data-theme="dark"] .mobile-menu a:not(.btn) { color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .pill { background: var(--paper-3); color: var(--ink-2); border-color: var(--line); }

/* Role/neutral badges (badge-soft = customer, badge-info = admin/staff) paint
   their chip with --paper-2, which in dark mode collapses to nearly the page
   background - the chip disappears and the muted --ink-3 text drops below a
   readable contrast. Lift the fill to --paper-3, brighten the text, and give
   the chip a visible edge so the role reads at a glance. */
html[data-theme="dark"] .badge-soft { background: var(--paper-3); color: var(--ink-2); border-color: var(--line-2); }
html[data-theme="dark"] .badge-info { background: var(--paper-3); color: var(--ink);   border-color: var(--line-2); }

/* Ink CTAs are painted with the brand-fixed --brand-ink, which doesn't flip in
   dark mode - so a near-black button lands on a near-black page with only a
   transparent border and no visible edge. Give primary/ink buttons a border so
   their shape reads against the dark surface. */
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-ink { border-color: var(--line-2); }

/* admin-topbar + sidebar are pinned to brand tokens so no dark-mode override
   is needed. .admin-main inherits from --paper, which already flips. */
html[data-theme="dark"] .admin-main { background: var(--paper); color: var(--ink); }

/* Auto-flip if the user hasn't manually picked a theme. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --ink:        #F2EBDB;
    --ink-3:      #948775;
    --paper:      #14120E;
    --ink-2:      #CFC4AC;
    --paper-2:    #1C1A14;
    --paper-3:    #24211A;
    --card:       #1A1812;
    --line:       #2E2A20;
    --line-2:     #4A4332;
    --champagne:   #C9AC6F;
  }
  html:not([data-theme]) body { background: var(--paper); color: var(--ink); }
  html:not([data-theme]) .btn-primary,
  html:not([data-theme]) .btn-ink { border-color: var(--line-2); }
  /* Keep role badges legible in the JS-off auto-dark fallback too. */
  html:not([data-theme]) .badge-soft { background: var(--paper-3); color: var(--ink-2); border-color: var(--line-2); }
  html:not([data-theme]) .badge-info { background: var(--paper-3); color: var(--ink);   border-color: var(--line-2); }
}

/* ============================================================
   Visual Markdown editor (public/js/md-editor.js)
   A toolbar + Write/Preview wrapper built around <textarea
   data-md-editor>. Uses the shared design tokens so it themes
   automatically. The textarea keeps its own width/rows.
   ============================================================ */
.md-editor { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); overflow: hidden; }

/* Toolbar - formatting controls styled to match the site .btn theme so the
   editor feels native to the rest of the admin / public UI. */
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 10px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.md-tools { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.md-tool {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px; padding: 7px 12px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: inherit; font-weight: var(--fw-medium); font-size: 12.5px; line-height: 1.25;
  letter-spacing: -0.005em; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease,
              transform .15s cubic-bezier(.34, 1.56, .64, 1);
}
.md-tool:hover { background: var(--paper-2); border-color: var(--line-2); color: var(--ink); }
.md-tool:active { transform: translateY(1px); }
.md-tool:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.md-tool.md-b { font-weight: 700; }
.md-tool.md-i { font-style: italic; font-family: Georgia, serif; }

/* Side-by-side editable surfaces: Write (left) + live Preview (right). Each is
   a tinted, bordered box so it stands apart from the surrounding panel and
   reads as an editable area. Stacks on narrow screens. */
.md-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; background: var(--card); }
.md-col { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-input); background: var(--paper-2); overflow: hidden; }
.md-col-label { padding: 6px 12px; font-size: 11px; font-weight: var(--fw-medium); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.md-col-write { transition: border-color .18s ease, box-shadow .18s ease; }
.md-col-write:focus-within { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.md-col-write textarea { width: 100%; flex: 1; min-height: 120px; border: 0; border-radius: 0; background: transparent; resize: vertical; padding: 12px 14px; font: inherit; line-height: 1.55; color: var(--ink); }
.md-col-write textarea:focus { outline: none; }

.md-preview { flex: 1; padding: 12px 14px; min-height: 120px; color: var(--ink); line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 720px) { .md-split { grid-template-columns: 1fr; } }
.md-preview h2 { font-size: 20px; margin: 0 0 8px; }
.md-preview h3 { font-size: 16px; margin: 14px 0 6px; }
.md-preview p { margin: 0 0 10px; }
.md-preview ul, .md-preview ol { margin: 0 0 10px; padding-left: 22px; }
.md-preview li { margin: 2px 0; }
.md-preview blockquote { margin: 0 0 10px; padding: 6px 14px; border-left: 3px solid var(--teal); color: var(--ink-2); background: var(--paper-2); border-radius: 0 6px 6px 0; }
.md-preview a { color: var(--teal); }
.md-preview .md-empty { color: var(--ink-3); font-style: italic; }

.md-help { margin: 0; padding: 7px 12px; font-size: 11px; color: var(--ink-3); background: var(--paper-2); border-top: 1px solid var(--line); }

/* ============================================================
   Email-body composer (shared: Outbox templates + Broadcasts)
   Both surfaces edit a plain-text body that lib/email-template.js
   turns into HTML (blank line → paragraph, single newline → <br>,
   "- " lines → list, a lone URL → button). Whitespace is therefore
   semantic, so the box is monospace; insertable {token} chips sit
   below it. Insertion is handled by public/js/token-insert.js.
   ============================================================ */
.email-body-input { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; }
.token-row { display: flex; flex-wrap: wrap; gap: 6px; }
.token-chip {
  display: inline-flex; align-items: center;
  padding: 4px 9px; border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 11px; line-height: 1.4;
  letter-spacing: 0; text-transform: none;
  background: var(--paper-2); color: var(--ink-2);
  border: 1px solid var(--line); cursor: copy;
  transition: background-color .15s ease, border-color .15s ease;
}
.token-chip:hover { background: var(--paper-3); border-color: var(--champagne); }
.token-chip:focus-visible { outline: 2px solid var(--champagne); outline-offset: 1px; }

/* ============================================================
   Day-list chip editor (Admin -> Settings: reminder lead days,
   flight-reminder cadence). Progressive enhancement of a plain
   comma-separated text input by public/js/days-editor.js.
   ============================================================ */
.days-editor { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.days-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 30px; }
.days-empty { font-size: 12px; }
.days-unit { font-size: 12px; }
.days-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 10px; border-radius: var(--r-pill);
  font-size: 12px; line-height: 1.4;
  background: var(--paper-2); color: var(--ink-1);
  border: 1px solid var(--line);
}
.days-chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3); cursor: pointer;
  font-size: 14px; line-height: 1;
  transition: background-color .15s ease, color .15s ease;
}
.days-chip-x:hover { background: var(--paper-3); color: var(--ink-1); }
.days-controls { display: flex; gap: 6px; align-items: stretch; }
.days-num { width: 90px; }
.days-controls .btn { display: inline-flex; align-items: center; }
.days-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.days-presets-label { font-size: 11px; }
.days-preset {
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11px; line-height: 1.4;
  background: var(--paper-2); color: var(--ink-2);
  border: 1px solid var(--line); cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.days-preset:hover { background: var(--paper-3); border-color: var(--champagne); }
.days-preset:focus-visible { outline: 2px solid var(--champagne); outline-offset: 1px; }

/* Public-facing rendered Markdown (Terms body, FAQ answers). */
.md-body h2 { font-size: 19px; margin: 22px 0 8px; }
.md-body h2:first-child { margin-top: 0; }
.md-body h3 { font-size: 16px; margin: 18px 0 6px; }
.md-body p { margin: 0 0 12px; line-height: 1.65; }
.md-body ul, .md-body ol { margin: 0 0 12px; padding-left: 22px; }
.md-body li { margin: 4px 0; line-height: 1.6; }
.md-body blockquote { margin: 0 0 12px; padding: 8px 16px; border-left: 3px solid var(--teal); background: var(--paper-2); color: var(--ink-2); border-radius: 0 6px 6px 0; }
.md-body a { color: var(--teal); }
.md-body > :last-child { margin-bottom: 0; }

/* Cookie consent banner (partials/cookie-banner.ejs + js/consent.js).
   Fixed above the chat FAB (z 60) - a consent decision outranks chat. Hidden
   by default via [hidden]; consent.js reveals it when no choice exists. */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; z-index: 70;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; justify-content: center;
  pointer-events: none; /* only the card itself catches clicks */
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner {
  pointer-events: auto;
  max-width: 720px; width: 100%;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-card);
  padding: 16px 18px;
  display: flex; flex-wrap: wrap; gap: 12px 18px;
  align-items: center; justify-content: space-between;
}
.cookie-banner-text { flex: 1 1 320px; min-width: 0; }
.cookie-banner-text strong { display: block; margin-bottom: 4px; font-size: 14px; }
.cookie-banner-text p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.cookie-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
