/* StellarSync booking: Cal.com-style booker and staff screens in the StellarSync world.
   Tokens follow stellarsync-next/DESIGN.md; a brand override only needs to redefine the custom properties. */

@font-face {
  font-family: "Urbanist";
  src: url("/assets/fonts/urbanist-variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: oklch(97.6% .006 90);
  --surface: oklch(99.5% .003 90);
  --surface-sunk: oklch(95.6% .007 90);
  --ink: oklch(19.5% .009 240);
  --ink-2: oklch(46% .012 250);
  --ink-3: oklch(62% .01 250);
  --line: oklch(90% .007 250);
  --line-strong: oklch(83% .008 250);
  --accent: oklch(52% .23 262);
  --accent-hover: oklch(46% .22 262);
  --accent-ink: oklch(99% .002 90);
  --accent-soft: oklch(52% .23 262 / .09);
  --accent-soft-hover: oklch(52% .23 262 / .16);
  --accent-text: oklch(45% .21 262);
  --danger: oklch(50% .18 27);
  --danger-soft: oklch(50% .18 27 / .08);
  --success: oklch(48% .12 155);
  --success-soft: oklch(48% .12 155 / .09);
  --shadow: 0 1px 2px oklch(19% .04 260 / .05), 0 24px 48px -28px oklch(19% .04 260 / .28);
  --shadow-sm: 0 1px 2px oklch(19% .04 260 / .06), 0 4px 10px -6px oklch(19% .04 260 / .14);
  --radius: 16px;
  --radius-sm: 10px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

/* Dark theme: the visitor's system preference, unless they picked a theme with the toggle (data-theme on <html>).
   The website's booking dialog is always light (data-embed). Keep the two blocks below identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-embed]) {
    --ground: oklch(19.1% .007 235);
    --surface: oklch(23.4% .008 235);
    --surface-sunk: oklch(21.2% .008 235);
    --ink: oklch(96.5% .006 90);
    --ink-2: oklch(76% .01 250);
    --ink-3: oklch(60% .01 250);
    --line: oklch(31% .01 240);
    --line-strong: oklch(38% .012 240);
    --accent: oklch(67% .19 262);
    --accent-hover: oklch(73% .16 262);
    --accent-ink: oklch(17% .02 262);
    --accent-soft: oklch(67% .19 262 / .14);
    --accent-soft-hover: oklch(67% .19 262 / .24);
    --accent-text: oklch(78% .13 262);
    --danger: oklch(72% .15 27);
    --danger-soft: oklch(72% .15 27 / .12);
    --success: oklch(76% .13 155);
    --success-soft: oklch(76% .13 155 / .12);
    --shadow: 0 1px 2px oklch(0% 0 0 / .3), 0 24px 48px -28px oklch(0% 0 0 / .7);
    --shadow-sm: 0 1px 2px oklch(0% 0 0 / .3), 0 4px 10px -6px oklch(0% 0 0 / .5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"]:not([data-embed]) {
  --ground: oklch(19.1% .007 235);
  --surface: oklch(23.4% .008 235);
  --surface-sunk: oklch(21.2% .008 235);
  --ink: oklch(96.5% .006 90);
  --ink-2: oklch(76% .01 250);
  --ink-3: oklch(60% .01 250);
  --line: oklch(31% .01 240);
  --line-strong: oklch(38% .012 240);
  --accent: oklch(67% .19 262);
  --accent-hover: oklch(73% .16 262);
  --accent-ink: oklch(17% .02 262);
  --accent-soft: oklch(67% .19 262 / .14);
  --accent-soft-hover: oklch(67% .19 262 / .24);
  --accent-text: oklch(78% .13 262);
  --danger: oklch(72% .15 27);
  --danger-soft: oklch(72% .15 27 / .12);
  --success: oklch(76% .13 155);
  --success-soft: oklch(76% .13 155 / .12);
  --shadow: 0 1px 2px oklch(0% 0 0 / .3), 0 24px 48px -28px oklch(0% 0 0 / .7);
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / .3), 0 4px 10px -6px oklch(0% 0 0 / .5);
  color-scheme: dark;
}

/* Logo and mark artwork: html.ts renders both variants, and only the current theme's one shows. */
:root[data-embed] .art-dark, :root[data-theme="light"] .art-dark { display: none !important; }
:root[data-theme="dark"]:not([data-embed]) .art-light { display: none !important; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .art-dark { display: none !important; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-embed]) .art-light { display: none !important; } }

/* ---------- Base and browser surfaces ---------- */

[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 16px/1.5 "Urbanist", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
}
::selection { background: var(--accent-soft-hover); color: var(--ink); }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 650; letter-spacing: -.02em; line-height: 1.15; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--accent-text); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
img, svg { display: block; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
* { scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid var(--surface); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Controls ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: -.005em; text-decoration: none; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  transition: background-color .18s var(--ease-out), border-color .18s var(--ease-out), box-shadow .18s var(--ease-out), transform .09s var(--ease-out);
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button.secondary:hover { background: var(--surface-sunk); border-color: var(--ink-3); }
.button.quiet { background: transparent; border-color: transparent; color: var(--ink-2); padding: 0 12px; }
.button.quiet:hover { color: var(--ink); background: var(--surface-sunk); }
.button.danger { background: transparent; color: var(--danger); border-color: var(--line-strong); }
.button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.button.block { width: 100%; }
.button-link { background: none; border: 0; padding: 11px 0; margin: -11px 0; font: inherit; color: var(--accent-text); cursor: pointer; text-decoration: underline; text-underline-offset: .22em; }

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 18px; }
.field label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  font-family: inherit; font-weight: 500; font-size: 16px; line-height: 1.4; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.input::placeholder { color: var(--ink-2); opacity: 1; }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-hover); }
.input[aria-invalid="true"] { border-color: var(--danger); }
textarea.input { min-height: 112px; resize: vertical; }
.field-error { font-size: 13px; font-weight: 600; color: var(--danger); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 500; background: var(--surface-sunk); color: var(--ink); }
.notice .icon { margin-top: 2px; }
.notice.bad { background: var(--danger-soft); color: var(--danger); }
.notice.good { background: var(--success-soft); color: var(--success); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-sunk); color: var(--ink-2); white-space: nowrap; }
.badge.good { background: var(--success-soft); color: var(--success); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 15px; letter-spacing: .01em;
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-mark { width: 40px; height: 40px; flex: none; }

.logo { display: inline-flex; }
.logo img { height: 30px; width: auto; }

/* ---------- Guest pages ---------- */

.guest { display: grid; justify-items: center; align-content: start; gap: 28px; padding: clamp(16px, 5vw, 56px) 16px 40px; min-height: 100dvh; }
/* Inside the website's booking dialog: the dialog is the frame, so the card loses its own. */
[data-embed] body { min-height: 0; background: var(--surface); }
[data-embed] .guest { min-height: 0; padding: 0 0 24px; gap: 0; }
[data-embed] .guest > .card { border: 0; border-radius: 0; box-shadow: none; }
[data-embed] .guest > .card.booker { width: 100%; }

.guest-footer { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.guest-footer .logo img { height: 26px; opacity: .92; }
.guest-footer a { color: inherit; }
.guest-footer .privacy { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.guest-footer .privacy:hover { color: var(--ink); }
.footer-links { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: center; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 4px; border: 0; background: none; color: var(--ink-2); font: inherit; cursor: pointer; border-radius: var(--radius-sm); }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card { width: min(100%, 1080px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.narrow { width: min(100%, 560px); }
.card.slim { width: min(100%, 420px); }

.booker { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(220px, 268px); }
.booker.is-form { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
.booker > section { padding: 28px; min-width: 0; }
.booker > section + section { border-left: 1px solid var(--line); }

/* Event details pane */
.host { display: flex; align-items: center; gap: 12px; }
.host-name { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.host-name a { color: inherit; text-decoration: none; }
.host-name a:hover { color: var(--ink); text-decoration: underline; }
.event-title { margin-top: 18px; font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
.event-meta { display: grid; gap: 12px; margin-top: 20px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.event-meta li { display: flex; gap: 10px; align-items: center; }
.event-meta .when { color: var(--ink); align-items: flex-start; }
.event-meta .when .icon { margin-top: 2px; }
.tz-form { display: flex; align-items: center; gap: 10px; }
.tz-select {
  appearance: none; -webkit-appearance: none; max-width: 100%; min-height: 44px; padding: 4px 28px 4px 8px; margin: -6px 0 -6px -8px;
  font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; color: var(--ink-2); background: transparent;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  /* A native select is as wide as its longest option; size it to the chosen one where supported. */
  field-sizing: content;
}
/* The chevron is a mask filled with the text colour, so it follows the theme and any brand. */
.tz-wrap { position: relative; display: inline-flex; max-width: 100%; color: var(--ink-2); }
.tz-wrap::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -6px; pointer-events: none; background: currentColor;
  -webkit-mask: 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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: 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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tz-wrap:hover { color: var(--ink); }
.tz-select:hover { border-color: var(--line-strong); color: var(--ink); }
.tz-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.event-description { margin-top: 22px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.about-narrow { display: none; }
.about-narrow summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line); font-size: 15px; font-weight: 700; cursor: pointer; list-style: none;
}
.about-narrow summary::-webkit-details-marker { display: none; }
.about-narrow summary .icon { color: var(--ink-2); transition: transform .2s var(--ease-out); }
.about-narrow[open] summary .icon { transform: rotate(90deg); }
.about-narrow .event-description { margin: 6px 0 4px; }
.expect { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.expect-pane { display: none; }
.booking-mark { width: 48px; height: 48px; margin: 0 auto; }
.expect h2 { font-size: 15px; font-weight: 700; letter-spacing: -.005em; }
.expect ul { display: grid; gap: 10px; margin-top: 12px; }
.expect li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.expect li .star { width: 10px; height: 10px; margin-top: 6px; fill: var(--accent); }

/* Month calendar */
.month-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.month-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.month-head h2 span { color: var(--ink-2); font-weight: 600; }
.month-nav { display: flex; gap: 6px; }
.icon-button {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--ink); border: 1px solid var(--line); background: var(--surface); text-decoration: none;
  transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out);
}
.icon-button:hover { background: var(--surface-sunk); border-color: var(--line-strong); }
.icon-button[aria-disabled="true"] { color: var(--ink-3); background: transparent; pointer-events: none; border-color: transparent; }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekdays { margin: 22px 0 8px; }
.weekdays abbr { text-decoration: none; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.day {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; min-height: 44px; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-3); text-decoration: none;
}
a.day { color: var(--accent-text); background: var(--accent-soft); font-weight: 700; transition: background-color .15s var(--ease-out), transform .09s var(--ease-out); }
a.day:hover { background: var(--accent-soft-hover); text-decoration: none; }
a.day[aria-current="date"] { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.day .star { position: absolute; bottom: 14%; width: 7px; height: 7px; fill: currentColor; }
.day .today-dot { position: absolute; bottom: 14%; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
a.day .today-dot { background: currentColor; }
span.day:has(.today-dot) { color: var(--ink); font-weight: 700; }
.day.outside { visibility: hidden; }
.calendar-note { margin-top: 18px; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.calendar-note a { font-weight: 600; }

/* Day's times */
.times-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.times-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.times-head h2 span { color: var(--ink-2); font-weight: 600; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-sunk); border: 1px solid var(--line); }
.segmented a { position: relative; min-width: 44px; text-align: center; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.segmented a::after { content: ""; position: absolute; inset: -10px 0; }
.segmented a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
/* The list scrolls inside the pane; the last rows fade so it reads as "more below", with room to scroll clear of the fade. */
.times-pane { position: relative; min-height: 540px; padding-bottom: 0 !important; }
.slots {
  position: absolute; top: 90px; left: 28px; right: 22px; bottom: 0;
  display: grid; align-content: start; gap: 8px; overflow-y: auto; padding: 2px 6px 32px 2px; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, var(--ink) calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, var(--ink) calc(100% - 36px), transparent);
}
.slot {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); font-size: 15.5px; font-weight: 650; font-variant-numeric: tabular-nums; text-decoration: none;
  transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out), color .15s var(--ease-out), transform .09s var(--ease-out);
}
.slot:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); text-decoration: none; }
.times-empty { margin-top: 18px; font-size: 14.5px; color: var(--ink-2); }
.slots { display: block; }
.slot-list { display: grid; gap: 8px; }
.slot-group { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.slot-group:first-child { margin-top: 0; }
.change-day { display: none; font-size: 14px; font-weight: 600; }

@keyframes star-in { from { transform: scale(.2) rotate(-45deg); opacity: 0; } }

/* Details form */
.form-pane { display: grid; align-content: start; }
.form-pane h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 22px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.form-note { margin-top: 16px; font-size: 13.5px; color: var(--ink-2); text-align: right; }
.form-errors { margin-bottom: 20px; }
.form-errors ul { display: grid; gap: 2px; margin-top: 4px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Confirmation */
.confirm { padding: 40px clamp(20px, 5vw, 44px) 32px; text-align: center; }
.confirm-badge { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; background: var(--accent); box-shadow: var(--shadow-sm); }
.confirm-badge svg { width: 34px; height: 34px; fill: var(--accent-ink); }
.confirm.is-new .confirm-badge { animation: badge-in .5s var(--ease-out) both; }
.confirm.is-new .confirm-badge svg { animation: star-in .7s var(--ease-out) .12s both; }
.confirm.is-new :is(h1, .lede, .summary, .manage-actions, .next, .confirm-foot) { animation: rise .5s var(--ease-out) both; }
.confirm.is-new h1 { animation-delay: .18s; }
.confirm.is-new .lede { animation-delay: .24s; }
.confirm.is-new .summary { animation-delay: .3s; }
.confirm.is-new .manage-actions { animation-delay: .36s; }
.confirm.is-new .next { animation-delay: .42s; }
.confirm.is-new .confirm-foot { animation-delay: .48s; }
@keyframes badge-in { from { transform: scale(.7); opacity: 0; } }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }
.next { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); text-align: left; }
.next h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.next ul { display: grid; gap: 10px; margin-top: 12px; }
.next li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.next li .star { width: 10px; height: 10px; margin-top: 6px; fill: var(--accent); }
.booking-mark + h1, .confirm h1 { margin-top: 26px; font-size: 30px; font-weight: 600; letter-spacing: -.03em; }
.confirm .lede { margin-top: 10px; color: var(--ink-2); font-size: 15.5px; }
.summary { display: grid; grid-template-columns: 112px minmax(0, 1fr); margin-top: 30px; padding-top: 6px; border-top: 1px solid var(--line); text-align: left; }
.summary dt, .summary dd { padding: 14px 0; border-bottom: 1px solid var(--line); }
.summary dt { font-weight: 700; font-size: 15px; }
.summary dd { font-size: 15px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.summary dd strong { color: var(--ink); font-weight: 650; }
.summary dd small { display: block; font-size: 13.5px; }
.confirm-foot { margin-top: 24px; font-size: 14.5px; color: var(--ink-2); }
.manage-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.button.danger-solid { background: var(--danger); border-color: var(--danger); color: var(--accent-ink); }
.button.danger-solid:hover { filter: brightness(.92); }
.summary s { color: var(--ink-2); }

/* Person page */
.profile { padding: 36px clamp(20px, 5vw, 40px) 20px; }
.profile-head { display: grid; justify-items: center; gap: 12px; text-align: center; }
.profile-head h1 { font-size: 24px; font-weight: 600; }
.profile-head p { color: var(--ink-2); font-size: 15px; }
.type-list { margin-top: 28px; border-top: 1px solid var(--line); }
.type-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 18px 6px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: 0; transition: background-color .15s var(--ease-out); }
.type-row:hover { background: var(--surface-sunk); text-decoration: none; }
.type-row:last-child { border-bottom: 0; }
.type-row h2 { font-size: 16.5px; font-weight: 700; }
.type-row p { margin-top: 4px; color: var(--ink-2); font-size: 14.5px; }
.type-row .badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.type-row .icon { color: var(--ink-3); }
.type-row:hover .icon { color: var(--ink); }

/* Message pages (not found, unavailable, too many attempts) */
.message { padding: 40px clamp(20px, 5vw, 44px); text-align: center; display: grid; justify-items: center; gap: 12px; }
.message .mark { width: 44px; height: 44px; }
.message h1 { font-size: 22px; font-weight: 600; margin-top: 6px; }
.message p { color: var(--ink-2); max-width: 46ch; }
.message .button { margin-top: 10px; }

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

.signin { padding: 36px clamp(20px, 5vw, 36px) 30px; display: grid; gap: 22px; }
.signin .logo img { height: 34px; }
.signin h1 { font-size: 24px; font-weight: 600; }
.signin p { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
.google-button { width: 100%; background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.google-button:hover { background: var(--surface-sunk); border-color: var(--ink-3); }
.google-button svg { width: 18px; height: 18px; }
.signin-foot { font-size: 13.5px; color: var(--ink-2); text-align: center; }

/* ---------- Staff app shell ---------- */

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 28px; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.sidebar .logo { padding: 2px 10px; }
.sidebar .logo img { height: 28px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 15px; font-weight: 600; text-decoration: none; }
.nav a:hover { background: var(--surface-sunk); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface-sunk); color: var(--ink); }
.me { margin-top: auto; display: grid; gap: 12px; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.me-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.me-row div { min-width: 0; }
.me-row div strong { display: block; font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-row div span { display: block; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-actions { display: flex; flex-wrap: wrap; gap: 2px; margin-inline: -12px; }
.me .theme-toggle.button { min-height: 40px; padding: 0 12px; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }

/* Phone header and menu (replaces the sidebar below 860px) */
.topbar { display: none; }
.menu summary {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; list-style: none;
  color: var(--ink); border: 1px solid var(--line); background: var(--surface);
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--surface-sunk); }
.menu .menu-close, .menu[open] .menu-open { display: none; }
.menu[open] .menu-close { display: block; }
.menu-panel {
  position: absolute; left: 0; right: 0; top: 100%; padding: 10px 12px 14px;
  background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  animation: menu-in .22s var(--ease-out) both;
}
.menu-panel .nav a { min-height: 48px; font-size: 16px; }
.menu-panel .me { margin-top: 10px; padding: 14px 10px 0; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }

.main { padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 56px) 72px; max-width: 1120px; width: 100%; margin-inline: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -.03em; }
.page-head p { margin-top: 8px; max-width: 60ch; color: var(--ink-2); font-size: 15.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.main > .notice { margin-bottom: 20px; }
.panel { margin-top: 36px; scroll-margin-top: 24px; }
.panel > header { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.panel > header h2 { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.panel > header p { margin-top: 4px; color: var(--ink-2); font-size: 14.5px; }
.panel .notice { margin-bottom: 14px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.rows > * { display: grid; gap: 14px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.rows > *:first-child { border-top: 0; }
.type-item { grid-template-columns: minmax(0, 1fr) auto; }
.type-item h3 { font-size: 16px; font-weight: 700; }
.type-item .link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere; }
.type-item .link:hover { color: var(--accent-text); text-decoration: underline; }
.type-item .meta { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.type-item .actions { display: flex; gap: 8px; }
.booking-item { grid-template-columns: 76px minmax(0, 1fr) auto; }
.date-block { display: grid; justify-items: center; padding: 8px 0; border-radius: var(--radius-sm); background: var(--surface-sunk); }
.date-block small { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .03em; }
.date-block strong { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.booking-item h3 { font-size: 15.5px; font-weight: 700; }
.booking-item p { margin-top: 2px; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.empty { padding: 28px 20px; text-align: center; color: var(--ink-2); font-size: 15px; }
.connection { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px; }
.connection .tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-sunk); }
.connection .tile svg { width: 22px; height: 22px; }
.connection h3 { font-size: 15.5px; font-weight: 700; }
.connection p { margin-top: 2px; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.connection .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-sunk); }
.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child { border-top-right-radius: var(--radius); }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td small { display: block; color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.table td:last-child { text-align: right; }
.invite { padding: 22px 20px; margin-top: 14px; }
.invite h3 { font-size: 16px; font-weight: 700; }
.invite > p { margin-top: 4px; color: var(--ink-2); font-size: 14.5px; }
.invite form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin-top: 16px; }
.invite .field + .field { margin-top: 0; }

/* Event type editor */
.editor .panel { margin-top: 28px; }
.editor-box { padding: 20px; display: grid; gap: 18px; }
.editor-box .field + .field { margin-top: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-hover); }
.input-prefix span { display: flex; align-items: center; padding: 0 4px 0 14px; color: var(--ink-2); font-size: 15px; font-weight: 500; white-space: nowrap; background: var(--surface-sunk); border-right: 1px solid var(--line); padding-right: 10px; }
.input-prefix .input { border: 0; border-radius: 0; box-shadow: none; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hours-row { grid-template-columns: 150px minmax(0, 1fr); }
.hours-row .field-error { grid-column: 2; }
.times-inputs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.times-inputs .input { width: 128px; font-variant-numeric: tabular-nums; }
.question-row { grid-template-columns: minmax(0, 1fr) 140px auto auto; align-items: end; }
.question-row .field + .field { margin-top: 0; }
.editor-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 10px; }
.panel > header .button { flex: none; }
.member-check { padding: 12px 20px; }
.member-check small { display: block; font-weight: 500; }
.kind-field { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.kind-field legend { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.kind-field small { font-weight: 500; }
.team-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-top: 16px; }
@media (max-width: 720px) { .team-form { grid-template-columns: minmax(0, 1fr); } }

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

@media (max-width: 960px) {
  .booker, .booker.is-form { grid-template-columns: minmax(0, 1fr); }
  .booker > section + section { border-left: 0; border-top: 1px solid var(--line); }
  .booker > section { padding: 22px; }
  .times-pane { min-height: 0; padding-bottom: 22px !important; }
  .slots { position: static; margin-top: 18px; max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; margin-right: 0; padding: 2px; }
  .slot-list { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .change-day { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; }
  :is(#times, #your-details, #calendar) { scroll-margin-top: 12px; }
  .about-wide { display: none; }
  .expect.in-details { display: none; }
  .booker > .expect-pane { display: block; margin-top: 0; padding: 22px; border-top: 1px solid var(--line); }
  .about-narrow { display: block; }
  .event-title { font-size: 24px; margin-top: 14px; }
  .invite form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .invite form .button { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .topbar .logo img { height: 26px; }
  .connection { grid-template-columns: auto minmax(0, 1fr); }
  .connection .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 0; border: 0; }
  .table td:last-child { text-align: left; }
}

@media (max-width: 720px) {
  .hours-row, .question-row { grid-template-columns: minmax(0, 1fr); }
  .hours-row .field-error { grid-column: 1; }
  .times-inputs .input { width: calc(50% - 22px); }
}

@media (max-width: 560px) {
  .guest { padding-top: 12px; gap: 22px; }
  .card { border-radius: 16px; }
  .booker > section { padding: 20px 18px; }
  .type-item, .booking-item { grid-template-columns: minmax(0, 1fr); }
  .booking-item .date-block { display: none; }
  .invite form { grid-template-columns: minmax(0, 1fr); }
  .form-actions .button { flex: 1 1 140px; }
  .summary { grid-template-columns: 88px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-property: color, background-color, border-color, opacity !important; }
  :is(.button, a.day, .slot, .segmented a, .icon-button):active { transform: none !important; }
}

/* ---------- Between steps ---------- */

/* Every step is a full page load (state lives in the URL). Browsers that support cross-document view transitions
   carry the regions across instead of repainting: quiet 180–320ms moves, nothing for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-group(*) { animation-duration: .24s; animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation: .14s ease both vt-out; }
::view-transition-new(root) { animation: .18s var(--ease-out) both vt-in; }
.guest > .card { view-transition-name: card; }
::view-transition-group(card) { animation-duration: .32s; }
::view-transition-old(card), ::view-transition-new(card) { height: 100%; object-fit: none; object-position: top center; }
.booker > section:first-child { view-transition-name: details; }
.booker .month-pane { view-transition-name: month; }
.booker .times-pane { view-transition-name: times; }
::view-transition-old(times) { animation: .12s ease both vt-out; }
::view-transition-new(times) { animation: .22s var(--ease-out) .04s both vt-rise; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
@keyframes vt-rise { from { opacity: 0; transform: translateY(8px); } }

/* Press feedback */
:is(.button, a.day, .slot, .segmented a, .icon-button):active { transform: scale(.97); }

/* Busy submit: the label says what is happening, and a small ring turns beside it. */
.button.is-busy { pointer-events: none; cursor: progress; }
.button.is-busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Landing points after a step: focusable for keyboard and screen readers, no ring for a pointer visit. */
[tabindex="-1"]:focus { outline: none; }
/* On wide screens the whole booker is in view: a fragment jump would only crop the top of the card. */
@media (min-width: 961px) { :is(#times, #your-details, #calendar) { scroll-margin-top: 100vh; } }

/* ---------- Staff pages ---------- */

/* Sidebar: real pages, the current one lit; the member's own link always to hand. */
.nav { display: grid; gap: 2px; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav a[aria-current="page"] .icon { color: var(--accent-text); }
.nav-label { margin: 18px 10px 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.my-link { display: grid; gap: 2px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-sunk); font-size: 13px; }
.my-link span { color: var(--ink-2); font-weight: 600; }
.my-link a { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; text-decoration: none; }
.my-link a:hover { text-decoration: underline; }
.my-link .button { justify-self: start; min-height: 32px; margin: 4px 0 0 -8px; padding: 0 8px; font-size: 13px; }

/* One surface per list, rows separated by a hairline, the row's own title as its link. */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 22px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.row-main { min-width: 0; }
.row-main h3 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.row-main h3 a { color: var(--ink); text-decoration: none; }
.row-main h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.row-meta > * + *::before { content: "·"; margin-right: 14px; color: var(--ink-3); }
.row-meta a { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.row-meta a:hover { color: var(--accent-text); text-decoration: underline; }
.list-row .actions { display: flex; gap: 8px; }
a.link-row { grid-template-columns: auto minmax(0, 1fr) auto auto; color: inherit; text-decoration: none; transition: background-color .15s var(--ease-out); }
a.link-row:hover { background: var(--surface-sunk); }
a.link-row > .icon { color: var(--ink-3); }
.avatar-mark-tile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Bookings: grouped by day, the time leads each row. */
.day-group + .day-group { margin-top: 28px; }
.day-label { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-size: 15px; font-weight: 700; }
.day-label span { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.booking-row { grid-template-columns: 92px minmax(0, 1fr) auto; }
.booking-row .when { font-size: 15.5px; font-weight: 650; }
.booking-row .when span { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); }

/* Something to act on, not grey text in a box. */
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 56px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-state .tile, .callout .tile { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); }
.empty-state h2 { margin-top: 6px; font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
.empty-state p { max-width: 46ch; color: var(--ink-2); font-size: 15px; }
.empty-state .button { margin-top: 8px; }
.callout { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-bottom: 24px; padding: 18px 20px; border-radius: var(--radius); background: var(--accent-soft); }
.callout h2 { font-size: 16px; font-weight: 650; }
.callout p { margin-top: 2px; font-size: 14px; color: var(--ink-2); }

.form-narrow { max-width: 620px; padding: 24px; display: grid; gap: 18px; }
.form-narrow .editor-actions { margin-top: 4px; }
.person { display: flex; align-items: center; gap: 12px; }
.table .person small { margin-top: 1px; }

/* Phones: header then page; short pages must not stretch the header to fill the screen. */
@media (max-width: 860px) { .app { align-content: start; } }
@media (max-width: 720px) {
  .page-head h1 { font-size: 26px; }
  .list-row, a.link-row { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  a.link-row > .icon, a.link-row .avatar-mark-tile { display: none; }
  .booking-row { grid-template-columns: 72px minmax(0, 1fr); }
  .booking-row > .button { grid-column: 1 / -1; }
  .callout { grid-template-columns: minmax(0, 1fr); }
  .callout .tile { display: none; }
}
