/* ==========================================================================
   STURA, Raya photoshoot booking. See DESIGN.md.
   Calm panels and step-by-step layout, Archivo, Hijau Raya colours, Anyaman logo.
   Components use only the variables below.
   ========================================================================== */

:root {
  /* Base */
  --bg: #f6faf7;
  --surface: #ffffff;
  --surface-2: #eef5f0;
  --border: #d3e0d8;
  --border-strong: #7d9488;

  /* Text */
  --text: #0d2b1f;
  --text-2: #4a6156;
  --placeholder: #66786f;

  /* Hijau Raya */
  --nav: #0a4630;
  --nav-track: #0f5b3e;
  --nav-ink: #f7fbf8;
  --nav-soft: #d5e8dd;
  --primary: #0b6644;
  --primary-soft: #d5e8dd;
  --gold: #f2c14e;
  --gold-press: #e2ae33;
  --gold-soft: #fbe7b2;

  /* Feedback */
  --danger: #a4231d;
  --danger-press: #861b16;
  --danger-soft: #fdeceb;
  --chat: #e7f6dd;
  --shade: rgba(6, 30, 20, 0.5);

  /* Package colours (dots and bars, chosen per package in Settings) */
  --pkg-maroon: #b3243b;
  --pkg-gold: #dda01e;
  --pkg-emerald: #1f8a5b;
  --pkg-teal: #1f7a86;
  --pkg-plum: #7b3f8c;
  --pkg-navy: #2c5aa0;

  /* Type */
  --font: 'Archivo Variable', 'Segoe UI', system-ui, sans-serif;
  --fs-xs: 13px; --lh-xs: 16px;
  --fs-sm: 15px; --lh-sm: 20px;
  --fs-base: 16px; --lh-base: 24px;
  --fs-lg: 18px; --lh-lg: 26px;
  --fs-xl: 22px; --lh-xl: 28px;
  --fs-2xl: 30px; --lh-2xl: 36px;

  /* Shape and depth */
  --r-sm: 8px;
  --r-md: 12px;
  --r-pill: 999px;
  --shadow-float: 0 8px 24px rgba(10, 70, 48, 0.12), 0 2px 6px rgba(10, 70, 48, 0.06);

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 120ms;
  --t-med: 200ms;

  --topbar-h: 64px;
  --tabbar-h: 64px;
}

