/* Visual language mirrors the sports portal (shadcn "neutral" palette, emerald live
   accents, rounded-xl cards, frosted floating header). Dark is the default theme. */
:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --card-border: #e5e5e5;
  --border: #e5e5e5;
  --input: #e5e5e5;
  --muted: #f5f5f5;
  --muted-fg: #737373;
  --primary: #171717;
  --primary-fg: #fafafa;
  --accent: #f5f5f5;
  --ring: #a3a3a3;
  --grad-from: #404040;
  --grad-to: #525252;
  --tile-from: #404040;
  --tile-to: #262626;
  --glow: rgba(16, 185, 129, .08);
  --emerald: #10b981;
  --emerald-strong: #059669;
  --emerald-soft: rgba(16, 185, 129, .12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, .12);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, .1);
  --neutral-dot: #a3a3a3;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);
  --radius: 10px;
  color-scheme: light;
}
.dark {
  --background: #0a0a0a;
  --foreground: #fafafa;
  --card: #171717;
  --card-border: #404040;
  --border: rgba(255, 255, 255, .1);
  --input: rgba(255, 255, 255, .15);
  --muted: #262626;
  --muted-fg: #a1a1a1;
  --primary: #e5e5e5;
  --primary-fg: #171717;
  --accent: #262626;
  --ring: #737373;
  --grad-from: #a3a3a3;
  --grad-to: #d4d4d4;
  --tile-from: #525252;
  --tile-to: #404040;
  --glow: rgba(16, 185, 129, .06);
  --emerald: #34d399;
  --emerald-strong: #10b981;
  --rose: #fb7185;
  --neutral-dot: #737373;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1000px 600px at 50% -10%, var(--glow), transparent 70%),
    var(--background);
  color: var(--foreground);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}
[hidden] { display: none !important; }
svg[data-icon] { width: 16px; height: 16px; flex-shrink: 0; }
.muted { color: var(--muted-fg); }
.grad {
  background: linear-gradient(90deg, var(--grad-from), var(--grad-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- motion -------------------------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
@keyframes pingTile { 75%, 100% { transform: scale(1.35); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.fade-up { animation: fadeUp .5s cubic-bezier(.2, .7, .2, 1) both; }
.fade-up[data-d="60"] { animation-delay: 60ms; }
.fade-up[data-d="120"] { animation-delay: 120ms; }
.fade-up[data-d="180"] { animation-delay: 180ms; }
.fade-up[data-d="240"] { animation-delay: 240ms; }
.fade-up[data-d="300"] { animation-delay: 300ms; }
.fade-up[data-d="360"] { animation-delay: 360ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- header -------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  margin-top: 20px;
  width: calc(100% - 32px);
  max-width: 1120px;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--background) 25%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand-tile {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--tile-from), var(--tile-to)); color: #fff; box-shadow: var(--shadow-sm);
}
.brand-name { font-size: 15px; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.who { color: var(--muted-fg); font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .who { display: none !important; } .brand-name .grad { display: none; } }

.icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 999px; border: 0; background: transparent;
  color: var(--muted-fg); cursor: pointer; display: grid; place-items: center; transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--accent); color: var(--foreground); }
.icon-btn svg { position: absolute; width: 19px; height: 19px; transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s; }
.i-moon { transform: rotate(90deg) scale(0); opacity: 0; }
.dark .i-sun { transform: rotate(-90deg) scale(0); opacity: 0; }
.dark .i-moon { transform: none; opacity: 1; }

/* ---- buttons & inputs ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .15s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--primary-fg); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 90%, transparent); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-outline:hover, .btn-ghost:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted-fg); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; font-size: 15px; }
.btn-block { width: 100%; }
.btn .spinner, .spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}

.input {
  display: block; width: 100%; height: 36px; padding: 4px 12px;
  font: inherit; color: var(--foreground); background: transparent;
  border: 1px solid var(--input); border-radius: 8px; box-shadow: var(--shadow-sm);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.dark .input { background: rgba(255, 255, 255, .045); }
.input::placeholder { color: var(--muted-fg); }
.input:focus-visible { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 35%, transparent); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: var(--card); color: var(--foreground); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---- login (mirrors the portal's split layout) --------------------------- */
.login { display: grid; min-height: 100vh; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .login { grid-template-columns: 1fr 1fr; } }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 104px 24px 40px; }
.login-form { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 22px; }
.login-head { text-align: center; }
.login-head h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.02em; }
.login-head p { margin: 0; font-size: 14px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 500; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 40px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted-fg); cursor: pointer; display: grid; padding: 4px; }
.pw-toggle:hover { color: var(--foreground); }
.fine { display: flex; gap: 8px; font-size: 12px; color: var(--muted-fg); margin: 0; }
.fine svg { width: 14px; height: 14px; margin-top: 2px; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--rose); background: var(--rose-soft); border: 1px solid color-mix(in srgb, var(--rose) 30%, transparent); animation: fadeUp .3s both; }

