/* Components. Built only on the custom properties in tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
:root { color-scheme: light; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--text); font: var(--weight-base) var(--text-base)/var(--line-base) var(--font-sans); }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul { list-style: none; }
h1 { font-size: var(--text-xl); line-height: var(--line-xl); font-weight: var(--weight-xl); letter-spacing: -0.01em; }
h2 { font-size: var(--text-lg); line-height: var(--line-lg); font-weight: var(--weight-lg); }
h3 { font-size: var(--text-base); line-height: var(--line-base); font-weight: 600; }
a { color: var(--accent-text); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
code, pre { font-family: var(--font-mono); font-size: var(--text-sm); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: var(--radius-sm); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.center { text-align: center; }
.right { text-align: right; }
.break { overflow-wrap: anywhere; }
.eyebrow { font-size: var(--text-xs); line-height: var(--line-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.icon { flex: none; vertical-align: -0.2em; }
.skip { position: absolute; left: var(--space-3); top: -100px; z-index: 50; background: var(--bg); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); }
.skip:focus { top: var(--space-3); }
.stack { display: grid; gap: var(--space-4); }
.stack > * { min-width: 0; }

/* Button */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 2.5rem; padding: 0 var(--space-4); border: 1px solid transparent; border-radius: var(--radius-md); font: 600 var(--text-sm)/1 var(--font-sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border-input); }
.btn-secondary:hover { background: var(--surface); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: var(--on-accent); }
.btn-danger:hover { filter: brightness(0.92); color: var(--on-accent); }
.btn-sm { height: 2rem; padding: 0 var(--space-3); }
.btn-lg { height: 3rem; padding: 0 var(--space-5); font-size: var(--text-base); }
.btn-block { width: 100%; }
.btn-icon { width: 2.5rem; padding: 0; }
.btn-icon.btn-sm { width: 2rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* Field */
.field { display: grid; gap: var(--space-1); min-width: 0; align-content: start; }
.field > label, .field > legend, .label { font-size: var(--text-sm); line-height: var(--line-sm); font-weight: 600; }
.optional { font-weight: 400; color: var(--text-muted); }
input, select, textarea { font: inherit; color: inherit; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .field select, .field textarea, .interval input, select {
  width: 100%; min-height: 2.5rem; padding: var(--space-2) var(--space-3); background: var(--bg); border: 1px solid var(--border-input); border-radius: var(--radius-md); }
.field textarea { resize: vertical; min-height: 5rem; }
.field input[type="color"] { width: 4rem; height: 2.5rem; padding: 2px; border: 1px solid var(--border-input); border-radius: var(--radius-md); background: var(--bg); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.hint { font-size: var(--text-sm); line-height: var(--line-sm); color: var(--text-muted); }
.error { font-size: var(--text-sm); line-height: var(--line-sm); color: var(--danger); font-weight: 500; }
.affix { display: flex; align-items: stretch; border: 1px solid var(--border-input); border-radius: var(--radius-md); background: var(--bg); overflow: hidden; }
.affix:focus-within { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.affix-text { display: flex; align-items: center; padding: 0 var(--space-3); background: var(--surface); color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.affix input { border: 0 !important; border-radius: 0 !important; outline: 0 !important; min-width: 0; flex: 1; }
.has-error .affix { border-color: var(--danger); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--space-4); align-items: start; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-1) 0; cursor: pointer; }
.check input { width: 1.125rem; height: 1.125rem; margin: 0.2rem 0 0; accent-color: var(--accent); flex: none; }
.check .hint { display: block; }
.check-label { font-size: var(--text-base); }

/* Toggle */
.toggle { position: relative; display: inline-flex; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { width: 2.5rem; height: 1.5rem; border-radius: var(--radius-pill); background: var(--border-input); transition: background var(--motion-base) var(--motion-ease); }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--bg); transition: transform var(--motion-base) var(--motion-ease); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(1rem); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* Card, badge, alert, toast */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.badge { display: inline-flex; align-items: center; padding: 2px var(--space-2); border-radius: var(--radius-pill); font-size: var(--text-xs); line-height: var(--line-xs); font-weight: var(--weight-xs); background: var(--surface-2); color: var(--text); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--text-sm); line-height: var(--line-sm); margin-bottom: var(--space-4); border: 1px solid transparent; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--accent-soft); color: var(--text); }
.alert a { color: inherit; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: var(--space-5); transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: var(--space-2); max-width: min(92vw, 32rem); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--text); color: var(--bg); font-size: var(--text-sm); line-height: var(--line-sm); box-shadow: var(--shadow-pop); animation: toast-in var(--motion-base) var(--motion-ease); }
.toast-error { background: var(--danger); color: var(--on-accent); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.empty { display: grid; justify-items: center; gap: var(--space-2); text-align: center; padding: var(--space-7) var(--space-4); }
.empty-icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); margin-bottom: var(--space-2); }
.empty .btn { margin-top: var(--space-3); }

