/* =========================================================
   LumiSpace Booking — layered on top of styles.css.
   Loads AFTER styles.css; never edits brand tokens, only adds
   booking-specific semantic tokens + components (UI_PLAN §1.2).
   ========================================================= */

:root {
  /* semantic status — booking system */
  --ok: #2E8B57;        --ok-bg: #E9F6EF;      /* confirmed, free, success */
  --danger: #C6442D;    --danger-bg: #FBEDEA;  /* cancel, error */
  --busy: #A9B6C4;      --busy-bg: #EFF3F7;    /* others' bookings — neutral, NOT red */
  --mine: var(--sun);   --mine-bg: #FFF3DC;    /* my bookings / selection */
  --info-bg: #EEF4FA;                          /* rule callouts */
  /* calendar geometry */
  --slot-h: 44px;
  --cal-time-col: 56px;
}

/* [hidden] must always win, even over display:flex/grid components */
[hidden] { display: none !important; }

/* ── page scaffold ─────────────────────────────────────────── */
.bk-main { padding: 42px 0 80px; min-height: 60vh; }
.bk-head { margin-bottom: 26px; }
.bk-head h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 6px 0 8px; }
.bk-head .bk-lede { color: var(--slate); max-width: 620px; margin: 0; }
.bk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 22px 0 16px; }
.bk-toolbar .spacer { flex: 1; }
.bk-crumb { font-size: .85rem; color: var(--steel); margin: 0 0 14px; }
.bk-crumb a { color: var(--steel); text-decoration: none; }
.bk-crumb a:hover { color: var(--sun-deep); text-decoration: underline; }

/* ── booking shell nav (slim .nav variant) ─────────────────── */
.bnav { position: sticky; top: 0; z-index: 60; background: rgba(255, 253, 249, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.bnav__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.bnav__links { display: flex; align-items: center; gap: 18px; }
.bnav__links a:not(.btn) { font-family: var(--f-display); font-weight: 500; font-size: .9rem;
  color: var(--slate); text-decoration: none; padding: 4px 2px; border-bottom: 2px solid transparent; }
.bnav__links a:not(.btn):hover { color: var(--ink); }
.bnav__links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--sun); }
.bnav__user { font-size: .8rem; color: var(--steel); white-space: nowrap; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; }
.bnav .btn { padding: 9px 18px; font-size: .85rem; }
/* Full nav (brand + 4 links + lang + Sign out) needs ~900px+ — below that it
   must wrap or the right-side buttons clip past the viewport (LumiSpace-c4s). */
@media (max-width: 1023px) {
  .bnav__inner { height: auto; flex-wrap: wrap; padding: 10px 0; row-gap: 6px; }
  .bnav__links { flex-wrap: wrap; gap: 12px; }
  .bnav__user { display: none; }
}
/* Phone (~375px): two clean rows — brand left + controls (lang/sign-in) right,
   then the section links on their own scrollable line. Prevents the cramped
   diagonal stacking of logo / lang pill / Sign in (wave-3 item 2). */
@media (max-width: 719px) {
  .bnav__inner { display: grid; grid-template-columns: 1fr auto; align-items: center;
    column-gap: 10px; row-gap: 4px; padding: 8px 0; }
  .bnav .brand { grid-column: 1; grid-row: 1; }
  .bnav div.bnav__links { grid-column: 2; grid-row: 1; flex-wrap: nowrap; gap: 8px; justify-content: flex-end; }
  .bnav nav.bnav__links { grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap; gap: 14px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .bnav nav.bnav__links::-webkit-scrollbar { display: none; }
  .bnav nav.bnav__links a:not(.btn) { white-space: nowrap; }
  .bnav nav.bnav__links:empty { display: none; }
  .bnav .btn { padding: 8px 14px; font-size: .8rem; white-space: nowrap; }
  .bnav .lang__toggle { padding: 6px 8px; }
}

/* ── segmented control / date pager ────────────────────────── */
.seg { display: inline-flex; border: 1px solid var(--border-cool); border-radius: 999px;
  background: var(--surface); padding: 3px; }
.seg button { font-family: var(--f-display); font-weight: 600; font-size: .82rem; color: var(--slate);
  border: 0; background: none; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease); min-height: 36px; }
