/* ============================================================
   DAL Hub pages — shared skin for the sibling landing hubs
   (/booking-hub, /coaching-hub, /event-hub, /openplay-hub).

   Brand v2 (2026-10-16): light theme. White page, tint panels, black
   text, brand-blue fills with BLACK text, blue-ink for small blue text.
   Every value below comes from the tokens in dal-brand.css (loaded by
   <BrandHead/> on each hub). The old dark "app shell" (navy gradient,
   #049df0, mint/pink states) is retired on these pages.

   Sub-brands per hub (guideline p.7 — one lit hole, name beside it):
     booking-hub = Court · coaching-hub = Academy · event-hub +
     openplay-hub = Event.

   The --hub-* token names stay (page styles and JS-built markup use
   them); only their values changed. Pages add `page-hub` to <body> plus
   their own page class. Everything below renders into innerHTML nodes,
   so it must live in a real stylesheet, never Astro scoped styles.
   ============================================================ */

:root {
  --hub-surface: var(--dal-card, #fff);
  --hub-surface-2: var(--dal-bg-soft, #EAF6FE);
  --hub-sheet-bg: var(--dal-card, #fff);
  --hub-ink: var(--dal-fg, #000);
  --hub-ink-muted: var(--dal-fg-2, #4B5563);
  --hub-ink-dim: var(--dal-fg-3, #6B7280);
  --hub-border: var(--dal-border, #D3E6F5);
  --hub-border-strong: var(--dal-border-strong, #C9D7E3);
  --hub-border-hot: var(--dal-blue, #2BA3F8);
  /* Fills (big areas, buttons): brand blue, BLACK text on it. */
  --hub-primary: var(--dal-blue, #2BA3F8);
  --hub-on-primary: var(--dal-ink, #000);
  /* Small blue TEXT on white/tint: blue-ink, never the fill blue. */
  --hub-primary-deep: var(--dal-blue-ink, #0A6BB0);
  --hub-primary-shade: var(--dal-blue-press, #148AE0);
  --hub-primary-soft: var(--dal-surface-tint, #EAF6FE);
  /* Status colours (dal-brand.css state tokens). */
  --hub-positive: var(--dal-success, #067647);
  --hub-positive-soft: var(--dal-success-bg, #E6F6EC);
  --hub-positive-line: var(--dal-success-line, #A8DFBF);
  --hub-negative: var(--dal-danger, #B42318);
  --hub-negative-soft: var(--dal-danger-bg, #FDECEA);
  --hub-negative-line: var(--dal-danger-line, #F5B5AE);
  --hub-warn: var(--dal-warning, #8A5300);
  --hub-warn-soft: var(--dal-warning-bg, #FFF4D6);
  --hub-warn-line: var(--dal-warning-line, #F3D68A);
  --hub-blue-soft: var(--dal-surface-tint, #EAF6FE);
  --hub-blue-line: var(--dal-line-blue, #D3E6F5);
  /* Light pages: flat white cards with the blue-tint border. */
  --hub-shadow: none;
  --hub-r-sm: var(--dal-r-sm, 12px);
  --hub-r-md: var(--dal-r-md, 16px);
  --hub-r-lg: var(--dal-r-lg, 24px);
  --hub-r-pill: 999px;
  --hub-ease: var(--dal-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
  --hub-dur-fast: 150ms;
  --hub-dur-base: 240ms;
  --hub-dur-slow: 400ms;
}

body.page-hub * { box-sizing: border-box; }

body.page-hub {
  margin: 0;
  min-height: 100vh;
  background: var(--dal-bg, #fff);
  color: var(--hub-ink);
  font-family: var(--dal-font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.hub-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px calc(48px + env(safe-area-inset-bottom));
  min-height: 100vh;
}


/* ============================================================
   Topbar — the standard brand app bar: back (tint circle) · lockup ·
   EN|TH. The markup carries .dal-topbar too; this only makes it bleed
   to the viewport edges while its content stays in the 720px column.
   ============================================================ */
.hub-topbar {
  margin: 0 calc(50% - 50vw) 10px;
  padding-left: max(12px, calc(50vw - 50% + 4px));
  padding-right: max(12px, calc(50vw - 50% + 4px));
}
.hub-topbar .dal-lockup { --lockup-mark: 26px; }
.hub-back { color: var(--hub-ink); }
.hub-back:hover { color: var(--hub-ink); }

/* ============================================================
   View switching (menu <-> detail) — JS toggles .is-active
   ============================================================ */
.hub-view { display: none; }
.hub-view.is-active { display: block; animation: hub-view-in var(--hub-dur-base) var(--hub-ease); }
@keyframes hub-view-in {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}
.hub-view.is-menu.is-active { animation-name: hub-menu-in; }
@keyframes hub-menu-in {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   Menu view
   ============================================================ */
.hub-greet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 16px;
}
.hub-greet-name { font-size: 1.5rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; }
html[lang="th"] .hub-greet-name { letter-spacing: -0.01em; }
.hub-greet-sub { margin-top: 3px; font-size: 0.85rem; color: var(--hub-ink-muted); overflow-wrap: anywhere; }
.hub-greet-contact { display: inline-block; max-width: 100%; }
.hub-greet-sep { margin: 0 6px; opacity: 0.6; }
.hub-greet-login {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--hub-r-pill);
  border: 0;
  background: var(--dal-ink, #000);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--hub-dur-fast) var(--hub-ease);
}
.hub-greet-login:hover { color: #fff; background: #1a1a1a; }
.hub-greet-login:active { transform: scale(0.97); }

/* Hero CTA — brand blue with the block pattern (guideline p.12–13),
   black text, sub-brand mark + name top-left, black pill action. */
.hub-cta {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--hub-r-lg);
  padding: 20px 20px 22px;
  /* The pattern lives on the right; the text side stays solid blue so the
     black copy never sits on the deeper-blue blocks. */
  background-color: var(--dal-blue, #2BA3F8);
  background-image:
    linear-gradient(100deg, var(--dal-blue, #2BA3F8) 0%, var(--dal-blue, #2BA3F8) 46%, rgba(43, 163, 248, 0) 78%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect x='8' y='8' width='44' height='44' rx='10' fill='%231E8FE0'/%3E%3Crect x='68' y='68' width='44' height='44' rx='10' fill='%231E8FE0'/%3E%3C/svg%3E");
  background-size: 100% 100%, 120px 120px;
  background-repeat: no-repeat, repeat;
  background-position: 0 0, right -14px top -14px;
  color: var(--dal-ink, #000);
  text-decoration: none;
  transition: transform var(--hub-dur-fast) var(--hub-ease);
}
.hub-cta:hover { color: var(--dal-ink, #000); }
.hub-cta:active { transform: scale(0.985); }
/* Sub-brand label: white mark (one cyan hole) + the sub-brand name. */
.hub-subbrand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--dal-ink, #000);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.hub-subbrand .dal-mark { width: 28px; height: 28px; }
.hub-subbrand svg { display: block; width: 28px; height: 28px; flex: 0 0 auto; }
.hub-cta-title { font-size: 1.85rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
html[lang="th"] .hub-cta-title { letter-spacing: -0.01em; line-height: 1.2; }
.hub-cta-sub { margin-top: 6px; max-width: 34ch; font-size: 0.95rem; line-height: 1.45; }
.hub-cta-note {
  /* Block (fit to content) so the pill below always starts on its own line. */
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: var(--hub-r-sm);
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  /* Two even lines rather than a stranded "คน)" on the second one. */
  text-wrap: balance;
}
.hub-cta-go {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--hub-r-pill);
  background: var(--dal-ink, #000);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}
.hub-cta-art { display: none; }

/* Secondary CTA row (cross-link to the sibling flow) */
.hub-cta-coach {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: var(--hub-r-md);
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  color: var(--hub-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: border-color var(--hub-dur-fast) var(--hub-ease);
}
.hub-cta-coach:hover { color: var(--hub-ink); border-color: var(--hub-border-hot); }
.hub-cta-coach .hub-chevron { margin-left: auto; }

/* Quick stats — tint panels, big black numbers. */
.hub-stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.hub-stat {
  appearance: none;
  font-family: inherit;
  text-align: left;
  /* A <button>'s anonymous content box is centred vertically by the UA, so
     the moment one of the three labels wraps to a second line the other two
     push their value down — three cards, three different baselines. Laying
     the content out explicitly pins them all to the top. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--hub-r-md);
  background: var(--hub-surface-2);
  padding: 14px 12px 12px;
  cursor: pointer;
  color: var(--hub-ink);
  transition: border-color var(--hub-dur-fast) var(--hub-ease), transform var(--hub-dur-fast) var(--hub-ease);
}
.hub-stat:active { transform: scale(0.97); }
.hub-stat:hover { border-color: var(--hub-border-hot); }
.hub-stat-value {
  max-width: 100%;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--hub-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub-stat-label { margin-top: 4px; font-size: 0.74rem; font-weight: 600; line-height: 1.3; color: var(--hub-ink-muted); }

/* Menu list */
.hub-menu { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.hub-menu-item {
  appearance: none;
  font-family: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-r-md);
  background: var(--hub-surface);
  color: var(--hub-ink);
  cursor: pointer;
  transition: border-color var(--hub-dur-fast) var(--hub-ease), transform var(--hub-dur-fast) var(--hub-ease);
}
.hub-menu-item:active { transform: scale(0.985); }
.hub-menu-item:hover { border-color: var(--hub-border-hot); }
/* Icon tile — the mark's corner (22%) on a tint square. */
.hub-menu-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 22%;
  background: var(--hub-primary-soft);
  color: var(--hub-primary-deep);
}
.hub-menu-txt { min-width: 0; flex: 1 1 auto; }
.hub-menu-title { font-weight: 600; font-size: 0.98rem; }
.hub-menu-sub {
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--hub-ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub-menu-sub b { color: var(--hub-primary-deep); font-weight: 600; }
.hub-badge {
  flex: 0 0 auto;
  min-width: 24px;
  text-align: center;
  padding: 3px 8px;
  border-radius: var(--hub-r-pill);
  background: var(--hub-primary);
  color: var(--hub-on-primary);
  font-size: 0.74rem;
  font-weight: 800;
}
.hub-chevron { flex: 0 0 auto; color: var(--hub-ink-dim); }

/* ============================================================
   Detail views
   ============================================================ */
.hub-view-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 14px;
}
.hub-view-back {
  appearance: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--hub-r-pill);
  background: var(--hub-surface-2);
  color: var(--hub-ink);
  cursor: pointer;
}
.hub-view-back:hover { filter: brightness(0.97); }
.hub-view-title { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
html[lang="th"] .hub-view-title { letter-spacing: -0.01em; }

/* Segmented control */
.hub-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--hub-r-pill);
  background: var(--hub-surface-2);
  margin-bottom: 14px;
}
.hub-seg-btn {
  appearance: none;
  border: none;
  font-family: inherit;
  min-height: 40px;
  padding: 8px;
  border-radius: var(--hub-r-pill);
  background: transparent;
  color: var(--hub-ink-muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background var(--hub-dur-fast) var(--hub-ease), color var(--hub-dur-fast) var(--hub-ease);
}
.hub-seg-btn.is-active { background: var(--dal-ink, #000); color: #fff; }

/* Booking/lesson cards — white card, status stripe on the left. */
.hub-bk-list { display: flex; flex-direction: column; gap: 10px; }
.hub-bk-card {
  border: 1px solid var(--hub-border);
  border-left: 4px solid var(--hub-border-strong);
  border-radius: var(--hub-r-md);
  background: var(--hub-surface);
  padding: 13px 14px;
}
.hub-bk-card.is-upcoming { border-left-color: var(--hub-primary); }
.hub-bk-card.is-completed { border-left-color: var(--hub-positive); }
.hub-bk-card.is-cancelled { border-left-color: var(--hub-negative); opacity: 0.72; }
.hub-bk-card.is-draft { border-left-color: var(--hub-warn-line); }
.hub-bk-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hub-bk-day { font-weight: 800; font-size: 0.98rem; letter-spacing: -0.01em; }
.hub-bk-pills { display: inline-flex; gap: 5px; flex: 0 0 auto; }
.hub-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--hub-r-pill);
  border: 1px solid transparent;
  background: var(--hub-surface-2);
  color: var(--hub-ink-muted);
  white-space: nowrap;
}
.hub-pill.is-upcoming { background: var(--hub-blue-soft); border-color: var(--hub-blue-line); color: var(--hub-primary-deep); }
.hub-pill.is-completed { background: var(--hub-positive-soft); border-color: var(--hub-positive-line); color: var(--hub-positive); }
.hub-pill.is-cancelled { background: var(--hub-negative-soft); border-color: var(--hub-negative-line); color: var(--hub-negative); }
.hub-pill.is-paid { background: var(--hub-positive-soft); border-color: var(--hub-positive-line); color: var(--hub-positive); }
.hub-pill.is-unpaid { background: var(--hub-warn-soft); border-color: var(--hub-warn-line); color: var(--hub-warn); }
/* Draft = waiting for payment: pending reads as warning, like its stripe. */
.hub-pill.is-draft { background: var(--hub-warn-soft); border-color: var(--hub-warn-line); color: var(--hub-warn); }
.hub-bk-meta { margin-top: 5px; display: flex; justify-content: space-between; gap: 10px; font-size: 0.84rem; color: var(--hub-ink-muted); }
.hub-bk-price { font-weight: 800; color: var(--hub-ink); white-space: nowrap; }
.hub-bk-tags { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.hub-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--hub-r-pill);
  background: var(--hub-surface-2);
  border: 1px solid transparent;
  color: var(--hub-ink-muted);
}
.hub-tag.is-coach { background: var(--hub-primary-soft); border-color: var(--hub-blue-line); color: var(--hub-primary-deep); }
/* Card foot (booking-hub): "details & receipt" + the self-cancel button.
   The whole card opens the details too — the button is the keyboard way in. */
.hub-bk-card[data-booking] { cursor: pointer; transition: border-color var(--hub-dur-fast) var(--hub-ease); }
.hub-bk-card[data-booking]:hover { border-top-color: var(--hub-border-hot); border-right-color: var(--hub-border-hot); border-bottom-color: var(--hub-border-hot); }
.hub-bk-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed var(--hub-border);
}
.hub-bk-more {
  appearance: none;
  border: none;
  background: transparent;
  min-height: 36px;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--hub-primary-deep);
  cursor: pointer;
}
.hub-bk-cancel {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--hub-r-pill);
  border: 1px solid var(--hub-negative-line);
  background: var(--hub-negative-soft);
  color: var(--hub-negative);
  font-weight: 600;
  font-size: 0.82rem;
}
.hub-bk-cancel:active { transform: scale(0.97); }
.hub-bk-note { margin: 9px 0 0; font-size: 0.76rem; line-height: 1.45; color: var(--hub-ink-dim); }
/* Also used as a <button> for the retry / join actions, hence the explicit
   font-family and cursor a bare <a> would not need. */
.hub-manage-link {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  margin-top: 14px;
  min-height: 48px;
  padding: 13px 16px;
  border: 0;
  border-radius: var(--hub-r-pill);
  background: var(--hub-primary-soft);
  color: var(--hub-primary-deep);
  font-weight: 600;
  font-size: 0.9rem;
}
.hub-manage-link:hover { color: var(--hub-primary-deep); background: #DCEFFD; }

/* Coupon cards */
.hub-cp-section { margin: 4px 0 10px; font-size: 0.74rem; font-weight: 600; color: var(--hub-primary-deep); text-transform: uppercase; letter-spacing: 0.12em; }
html[lang="th"] .hub-cp-section { letter-spacing: 0.04em; }
.hub-cp-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.hub-cp-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-r-md);
  background: var(--hub-surface);
  padding: 12px 14px;
}
.hub-cp-card.is-dead { opacity: 0.55; }
.hub-cp-left {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 62px;
  padding: 9px 6px;
  border-radius: var(--hub-r-sm);
  background: var(--hub-primary);
  color: var(--hub-on-primary);
}
.hub-cp-card.is-dead .hub-cp-left { background: var(--hub-surface-2); color: var(--hub-ink-muted); }
.hub-cp-mins { font-size: 1.2rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.hub-cp-unit { font-size: 0.68rem; font-weight: 600; margin-top: 3px; }
.hub-cp-body { min-width: 0; flex: 1 1 auto; }
.hub-cp-title { font-weight: 600; font-size: 0.92rem; }
.hub-cp-code { margin-top: 2px; font-size: 0.78rem; color: var(--hub-ink-muted); letter-spacing: 0.04em; }
.hub-cp-exp { margin-top: 2px; font-size: 0.76rem; color: var(--hub-ink-dim); }
.hub-cp-state { flex: 0 0 auto; }

/* Money / summary cards — tint panel, big black number. */
.hub-money-card {
  border-radius: var(--hub-r-lg);
  background: var(--hub-surface-2);
  border: 1px solid transparent;
  padding: 18px 18px 16px;
  margin-bottom: 14px;
}
.hub-money-label { font-size: 0.8rem; font-weight: 600; color: var(--hub-ink-muted); }
.hub-money-value { margin-top: 4px; font-size: 2.25rem; font-weight: 800; letter-spacing: -0.035em; color: var(--hub-ink); line-height: 1.05; }
.hub-money-note { margin-top: 8px; font-size: 0.8rem; color: var(--hub-ink-muted); }
.hub-money-note b { color: var(--hub-warn); }
.hub-progress { margin-top: 12px; height: 8px; border-radius: 99px; background: var(--hub-surface); overflow: hidden; }
.hub-progress-fill { height: 100%; border-radius: 99px; background: var(--hub-primary); transition: width var(--hub-dur-base) var(--hub-ease); }
/* Also a <button> (booking-hub's in-place redeem), hence the resets. */
.hub-money-cta {
  appearance: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--hub-r-pill);
  background: var(--hub-primary);
  color: var(--hub-on-primary);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}
.hub-money-cta:hover { color: var(--hub-on-primary); background: var(--dal-blue-hover, #1F98EE); }

/* Reward offers (redeem points -> coupon, booking-hub coupons view) */
.hub-rw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hub-rw-have { font-size: 0.76rem; letter-spacing: 0; text-transform: none; color: var(--hub-primary-deep); }
.hub-rw-offer.is-ready { border-color: var(--hub-border-hot); }
.hub-rw-cost { margin-top: 2px; font-size: 0.8rem; font-weight: 600; color: var(--hub-primary-deep); }
.hub-rw-btn {
  flex: 0 0 auto;
  appearance: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--hub-r-pill);
  background: var(--hub-primary);
  color: var(--hub-on-primary);
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
  transition: transform var(--hub-dur-fast) var(--hub-ease);
}
.hub-rw-btn:active { transform: scale(0.96); }
.hub-rw-need {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: var(--hub-r-pill);
  background: var(--hub-surface-2);
  color: var(--hub-ink-muted);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Bottom sheet. Closed = visibility:hidden + pointer-events:none, never just
   opacity 0 (a transparent layer still swallows taps). The visibility flip is
   delayed on close so the slide-out can play. */
.hub-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear var(--hub-dur-base);
}
.hub-sheet.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.hub-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--dal-scrim, rgba(0, 0, 0, 0.45));
  opacity: 0;
  transition: opacity var(--hub-dur-base) var(--hub-ease);
}
.hub-sheet.is-open .hub-sheet-backdrop { opacity: 1; }
.hub-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 560px;
  max-height: 88vh;
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: var(--hub-r-lg) var(--hub-r-lg) 0 0;
  background: var(--hub-sheet-bg);
  color: var(--hub-ink);
  box-shadow: var(--dal-shadow-2, 0 8px 28px rgba(10, 60, 100, 0.14));
  transform: translateY(100%);
  transition: transform var(--hub-dur-slow) var(--hub-ease);
}
.hub-sheet.is-open .hub-sheet-panel { transform: none; }
.hub-sheet-grip { width: 40px; height: 4px; margin: 4px auto 14px; border-radius: 4px; background: var(--hub-border-strong); }
body.hub-sheet-lock { overflow: hidden; }
.hub-sheet-title { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; }
html[lang="th"] .hub-sheet-title { letter-spacing: -0.01em; }
.hub-sheet-sub { margin: 4px 0 0; font-size: 0.88rem; color: var(--hub-ink-muted); line-height: 1.5; }
.hub-sheet-title.is-center, .hub-sheet-sub.is-center { text-align: center; }
.hub-sheet-rows {
  margin-top: 14px;
  padding: 2px 14px;
  border: 1px solid transparent;
  border-radius: var(--hub-r-md);
  background: var(--hub-surface-2);
}
.hub-sheet-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hub-border); font-size: 0.88rem; }
.hub-sheet-row:last-child { border-bottom: none; }
.hub-sheet-row span { color: var(--hub-ink-muted); }
.hub-sheet-row b { font-weight: 600; text-align: right; }
.hub-sheet-row b.is-down { color: var(--hub-negative); }
.hub-sheet-row b.is-up { color: var(--hub-positive); }
.hub-sheet-row b.is-total { color: var(--hub-ink); font-weight: 800; font-size: 1.05rem; }
/* Booking details sheet (booking-hub) */
.hub-sheet-quote {
  margin-top: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--hub-primary);
  border-radius: 0 var(--hub-r-sm) var(--hub-r-sm) 0;
  background: var(--hub-primary-soft);
}
.hub-sheet-quote b { display: block; font-size: 0.76rem; font-weight: 600; color: var(--hub-primary-deep); }
.hub-sheet-quote p { margin: 3px 0 0; font-size: 0.88rem; line-height: 1.55; white-space: pre-line; }
.hub-sheet-note { margin: 8px 2px 0; font-size: 0.88rem; line-height: 1.6; color: var(--hub-ink-muted); white-space: pre-line; }
.hub-sheet-cancel { margin-top: 16px; display: flex; justify-content: center; }
.hub-slip-wrap { display: grid; place-items: center; margin-top: 14px; }
.hub-sheet-row b small { display: block; margin-top: 2px; font-size: 0.74rem; font-weight: 400; color: var(--hub-ink-dim); }
.hub-sheet-label { margin: 18px 2px 0; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hub-primary-deep); }
html[lang="th"] .hub-sheet-label { letter-spacing: 0.04em; }
.hub-sheet-label + .hub-sheet-rows { margin-top: 8px; }
.hub-sheet-notes { margin: 12px 0 0; padding-left: 18px; font-size: 0.8rem; line-height: 1.55; color: var(--hub-ink-muted); }
.hub-sheet-notes li + li { margin-top: 3px; }
.hub-sheet-fine { margin: 12px 2px 0; font-size: 0.78rem; line-height: 1.5; color: var(--hub-ink-dim); }
.hub-sheet-err {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--hub-r-sm);
  border: 1px solid var(--hub-negative-line);
  background: var(--hub-negative-soft);
  color: var(--hub-negative);
  font-size: 0.85rem;
  font-weight: 600;
}
.hub-sheet-actions { margin-top: 18px; display: flex; gap: 10px; }
.hub-sheet-btn {
  flex: 1 1 0;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px; /* = /booking's CTA pill */
  padding: 12px 16px;
  border: 1.5px solid transparent;
  border-radius: var(--hub-r-pill);
  background: var(--hub-surface-2);
  color: var(--hub-ink);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--hub-dur-fast) var(--hub-ease), transform var(--hub-dur-fast) var(--hub-ease);
}
.hub-sheet-btn:hover { color: var(--hub-ink); background: #DCEFFD; }
.hub-sheet-btn:active { transform: scale(0.98); }
.hub-sheet-btn.is-primary { flex-grow: 1.7; background: var(--hub-primary); border-color: var(--hub-primary); color: var(--hub-on-primary); }
.hub-sheet-btn.is-primary:hover { background: var(--dal-blue-hover, #1F98EE); color: var(--hub-on-primary); }
.hub-sheet-btn.is-danger { flex-grow: 1.7; background: var(--hub-negative-soft); border-color: var(--hub-negative-line); color: var(--hub-negative); }
.hub-sheet-btn.is-danger:hover { background: var(--hub-negative-soft); color: var(--hub-negative); border-color: var(--hub-negative); }
.hub-sheet-btn:disabled { opacity: 0.5; cursor: default; }
.hub-sheet-btn.is-busy { cursor: progress; }
/* Result mark on a success / "checking" sheet */
.hub-sheet-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 2px auto 10px;
  border-radius: 22%;
}
.hub-sheet-mark.is-ok { background: var(--hub-primary); color: var(--hub-on-primary); }
.hub-sheet-mark.is-warn { background: var(--hub-warn-soft); color: var(--hub-warn); }
.hub-rw-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  padding: 18px 14px;
  border: 2px dashed var(--hub-border-hot);
  border-radius: var(--hub-r-md);
  background: var(--hub-primary-soft);
  text-align: center;
}
.hub-rw-hero-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; color: var(--hub-primary-deep); }
.hub-rw-hero-code { font-size: 1.6rem; font-weight: 800; letter-spacing: 0.06em; color: var(--hub-ink); user-select: all; -webkit-user-select: all; }
.hub-rw-hero-meta { font-size: 0.8rem; color: var(--hub-ink-muted); }

/* Ledger rows */
.hub-ledger-title { margin: 18px 0 8px; font-size: 0.72rem; font-weight: 600; color: var(--hub-primary-deep); text-transform: uppercase; letter-spacing: 0.12em; }
html[lang="th"] .hub-ledger-title { letter-spacing: 0.04em; }
.hub-ledger { display: flex; flex-direction: column; }
.hub-ledger-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--hub-border);
}
.hub-ledger-row:last-child { border-bottom: none; }
.hub-ledger-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 22%;
  background: var(--hub-surface-2);
  color: var(--hub-ink-muted);
}
.hub-ledger-ico.is-plus { background: var(--hub-positive-soft); color: var(--hub-positive); }
.hub-ledger-ico.is-minus { background: var(--hub-negative-soft); color: var(--hub-negative); }
.hub-ledger-ico.is-hold { background: var(--hub-warn-soft); color: var(--hub-warn); }
.hub-ledger-txt { min-width: 0; flex: 1 1 auto; }
.hub-ledger-reason { font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-ledger-when { margin-top: 1px; font-size: 0.75rem; color: var(--hub-ink-dim); }
.hub-ledger-amt { flex: 0 0 auto; text-align: right; }
.hub-ledger-delta { font-weight: 800; font-size: 0.92rem; }
.hub-ledger-delta.is-plus { color: var(--hub-positive); }
.hub-ledger-delta.is-minus { color: var(--hub-negative); }
.hub-ledger-delta.is-hold { color: var(--hub-warn); }
.hub-ledger-after { margin-top: 1px; font-size: 0.72rem; color: var(--hub-ink-dim); }

/* Empty / loading / login states */
.hub-empty {
  text-align: center;
  color: var(--hub-ink-muted);
  padding: 34px 16px;
  font-size: 0.92rem;
  line-height: 1.6;
}
.hub-login-hint {
  text-align: center;
  padding: 34px 20px;
  border-radius: var(--hub-r-lg);
  background: var(--hub-surface-2);
}
.hub-login-hint p { margin: 0 0 16px; color: var(--hub-ink-muted); font-size: 0.92rem; line-height: 1.5; }
.hub-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--hub-r-pill);
  background: var(--hub-primary);
  color: var(--hub-on-primary);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}
.hub-login-btn:hover { color: var(--hub-on-primary); background: var(--dal-blue-hover, #1F98EE); }
.hub-skel { border-radius: var(--hub-r-md); background: var(--hub-surface-2); animation: hub-pulse 1.2s ease-in-out infinite; }
@keyframes hub-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
/* Only the detail-view body lacks a gap of its own — the stats grid and
   menu column already space children, so a blanket sibling margin there
   would double up. */
#hubViewBody .hub-skel + .hub-skel { margin-top: 10px; }

@media (min-width: 600px) {
  .hub-greet-name { font-size: 1.75rem; }
  .hub-cta { padding: 26px 28px 28px; }
  .hub-cta-title { font-size: 2.3rem; }
  .hub-stat-value { font-size: 1.6rem; }
}