/* Tabs, segmented */
.tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); overflow-x: auto; }
.tabs a { padding: var(--space-3) 0; color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: var(--text-sm); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: var(--radius-md); }
.segmented > * { padding: var(--space-1) var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); font: 600 var(--text-sm)/var(--line-sm) var(--font-sans); text-decoration: none; cursor: pointer; }
.segmented > [aria-current="true"], .segmented > [aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: var(--shadow-card); }

/* Dialog */
dialog { width: min(92vw, 34rem); max-height: 88vh; padding: var(--space-5); border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); color: var(--text); background: var(--bg); }
dialog::backdrop { background: rgba(16, 24, 40, 0.5); }
dialog h2 { margin-bottom: var(--space-2); padding-right: var(--space-6); }
dialog h3 { margin: var(--space-4) 0 var(--space-2); }
.dialog-x { position: absolute; top: var(--space-3); right: var(--space-3); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-5); flex-wrap: wrap; }
.code { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.code pre { margin: 0; padding: var(--space-3); padding-right: 5.5rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.code .btn { position: absolute; top: var(--space-2); right: var(--space-2); }
.inline-copy { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.inline-copy code { overflow-wrap: anywhere; }

/* Table and rows */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: var(--text-xs); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.rows { display: grid; margin: var(--space-3) 0 var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); }
.row-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); flex-wrap: wrap; }
.row-item + .row-item { border-top: 1px solid var(--border); }
.row-item-plain { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.row-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
details.help { margin-top: var(--space-4); font-size: var(--text-sm); line-height: var(--line-sm); }
details.help summary { cursor: pointer; font-weight: 600; color: var(--accent-text); }
details.help ul { list-style: disc; padding-left: var(--space-5); margin-top: var(--space-2); display: grid; gap: var(--space-1); }
details.help p { margin-top: var(--space-2); }

/* Brand, avatar */
.brand { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.avatar { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: var(--text-sm); flex: none; }
.avatar-lg { width: 4rem; height: 4rem; font-size: var(--text-xl); }

/* App shell */
.shell { display: grid; grid-template-columns: var(--layout-sidebar) minmax(0, 1fr); min-height: 100vh; }
.shell-bar { display: none; }
.shell-side { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5) var(--space-3); background: var(--bg); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand-side { padding: 0 var(--space-3); }
.org-name { padding: 0 var(--space-3); font-size: var(--text-sm); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-switch { padding: 0 var(--space-2); }
.shell-side nav { display: grid; gap: 2px; }
.shell-side nav a, .shell-foot > a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: var(--text-sm); }
.shell-side nav a:hover, .shell-foot > a:hover { background: var(--surface); color: var(--text); }
.shell-side nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.shell-foot { margin-top: auto; display: grid; gap: var(--space-2); }
.me { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); min-width: 0; }
.me-name { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-foot form { padding: 0 var(--space-2); }
.shell-main { padding: var(--space-6) var(--space-5) var(--space-8); max-width: calc(var(--layout-content) + 2 * var(--space-5)); width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.page-head .muted { margin-top: var(--space-1); }
.page-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: var(--space-4); }
.share-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); font-size: var(--text-sm); }
.share-bar a { font-weight: 600; overflow-wrap: anywhere; }

/* Event type card */
.et-card { position: relative; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-4) var(--space-3) var(--space-5); overflow: hidden; }
.et-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--et, var(--accent)); }
.et-card.is-off { background: var(--surface); }
.et-card.is-off h2 a { color: var(--text-muted); }
.et-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.et-head h2 { font-size: 1.125rem; overflow-wrap: anywhere; }
.et-head h2 a { color: var(--text); text-decoration: none; }
.et-head h2 a:hover { text-decoration: underline; }
.et-meta { color: var(--text-muted); font-size: var(--text-sm); line-height: var(--line-sm); }
.et-flags { display: flex; gap: var(--space-2); flex-wrap: wrap; min-height: 0; }
.et-flags:empty { display: none; }
.et-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--border); }
.et-link { font-size: var(--text-sm); overflow-wrap: anywhere; }
.et-actions { display: flex; gap: var(--space-1); flex-wrap: wrap; }