.login-art { display: none; position: relative; overflow: hidden; background: linear-gradient(160deg, #171717, #0a0a0a 60%); }
@media (min-width: 1024px) { .login-art { display: block; } }
.court { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 1.5; }
.court * { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.4s ease forwards; }
.court *:nth-child(2) { animation-delay: .3s; } .court *:nth-child(3) { animation-delay: .5s; }
.court *:nth-child(4), .court *:nth-child(5) { animation-delay: .7s; }
.court *:nth-child(6), .court *:nth-child(7) { animation-delay: .9s; }
.login-art::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, #0a0a0a 70%); }
.art-copy { z-index: 1; position: absolute; left: 48px; right: 48px; bottom: 56px; color: #fafafa; animation: fadeUp .7s .6s both; }
.art-title { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 14px 0 8px; }
.art-sub { color: #a1a1a1; max-width: 420px; margin: 0; font-size: 15px; }
.live-dot { position: relative; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #10b981; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #10b981; animation: ping 1.5s cubic-bezier(0, 0, .2, 1) infinite; }

/* ---- page ---------------------------------------------------------------- */
.page { max-width: 1040px; margin: 0 auto; padding: 120px 16px 48px; }
.hero { text-align: center; margin-bottom: 36px; }
.hero-tile {
  position: relative; margin: 0 auto 22px; width: 72px; height: 72px; border-radius: 22px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--tile-from), var(--tile-to));
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .45);
}
.hero-tile svg { width: 32px; height: 32px; }
.hero-ping { position: absolute; inset: 0; border-radius: inherit; background: rgba(16, 185, 129, .2); animation: pingTile 2s cubic-bezier(0, 0, .2, 1) infinite; }
.hero-dot { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: #10b981; border: 2px solid var(--background); }
.hero-dot span { position: absolute; inset: 0; border-radius: 50%; background: #10b981; animation: ping 1.5s cubic-bezier(0, 0, .2, 1) infinite; }
.hero-title { font-size: clamp(30px, 6vw, 52px); font-weight: 700; letter-spacing: -.03em; margin: 0 0 12px; line-height: 1.1; }
.hero-sub { margin: 0 auto; max-width: 520px; color: var(--muted-fg); font-size: 16px; font-weight: 500; }

.stack { display: grid; gap: 20px; margin-bottom: 20px; }
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 14px;
  padding: 22px; box-shadow: var(--shadow-sm); transition: box-shadow .3s, border-color .3s, background-color .3s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 0; letter-spacing: -.01em; }
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 12px;
  background: linear-gradient(135deg, var(--tile-from), var(--tile-to)); color: #fff;
}
.hint { margin: 12px 0 0; color: var(--muted-fg); font-size: 12.5px; min-height: 1em; }
.empty { margin: 0; color: var(--muted-fg); font-size: 13px; padding: 14px 0; grid-column: 1 / -1; }

.search { position: relative; margin-bottom: 16px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); width: 18px; height: 18px; }
.search .input { height: 44px; padding-left: 42px; border-radius: 10px; font-size: 15px; }

/* selectable tiles */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tile, .chip, .slot {
  position: relative; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 12px;
  transition: transform .3s, box-shadow .3s, border-color .2s, background-color .2s;
  animation: fadeUp .4s both;
}
.tile:hover, .slot:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }
.tile[aria-checked="true"], .chip[aria-checked="true"], .slot[aria-checked="true"] {
  border-color: var(--foreground); box-shadow: 0 0 0 1px var(--foreground), var(--shadow-md); animation: pop .3s both;
}
.tile { padding: 14px; display: grid; gap: 6px; }
.tile-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.tile-name svg { color: var(--muted-fg); }
.tile-meta { color: var(--muted-fg); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.chip { padding: 8px 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.chip:hover { background: var(--accent); }
.chip .dot { width: 7px; height: 7px; }
.chip.off { opacity: .55; }
.chip-any svg { width: 14px; height: 14px; color: var(--emerald-strong); }
.dark .chip-any svg { color: var(--emerald); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--emerald) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.booking.fresh { border-color: var(--emerald-strong); animation: fadeUp .35s both, flash 1.4s .3s 2; }
.slot { padding: 16px; display: grid; gap: 10px; }
.slot-time { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.slot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted-fg); font-size: 12.5px; }
.slot-row span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bar { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--emerald-strong); transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.bar.low > i { background: var(--amber); }
.bar.none > i { background: var(--rose); }
.skeleton {
  border-radius: 12px; min-height: 62px;
  background: linear-gradient(90deg, var(--muted) 25%, color-mix(in srgb, var(--muted) 50%, var(--card)) 50%, var(--muted) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.slot-grid .skeleton { min-height: 104px; }

/* when-to-book */
.when-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1100px) { .when-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) { .when-grid { grid-template-columns: 1fr; } }
.when-opt { position: relative; cursor: pointer; }
.when-opt input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.when-body {
  display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px;
  border: 1px solid var(--card-border); border-radius: 12px; transition: border-color .2s, box-shadow .3s, transform .3s;
}
.when-opt:hover .when-body { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.when-opt input:checked + .when-body { border-color: var(--foreground); box-shadow: 0 0 0 1px var(--foreground), var(--shadow-md); }
.when-opt input:focus-visible + .when-body { outline: 2px solid var(--ring); outline-offset: 2px; }
.when-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.when-desc { color: var(--muted-fg); font-size: 12.5px; }
.when-body .select { margin-top: 4px; }
.when-opt input:not(:checked) + .when-body .select { opacity: .55; }
.custom-row { display: flex; gap: 6px; align-items: center; }
.time-row .select { padding-left: 10px; padding-right: 24px; background-position: right 7px center; }
.colon { color: var(--muted-fg); font-weight: 700; }
.eta {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  color: var(--emerald-strong); background: var(--emerald-soft); min-height: 24px;
}
.dark .eta { color: var(--emerald); }
.eta.bad { color: var(--rose); background: var(--rose-soft); }
.eta:empty { display: none; }

.summary { display: grid; gap: 12px; }
.summary p { margin: 0; text-align: center; }

/* bookings */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted-fg); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot-emerald { background: var(--emerald-strong); }
.dot-amber { background: var(--amber); }
.dot-rose { background: var(--rose); }
.dot-neutral { background: var(--neutral-dot); }
.rules { margin: -6px 0 14px; }
.bookings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.booking {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: start;
  padding: 14px; border: 1px solid var(--border); border-radius: 12px; animation: fadeUp .35s both;
}
.b-icon { grid-row: span 3; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.b-icon svg { width: 18px; height: 18px; }
.st-scheduled .b-icon, .st-running .b-icon { background: var(--amber-soft); color: var(--amber); }
.st-success .b-icon { background: var(--emerald-soft); color: var(--emerald-strong); }
.dark .st-success .b-icon { color: var(--emerald); }
.st-failed .b-icon { background: var(--rose-soft); color: var(--rose); }
.st-cancelled .b-icon { background: var(--muted); color: var(--muted-fg); }
.st-running .b-icon svg { animation: spin 1.2s linear infinite; }
.b-title { font-weight: 600; }
.b-meta { color: var(--muted-fg); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.b-meta span { display: inline-flex; align-items: center; gap: 5px; }
.b-meta svg { width: 13px; height: 13px; }
.b-msg { color: var(--muted-fg); font-size: 12.5px; grid-column: 2; }
.st-failed .b-msg { color: var(--rose); }
.b-side { grid-column: 3; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid; white-space: nowrap;
}
.st-scheduled .badge, .st-running .badge { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: var(--amber-soft); }
.st-success .badge { color: var(--emerald-strong); border-color: color-mix(in srgb, var(--emerald-strong) 40%, transparent); background: var(--emerald-soft); }
.dark .st-success .badge { color: var(--emerald); }
.st-failed .badge { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 40%, transparent); background: var(--rose-soft); }
.st-cancelled .badge { color: var(--muted-fg); border-color: var(--border); background: var(--muted); }
@media (max-width: 560px) {
  .booking { grid-template-columns: auto 1fr; align-items: center; }
  .b-icon { grid-row: auto; }
  .b-meta, .b-msg { grid-column: 1 / -1; }
  .b-side { grid-column: 1 / -1; grid-row: auto; flex-direction: row; justify-content: space-between; align-items: center; order: 5; }
}

.foot { display: grid; justify-items: center; gap: 10px; margin: 28px 0 0; text-align: center; }
.collected { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--muted-fg); }
.live-dot.small { width: 8px; height: 8px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.source { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted-fg); }
.source.live { color: var(--emerald-strong); border-color: color-mix(in srgb, var(--emerald-strong) 40%, transparent); background: var(--emerald-soft); }
.dark .source.live { color: var(--emerald); }
.source svg { width: 13px; height: 13px; }
.reveal { animation: fadeUp .45s cubic-bezier(.2, .7, .2, 1) both; }
#pick-sections > .reveal:nth-child(2) { animation-delay: 60ms; }
#pick-sections > .reveal:nth-child(3) { animation-delay: 120ms; }
#pick-sections > .reveal:nth-child(4) { animation-delay: 180ms; }
.slot-note { font-size: 12px; color: var(--muted-fg); }
.link-danger { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--muted-fg); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.link-danger:hover { color: var(--rose); }

/* toasts (sonner-like) */
.toasts { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(360px, calc(100% - 32px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 10px;
  background: var(--card); color: var(--foreground); border: 1px solid var(--card-border); box-shadow: var(--shadow-md);
  font-size: 13.5px; animation: toastIn .35s cubic-bezier(.2, .7, .2, 1) both; transition: opacity .3s, transform .3s;
}
.toast.out { opacity: 0; transform: translateY(8px); }
.toast svg { width: 18px; height: 18px; margin-top: 1px; }
.toast.ok svg { color: var(--emerald-strong); }
.toast.err svg { color: var(--rose); }
.toast strong { display: block; }

/* ---- account menu ---------------------------------------------------------- */
.account { position: relative; }
.account-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 3px 10px 3px 3px;
  border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--foreground);
  font: inherit; font-weight: 500; cursor: pointer; transition: background .2s, border-color .2s;
}
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--accent); }
.account-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 14px !important; height: 14px !important; color: var(--muted-fg); transition: transform .25s; }
.account-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
@media (max-width: 560px) { .account-name { display: none; } .account-btn { padding-right: 8px; } }
.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, var(--tile-from), var(--tile-to)); box-shadow: inset 0 0 0 2px rgba(16, 185, 129, .45);
}
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 280px; padding: 6px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; box-shadow: var(--shadow-md);
  transform-origin: top right; animation: menuIn .18s cubic-bezier(.2, .7, .2, 1) both;
}
.menu-head { display: flex; gap: 10px; align-items: center; padding: 8px 8px 10px; }
.menu-who { display: grid; min-width: 0; }
.menu-who strong, .menu-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-who span { font-size: 12px; }
.menu-label { padding: 6px 8px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-fg); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 0 4px 6px; padding: 3px; border-radius: 9px; background: var(--muted); }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted-fg); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s;
}
.seg button svg { width: 13px; height: 13px; }
.seg button[aria-checked="true"] { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--foreground); font: inherit; font-size: 13.5px; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); outline: none; }
.menu-item svg { color: var(--muted-fg); }
.menu-danger, .menu-danger svg { color: var(--rose); }
.menu-danger:hover { background: var(--rose-soft); }