.seg button[aria-pressed="true"] { background: linear-gradient(180deg, var(--sun-soft), var(--sun-deep)); color: #3a2a06; }
.datenav { display: inline-flex; align-items: center; gap: 8px; }
.datenav button { border: 1px solid var(--border-cool); background: var(--surface); color: var(--slate);
  border-radius: 999px; min-width: 40px; min-height: 40px; font-size: 1rem; cursor: pointer;
  transition: border-color .15s var(--ease); }
.datenav button:hover { border-color: var(--sun-deep); color: var(--ink); }
.datenav__label { font-family: var(--f-display); font-weight: 600; color: var(--ink);
  font-size: .95rem; min-width: 130px; text-align: center; }

/* ── room chips (mobile filter) ────────────────────────────── */
.roomchips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; }
.roomchips button { flex: 0 0 auto; font-family: var(--f-display); font-weight: 600; font-size: .8rem;
  color: var(--slate); background: var(--surface); border: 1px solid var(--border-cool);
  border-radius: 999px; padding: 9px 15px; cursor: pointer; min-height: 38px; white-space: nowrap; }
.roomchips button[aria-pressed="true"] { background: var(--mine-bg); border-color: var(--sun); color: var(--ink); }
@media (min-width: 720px) { .roomchips { display: none; } }

/* ── calendar grid ─────────────────────────────────────────── */
.cal-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  overflow: auto; max-height: 72vh; box-shadow: var(--shadow-sm, 0 6px 22px -14px rgba(85,102,119,.25)); }
.cal { display: grid; min-width: 100%; }
.cal__corner, .cal__roomhead { position: sticky; top: 0; z-index: 3; background: var(--bg-warm);
  border-bottom: 1px solid var(--border); }
.cal__corner { left: 0; z-index: 4; }
.cal__roomhead { font-family: var(--f-display); font-weight: 600; font-size: .8rem; color: var(--ink);
  text-align: center; padding: 10px 8px; border-inline-start: 1px solid var(--border-cool); }
.cal__roomhead a { color: inherit; text-decoration: none; }
.cal__roomhead a:hover { color: var(--sun-deep); }
.cal__roomhead .cap { display: block; font-weight: 400; font-size: .7rem; color: var(--steel); margin-top: 2px; }
.cal__time { position: sticky; left: 0; z-index: 2; background: var(--surface); font-size: .72rem;
  color: var(--steel); text-align: right; padding: 4px 8px 0 4px; border-block-start: 1px solid var(--border-cool);
  min-height: var(--slot-h); font-variant-numeric: tabular-nums; }
.cal__slot { min-height: var(--slot-h); border-block-start: 1px solid var(--border-cool);
  border-inline-start: 1px solid var(--border-cool); cursor: pointer; position: relative;
  transition: background .15s var(--ease); background: var(--surface); padding: 0; border-block-end: 0; border-inline-end: 0; }
.cal__slot:focus-visible { outline: 2px solid var(--sun-deep); outline-offset: -2px; z-index: 1; }
.cal__slot.is-free:hover { background: rgba(255, 189, 89, .14); }
.cal__slot.is-busy { background: var(--busy-bg); color: var(--steel); cursor: default;
  font-size: .68rem; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.cal__slot.is-hold { background: repeating-linear-gradient(45deg, #FFF3DC 0 6px, #FFE3B0 6px 12px);
  color: #8a6415; cursor: default; font-size: .62rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.15; }
.cal__slot.is-selected { background: var(--mine-bg); box-shadow: inset 0 0 0 2px var(--sun); z-index: 1; }
.cal__slot.is-past, .cal__slot.is-lead { background: repeating-linear-gradient(45deg, transparent 0 6px,
  rgba(169, 182, 196, .14) 6px 12px); cursor: not-allowed; }
.cal__slot.is-stafffree { background: var(--ok-bg); cursor: pointer; font-size: .64rem; font-weight: 600;
  color: var(--ok); display: flex; align-items: center; justify-content: center; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: .78rem; color: var(--slate); }
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legend i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-cool); flex: 0 0 auto; }
.cal-legend .sw-free { background: var(--surface); }
.cal-legend .sw-busy { background: var(--busy-bg); }
.cal-legend .sw-hold { background: repeating-linear-gradient(45deg, #FFF3DC 0 4px, #FFE3B0 4px 8px); border-color: var(--sun); }
.cal-legend .sw-past { background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(169,182,196,.25) 4px 8px); }
.cal-legend .sw-sel { background: var(--mine-bg); border-color: var(--sun); }
.cal-legend .sw-staff { background: var(--ok-bg); border-color: var(--ok); }

/* ── room cards ────────────────────────────────────────────── */
.room-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1023px) { .room-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 719px) { .room-grid { grid-template-columns: 1fr; } }
.room-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.room-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sun); }
.room-card__photo { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--bg-warm);
  overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--steel-2); }