/* Forms in cards */
.form-sections { display: grid; gap: var(--space-4); }
.form-card { display: grid; gap: var(--space-4); padding: var(--space-5); margin-bottom: var(--space-4); }
.form-sections .form-card { margin-bottom: 0; }
.form-card > h2 { font-size: 1.125rem; }
.form-card > .btn { justify-self: start; }
.form-card h3 { margin-top: var(--space-2); }
.form-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.form-sections > .form-actions { position: sticky; bottom: 0; padding: var(--space-3) 0; background: linear-gradient(transparent, var(--surface) 30%); }
.swatches > div { display: flex; gap: var(--space-2); flex-wrap: wrap; padding-top: var(--space-1); }
.swatch { position: relative; width: 2rem; height: 2rem; border-radius: 50%; background: var(--sw); cursor: pointer; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 5px; }
.q-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: var(--space-3); align-items: end; margin-bottom: var(--space-3); }
.danger-zone { margin-top: var(--space-4); }

/* Availability */
.week { display: grid; }
.day { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.day-check { padding-top: var(--space-2); }
.day-intervals { display: grid; gap: var(--space-2); }
.day-off { padding: var(--space-2) 0; }
.interval { display: flex; align-items: center; gap: var(--space-2); }
.interval input { width: 8rem; }
.override-form { display: grid; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); justify-items: start; }
.override-form .row { width: 100%; }

/* Meetings */
.day-head { font-size: var(--text-sm); color: var(--text-muted); font-weight: 600; margin: var(--space-5) 0 var(--space-2); }
.meetings { display: grid; gap: var(--space-2); }
.meeting { background: var(--bg); border: 1px solid var(--border); border-left: 6px solid var(--et, var(--accent)); border-radius: var(--radius-md); }
.meeting summary { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); cursor: pointer; list-style: none; flex-wrap: wrap; }
.meeting summary::-webkit-details-marker { display: none; }
.meeting-time { font-weight: 600; min-width: 11rem; font-variant-numeric: tabular-nums; }
.meeting-time .muted { font-weight: 400; }
.meeting-who { display: grid; flex: 1; min-width: 10rem; }
.meeting-more { font-size: var(--text-sm); color: var(--accent-text); font-weight: 600; }
.meeting[open] .meeting-more, details[open] > summary .meeting-more { visibility: hidden; }
.meeting.is-cancelled .meeting-time { text-decoration: line-through; color: var(--text-muted); }
.meeting-detail { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); padding: 0 var(--space-4) var(--space-4); font-size: var(--text-sm); line-height: var(--line-sm); }
.meeting-detail dt { color: var(--text-muted); }
.meeting-detail dd { overflow-wrap: anywhere; white-space: pre-wrap; }
.meeting .row-actions { padding: 0 var(--space-4) var(--space-4); }

/* Analytics */
.stats { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin-bottom: var(--space-4); }
.stat { padding: var(--space-4); }
.stat-label { font-size: var(--text-sm); color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: var(--text-xl); line-height: var(--line-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: auto; }
.chart .bar { fill: var(--accent); }
.chart .axis { stroke: var(--border); }
.chart .tick { fill: var(--text-muted); font-size: 11px; }
.bars { display: grid; gap: var(--space-3); }
.bars li { display: grid; grid-template-columns: minmax(6rem, 14rem) minmax(0, 1fr) 2.5rem; gap: var(--space-3); align-items: center; font-size: var(--text-sm); }
.bar-track { height: 0.75rem; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: var(--radius-pill); min-width: 4px; }
.bars strong { text-align: right; font-variant-numeric: tabular-nums; }

/* Plain pages (login, signup, errors) */
.plain { min-height: 100vh; display: grid; align-content: start; justify-items: center; gap: var(--space-5); padding: var(--space-7) var(--space-4); }
.plain-card { width: 100%; max-width: 27rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); display: grid; gap: var(--space-4); }
.plain-wide { max-width: 60rem; }
.plain-card h2 { margin-top: var(--space-4); }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); padding: var(--space-4); border-radius: var(--radius-md); margin: 0; }