/* bookings sync */
.synced { font-size: 12px; color: var(--muted-fg); }
.legend-row { margin: -4px 0 10px; }
#sync-bookings.spinning svg { animation: spin .8s linear infinite; }
.st-success .b-icon.portal { background: var(--emerald-soft); }

/* notices: messages left for the user's next visit */
.notices { display: grid; gap: 10px; margin: -12px 0 20px; }
.notice {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: start;
  padding: 14px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  background: color-mix(in srgb, var(--amber-soft) 70%, var(--card)); animation: fadeUp .4s both;
  transition: opacity .25s, transform .25s;
}
.notice.out { opacity: 0; transform: translateY(-6px); }
.notice.k-SLOTS_FULL, .notice.k-MISSED { border-color: color-mix(in srgb, var(--rose) 40%, transparent); background: color-mix(in srgb, var(--rose-soft) 80%, var(--card)); }
.notice-icon { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.notice.k-SLOTS_FULL .notice-icon, .notice.k-MISSED .notice-icon { background: var(--rose-soft); color: var(--rose); }
.notice-icon svg { width: 18px; height: 18px; }
.notice-title { font-weight: 600; }
.notice-body { grid-column: 2; color: var(--muted-fg); font-size: 13px; }
.notice-time { font-size: 12px; color: var(--muted-fg); }
.notice-side { grid-row: 1 / span 2; grid-column: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.notices-all { justify-self: end; }
@media (max-width: 560px) { .notice { grid-template-columns: auto 1fr; } .notice-side { grid-column: 1 / -1; grid-row: auto; flex-direction: row; justify-content: space-between; align-items: center; } }

/* Slots that already started today: listed but not bookable. */
.slot.slot-started { opacity: .5; cursor: not-allowed; }
.slot.slot-started:hover { transform: none; }

/* Bookings tabs: Active / Logs */
.tabs { display: inline-grid; grid-auto-flow: column; gap: 2px; margin: 0 0 14px; padding: 3px; border-radius: 9px; background: var(--muted); }
.tabs button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted-fg); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }
.tab-count:empty { display: none; }
.tab-count { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--border); font-size: 11.5px; line-height: 18px; text-align: center; }