/* Status and package helpers (they set variables; components read them) */
.st--booked { --st: var(--nav); --st-soft: var(--nav-soft); }
.st--shoot_done { --st: var(--text); --st-soft: var(--gold-soft); }
.st--edited { --st: var(--text); --st-soft: var(--gold); }
.st--delivered { --st: var(--nav-ink); --st-soft: var(--primary); }
.st--cancelled { --st: var(--text-2); --st-soft: var(--surface-2); }
.pkg--maroon { --pkg: var(--pkg-maroon); }
.pkg--gold { --pkg: var(--pkg-gold); }
.pkg--emerald { --pkg: var(--pkg-emerald); }
.pkg--teal { --pkg: var(--pkg-teal); }
.pkg--plum { --pkg: var(--pkg-plum); }
.pkg--navy { --pkg: var(--pkg-navy); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding: calc(var(--topbar-h) + 16px) 0 calc(var(--tabbar-h) + 24px); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh-base); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 4px; }
a:hover { color: var(--nav); }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h4 { font-size: inherit; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
abbr { text-decoration: none; }
::selection { background: var(--gold); color: var(--text); }
.muted { color: var(--text-2); }
.prewrap { white-space: pre-wrap; }
.is-hidden { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.icon { flex: none; width: 18px; height: 18px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.topbar :focus-visible, .tabbar :focus-visible { outline-color: var(--gold); }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--gold); color: var(--text); padding: 12px 16px; border-radius: var(--r-sm); z-index: 60; }
.skip-link:focus { top: 8px; }

/* ---------- App shell ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); background: var(--nav); color: var(--nav-ink); border-bottom: 2px solid var(--gold); }
.topbar__inner {
  height: 100%; max-width: 1264px; margin: 0 auto; padding: 0 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--nav-ink); justify-self: start; min-height: 44px; }
.brand:hover { color: var(--nav-ink); }
.brand__mark { flex: none; }
.brand__eye { fill: var(--gold); }
.brand__name { font-weight: 850; font-stretch: 118%; font-size: var(--fs-xl); line-height: 1; }
.brand__sub { font-size: var(--fs-sm); color: var(--nav-soft); white-space: nowrap; }

.segmented { display: none; gap: 4px; padding: 4px; background: var(--nav-track); border-radius: var(--r-pill); }
.segmented__item {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--r-pill);
  color: var(--nav-soft); text-decoration: none; font-size: var(--fs-sm); font-weight: 650;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented__item:hover { color: var(--nav-ink); background: var(--nav); }
.segmented__item.is-active { background: var(--gold); color: var(--text); }

.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(3, 1fr); background: var(--nav);
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--nav-soft); text-decoration: none; font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 650;
}
.tabbar__item:hover { color: var(--nav-ink); }
.tabbar__item .icon { width: 22px; height: 22px; }
.tabbar__item.is-active { color: var(--gold); }
.tabbar__item:focus-visible { outline-offset: -4px; }

@media (max-width: 767px) { .topbar__inner { display: flex; } }
@media (min-width: 768px) {
  html { scroll-padding-bottom: 24px; }
  .segmented { display: inline-flex; }
  .tabbar { display: none; }
  .topbar__inner { padding: 0 24px; }
}
@media (min-width: 768px) and (max-width: 900px) { .brand__sub { display: none; } }

.main { padding: 16px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
.container { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.container--narrow { max-width: 760px; }
.container--settings { max-width: 960px; }
@media (min-width: 768px) { .main { padding: 24px 24px 64px; } }
@media (min-width: 1024px) { .main { padding: 32px 32px 64px; } }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.page-title { font-size: var(--fs-2xl); line-height: var(--lh-2xl); font-weight: 800; font-stretch: 92%; letter-spacing: -0.01em; }
.page-sub { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); margin-top: 4px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; min-width: 0; }
@media (min-width: 768px) { .panel { padding: 24px; } }
.section-title { font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.panel-sub { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); margin-top: 4px; max-width: 70ch; }
.panel-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.panel .slots-empty { margin-top: 16px; }

.layout-cal { display: grid; gap: 24px; align-items: start; }
.layout-cal > * { min-width: 0; }
/* Bookings on phones and tablets: the list comes first, the calendar below it. */
@media (max-width: 1023px) { .layout-cal--list-first > .panel:last-child { order: -1; } }
@media (min-width: 1024px) {
  .layout-cal { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .layout-cal > .panel:first-child { position: sticky; top: calc(var(--topbar-h) + 24px); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: var(--fs-sm); font-weight: 650; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; touch-action: manipulation;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { color: var(--text-2); cursor: not-allowed; }
.btn--primary { background: var(--gold); color: var(--text); }
.btn--primary:hover { background: var(--gold-press); color: var(--text); }
.btn--secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--primary); color: var(--text); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--surface); border-color: var(--border-strong); color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn--danger-solid { background: var(--danger); color: var(--nav-ink); }
.btn--danger-solid:hover { background: var(--danger-press); color: var(--nav-ink); }
.btn--block { width: 100%; }
.btn .icon--wa { color: var(--primary); }
.btn.is-loading, .btn.is-busy { pointer-events: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); cursor: pointer; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--primary); color: var(--text); }
.icon-btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.icon-btn--ghost:hover { border-color: transparent; }

.link-btn {
  display: inline-flex; align-items: center; align-self: flex-start; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none;
  color: var(--primary); font-size: var(--fs-sm); font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 4px;
}
.link-btn:hover { color: var(--nav); }