.room-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.room-card h2, .room-card h3 { font-size: 1.15rem; margin: 0; }
.room-card__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.room-card .btn { margin-top: auto; align-self: flex-start; }
.room-card__desc { font-size: .9rem; color: var(--slate); margin: 0; }

/* ── chips / status ────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-display);
  font-weight: 600; font-size: .74rem; padding: 5px 12px; border-radius: 999px;
  background: var(--bg-warm); border: 1px solid var(--border); color: var(--slate); white-space: nowrap; }
.chip--ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.chip--busy { background: var(--busy-bg); border-color: transparent; color: var(--slate); }
.chip--danger { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.chip--paid { background: var(--mine-bg); border-color: transparent; color: #7a5b17; }

/* ── ledger badge ──────────────────────────────────────────── */
.ledger { display: inline-flex; align-items: center; gap: 9px; font-family: var(--f-display);
  font-weight: 600; font-size: .88rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 9px 18px; }
.ledger::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.ledger.is-low::before { background: var(--sun-deep); }
.ledger.is-zero::before { background: var(--steel); }
.ledger--hero { font-size: 1rem; padding: 12px 22px; }
.ledger small { font-weight: 400; color: var(--steel); }

/* ── callouts ──────────────────────────────────────────────── */
.callout { position: relative; display: flex; gap: 10px; align-items: flex-start; font-size: .9rem;
  color: var(--ink); background: var(--info-bg); border-radius: var(--radius-sm);
  padding: 13px 16px 13px 18px; margin: 14px 0; overflow: hidden; }
.callout::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--steel-2); }
.callout--ok { background: var(--ok-bg); } .callout--ok::before { background: var(--ok); }
.callout--danger { background: var(--danger-bg); } .callout--danger::before { background: var(--danger); }
.callout--info::before { background: #7FA6CB; }
.callout--warn { background: #FFF4DE; } .callout--warn::before { background: #FFBD59; }
.callout .icon { flex: 0 0 auto; margin-top: 2px; }
.callout p { margin: 0; }

/* ── price box ─────────────────────────────────────────────── */
.pricebox { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  background: var(--bg-warm); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 15px 18px; margin: 14px 0; }
.pricebox__label { font-weight: 600; color: var(--ink); }
.pricebox__amt { font-family: var(--f-display); font-weight: 700; font-size: 1.45rem; color: var(--slate);
  font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── cards / panels ────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow, 0 18px 48px -24px rgba(85,102,119,.28)); padding: 26px 24px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 1.2rem; margin: 0 0 16px; }
.panel--narrow { max-width: 480px; margin-inline: auto; }

/* ── booking list cards ────────────────────────────────────── */
.bk-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px; margin-bottom: 12px; }
.bk-card__main { flex: 1 1 240px; min-width: 0; }
.bk-card__room { font-family: var(--f-display); font-weight: 600; color: var(--ink); margin: 0 0 3px; }
.bk-card__when { font-size: .88rem; color: var(--slate); margin: 0; font-variant-numeric: tabular-nums; }
.bk-card__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bk-card__hint { font-size: .76rem; color: var(--steel); margin: 0; max-width: 220px; text-align: right; }
.btn--danger { background: none; border: 1px solid var(--danger); color: var(--danger); box-shadow: none; }
.btn--danger:hover:not(:disabled) { background: var(--danger-bg); transform: translateY(-1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none; }
.btn--sm { padding: 8px 16px; font-size: .82rem; }

/* ── data table ────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tbl th { font-family: var(--f-display); font-weight: 600; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--steel); text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--border); background: var(--bg-warm); position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border-cool); color: var(--ink);
  font-variant-numeric: tabular-nums; }
/* date/when columns: never wrap mid-date — .tbl-wrap scrolls horizontally instead */
.tbl td.td-when, .tbl th.th-when { white-space: nowrap; }
.tbl tbody tr:hover { background: var(--bg-warm); }
.tbl tfoot td { font-weight: 700; background: var(--bg-warm); }

/* ── forms (extends .reg-* patterns) ───────────────────────── */
.bk-field { display: block; margin-bottom: 16px; }
.bk-field__label { display: block; font-size: .82rem; font-weight: 600; color: var(--slate); margin-bottom: 6px; }
.bk-field input, .bk-field select, .bk-field textarea { width: 100%; font-family: var(--f-body);
  font-size: 1rem; color: var(--ink); padding: 12px 14px; border: 1px solid var(--border-cool);
  border-radius: var(--radius-sm); background: #fff;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.bk-field input:focus, .bk-field select:focus, .bk-field textarea:focus { outline: none;
  border-color: var(--sun-deep); box-shadow: 0 0 0 3px rgba(255, 189, 89, .22); }
.bk-field.is-invalid input { border-color: var(--danger); }
.bk-error { display: block; font-size: .82rem; color: var(--danger); margin: 6px 0 0; }
.bk-pass { position: relative; }
.bk-pass input { padding-inline-end: 72px; }
.bk-pass button { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--steel); font-size: .78rem; font-weight: 600;
  cursor: pointer; padding: 8px; min-height: 36px; }