/* Public booking pages */
.public { min-height: 100vh; display: grid; align-content: start; justify-items: center; gap: var(--space-4); padding: var(--space-6) var(--space-4); }
.public > main { width: 100%; display: grid; justify-items: center; }
.public.is-embed { min-height: 0; padding: var(--space-2); }
html.embed body { background: transparent; }
.badge-line { font-size: var(--text-xs); }
.badge-line a { color: var(--text-muted); text-decoration: none; }
.badge-line a:hover { text-decoration: underline; }
.narrow { width: 100%; max-width: 30rem; padding: var(--space-6); display: grid; gap: var(--space-4); }
.profile { width: 100%; max-width: 36rem; display: grid; gap: var(--space-5); }
.profile-head { display: grid; justify-items: center; gap: var(--space-2); text-align: center; }
.profile-head .muted { max-width: 30rem; font-size: var(--text-base); line-height: var(--line-base); }
.profile-list { display: grid; gap: var(--space-3); }
.profile-item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5); color: var(--text); text-decoration: none; overflow: hidden; transition: box-shadow var(--motion-fast) var(--motion-ease); }
.profile-item::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--et, var(--accent)); }
.profile-item:hover { box-shadow: var(--shadow-card); color: var(--text); border-color: var(--border-input); }
.profile-item > span { display: grid; gap: var(--space-1); }
.profile-item strong { font-size: 1.125rem; }
.profile-desc { font-size: var(--text-sm); line-height: var(--line-sm); color: var(--text-muted); }