/* ---------- Badges and small labels ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--st-soft); color: var(--st); font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 650; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.is-cancelled-name { text-decoration: line-through; color: var(--text-2); }
.kiv { display: inline-flex; align-items: center; padding: 0 8px; border-radius: var(--r-pill); background: var(--gold-soft); color: var(--text); font-size: var(--fs-xs); line-height: 20px; font-weight: 700; }
.pkg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--pkg, var(--text-2)); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: var(--r-pill); font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 650; }
.pill .icon { width: 14px; height: 14px; }
.pill--ok { background: var(--primary-soft); color: var(--nav); }
.pill--warn { background: var(--gold-soft); color: var(--text); }
.tag, .todo-who { font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 650; color: var(--text-2); background: var(--surface-2); padding: 4px 8px; border-radius: var(--r-pill); }

/* ---------- Calendar (shared by Book and Bookings) ---------- */
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cal__title { font-size: var(--fs-2xl); line-height: var(--lh-2xl); font-weight: 800; font-stretch: 92%; letter-spacing: -0.01em; min-width: 0; }
.cal__nav { display: flex; align-items: center; gap: 8px; flex: none; }
.cal__title-short { display: none; }
.cal__filters { display: flex; gap: 8px; margin-bottom: 16px; }
.cal__filters select { flex: 0 1 200px; }
.cal__filters .input-icon { flex: 1 1 auto; }
.cal__grid { display: flex; flex-direction: column; gap: 8px; }
.cal__row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal__cell { display: flex; min-width: 0; }
.cal__cell > .cal-day { flex: 1; min-width: 0; }
.cal__dow { text-align: center; font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 550; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); padding-bottom: 4px; }
.cal-day {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  min-height: 84px; padding: 8px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.cal-day:hover { border-color: var(--primary); color: var(--text); }
.cal-day--blank { border: 0; background: transparent; }
/* The date; today is a filled circle */
.cal-day__num { display: inline-grid; place-items: center; align-self: flex-start; width: 28px; height: 28px; margin: -4px 0 0 -4px; border-radius: 50%; font-size: var(--fs-base); line-height: 1; font-weight: 700; }
.cal-day.is-today .cal-day__num { background: var(--nav); color: var(--nav-ink); }
.cal-day.is-past .cal-day__num { color: var(--text-2); font-weight: 450; }
/* The day in words */
.cal-day__info { margin-top: auto; font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 650; color: var(--nav); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day__count { color: var(--text-2); font-weight: 600; }
.cal-day__short { display: none; }
.cal-day.is-past .cal-day__info { color: var(--text-2); }
/* How full the day is, in package colours */
.cal-day__strip { display: flex; gap: 1px; height: 8px; margin-top: auto; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.cal-day__info + .cal-day__strip { margin-top: 0; }
.cal-day__strip i { flex: none; height: 100%; background: var(--pkg); }
.cal-day.is-past .cal-day__strip { opacity: 0.55; }
.cal-day.is-full { background: var(--primary-soft); border-color: var(--primary-soft); }
.cal-day.is-full .cal-day__strip { background: var(--surface); }
.cal-day.is-off { background: repeating-linear-gradient(135deg, var(--border) 0 2px, var(--surface) 2px 8px); }
.cal-day.is-off .cal-day__info { color: var(--text); align-self: flex-start; padding: 0 4px; border-radius: 4px; background: var(--surface); }
.cal-day.is-selected, .cal-day.is-selected:hover { border-color: var(--nav); box-shadow: inset 0 0 0 2px var(--nav); }
.cal__legend { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.cal__keys { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-bar { width: 20px; height: 6px; border-radius: 3px; background: var(--pkg); flex: none; }
.legend-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); flex: none; }
.legend-swatch--full { background: var(--primary-soft); border-color: var(--primary-soft); }
.legend-swatch--off { background: repeating-linear-gradient(135deg, var(--border-strong) 0 2px, transparent 2px 6px); }
.legend-today { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--nav); color: var(--nav-ink); font-size: var(--fs-xs); font-weight: 700; flex: none; }
.cal.is-loading .cal__grid { opacity: 0.5; }
@media (max-width: 767px) {
  .cal__title { font-size: var(--fs-xl); line-height: var(--lh-xl); }
  .cal__grid, .cal__row { gap: 4px; }
  .cal__dow { letter-spacing: 0; }
  .cal-day { min-height: 60px; padding: 4px; gap: 2px; }
  .cal-day__num { width: 24px; height: 24px; margin: 0; font-size: var(--fs-sm); }
  .cal-day__count { display: none; } /* the bar shows it; the count is read out and on hover */
  .cal-day__long { display: none; }
  .cal-day__short { display: inline; }
  .cal-day__strip { height: 6px; }
  .cal__title-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cal__title-short { display: inline; }
  .cal__nav .btn { padding: 0 12px; }
  .cal__filters { flex-wrap: wrap; }
  .cal__filters select, .cal__filters .input-icon { flex: 1 1 100%; }
}
@media (max-width: 23rem) { .cal__title { font-size: var(--fs-lg); } .cal__nav { gap: 4px; } }

/* ---------- Lists of bookings ---------- */
.day-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; margin-bottom: 16px; }
.day-head__meta { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); margin-top: 4px; overflow-wrap: anywhere; }
.card-list { display: flex; flex-direction: column; gap: 12px; }
.bcard {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.bcard:hover { background: var(--surface-2); border-color: var(--primary); color: var(--text); }
.bcard.is-selected { border-color: var(--nav); box-shadow: inset 0 0 0 1px var(--nav); background: var(--surface-2); }
.bcard:focus-visible { outline-offset: 3px; }
.bcard__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; }
.bcard__name { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 700; overflow-wrap: anywhere; }
.bcard__facts { display: grid; gap: 4px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.bcard__facts > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
.bcard__facts dt { color: var(--text-2); }
.bcard__facts dd { font-weight: 600; overflow-wrap: anywhere; }
.bcard__facts .pkg-dot { margin-right: 8px; }
.bcard__note { font-weight: 400; color: var(--text-2); }
@media (max-width: 23rem) { .bcard__facts > div { grid-template-columns: 96px minmax(0, 1fr); gap: 8px; } }
.progress { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.progress__step {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 600;
}
.progress__step .icon { width: 14px; height: 14px; }
.progress__step.is-done { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--nav); }

.tabs { display: flex; gap: 4px; margin: -4px 0 20px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs--page { margin: -8px 0 0; }
.tabs__tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 650; white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab:focus-visible { outline-offset: -4px; }
.tabs__tab.is-active { color: var(--primary); }
.tabs__tab.is-active::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--primary); }
.tabs__count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); line-height: 1; font-weight: 700; }
.tabs__tab.is-active .tabs__count { background: var(--primary-soft); color: var(--nav); }
.tabs__count--alert, .tabs__tab.is-active .tabs__count--alert { background: var(--gold-soft); color: var(--text); }
@media (max-width: 767px) {
  .tabs--page { flex-wrap: wrap; overflow: visible; border-bottom: 0; gap: 8px; margin: 0; }
  .tabs--page .tabs__tab { border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); padding: 0 16px; }
  .tabs--page .tabs__tab.is-active { background: var(--nav); border-color: var(--nav); color: var(--nav-ink); }
  .tabs--page .tabs__tab.is-active::after { display: none; }
  .tabs:not(.tabs--page) { justify-content: space-between; gap: 0; }
  .tabs:not(.tabs--page) .tabs__tab { padding: 0 4px; gap: 4px; }
  .tabs__tab.is-active::after { left: 4px; right: 4px; }
}
@media (max-width: 23rem) { .tabs:not(.tabs--page) .tabs__tab { padding: 0; font-size: 14px; } .tabs__count { min-width: 20px; height: 20px; padding: 0 4px; } .tabs__tab.is-active::after { left: 0; right: 0; } }
.list-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0 8px; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 700; }
.todo-group:first-of-type > .list-label, .tabs + .list-label { margin-top: 0; }
.todo-group + .todo-group { margin-top: 24px; }
.todo-group .help { margin: 0 0 12px; }

