/* ============================================================
   Otisville Hub — Design System
   Deep navy-blue canvas, brick-red accents, white cards.
   ============================================================ */

:root {
  /* Palette */
  --bg: #103A5C;          /* deep navy-blue canvas */
  --bg-2: #0C2E49;        /* darker navy — footer / sections */
  --red: #C23B2E;         /* brick red — buttons & on-white accents */
  --red-dark: #9E2E24;    /* darker red — hover, hard shadow */
  --red-bright: #FF7E6F;  /* lightened red — accent TEXT on the dark canvas */
  --card: #FFFFFF;        /* cards & inputs */
  --text: #2A2E33;        /* charcoal — text on white cards */
  --muted: #5B6470;       /* muted text on white cards */
  --text-on-dark: #EAF1F8;/* near-white — text on the navy canvas */
  --muted-on-dark: #AEC3D8;/* muted text on the navy canvas */
  --navy: #0A2236;        /* code / mono panels */
  --line: #E2E8F0;        /* hairline borders on white */
  --line-dark: rgba(255, 255, 255, 0.16);

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-card: 0 14px 34px rgba(4, 16, 28, 0.30);
  --shadow-card-hover: 0 18px 44px rgba(4, 16, 28, 0.40);

  /* Motion */
  --t-fast: 150ms;
  --t-base: 220ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-on-dark);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;          /* don't let mobile Safari resize text */
  -webkit-tap-highlight-color: transparent; /* we draw our own press states */
}

h1, h2, h3 {
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: inherit;            /* near-white on canvas, charcoal inside cards */
  margin: 0 0 0.4em;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--red-bright); }

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

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.section { padding: 52px 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--red); color: #fff;
  padding: 10px 16px; border-radius: 0 0 var(--r-sm) 0; z-index: 60; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---------- Top bar & nav ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 18px 0;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.08rem;
  letter-spacing: -0.01em; color: var(--text-on-dark); text-decoration: none;
}
.brand__mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; background: var(--red); color: #fff; flex: none;
  box-shadow: 0 4px 0 0 var(--red-dark);
}
.brand__mark svg { width: 23px; height: 23px; }
.brand small {
  display: block; font-family: 'Inter', sans-serif; font-weight: 500;
  font-size: 0.74rem; color: var(--muted-on-dark); letter-spacing: 0.01em;
}

.bar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.navlink {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 15px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 0.9rem; text-decoration: none;
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-dark);
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease),
              box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.navlink svg { width: 17px; height: 17px; flex: none; }
.navlink:hover { background: rgba(255, 255, 255, 0.18); }
.navlink.is-active {
  background: var(--red); color: #fff; border-color: var(--red-dark);
  box-shadow: 0 3px 0 0 var(--red-dark);
}

.identity {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-dark);
  border-radius: var(--r-pill); padding: 6px 8px 6px 14px;
}
.identity__who { font-size: 0.86rem; line-height: 1.2; }
.identity__who b { display: block; font-weight: 700; }
.identity__who span { color: var(--muted-on-dark); font-size: 0.78rem; }
.btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.10); color: var(--text-on-dark);
  border: 1px solid var(--line-dark); border-radius: var(--r-pill);
  padding: 7px 12px; font: inherit; font-weight: 700; font-size: 0.82rem;
  cursor: pointer; transition: background-color var(--t-base) var(--ease);
}
.btn-link:hover { background: rgba(255, 255, 255, 0.2); }
.btn-link svg { width: 15px; height: 15px; }

/* Mobile menu toggle (hamburger) — injected by identity.js, shown only ≤640px.
   Hidden on desktop; the full nav + identity render inline there as before. */
.nav-toggle {
  display: none;
  width: 46px; height: 46px; flex: none; place-items: center;
  border-radius: 12px; background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-dark); color: var(--text-on-dark);
  cursor: pointer; transition: background-color var(--t-base) var(--ease);
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.18); }
.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle__close { display: none; }
.topbar.nav-open .nav-toggle__open { display: none; }
.topbar.nav-open .nav-toggle__close { display: block; }

/* ---------- Hero ---------- */

.hero { padding: 26px 0 6px; }
.hero__grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); color: var(--red-dark);
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 7px 14px; border-radius: var(--r-pill); margin-bottom: 22px;
}
.eyebrow svg { width: 15px; height: 15px; }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); font-weight: 900; margin-bottom: 18px; }
.hero h1 .accent { color: var(--red-bright); }
.hero__lede {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted-on-dark);
  max-width: 40ch; margin-bottom: 30px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.hero__card {
  background: var(--card); color: var(--text);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 30px;
}
.hero__card h3 { font-size: 1.15rem; margin-bottom: 18px; }