.book { width: 100%; max-width: 58rem; display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); overflow: hidden; }
.book-info { display: grid; align-content: start; gap: var(--space-3); padding: var(--space-5); border-right: 1px solid var(--border); background: var(--bg); }
.book-org { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); text-decoration: none; }
.book-org:hover { color: var(--text); }
.facts { display: grid; gap: var(--space-2); }
.facts li { display: flex; gap: var(--space-2); align-items: flex-start; color: var(--text-muted); font-weight: 500; }
.facts li[data-chosen] { color: var(--accent-text); font-weight: 600; }
.facts .icon { margin-top: 3px; }
.book-desc { font-size: var(--text-sm); line-height: var(--line-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.was { font-size: var(--text-sm); color: var(--text-muted); }
.book-main { padding: var(--space-5); min-width: 0; }
.book-main h2 { margin-bottom: var(--space-4); }
.earliest { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: calc(-1 * var(--space-2)) 0 var(--space-4); }
.pre { white-space: pre-wrap; }
a.badge { text-decoration: none; }
a.badge:hover { text-decoration: underline; }
.pick { display: grid; grid-template-columns: minmax(0, 1fr) 11.5rem; gap: var(--space-5); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.cal-month { font-weight: 600; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow span { text-align: center; font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; padding: var(--space-1) 0; }
.cal-day { position: relative; aspect-ratio: 1; max-height: 3rem; width: 100%; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); font: 500 var(--text-sm)/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.cal-day:disabled { opacity: 0.55; }
.cal-day.is-open { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; cursor: pointer; }
.cal-day.is-open:hover { box-shadow: inset 0 0 0 2px var(--accent-text); }
.cal-day.is-selected { background: var(--accent); color: var(--on-accent); }
.cal-day.is-today::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.cal-note { margin-top: var(--space-3); min-height: 1.25rem; }
.cal.is-loading .cal-grid { opacity: 0.4; }
.slots h3 { font-size: var(--text-sm); margin-bottom: var(--space-2); min-height: 2.5rem; display: flex; align-items: center; }
.slots [data-slots-list] { display: grid; gap: var(--space-2); max-height: 21rem; overflow-y: auto; padding: 2px; }
.slot { height: 2.75rem; border: 1px solid var(--accent-text); border-radius: var(--radius-md); background: var(--bg); color: var(--accent-text); font: 600 var(--text-sm)/1 var(--font-sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.slot:hover { background: var(--accent-soft); }
.pick-foot { display: flex; gap: var(--space-4); align-items: end; margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); flex-wrap: wrap; }
.pick-foot .field:first-child { flex: 1; min-width: 12rem; }
[data-step="form"] > .btn { margin: calc(-1 * var(--space-2)) 0 var(--space-3) calc(-1 * var(--space-3)); }
[data-step="form"] h2:focus { outline: none; }

.status-card { justify-items: stretch; gap: var(--space-5); }
.status-top { display: grid; justify-items: center; text-align: center; gap: var(--space-2); }
.status-mark { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); margin-bottom: var(--space-1); }
.status-mark.is-cancelled { background: var(--danger-soft); color: var(--danger); }
.status-ring { opacity: .35; }
.is-fresh .status-mark { animation: mark-pop .5s var(--motion-ease) both; }
.is-fresh .status-ring { stroke-dasharray: 145; stroke-dashoffset: 145; animation: mark-draw .6s .1s ease-out forwards; }
.is-fresh .status-tick { stroke-dasharray: 34; stroke-dashoffset: 34; animation: mark-draw .35s .55s ease-out forwards; }
.is-fresh .when-card, .is-fresh .status-facts, .is-fresh .add-cal { animation: rise-in .5s var(--motion-ease) both; }
.is-fresh .when-card { animation-delay: .35s; } .is-fresh .status-facts { animation-delay: .45s; } .is-fresh .add-cal { animation-delay: .55s; }
@keyframes mark-pop { from { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } to { transform: none; opacity: 1; } }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }
@keyframes rise-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.when-card { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--accent-soft); }
.when-card.is-cancelled { background: var(--surface); }
.date-tile { flex: none; width: 4.5rem; display: grid; justify-items: center; border-radius: var(--radius-md); overflow: hidden; background: var(--bg); box-shadow: var(--shadow-card); }
.date-tile span { width: 100%; text-align: center; padding: 3px 0; background: var(--accent); color: var(--on-accent); font: 700 var(--text-xs)/1.3 var(--font-sans); letter-spacing: .04em; }
.date-tile b { font: 750 1.9rem/1.15 var(--font-sans); letter-spacing: -.03em; padding-top: 2px; }
.date-tile i { font: 600 var(--text-xs)/1 var(--font-sans); font-style: normal; color: var(--text-muted); padding-bottom: 7px; }
.when-text { display: grid; gap: 1px; min-width: 0; font-size: var(--text-sm); }
.when-text strong { font-size: var(--text-lg); line-height: var(--line-lg); letter-spacing: -.01em; }
.status-facts { display: grid; gap: var(--space-3); }
.status-facts li { display: flex; gap: var(--space-3); align-items: flex-start; overflow-wrap: anywhere; }
.status-facts .icon { margin-top: 3px; color: var(--text-muted); flex: none; }
.status-facts .face { margin: 0 -3px; }
.good-to-know { padding: var(--space-3) var(--space-4); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-md) var(--radius-md) 0; display: grid; gap: var(--space-1); }
.cal-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.status-actions { justify-content: center; border-top: 1px solid var(--border); padding-top: var(--space-4); }
/* People, as coloured initials */
.faces { display: inline-flex; flex: none; padding-left: 6px; }
.face { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-left: -6px; border-radius: 50%; background: hsl(var(--h, 220) 62% 44%); color: #fff; font: 700 .7rem/1 var(--font-sans); box-shadow: 0 0 0 2px var(--bg); flex: none; }
.face-more { background: var(--surface-2); color: var(--text); }
.facts .fact-hosts { align-items: center; }
@media (prefers-reduced-motion: reduce) { .is-fresh .status-mark, .is-fresh .status-ring, .is-fresh .status-tick, .is-fresh .when-card, .is-fresh .status-facts, .is-fresh .add-cal { animation: none; stroke-dashoffset: 0; } }
.struck { text-decoration: line-through; color: var(--text-muted); }
.add-cal { display: grid; gap: var(--space-2); }
.center-card { justify-items: center; }

/* Marketing site */
.site-wrap { max-width: var(--layout-content); margin: 0 auto; padding: 0 var(--space-5); }
.site-head { background: var(--bg); border-bottom: 1px solid var(--border); }
.site-head .site-wrap, .site-foot .site-wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--layout-header); flex-wrap: wrap; }
.site-head nav, .site-foot nav { display: flex; align-items: center; gap: var(--space-4); font-size: var(--text-sm); font-weight: 600; }
.site-head nav a:not(.btn), .site-foot a { color: var(--text-muted); text-decoration: none; }
.site-head nav a:not(.btn):hover, .site-foot a:hover { color: var(--text); }
.site-foot { border-top: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font-size: var(--text-sm); padding: var(--space-3) 0; }
.hero { padding: var(--space-8) 0 var(--space-7); background: var(--bg); }
.hero h1, .ds-display { font-size: clamp(2rem, 5vw, var(--text-display)); line-height: 1.08; font-weight: var(--weight-display); letter-spacing: -0.025em; max-width: 18ch; }
.lede { font-size: 1.25rem; line-height: 1.75rem; color: var(--text-muted); max-width: 44ch; margin: var(--space-4) 0 var(--space-5); }
.prose { padding: var(--space-7) 0; background: var(--bg); }
.prose .site-wrap { max-width: 44rem; display: grid; gap: var(--space-4); }
.prose h2 { margin-top: var(--space-4); }
.prose ul { list-style: disc; padding-left: var(--space-5); display: grid; gap: var(--space-2); }