/* Tomorrow's reminders */
.remind-list { border-top: 1px solid var(--border); }
.remind { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.remind__info { display: flex; gap: 12px; flex: 1 1 200px; min-width: 0; min-height: 44px; color: var(--text); text-decoration: none; }
.remind__info:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.remind__time { flex: 0 0 76px; font-weight: 700; white-space: nowrap; }
.remind__time small { display: block; font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 450; color: var(--text-2); }
.remind__main { min-width: 0; overflow-wrap: anywhere; }
.remind__main > * { display: block; }
.remind__main > span { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.remind__main .kiv { margin-right: 4px; }
.remind__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.remind__state { display: none; align-items: center; gap: 4px; color: var(--primary); font-size: var(--fs-sm); font-weight: 650; }
.remind.is-done .remind__state { display: inline-flex; }
.remind.is-done .remind__acts > .btn { display: none; }
.remind.is-done .remind__main strong { font-weight: 500; }
.banner--tight { margin: 0 0 16px; }

/* ---------- One booking, in a window over the Bookings page ---------- */
.bwin {
  width: min(1040px, calc(100vw - 48px)); max-width: none; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  padding: 0; border: 0; border-radius: var(--r-md); background: var(--surface); color: var(--text);
  overflow-y: auto; overscroll-behavior: contain; box-shadow: var(--shadow-float);
}
.bwin:not([open]) { display: none; }
.bwin::backdrop { background: var(--shade); }
.bwin[open] { animation: win-in var(--t-med) var(--ease); }
@keyframes win-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body:has(.bwin[open]) { overflow: hidden; }
.bwin[aria-busy='true'] .detail { opacity: 0.6; transition: opacity var(--t-fast) var(--ease) 80ms; }
@media (max-width: 639px) {
  .bwin { width: 100vw; height: 100vh; height: 100dvh; max-height: none; margin: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
}
.detail { display: flex; flex-direction: column; min-width: 0; }
.detail__top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; padding: 8px 12px 8px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.detail__no { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 650; color: var(--text-2); }
.detail__tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.detail__back { display: none; }
.detail__head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.detail__name { font-size: 28px; line-height: 34px; font-weight: 800; font-stretch: 92%; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.detail__name:focus { outline: 0; }
.detail__name:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; border-radius: 4px; }
.detail__when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: -4px; font-weight: 600; }
.detail__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.detail__acts form { margin: 0; }
.detail__sec { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.detail__sec > h3 { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 650; color: var(--text-2); margin-bottom: 12px; }
.detail__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 16px 24px; }
.detail__no--foot { font-weight: 450; }
@media (max-width: 639px) {
  .detail__back { display: inline-flex; }
  .detail__close, .detail__top > .detail__no { display: none; }
  .detail__top { padding-left: 16px; }
}
/* Wide window: Details and Payment on the left, Photos and delivery on the right */
@media (min-width: 900px) {
  .detail__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .detail__col + .detail__col { border-left: 1px solid var(--border); }
  .detail__col > .detail__sec:last-child { border-bottom: 0; }
}
@media (max-width: 767px) {
  .detail__head, .detail__sec { padding: 16px; }
  .detail__foot { padding: 16px; }
  .detail__name { font-size: 26px; line-height: 32px; }
}

/* Details: label on the left, value on the right */
.facts { display: grid; gap: 8px; }
.facts > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; }
.facts dt { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-base); }
.facts dd { font-weight: 550; overflow-wrap: anywhere; }
.facts .pkg-dot { margin-right: 8px; }
.facts__note { font-weight: 400; color: var(--text-2); }
@media (max-width: 767px) { .facts > div { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; } }
@media (max-width: 23rem) { .facts > div { grid-template-columns: 1fr; gap: 0; } }