.schedule-list { list-style: none; margin: 0; padding: 0; }
.schedule-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.schedule-list li:last-child { border-bottom: none; }
.schedule-list .day { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.schedule-list .day svg { width: 18px; height: 18px; color: var(--red); }
.schedule-list .hours { color: var(--muted); font-variant-numeric: tabular-nums; }
.schedule-list .closed { color: var(--muted); font-weight: 600; }

/* ---------- Buttons ---------- */

.btn {
  --press: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 16px 26px; border-radius: var(--r-pill); border: 2px solid transparent;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
              background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.btn svg { width: 19px; height: 19px; flex: none; }

.btn--primary { background: var(--red); color: #fff; box-shadow: 0 var(--press) 0 0 var(--red-dark); }
.btn--primary:hover { background: var(--red-dark); }
.btn--primary:active { transform: translateY(calc(var(--press) - 2px)); box-shadow: 0 2px 0 0 var(--red-dark); }

.btn--secondary {
  background: var(--card); color: var(--red-dark); border-color: var(--red);
  box-shadow: 0 4px 0 0 rgba(194, 59, 46, 0.25);
}
.btn--secondary:hover { background: #FFF4F2; }
.btn--secondary:active { transform: translateY(2px); box-shadow: 0 1px 0 0 rgba(194, 59, 46, 0.25); }

.btn--block { width: 100%; }
.btn--lg { padding: 18px 30px; font-size: 1.08rem; }

.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

.btn__spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Snappy taps: no 300ms delay, no double-tap zoom on controls. */
.btn, .navlink, .btn-link, .nav-toggle, .icon-btn, .add-companion,
.chat__send, .btn-cancel, .slot, .suggest button, .brand, .skip-link {
  touch-action: manipulation;
}

/* ---------- Pills / tags ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); color: var(--red-dark);
  font-weight: 700; font-size: 0.78rem; letter-spacing: 0.02em;
  padding: 5px 12px; border-radius: var(--r-pill);
}
.pill svg { width: 13px; height: 13px; }
.pill--ghost { background: rgba(255,255,255,0.1); border-color: var(--line-dark); color: var(--text-on-dark); }
.pill--open { background: #E7F6EC; border-color: #BFE6CC; color: #156B36; }
.pill--full { background: #FDECEA; border-color: #F4C9C3; color: #8A2318; }
.pill--mine { background: #FFF1EF; border-color: #F4C9C3; color: var(--red-dark); }

/* ---------- Cards / panels ---------- */

.card {
  background: var(--card); color: var(--text);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 30px;
}
.panel-head { margin-bottom: 8px; }
.panel-head h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; }
.panel-head p { color: var(--muted-on-dark); }
.card .panel-head p { color: var(--muted); }

.muted { color: var(--muted-on-dark); }
.card .muted, .confirmation .muted, .table-card .muted, .slot-card .muted { color: var(--muted); }

/* ---------- Booking flow ---------- */

.booking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 7px; color: var(--text); }
.label-hint { color: var(--muted); font-weight: 500; }

input[type='text'], input[type='tel'], input[type='date'],
input[type='password'], input[type='number'], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--card);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 13px 14px;
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
input::placeholder, textarea::placeholder { color: #9aa3ad; }
input:hover, select:hover, textarea:hover { border-color: #c3cfdd; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(194, 59, 46, 0.18);
}

/* Booker identity preview inside the form */
.booker-box {
  display: flex; align-items: center; gap: 12px;
  background: #F7FAFD; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; margin-bottom: 18px;
}
.booker-box .brand__mark { width: 38px; height: 38px; box-shadow: 0 3px 0 0 var(--red-dark); }
.booker-box b { display: block; }
.booker-box span { color: var(--muted); font-size: 0.88rem; }

/* Companions */
.companions { display: flex; flex-direction: column; gap: 10px; }
.companion-row { display: flex; gap: 8px; align-items: center; }
.companion-row input { flex: 1; }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--line); background: #FFF1EF; color: var(--red-dark);
  border-radius: var(--r-sm); cursor: pointer;
  transition: background-color var(--t-base) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { background: #FBDFDA; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; }
.add-companion {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  background: var(--card); color: var(--red-dark); border: 1.5px dashed var(--red);
  border-radius: var(--r-pill); padding: 10px 16px; font: inherit; font-weight: 700;
  font-size: 0.9rem; cursor: pointer; transition: background-color var(--t-base) var(--ease);
}
.add-companion:hover { background: #FFF4F2; }
.add-companion[disabled] { opacity: 0.5; cursor: not-allowed; border-style: solid; }
.add-companion svg { width: 16px; height: 16px; }

.party-meter {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  font-weight: 700; color: var(--text);
}
.party-meter .count { color: var(--red-dark); font-family: 'Archivo', sans-serif; font-size: 1.05rem; }
.party-meter.is-full .count { color: #8A2318; }

/* Slots */
.slots-status { color: var(--muted); margin-bottom: 16px; font-weight: 600; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.slot {
  position: relative; text-align: left; color: var(--text);
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 15px 16px; cursor: pointer;
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease),
              transform var(--t-fast) var(--ease);
}
.slot:hover { border-color: var(--red); box-shadow: 0 6px 16px rgba(194, 59, 46, 0.18); }
.slot:active { transform: translateY(1px); }
.slot.is-selected { border-color: var(--red); box-shadow: 0 0 0 2px var(--red) inset, 0 8px 18px rgba(194, 59, 46, 0.22); }
.slot__time { font-weight: 800; font-family: 'Archivo', sans-serif; font-size: 1.02rem; }
.slot__remaining { font-size: 0.85rem; color: var(--muted); margin-top: 3px; }
.slot.is-selected .slot__remaining { color: var(--red-dark); }
.slot[disabled], .slot.is-full { cursor: not-allowed; opacity: 0.6; background: #F4F7FB; }
.slot.is-full:hover { border-color: var(--line); box-shadow: none; }
.slot__check {
  position: absolute; top: 12px; right: 12px; width: 22px; height: 22px;
  color: var(--red); opacity: 0; transition: opacity var(--t-base) var(--ease);
}
.slot.is-selected .slot__check { opacity: 1; }

/* Arrival / departure time inputs + "already booked that day" list */
.time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type='time'] { font-variant-numeric: tabular-nums; }
.booked-day { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.booked-day__title { font-size: 1.02rem; margin: 0 0 4px; }
.day-bookings { display: flex; flex-direction: column; gap: 8px; }
.booked-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #F7FAFD; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 14px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.booked-chip .who { color: var(--muted); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.booked-chip.is-empty { justify-content: center; color: var(--muted); font-weight: 600; }

/* Notices */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--r-md); padding: 16px 18px; font-weight: 600; margin-bottom: 18px;
}
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.notice--info { background: #EFF6FF; color: #1E3A5F; }
.notice--closed { background: #FFF4E5; color: #7A4A12; }
.notice--error { background: #FDECEA; color: #8A2318; }

/* Confirmation */
.confirmation {
  background: var(--card); color: var(--text); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: 34px; text-align: center;
}
.confirmation__badge {
  width: 64px; height: 64px; margin: 0 auto 18px; display: grid; place-items: center;
  border-radius: 50%; background: #E7F6EC; color: #1B7A40;
}
.confirmation__badge svg { width: 34px; height: 34px; }
.confirmation h3 { font-size: 1.6rem; }
.confirmation__detail {
  display: inline-grid; grid-template-columns: auto auto; gap: 8px 22px; text-align: left;
  margin: 20px auto 26px; background: #F7FAFD; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 18px 24px;
}
.confirmation__detail dt { color: var(--muted); font-weight: 600; }
.confirmation__detail dd { margin: 0; font-weight: 700; }

/* ---------- How it works ---------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--card); color: var(--text); border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-card); }
.step__num {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--red); color: #fff; font-family: 'Archivo', sans-serif; font-weight: 800;
  box-shadow: 0 4px 0 0 var(--red-dark); margin-bottom: 14px;
}
.step h3 { font-size: 1.1rem; }
.step p { color: var(--muted); margin: 0; font-size: 0.96rem; }

/* ---------- Booked Times page ---------- */

.day-block { margin-bottom: 30px; }
.day-block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.day-block__head h3 { font-size: 1.35rem; margin: 0; }
.day-block__head .meta { color: var(--muted-on-dark); font-weight: 600; font-size: 0.9rem; }

.slot-card { background: var(--card); color: var(--text); border-radius: var(--r-md); box-shadow: var(--shadow-card); padding: 22px 24px; margin-bottom: 14px; }
.slot-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.slot-card__time { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.2rem; }
.slot-card__tags { display: flex; gap: 8px; flex-wrap: wrap; }

.ride-along {
  display: flex; gap: 10px; align-items: flex-start;
  background: #FFF6F4; border: 1px solid #F4D3CD; border-radius: var(--r-sm);
  padding: 12px 14px; margin: 12px 0 6px; color: var(--red-dark); font-weight: 600;
}
.ride-along svg { width: 19px; height: 19px; flex: none; margin-top: 2px; }
.ride-along a { color: var(--red-dark); font-weight: 800; white-space: nowrap; }

.party-list { list-style: none; margin: 10px 0 0; padding: 0; }
.party {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.party__avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: #EEF3F9; color: var(--red-dark); display: grid; place-items: center;
  font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 0.95rem;
}
.party__body { flex: 1; min-width: 0; }
.party__name { font-weight: 700; }
.party__phone { color: var(--muted); font-size: 0.9rem; }
.party__phone a { color: var(--muted); }
.party__with { font-size: 0.9rem; color: var(--muted); margin-top: 3px; }
.party__with b { color: var(--text); font-weight: 600; }
.party__actions { flex: none; }

.btn-cancel {
  display: inline-flex; align-items: center; gap: 7px; background: var(--card);
  color: var(--red-dark); border: 1.5px solid var(--red); border-radius: var(--r-pill);
  padding: 9px 14px; min-height: 40px; font-weight: 700; font-size: 0.85rem; cursor: pointer;
  transition: background-color var(--t-base) var(--ease), transform var(--t-fast) var(--ease);
}
.btn-cancel:hover { background: #FFF1EF; }
.btn-cancel:active { transform: translateY(1px); }
.btn-cancel svg { width: 15px; height: 15px; }

.empty-state {
  text-align: center; color: var(--muted); background: var(--card);
  border-radius: var(--r-md); box-shadow: var(--shadow-card); padding: 52px 24px;
}
.empty-state svg { width: 44px; height: 44px; color: #B7C2D0; margin-bottom: 10px; }
.empty-state h3 { color: var(--text); }

/* ---------- Assistant ---------- */

.assistant-grid { display: grid; grid-template-columns: 0.9fr 1.6fr; gap: 24px; align-items: start; }

.chat { display: flex; flex-direction: column; height: min(68vh, 640px); padding: 0; overflow: hidden; }
.chat__log { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; padding: 12px 16px; border-radius: 18px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { align-self: flex-start; background: #F1F5FA; color: var(--text); border-bottom-left-radius: 6px; }
.msg.user { align-self: flex-end; background: var(--red); color: #fff; border-bottom-right-radius: 6px; }
.msg.system { align-self: center; background: #FFF4E5; color: #7A4A12; font-size: 0.88rem; font-weight: 600; text-align: center; max-width: 100%; }
.msg.is-typing { color: var(--muted); font-style: italic; }
.chat__form { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--line); background: #FAFCFE; }
.chat__form input { flex: 1; }
.chat__send {
  flex: none; width: 52px; height: 52px; display: grid; place-items: center; border: none;
  border-radius: var(--r-sm); background: var(--red); color: #fff; cursor: pointer;
  box-shadow: 0 4px 0 0 var(--red-dark);
  transition: background-color var(--t-base) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.chat__send:hover { background: var(--red-dark); }
.chat__send:active { transform: translateY(2px); box-shadow: 0 1px 0 0 var(--red-dark); }
.chat__send[disabled] { opacity: 0.55; cursor: not-allowed; }
.chat__send svg { width: 22px; height: 22px; }

.suggest { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.suggest button {
  text-align: left; background: var(--card); border: 1.5px solid var(--line); color: var(--text);
  border-radius: var(--r-sm); padding: 13px 15px; font: inherit; font-weight: 600; cursor: pointer;
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.suggest button:hover { border-color: var(--red); box-shadow: 0 6px 16px rgba(194, 59, 46, 0.16); }

.feature-list { list-style: none; margin: 14px 0 0; padding: 0; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; color: var(--muted); }
.feature-list li svg { width: 19px; height: 19px; color: var(--red); flex: none; margin-top: 2px; }
.feature-list li b { color: var(--text); }

/* ---------- Code / mono panel ---------- */

.code-panel {
  background: var(--navy); color: #E6EDF5; border-radius: var(--r-md);
  padding: 18px 20px; font-family: 'SFMono-Regular', ui-monospace, 'Menlo', 'Consolas', monospace;
  font-size: 0.92rem; line-height: 1.7; overflow-x: auto;
}
.code-panel .tok { color: #7FB7F2; }

/* ---------- Sign-in overlay ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(7, 22, 37, 0.86); backdrop-filter: blur(5px);
  display: grid; place-items: center;
  /* keep the card clear of the notch / home indicator on phones */
  padding:
    max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}
.overlay__card { width: 100%; max-width: 440px; }
.overlay__card .brand__mark { width: 46px; height: 46px; margin-bottom: 16px; }

/* Prison-cell sign-in: black backdrop with vertical metal bars + top/bottom rails.
   The bars are decorative (aria-hidden, pointer-events:none) and sit BEHIND the
   form (z-index), so they never block keyboard or pointer access to the inputs. */
.overlay--cell { background-color: #05070a; backdrop-filter: none; overflow: hidden; }
.cell-bars {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-color: transparent;
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 60px, rgba(0,0,0,.55) 60px 68px, rgba(0,0,0,0) 68px 76px),
    repeating-linear-gradient(90deg,
      rgba(0,0,0,0) 0 26px,
      #14171b 26px, #353c44 30px, #6e7782 36px, #c7cfd7 42px, #eef3f8 44px,
      #c7cfd7 46px, #6e7782 52px, #353c44 58px, #14171b 62px,
      rgba(0,0,0,0) 62px 76px);
  transition: transform 820ms cubic-bezier(.5, 0, .2, 1);
  will-change: transform;
}
.cell-cross {
  position: absolute; left: -2%; right: -2%; height: 30px;
  background: linear-gradient(180deg, #14171b, #353c44 18%, #aeb6bf 46%, #eef3f8 52%, #aeb6bf 58%, #353c44 82%, #14171b);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
}
.cell-cross--top { top: 13%; }
.cell-cross--bottom { bottom: 13%; }
.overlay--cell .overlay__card { position: relative; z-index: 2; }

/* Gate lift on successful sign-in */
.overlay--cell.is-opening { background-color: transparent; transition: background-color 700ms ease; }
.overlay--cell.is-opening .cell-bars { transform: translateY(-120%); }
.overlay--cell.is-opening .overlay__card {
  opacity: 0; transform: translateY(-10px);
  transition: opacity 360ms ease, transform 520ms ease;
}

/* ---------- Footer ---------- */

.footer { background: var(--bg-2); color: #C4CEDB; margin-top: 56px; border-top: 1px solid var(--line-dark); }
.footer .container { padding-top: 48px; padding-bottom: 40px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer h4 { font-family: 'Archivo', sans-serif; color: #fff; font-size: 0.95rem; letter-spacing: 0.02em; margin: 0 0 14px; }
.footer a { color: #C4CEDB; text-decoration: none; transition: color var(--t-base) var(--ease); }
.footer a:hover { color: #fff; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 10px; display: flex; align-items: center; gap: 9px; }
.footer li svg { width: 17px; height: 17px; color: #7FB7F2; flex: none; }
.footer__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer__brand strong { font-family: 'Archivo', sans-serif; color: #fff; font-size: 1.05rem; }
.footer__legal { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 32px; padding-top: 20px; font-size: 0.85rem; color: #9AA8B8; }

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

.is-hidden { display: none !important; }
.mt-24 { margin-top: 24px; }
.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 visibility ---------- */

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, .slot:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--red-dark); outline-offset: 2px;
}
/* On the dark canvas, use a light ring so it's visible against navy. */
.navlink:focus-visible, .skip-link:focus-visible, .footer a:focus-visible,
.hero__cta .btn:focus-visible, .identity .btn-link:focus-visible,
.nav-toggle:focus-visible, .brand:focus-visible { outline-color: var(--text-on-dark); }

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

@media (max-width: 980px) {
  .assistant-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 28px; }
  .booking-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 26px; }
  .topbar { gap: 12px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }

  /* Anchor jumps land below the sticky header instead of under it. */
  html { scroll-padding-top: 84px; }

  /* --- Consistent edge gutters everywhere, respecting device safe areas.
         Nothing touches the screen edge; notch/home-indicator are cleared. --- */
  .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .section { padding: 32px 0; }

  /* --- Header: compact, sticky, with its own surface so content scrolls
         cleanly underneath. The hamburger menu slides + fades open. --- */
  header.container {
    position: sticky; top: 0; z-index: 50;
    background: var(--bg);
    padding-top: env(safe-area-inset-top);
    box-shadow: 0 6px 20px rgba(4, 16, 28, 0.28);
  }
  .topbar { padding: 12px 0; gap: 12px; }
  .topbar.js-nav .brand { flex: 1; min-width: 0; }
  .brand small { font-size: 0.7rem; }
  .nav-toggle { display: inline-grid; }

  /* Collapsed by default; animate max-height + opacity + slide for a smooth
     open/close (no jarring jump). visibility flips after the collapse so the
     hidden links leave the tab order. */
  .topbar.js-nav .bar-right {
    display: flex; width: 100%; flex-basis: 100%;
    flex-direction: column; align-items: stretch; gap: 10px;
    max-height: 0; margin-top: 0; opacity: 0; visibility: hidden;
    overflow: hidden; transform: translateY(-6px);
    transition: max-height var(--t-base) var(--ease),
                opacity var(--t-base) var(--ease),
                transform var(--t-base) var(--ease),
                margin-top var(--t-base) var(--ease),
                visibility 0s linear var(--t-base);
  }
  .topbar.js-nav.nav-open .bar-right {
    max-height: 480px; margin-top: 12px; opacity: 1; visibility: visible;
    overflow: visible; transform: translateY(0);
    transition: max-height var(--t-base) var(--ease),
                opacity var(--t-base) var(--ease),
                transform var(--t-base) var(--ease),
                margin-top var(--t-base) var(--ease),
                visibility 0s;
  }
  .topbar.js-nav .nav { flex-direction: column; width: 100%; gap: 8px; }
  .topbar.js-nav .navlink {
    width: 100%; justify-content: flex-start; min-height: 48px;
    padding: 13px 16px; font-size: 1rem;
  }
  .topbar.js-nav .identity {
    width: 100%; justify-content: space-between; padding: 10px 12px 10px 16px;
  }
  .topbar.js-nav .btn-link { min-height: 44px; }

  /* --- Hero: smaller headline, roomier spacing, full-width stacked CTAs --- */
  .hero { padding: 20px 0 4px; }
  .eyebrow { margin-bottom: 16px; }
  .hero h1 { font-size: clamp(1.9rem, 7vw, 2.5rem); margin-bottom: 16px; }
  .hero__lede { font-size: 1.05rem; margin-bottom: 24px; }
  .hero__grid { gap: 22px; }
  .hero__cta { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero__cta .btn { width: 100%; }

  /* --- Cards & headings: breathing room inside, calm rhythm between --- */
  .card, .hero__card, .confirmation { padding: 22px; }
  h1, h2, h3 { overflow-wrap: break-word; }
  .panel-head { margin-bottom: 14px; }

  /* --- Touch targets: every control comfortably tappable (≥44–48px) --- */
  input[type='text'], input[type='tel'], input[type='date'], input[type='time'],
  input[type='password'], input[type='number'], select, textarea {
    min-height: 48px; padding: 14px;
  }
  .btn { padding: 16px 24px; }
  .icon-btn { width: 48px; height: 48px; }
  .add-companion { min-height: 48px; }

  /* --- Booking flow: single-column slots --- */
  .booking-grid { gap: 16px; }
  .slots { grid-template-columns: 1fr; gap: 10px; }
  .time-fields { grid-template-columns: 1fr; gap: 4px; }
  .confirmation__detail { grid-template-columns: 1fr; gap: 4px 0; padding: 16px 18px; }
  .confirmation__detail dt { margin-top: 8px; }
  .confirmation__detail dt:first-of-type { margin-top: 0; }

  /* --- Booked Times --- */
  .day-block { margin-bottom: 24px; }
  .slot-card { padding: 18px; margin-bottom: 12px; }
  .day-block__head { flex-wrap: wrap; }
  .party { flex-wrap: wrap; }
  .party__actions { width: 100%; }
  .btn-cancel { min-height: 44px; width: 100%; justify-content: center; }

  /* --- Assistant chat --- */
  .assistant-grid { gap: 16px; }
  .chat { height: min(72vh, 560px); }
  .chat__log { padding: 18px; gap: 12px; }
  .chat__form { padding: 14px; }
  .msg { max-width: 88%; }

  /* --- Footer: clear the home indicator, calmer spacing --- */
  .footer { margin-top: 40px; }
  .footer .container {
    padding-top: 36px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .btn--primary:active, .btn--secondary:active, .slot:active,
  .icon-btn:active, .chat__send:active, .navlink.is-active { transform: none; }
  /* Cell gate: no animation — JS also removes the overlay immediately. */
  .overlay--cell .cell-bars { transition: none; }
  .overlay--cell.is-opening .cell-bars { transform: none; }
  .overlay--cell.is-opening .overlay__card { transition: none; }
}