/* Design system page */
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: var(--space-3); }
.ds-swatch span { display: block; height: 3rem; border-radius: var(--radius-md); border: 1px solid var(--border); }
.ds-icons { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* Small screens */
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell-bar { display: flex; align-items: center; justify-content: space-between; height: var(--layout-header); padding: 0 var(--space-4); background: var(--bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .shell-side { display: none; position: fixed; inset: var(--layout-header) 0 0 0; height: auto; z-index: 19; border-right: 0; }
  .shell-side.is-open { display: flex; }
  .brand-side { display: none; }
  .shell-main { padding: var(--space-5) var(--space-4) var(--space-7); }
  .book { grid-template-columns: minmax(0, 1fr); }
  .book-info { border-right: 0; border-bottom: 1px solid var(--border); }
  .pick { grid-template-columns: minmax(0, 1fr); }
  .slots [data-slots-list] { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); max-height: none; }
  .day { grid-template-columns: minmax(0, 1fr) auto; }
  .day-check { grid-column: 1 / -1; padding-top: 0; }
  .q-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
  .q-row .field:first-of-type { grid-column: 1 / -1; }
  .table th:nth-child(3), .table td:nth-child(3) { text-align: right; }
  .meeting-time { min-width: 0; width: 100%; }
  .narrow, .plain-card { padding: var(--space-5); }
  .interval input { width: 6.75rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Landing and pricing */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-7); align-items: center; }
.hero-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.hero-shot, .wide-shot { margin: 0; }
.hero-shot img, .wide-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); background: var(--bg); }
.wide-shot { margin-top: var(--space-6); }
.hero-small { padding-bottom: var(--space-5); }
main > section { padding: var(--space-8) 0; }
main > section.hero { padding-top: var(--space-8); }
.band { background: var(--surface); }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; max-width: 26ch; margin-bottom: var(--space-5); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: var(--space-4); }
.pad { padding: var(--space-5); display: grid; gap: var(--space-3); align-content: start; }
.pad p { color: var(--text-muted); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--space-5); padding: 0; margin: 0; }
.steps li { display: grid; gap: var(--space-2); align-content: start; }
.steps p, .feature p { color: var(--text-muted); }
.step-n { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: var(--space-5); }
.feature { display: grid; gap: var(--space-2); align-content: start; }
.feature-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent-text); }
.narrow-wrap { max-width: 46rem; }
.price-card { gap: var(--space-4); }
.price-card p { color: var(--text); }
.price strong { font-size: var(--text-display); line-height: 1; font-weight: var(--weight-display); letter-spacing: -0.03em; }
.price span { color: var(--text-muted); }
.price-table th { text-transform: none; letter-spacing: 0; font-size: var(--text-base); color: var(--text); font-weight: 400; padding-left: 0; }
.price-table td { text-align: right; color: var(--text-muted); padding-right: 0; white-space: nowrap; }
.price-table td .icon { color: var(--success); }
.prose-block { display: grid; gap: var(--space-3); margin-top: var(--space-6); }
.prose-block ul { list-style: disc; padding-left: var(--space-5); display: grid; gap: var(--space-2); }
.faq { display: grid; gap: var(--space-2); }
.faq details { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin-top: var(--space-2); color: var(--text-muted); }
.final { text-align: center; }
.final .site-wrap { display: grid; justify-items: center; }
.final h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 750; }
.final .lede { margin-left: auto; margin-right: auto; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  main > section { padding: var(--space-7) 0; }
  .price-table td { white-space: normal; }
}