/* Payment in plain words */
.paid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.paid__main { display: flex; align-items: center; gap: 8px; font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 750; }
.paid__main.is-done { color: var(--nav); }
.paid__sub { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); margin-top: 4px; }
.paid form { margin: 0; }

/* Photos and delivery: done steps are one line, only the current step is open */
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.step:first-child { border-top: 0; padding-top: 0; }
.step:last-child { padding-bottom: 0; }
.step__mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; }
.step__mark .icon { width: 16px; height: 16px; }
.step.is-done .step__mark { background: var(--primary); border-color: var(--primary); color: var(--nav-ink); }
.step.is-current .step__mark { background: var(--gold); border-color: var(--gold); color: var(--text); }
.step__body { min-width: 0; }
.step__line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; min-height: 28px; }
.step__title { font-weight: 700; }
.step.is-later .step__title { font-weight: 550; color: var(--text-2); }
.step__meta { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.step.is-current .step__meta { color: var(--text); font-weight: 600; }
.step__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; margin-top: 4px; }
.step__tools form { margin: 0; }
.step__tools .fold[open] { flex-basis: 100%; }
.step__tools .fold > summary { min-height: 44px; }
.step__work { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 12px; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); }
.step__work > form, .step__work .link-form { align-self: stretch; }
.step__row { display: flex; flex-wrap: wrap; gap: 8px; }
.step .field__error { margin-top: 8px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 128px; padding: 16px;
  border: 2px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text);
  text-align: center; cursor: pointer; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.dropzone:hover { border-color: var(--primary); }
.dropzone .icon { width: 28px; height: 28px; color: var(--primary); }
.dropzone__label { font-weight: 700; }
.dropzone__hint { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.dropzone.is-busy { pointer-events: none; }
.sr-only:focus-visible + label { outline: 3px solid var(--primary); outline-offset: 2px; }
.selfie__thumb { display: block; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; overflow: hidden; cursor: zoom-in; background: var(--surface-2); flex: none; }
.selfie__thumb img { width: 44px; height: 44px; object-fit: cover; }
.link-form { display: flex; gap: 8px; }
.link-form input { flex: 1; min-width: 0; }
@media (max-width: 23rem) { .link-form { flex-direction: column; } }
.status-form { display: flex; align-items: center; gap: 12px; }
.status-form label { font-size: var(--fs-sm); color: var(--text-2); }
.status-form select { width: auto; min-width: 168px; }

/* Move to another date or time */
.move-panel { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); }
.move-panel[hidden] { display: none; }
.move-panel__title { font-size: var(--fs-base); line-height: var(--lh-base); font-weight: 700; }
.move-panel__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
@media (min-width: 480px) { .move-panel .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; } }

/* Menus: More actions, and WhatsApp messages */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 208px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-float);
}
.menu--left .menu__list { right: auto; left: 0; }
.menu__item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer;
}
.menu__item:hover { background: var(--surface-2); color: var(--text); }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover { color: var(--danger); background: var(--danger-soft); }

.fold > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; color: var(--primary); font-size: var(--fs-sm); font-weight: 650; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { color: var(--nav); text-decoration: underline; text-underline-offset: 4px; }
.fold[open] > summary { margin-bottom: 8px; }