/* Email settings dialog */
.dialog {
  width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm);
}
.dialog::backdrop { background: rgb(0 0 0 / .5); }
.dialog-body { display: grid; gap: 14px; padding: 22px; }
.dialog-body h2 { margin: 0; font-size: 19px; }
.dialog-body > p { margin: 0; font-size: 13.5px; }
.switch-row, .radio-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.switch-row > span { display: grid; gap: 2px; }
.switch-row .muted { font-size: 12.5px; }
.switch-row input, .radio-row input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--emerald-strong); }
.email-to { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.email-to legend { margin-bottom: 6px; font-size: 13.5px; font-weight: 500; }
.radio-row .muted { font-size: 12.5px; word-break: break-all; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Admin "Open as user" bar */
.acting-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px;
  padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); border-radius: var(--radius);
  background: var(--amber-soft); font-size: 14px;
}
.acting-bar > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.acting-bar svg { width: 16px; height: 16px; color: var(--amber); }
.acting-flags { color: var(--rose); font-size: 12.5px; }

/* "Any" table priority order */
.any-order { margin-top: 14px; }
.any-order .hint { margin: 0 0 8px; }
.any-order ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 420px; }
.any-order li { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); font-size: 14px; }
.order-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); font-size: 12px; font-weight: 600; }
.order-name { flex: 1; }
.any-order .icon-sm { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--foreground); cursor: pointer; }
.any-order .icon-sm:disabled { opacity: .35; cursor: default; }
.any-order .icon-sm svg { width: 15px; height: 15px; transform: rotate(180deg); }
.any-order .icon-sm.flip svg { transform: none; }