/* Brand settings: exact colours and a logo */
.color-pair { display: flex; align-items: center; gap: var(--space-2); }
.color-pair input[type="color"] { flex: none; width: 2.5rem; height: 2.5rem; padding: 2px; border: 1px solid var(--border-input); border-radius: var(--radius-md); background: var(--bg); cursor: pointer; }
.color-pair input[type="text"] { flex: 1; min-width: 0; max-width: 9rem; font-family: var(--font-mono); text-transform: lowercase; }
.color-pair.is-empty input[type="color"] { opacity: .45; }
.logo-pick { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.logo-preview { display: grid; place-items: center; width: 5rem; height: 5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.logo-actions label.btn { cursor: pointer; } .logo-actions input[type="file"]:focus-visible + * , .logo-actions label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-inline { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); cursor: pointer; }
.org-logo { width: 1.5rem; height: 1.5rem; object-fit: contain; border-radius: 4px; }
.org-logo-lg { width: auto; max-width: 12rem; height: 4.5rem; border-radius: var(--radius-md); }
.public.has-bg { background: var(--pub-bg); }
.public.has-bg .profile-head h1 { color: var(--pub-fg); }
.public.has-bg .profile-head .muted, .public.has-bg .badge-line, .public.has-bg .badge-line a { color: var(--pub-muted); }
.logo-actions { position: relative; }
.logo-actions input[type="file"] { position: absolute; left: 0; top: 0; width: 1px !important; height: 1px !important; min-width: 0; opacity: 0; }

/* Phones (iOS especially) give date and time boxes a width of their own; keep them inside their card. */
input[type="date"], input[type="time"], input[type="datetime-local"] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; box-sizing: border-box; }
.field input[type="date"], .field input[type="time"], .field input[type="datetime-local"] { display: block; width: 100%; }
.interval { min-width: 0; }
@media (max-width: 820px) {
  /* Room for "09:00 AM to 05:00 PM" plus the add and remove buttons on a phone: drop the small clock icon, the box still opens the time picker. */
  .interval { gap: var(--space-1); }
  .interval input { flex: 0 0 auto; width: 5.9rem; padding-left: var(--space-2); padding-right: var(--space-2); }
  .interval input::-webkit-calendar-picker-indicator { display: none; }
}
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; min-height: 1.5em; }
.field, .row > *, .stack > *, .card { min-width: 0; }

/* TEMPORARY: agent tile image page */
.agent-row { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); }
.agent-prev { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: var(--radius-md); background: #fff; border: 1px solid var(--border); overflow: hidden; font-size: var(--text-xs); }
.agent-prev img { max-width: 70%; max-height: 70%; object-fit: contain; }
.agent-row .row-actions { display: flex; gap: var(--space-2); align-items: center; } .agent-row form { position: relative; }
.agent-file { position: absolute; left: 0; top: 0; width: 1px !important; height: 1px !important; opacity: 0; }
.agent-row label.btn { cursor: pointer; }

/* Getting started */
.setup { padding: var(--space-5); display: grid; gap: var(--space-4); margin-bottom: var(--space-5); }
.setup-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6rem, 14rem) auto; align-items: center; gap: var(--space-4); }
.setup-meter { height: 8px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.setup-meter span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s var(--motion-ease); }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; }
.setup-list li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.setup-dot { flex: none; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 1.5px solid var(--border-input); color: var(--text-muted); font: 700 var(--text-xs)/1 var(--font-sans); }
.setup-list .is-next .setup-dot { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.setup-list .is-done .setup-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.setup-text { flex: 1; min-width: 0; display: grid; font-size: var(--text-sm); }
.setup-text strong { font-size: var(--text-base); }
.setup-list .is-done .setup-text strong { color: var(--text-muted); text-decoration: line-through; font-weight: 500; }
.setup-list .is-done .setup-text .muted { display: none; }
@media (max-width: 640px) { .setup-head { grid-template-columns: minmax(0, 1fr) auto; } .setup-meter { grid-column: 1 / -1; grid-row: 2; } .setup-list li { flex-wrap: wrap; } .setup-list li > .btn { margin-left: calc(1.75rem + var(--space-3)); } }

/* Dark booking pages: the same components on a dark set of tokens. */
html.theme-dark { color-scheme: dark;
  --bg: #14141c; --surface: #07070a; --surface-2: #1d1d28; --border: #2b2b38; --border-input: #8c8c9c;
  --text: #f4f3ee; --text-muted: #a9a9b8;
  --danger: #ff8f85; --danger-soft: #3a1512; --success: #5fd49a; --success-soft: #10301f; --warning: #f3c06a; --warning-soft: #33250a;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .6); --shadow-pop: 0 18px 40px rgba(0, 0, 0, .6); }