[aria-busy='true'] { cursor: progress; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 24px; }
.group { display: flex; flex-direction: column; gap: 16px; }
.group__title { font-size: var(--fs-base); line-height: var(--lh-base); font-weight: 700; padding: 0; }
/* Floated legends behave like normal headings (no border notch, normal spacing). */
.group > legend, .field > legend { float: left; width: 100%; margin: 0; }
.group > legend + *, .field > legend + * { clear: both; }
.group + .group { padding-top: 24px; border-top: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .field > legend, .label { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; color: var(--text); padding: 0; }
.optional { font-weight: 400; color: var(--text-2); }
.field--short { max-width: 240px; }
.grid-2 { display: grid; gap: 16px; align-items: start; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
input[type='text'], input[type='tel'], input[type='url'], input[type='search'], input[type='date'], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: var(--fs-base); line-height: var(--lh-base);
  transition: border-color var(--t-fast) var(--ease);
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--text-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 0; }
input:disabled { background: var(--surface-2); border-color: var(--border); color: var(--text-2); cursor: not-allowed; }
fieldset:disabled .btn { background: var(--surface-2); border-color: var(--border); }
select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%230d2b1f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
[aria-invalid='true'] { border-color: var(--danger) !important; box-shadow: inset 0 0 0 1px var(--danger); }
.field__error { display: flex; align-items: flex-start; gap: 8px; color: var(--danger); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; }
.field__error:empty { display: none; }
.field__error::before {
  content: ''; flex: none; width: 16px; height: 16px; margin-top: 2px; background: currentColor;
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E");
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
}
#date-err:not(:empty), #package_id-err:not(:empty), #start_time-err:not(:empty) { margin-top: 12px; }
#package_id-err:not(:empty) { margin: -8px 0 16px; }
.help { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.input-prefix, .input-icon { position: relative; }
.input-prefix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.input-prefix > input { padding-left: 44px; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.input-icon > input { padding-left: 40px; }
.join { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

/* Switch (KIV) */
.switch { position: relative; display: inline-flex; align-items: center; align-self: flex-start; gap: 12px; min-height: 44px; cursor: pointer; font-size: var(--fs-sm); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 44px; height: 24px; border-radius: var(--r-pill); background: var(--border-strong); flex: none; transition: background-color var(--t-fast) var(--ease); }
.switch__track::after { content: ''; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform var(--t-fast) var(--ease); }
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Team names and {words} */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.chip:hover { background: var(--surface-2); border-color: var(--primary); }
.chip[aria-pressed='true'] { background: var(--nav); border-color: var(--nav); color: var(--nav-ink); }

.slots-empty { padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.avail > .slots-empty { margin-top: 12px; }
.balance-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); color: var(--text-2); }
.balance-line strong { font-size: var(--fs-lg); line-height: var(--lh-lg); color: var(--text); font-weight: 750; }
.balance-line.is-invalid strong { color: var(--danger); }
.form-end { display: flex; justify-content: flex-end; margin-top: 16px; }
.panel-form > .form-end { margin-top: 0; }
@media (max-width: 767px) {
  .form-end .btn { width: 100%; }
  /* Save stays in reach above the tab bar */
  .form-actions {
    position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 5;
    margin: 0 -16px -16px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border); border-radius: 0 0 var(--r-md) var(--r-md);
  }
}
.banner { display: flex; align-items: flex-start; gap: 8px; padding: 12px 16px; border-radius: var(--r-sm); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.banner .icon { margin-top: 1px; }
.banner--error { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.banner--warn { background: var(--gold-soft); color: var(--text); }
.panel > .banner--warn:not(.banner--tight) { margin-top: 20px; }
.banner--warn a { color: var(--text); font-weight: 650; }
.banner--ok { background: var(--primary-soft); color: var(--text); }
.banner--ok .btn { margin-top: 8px; }
.plain-list li { padding: 4px 0; }

/* ---------- Book page ---------- */
.layout-book { display: grid; gap: 24px; align-items: start; }
.layout-book > * { min-width: 0; }
@media (min-width: 1024px) { .layout-book { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.step-title { display: flex; align-items: center; gap: 12px; font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 700; margin-bottom: 16px; }
.step-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--nav); color: var(--gold); font-size: var(--fs-sm); line-height: 1; font-weight: 750; }

.pkg-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; margin-bottom: 20px; }
.pkg-card { position: relative; display: block; cursor: pointer; }
.pkg-card input { position: absolute; opacity: 0; pointer-events: none; }
.pkg-card__body {
  display: flex; flex-direction: column; gap: 4px; min-height: 64px; padding: 12px 16px; border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.pkg-card:hover .pkg-card__body { background: var(--surface-2); }
.pkg-card input:checked + .pkg-card__body { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--surface-2); }
.pkg-card input:focus-visible + .pkg-card__body { outline: 3px solid var(--primary); outline-offset: 2px; }
.pkg-card__name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.pkg-card__meta { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }

/* Availability timeline */
.avail-head { float: left; width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 0; margin-bottom: 8px; }
.avail-head + * { clear: both; }
.avail-head__date { font-weight: 700; }
.avail-head__meta { font-size: var(--fs-sm); color: var(--text-2); }
.avail__past { margin: 4px 0 8px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--gold-soft); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.avail__past[hidden] { display: none; }
.avail__hint { margin: 4px 0 12px; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text); }
.avail__legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 16px; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.avail__legend > span { display: inline-flex; align-items: center; gap: 8px; }
.avail__key { width: 16px; height: 12px; border-radius: 4px; }
.avail__key--free { border: 1px solid var(--border-strong); background: var(--surface); }
.avail__key--busy { background: var(--primary-soft); }
.avail__key--short { background: repeating-linear-gradient(135deg, var(--border) 0 2px, var(--surface-2) 2px 5px); }
.avail__key--mine { background: var(--nav); }
.avail.is-loading .slots { opacity: 0.5; }

/* Start times, grouped by part of the day */
.slots { display: flex; flex-direction: column; gap: 16px; }
.slots__title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 700; }
.slots__title span { font-weight: 450; color: var(--text-2); }
.slots__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid transparent; min-width: 0; }
.slot__time { font-size: var(--fs-base); line-height: 20px; font-weight: 700; white-space: nowrap; }
.slot__sub { display: flex; align-items: center; gap: 4px; min-height: 16px; font-size: var(--fs-xs); line-height: var(--lh-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot__sub .pkg-dot { width: 8px; height: 8px; }
.slot__pkg { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.is-booked .slot__sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; overflow-wrap: anywhere; font-weight: 600; } /* names get two lines */
.slot.is-booked .slot__sub .pkg-dot { display: inline-block; margin-right: 4px; vertical-align: 1px; }
@media (min-width: 768px) { .slots__grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); } }
.slot.is-free { border-color: var(--border-strong); background: var(--surface); color: var(--primary); cursor: pointer; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.slot.is-free .slot__sub { color: var(--text-2); }
.slot.is-free.is-passed { color: var(--text-2); border-color: var(--border); }
.slot.is-free.is-passed .slot__time { font-weight: 550; }
.slot.is-free:hover { border-color: var(--primary); background: var(--surface-2); }
.slot.is-free input { position: absolute; opacity: 0; pointer-events: none; }
.slot.is-free:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.slot.is-booked { background: var(--primary-soft); color: var(--text); cursor: default; }
.slot.is-booked .slot__time { font-weight: 600; }
.slot.is-short { background: repeating-linear-gradient(135deg, var(--border) 0 2px, var(--surface-2) 2px 7px); color: var(--text-2); cursor: not-allowed; }
.slot.is-short .slot__time { font-weight: 500; }
.slot.is-short .slot__sub { color: var(--text); }
.slot.is-free.is-mine { background: var(--nav); border-color: var(--nav); color: var(--nav-ink); }
.slot.is-free.is-mine .slot__sub { color: var(--nav-ink); }
.slot.is-free.is-in { background: var(--primary-soft); border: 2px solid var(--nav); padding: 7px 11px; color: var(--nav); }
.slot.is-free.is-in .slot__sub { color: var(--nav); font-weight: 600; }
.slot.is-free.is-mine:has(input:focus-visible) { outline-color: var(--gold); }
@media (max-width: 23rem) { .slots__grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); } .slot { padding: 8px; } .slot.is-free.is-in { padding: 7px; } .slot__time { font-size: var(--fs-sm); } }