.bk-pass button:hover { color: var(--sun-deep); }

/* ── tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tabs button { flex: 1; font-family: var(--f-display); font-weight: 600; font-size: .92rem;
  color: var(--steel); background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 12px 8px; cursor: pointer; min-height: 44px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--sun); }

/* ── toast ─────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff; font-size: .88rem; padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; z-index: 100;
  transition: opacity .25s var(--ease), transform .25s var(--ease); max-width: min(90vw, 480px); text-align: center; }
.toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── modal (self-contained; matches site .modal look) ──────── */
.bk-modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px; }
.bk-modal.is-open { display: flex; }
.bk-modal__backdrop { position: absolute; inset: 0; background: rgba(62, 76, 90, .5); backdrop-filter: blur(3px); }
.bk-modal__dialog { position: relative; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 24px; width: 100%; max-width: 420px; }
.bk-modal__dialog h3 { margin: 0 0 8px; font-size: 1.15rem; }
.bk-modal__dialog p { color: var(--slate); font-size: .92rem; margin: 0 0 18px; }
.bk-modal__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ── skeleton / empty / success ────────────────────────────── */
.skel { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--bg-warm) 25%, #F3ECDD 45%, var(--bg-warm) 65%);
  background-size: 200% 100%; animation: skel 1.1s linear infinite; min-height: 44px; margin-bottom: 10px; }
@keyframes skel { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 44px 20px; color: var(--slate); }
.empty__icon { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 16px; background: var(--mine-bg);
  display: flex; align-items: center; justify-content: center; color: var(--sun-deep); }
.empty p { margin: 0 0 18px; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px; background: var(--ok-bg);
  border: 1px solid #B7E3CB; display: flex; align-items: center; justify-content: center; color: var(--ok); }
.success-icon svg { width: 30px; height: 30px; }
.center { text-align: center; }

/* ── sticky mobile action bar ──────────────────────────────── */
.stickybar { position: sticky; bottom: 0; z-index: 50; background: rgba(255, 253, 249, .96);
  backdrop-filter: blur(8px); border-top: 1px solid var(--border);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: 20px; }
.stickybar .container { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.stickybar__label { font-family: var(--f-display); font-weight: 600; color: var(--ink);
  font-size: .92rem; font-variant-numeric: tabular-nums; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── auth divider + Google button + guest checkout (Wave 2) ── */
.bk-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0;
  color: var(--steel-2); font-size: .82rem; text-transform: lowercase; }
.bk-divider::before, .bk-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn--google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  background: #fff; color: #3c4043; border: 1px solid var(--border); font-weight: 500; }
.btn--google:hover { background: #f8f9fa; border-color: #d2d5d9; }
.btn--google svg { width: 19px; height: 19px; flex: 0 0 auto; }
.guest-box { margin-top: 4px; }
.guest-box .bk-crumb { margin: 6px 0 12px; }

/* ── GIS (Google Identity Services) button host (Wave 3) ───── */
.gsi-host { display: flex; justify-content: center; min-height: 0; }
.gsi-host > div { max-width: 100%; }

/* ── org member management (Wave 3) ────────────────────────── */
.org-invite { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 12px 0 6px; }
.org-invite .bk-field { flex: 1 1 240px; margin-bottom: 0; }
.org-invite .btn { flex: 0 0 auto; }

/* ── add-to-calendar row actions (Wave 3) ──────────────────── */
.bk-card__calrow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

@media (prefers-reduced-motion: reduce) {
  .cal__slot, .seg button, .toast, .room-card, .skel { transition: none !important; animation: none !important; }
}