/* Booking summary (step 3) */
.summary-box { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr) minmax(0, 8fr); gap: 12px; margin: 0 0 24px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface-2); }
.summary-box dt { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.summary-box dd { margin-top: 4px; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 650; overflow-wrap: anywhere; }
.summary-box dd.is-empty { font-weight: 450; color: var(--text-2); }
@media (max-width: 480px) { .summary-box { grid-template-columns: 1fr 1fr; } }

/* ---------- Settings ---------- */
.pkg-list, .line-list { margin-top: 12px; }
.pkg { padding: 16px 0 8px; border-bottom: 1px solid var(--border); }
.pkg:last-child { border-bottom: 0; padding-bottom: 0; }
.pkg__main { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pkg__info { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.pkg__name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 700; }
.pkg__meta { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.pkg.is-inactive .pkg__name { color: var(--text-2); }
.pkg__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pkg-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 768px) { .pkg-grid { grid-template-columns: 2fr 1fr 1fr; } .pkg-grid__full { grid-column: 1 / -1; } }
.pkg .fold form { padding-bottom: 16px; }
.pkg .fold .help { margin-top: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-opt { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-pill); cursor: pointer; font-size: var(--fs-sm); }
.swatch-opt:hover { background: var(--surface-2); }
.swatch-opt input { position: absolute; opacity: 0; pointer-events: none; }
.swatch-opt .pkg-dot { width: 16px; height: 16px; }
.swatch-opt:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--surface-2); font-weight: 650; }
.swatch-opt:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.line > div { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.line strong { font-weight: 650; }
.line span { display: block; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.line.is-undone strong { text-decoration: line-through; font-weight: 450; color: var(--text-2); }
.msg { display: grid; gap: 16px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
@media (min-width: 900px) { .msg { grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; } }
.msg textarea { field-sizing: content; min-height: 144px; }
.preview { background: var(--chat); border-radius: var(--r-md); padding: 16px; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Receipt ---------- */
.receipt-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .receipt-grid { grid-template-columns: minmax(0, 540px) minmax(0, 340px); justify-content: center; } }
.receipt-page .page-head { width: 100%; max-width: 904px; margin: 0 auto; }
.receipt-img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.receipt-view.has-img .receipt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.receipt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.receipt__head { display: flex; align-items: center; gap: 16px; padding: 24px; background: var(--nav); color: var(--nav-ink); border-bottom: 4px solid var(--gold); }
.receipt__head .brand__name { font-size: 30px; }
.receipt__body { padding: 24px; }
.receipt__details { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); margin-bottom: 16px; }
.receipt h2 { font-size: 26px; line-height: 32px; font-weight: 800; }
.receipt__no { color: var(--text-2); }
.receipt__cancel { margin-top: 12px; color: var(--danger); font-weight: 650; }
.receipt dl { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--border); }
.receipt dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.receipt dt { flex: none; color: var(--text-2); }
.receipt dd { text-align: right; overflow-wrap: anywhere; }
.receipt__total { font-size: 20px; line-height: 28px; font-weight: 800; }
.receipt__total dt { color: var(--text); }
.receipt__thanks { margin-top: 20px; font-weight: 650; }
.receipt-acts { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.receipt-acts + .help { margin-bottom: 8px; }
@media print {
  @page { margin: 16mm; }
  .topbar, .tabbar, .toasts, .no-print, .skip-link, dialog { display: none !important; }
  body, .main { background: none; padding: 0; min-height: 0; }
  .receipt-grid { display: block; }
  .receipt-view.has-img .receipt { position: static; width: auto; height: auto; clip-path: none; }
  .receipt { max-width: 150mm; margin: 0 auto; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Toasts, dialogs, empty ---------- */
.toasts {
  top: auto; width: auto; height: auto; margin: 0; border: 0; padding: 0; background: none; overflow: visible;
  position: fixed; z-index: 70; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; pointer-events: none;
}
@media (min-width: 768px) { .toasts { left: auto; right: 24px; bottom: 24px; } }
.toast {
  display: flex; align-items: center; gap: 12px; max-width: 440px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--text); color: var(--nav-ink);
  font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; box-shadow: var(--shadow-float); animation: toast-in var(--t-med) var(--ease);
}
.toast--success .icon { color: var(--gold); }
.toast--error { background: var(--danger); }
.toast.is-leaving { opacity: 0; transition: opacity var(--t-med) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.confirm, .lightbox { border: 0; padding: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
.confirm::backdrop, .lightbox::backdrop { background: var(--shade); }
.confirm__box { width: min(420px, calc(100vw - 32px)); padding: 24px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-float); animation: fade-in var(--t-med) var(--ease); }
.confirm__title { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: 700; overflow-wrap: anywhere; }
.confirm__body { margin-top: 8px; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.confirm__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
@media (max-width: 767px) {
  .confirm { margin: auto 0 0; width: 100%; }
  .confirm__box { width: 100%; border-radius: var(--r-md) var(--r-md) 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); animation: sheet-in var(--t-med) var(--ease); }
  .confirm__actions { flex-direction: column-reverse; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.lightbox__box { padding: 12px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-float); }
.lightbox img { max-width: min(88vw, 640px); max-height: 76vh; border-radius: var(--r-sm); object-fit: contain; }
.lightbox__caption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: var(--fs-sm); color: var(--text-2); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 16px; color: var(--text-2); }
.empty > .icon { width: 48px; height: 48px; stroke-width: 1.5; }
.empty .btn { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .spinner { animation-duration: 1.4s !important; }
}
@media (forced-colors: active) { .pkg-dot { forced-color-adjust: none; } }
