/* Opaltime brand: cream, chocolate, peach, sand. Inter for all text; Urbanist only in the
   "opaltime" wordmark. */
:root {
  --cream: #FFF7F0;
  --chocolate: #3B2420;
  --peach: #F39A6B;
  --sand: #EBD9C6;
  --white: #ffffff;
  --muted: #7a5c52;
  --line: #e2cdb8;
  --danger: #a3341f;
  --ok: #2f6b3a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(59, 36, 32, .06), 0 6px 20px rgba(59, 36, 32, .06);
  --focus: 0 0 0 3px var(--cream), 0 0 0 5px var(--chocolate);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--chocolate);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "tnum" 1;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: 1.15rem; margin-top: 1.6em; }
h2 small { font-weight: 500; color: var(--muted); font-size: .9rem; margin-left: .4em; }
p { margin: 0 0 1em; }
a { color: var(--chocolate); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--chocolate); color: var(--cream); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.small { font-size: .875rem; color: var(--muted); }
.lead { font-size: 1.05rem; color: var(--muted); }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: .45em; vertical-align: middle; }
.logo-mark { flex: none; }
.wordmark { font-family: "Urbanist", "Inter", sans-serif; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; color: var(--chocolate); }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--chocolate); background: transparent; color: var(--chocolate);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--sand); }
.btn-primary { background: var(--chocolate); color: var(--cream); }
.btn-primary:hover { background: #563631; }
.btn-quiet { border-color: var(--line); }
.link { background: none; border: 0; padding: 4px; font: inherit; color: var(--chocolate); text-decoration: underline; cursor: pointer; }
form.inline { display: inline; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; color: var(--chocolate);
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--chocolate); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.error { color: var(--danger); font-size: .9rem; margin: 4px 0 0; }
.warning { background: #fff0e4; border-left: 4px solid var(--peach); padding: 10px 12px; border-radius: 8px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.messages { margin-bottom: 16px; }
.msg { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--white); border: 1px solid var(--line); }
.msg-error { border-color: var(--danger); color: var(--danger); }
.msg-success { border-color: var(--ok); color: var(--ok); }

/* Status badges */
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--sand); }
.status-confirmed, .status-checked_in { background: #e3efe2; color: var(--ok); }
.status-requested, .status-held { background: #fde3d2; }
.status-cancelled, .status-no_show { background: #f3dcd6; color: var(--danger); }

/* Public booking page */
.page { max-width: 720px; margin: 0 auto; padding: 0 16px; min-height: 100vh; display: flex; flex-direction: column; }
.pub-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.pub-name { font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.pub-main { flex: 1; padding-bottom: 32px; }
.pub-footer { border-top: 1px solid var(--line); padding: 20px 0 28px; font-size: .9rem; color: var(--muted); }
.pub-footer p { margin: 0 0 6px; }
.powered { margin-top: 12px !important; display: flex; align-items: center; gap: 6px; }
.powered .wordmark { font-size: 1rem; }
.powered .logo-mark { width: 20px; height: 20px; }
.privacy-link a { color: inherit; }
.langs { display: flex; gap: 4px; }
.langs a { padding: 6px 10px; border-radius: 999px; text-decoration: none; font-size: .85rem; font-weight: 600; min-width: 40px; text-align: center; }
.langs a[aria-current] { background: var(--chocolate); color: var(--cream); }
.back { margin-bottom: 8px; font-size: .95rem; }
.meta { color: var(--muted); font-weight: 500; }
.services { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.service {
  display: grid; gap: 2px; padding: 16px 18px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow);
}
.service:hover { border-color: var(--peach); }
.service-name { font-weight: 600; font-size: 1.05rem; }
.service-desc { color: var(--muted); font-size: .92rem; }
.service-meta { font-size: .92rem; font-weight: 500; }
.options { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.options fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.options fieldset:last-of-type { margin-bottom: 0; }
.options legend { font-weight: 700; margin-bottom: 6px; }
.choice { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; flex-wrap: wrap; }
.choice input { width: 20px; height: 20px; accent-color: var(--chocolate); }
.choice small { color: var(--muted); margin-left: auto; }
.days-nav { display: flex; align-items: center; gap: 6px; }
.arrow { flex: none; width: 36px; height: 44px; display: grid; place-items: center; text-decoration: none; font-size: 1.6rem; border-radius: 10px; }
.arrow:hover { background: var(--sand); }
.days { list-style: none; margin: 0; padding: 4px 2px; display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; flex: 1; }
.days li { scroll-snap-align: start; }
.day {
  display: grid; justify-items: center; width: 56px; padding: 8px 0; border-radius: 12px;
  text-decoration: none; background: var(--white); border: 1.5px solid var(--line); font-size: .78rem;
}
.day b { font-size: 1.15rem; line-height: 1.25; }
.day.is-selected { background: var(--peach); border-color: var(--peach); }
.day.is-closed { opacity: .45; background: transparent; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot {
  min-height: 46px; border-radius: 12px; border: 1.5px solid var(--sand); background: var(--sand);
  color: var(--chocolate); font: inherit; font-weight: 600; cursor: pointer;
}
.slot:hover { border-color: var(--chocolate); }
.slot:active, .slot:focus-visible { background: var(--peach); border-color: var(--peach); }
.empty { background: var(--white); border: 1px dashed var(--line); padding: 14px; border-radius: var(--radius); }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; }
.summary dt { color: var(--muted); font-size: .92rem; }
.summary dd { margin: 0; font-weight: 500; }
.hold-note { font-size: .92rem; color: var(--muted); }
.details-form { max-width: 520px; }
.cancel-form { margin: 18px 0 28px; }

.center-box { max-width: 420px; margin: 10vh auto; padding: 0 16px; text-align: left; }
.center-box h1 { margin-top: 18px; }
.login-form { margin: 18px 0; }

/* Business app: a side menu on desktop, a tab bar on the phone */
.app { background: var(--cream); }
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; border-right: 1px solid var(--line); background: #fffaf5; }
.side .logo { padding: 2px 10px 14px; text-decoration: none; }
.side-business { margin: 0 4px 10px; padding: 12px 12px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.side-business b { display: block; font-size: .98rem; line-height: 1.3; }
.side-business a { font-size: .82rem; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.side-business a:hover { color: var(--chocolate); }
.side-business details { margin-top: 6px; font-size: .82rem; }
.side-business summary { cursor: pointer; color: var(--muted); }
.side-business ul { list-style: none; padding: 6px 0 0; margin: 0; }
.side-business li a { color: var(--chocolate); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 500; color: var(--chocolate); }
.nav a:hover { background: #f8ebde; }
.nav a[aria-current="page"] { background: #fde3d2; font-weight: 650; box-shadow: inset 3px 0 0 var(--peach); }
.nav .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--peach); color: var(--chocolate); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 4px 0; border-top: 1px solid var(--line); font-size: .88rem; }
.side-bottom .langs { padding: 0 6px; }
.side-bottom form button, .side-bottom > a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--muted); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; width: 100%; text-align: left; }
.side-bottom form button:hover, .side-bottom > a:hover { background: #f8ebde; color: var(--chocolate); }
.main { min-width: 0; padding: 28px 32px 48px; }
.main-narrow { max-width: 860px; }
.topbar { display: none; }
.tabbar { display: none; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.7rem; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); text-decoration: none; margin-bottom: 10px; }
.back-link:hover { color: var(--chocolate); }
.back-link .icon { transform: rotate(180deg); }
.btn .icon { margin-left: -2px; }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn-danger { border-color: #e9c3b8; color: var(--danger); }
.btn-danger:hover { background: #fbe9e4; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 18px; }
.card > h2:first-child, .card-head h2 { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 1.1rem; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; width: 100%; }
.card-note { color: var(--muted); font-size: .9rem; margin: -4px 0 14px; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 10px; font-weight: 700; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid #f1e4d6; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; text-decoration: none; color: inherit; }
a.row:hover { background: #fffaf5; border-radius: 12px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; display: block; }
.row-meta { color: var(--muted); font-size: .88rem; display: block; margin-top: 2px; }
.row-end { color: var(--muted); font-size: .9rem; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(59, 36, 32, .12); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; color: var(--chocolate); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--sand); font-size: .78rem; font-weight: 600; }
.tag-peach { background: #fde3d2; }
.empty-state { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty-state .icon { color: var(--peach); width: 36px; height: 36px; }
.empty-state p { margin: 10px auto 16px; max-width: 360px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.field .help { color: var(--muted); font-size: .84rem; margin: 4px 0 0; }
.input { width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; color: var(--chocolate); background: var(--white); border: 1.5px solid var(--line); border-radius: 12px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233B2420' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input:focus { border-color: var(--chocolate); outline: none; }
.input-time { width: 136px; min-height: 40px; padding: 6px 8px; text-align: center; }
textarea.input { min-height: 84px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--chocolate); flex: none; }
.check small { display: block; color: var(--muted); }
.switch-label { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; cursor: pointer; font-weight: 600; }
.toggle { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: #e4d3c2; position: relative; cursor: pointer; flex: none; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.toggle:checked { background: var(--chocolate); }
.toggle:checked::after { transform: translateX(18px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 4px 0 0; }
.chips label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); cursor: pointer; font-weight: 500; }
.chips input { accent-color: var(--chocolate); }
.chips label:has(input:checked) { background: #fde3d2; border-color: var(--peach); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; list-style: none; padding: 0; margin: 6px 0 0; }
.swatches label { width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: block; position: relative; box-shadow: inset 0 0 0 1px rgba(59, 36, 32, .15); }
.swatches input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.swatches label:has(input:checked) { box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--chocolate); }
.swatches label:has(input:focus-visible) { box-shadow: var(--focus); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--cream) 70%, rgba(255,247,240,0)); padding: 16px 0 8px; margin-top: 10px; z-index: 5; }
details.more { margin-top: 10px; border-top: 1px solid #f1e4d6; padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 600; padding: 6px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary .icon { transition: transform .15s; }
details.more[open] summary .icon { transform: rotate(90deg); }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--danger); font-size: .88rem; }

/* The week of a staff member */
.week { display: grid; gap: 4px; }
.day-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f1e4d6; }
.day-row:first-child { border-top: 0; }
.day-name { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.day-times { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-times .dash { color: var(--muted); }
.day-off { color: var(--muted); font-size: .92rem; }
.day-row:not(.is-on) .day-times { display: none; }
.day-row.is-on .day-off { display: none; }
.break { display: none; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; padding-top: 6px; font-size: .9rem; color: var(--muted); }
.day-row.has-break .break { display: flex; }
.day-row.has-break .add-break { display: none; }
.add-break, .remove-break, .copy-week { background: none; border: 0; color: var(--muted); font: inherit; font-size: .88rem; text-decoration: underline; cursor: pointer; padding: 4px; }
.add-break:hover, .remove-break:hover, .copy-week:hover { color: var(--chocolate); }

/* Start checklist */
.progress { height: 10px; background: #f3e4d5; border-radius: 999px; overflow: hidden; margin: 10px 0 4px; }
.progress span { display: block; height: 100%; background: var(--peach); border-radius: 999px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.step { display: flex; gap: 16px; align-items: flex-start; padding: 18px 4px; border-top: 1px solid #f1e4d6; }
.step:first-child { border-top: 0; }
.step-mark { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-weight: 700; flex: none; background: var(--white); }
.step.is-done .step-mark { background: var(--peach); border-color: var(--peach); }
.step.is-done .step-title { text-decoration: line-through; text-decoration-color: rgba(59, 36, 32, .35); }
.step-body { flex: 1; }
.step-title { font-weight: 650; font-size: 1.02rem; display: block; }
.step-text { color: var(--muted); font-size: .92rem; margin: 2px 0 10px; display: block; }
.share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fff4ea; border: 1px dashed var(--peach); border-radius: 14px; padding: 12px 14px; }
.share code { font-family: inherit; font-weight: 650; font-size: 1rem; word-break: break-all; flex: 1; min-width: 180px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast .msg { box-shadow: var(--shadow); background: var(--chocolate); color: var(--cream); border: 0; display: flex; gap: 10px; align-items: center; }
.toast .msg-error { background: var(--danger); color: var(--white); }
.link-box { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.link-box input { flex: 1; font-size: .85rem; }

/* Calendar page */
.cal-tools { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.cal-tools h1 { margin: 0 auto 0 0; font-size: 1.5rem; }
.calendar { background: var(--white); border-radius: 18px; border: 1px solid var(--line); padding: 10px; box-shadow: var(--shadow); }
.panel { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 1px solid var(--line); border-radius: 20px; padding: 24px; background: var(--cream); color: var(--chocolate); box-shadow: var(--shadow); }
.panel::backdrop { background: rgba(59, 36, 32, .35); }
.panel-close { position: absolute; right: 10px; top: 8px; width: 40px; height: 40px; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--chocolate); border-radius: 50%; }
.panel-close:hover { background: var(--sand); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.log { font-size: .85rem; color: var(--muted); }
.log ul { padding-left: 18px; }
.panel-form .btn { margin-right: 8px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fffaf5; position: sticky; top: 0; z-index: 20; }
  .topbar .logo .wordmark { font-size: 1.1rem; }
  .topbar-business { font-weight: 600; font-size: .92rem; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 18px 16px 96px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fffaf5; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 12px; font-size: .7rem; font-weight: 600; text-decoration: none; color: var(--muted); min-width: 60px; }
  .tabbar a[aria-current="page"] { color: var(--chocolate); background: #fde3d2; }
  .form-grid { grid-template-columns: 1fr; }
  .day-row { grid-template-columns: 1fr; gap: 6px; }
  .card { padding: 18px 16px; border-radius: 16px; }
  .page-head h1 { font-size: 1.45rem; }
  .toast { left: 16px; right: 16px; bottom: 84px; }
}

/* EventCalendar in brand colours. ".calendar .ec" outranks the library's own ".ec" rules,
   including its dark-mode ones, so the calendar always stays in the brand's light look. */
.calendar .ec {
  color-scheme: light;
  --ec-color-400: #c9ad94; --ec-color-300: var(--line); --ec-color-200: var(--sand);
  --ec-color-100: #fbf1e7; --ec-color-50: var(--cream);
  --ec-bg-color: var(--white); --ec-text-color: var(--chocolate); --ec-border-color: var(--line);
  --ec-button-bg-color: var(--white); --ec-button-border-color: var(--line);
  --ec-button-text-color: var(--chocolate); --ec-button-active-bg-color: var(--chocolate);
  --ec-button-active-border-color: var(--chocolate); --ec-button-active-text-color: var(--cream);
  --ec-event-bg-color: var(--peach); --ec-event-text-color: var(--chocolate);
  --ec-today-bg-color: #fff1e4; --ec-highlight-color: #fde3d2;
  --ec-bg-event-color: var(--sand); --ec-bg-event-opacity: .5;
  --ec-now-indicator-color: #d9622b; --ec-popup-bg-color: var(--white);
  font-family: inherit;
}
.ec-event.ot-ev { border-radius: 10px; border-left: 4px solid var(--ev, var(--peach)); box-shadow: 0 0 0 2px var(--t-surface, #fff); cursor: pointer; padding: 0; overflow: hidden; }
.ec-event.ot-ev:hover { box-shadow: 0 0 0 2px var(--t-surface, #fff), 0 4px 14px rgba(59, 36, 32, .18); z-index: 3; }
.ec-event .ev { display: flex; flex-direction: column; gap: 1px; padding: 5px 8px; line-height: 1.25; min-width: 0; width: 100%; }
.ec-event .ev-top { display: flex; align-items: center; gap: 6px; }
.ec-event .ev-time { font-size: .74rem; font-weight: 500; opacity: .75; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ec-event .ev-client { font-size: .86rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-event .ev-service { font-size: .78rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-event .ev-short { flex-direction: row; align-items: center; gap: 6px; padding: 2px 8px; white-space: nowrap; overflow: hidden; }
.ec-event .ev-badge { margin-left: auto; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .75); color: #3B2420; white-space: nowrap; }
.ec-event .ev-note { font-size: .75rem; opacity: .7; }
.ec-event.ot-requested { outline: 2px dashed var(--ev, var(--chocolate)); outline-offset: -2px; }
.ec-event.ot-requested .ev-badge { background: #3B2420; color: #FFF7F0; }
.ec-event.ot-checked_in .ev-badge { background: #e3efe2; color: var(--ok); }
.ec-event.ot-held { opacity: .55; }
.ec-event.ot-completed { opacity: .62; }
.ec-event.ot-no_show { opacity: .62; }
.ec-event.ot-no_show .ev-client { text-decoration: line-through; }
.ec-event.ot-no_show .ev-badge { background: #f3dcd6; color: var(--danger); }
.ec-event.ot-block { background: repeating-linear-gradient(135deg, #f4ebe2 0 7px, #ece0d3 7px 14px) !important; color: #6e4f45 !important; border-radius: 10px; box-shadow: 0 0 0 2px var(--t-surface, #fff); }
.ec-event .ev-block { flex-direction: row; gap: 8px; align-items: center; font-size: .78rem; font-weight: 600; }
.calendar .ec-bg-event.ot-off { background: repeating-linear-gradient(135deg, rgba(59, 36, 32, .035) 0 6px, transparent 6px 12px), var(--t-surface-2, #fbf3ea) !important; opacity: 1 !important; }
.res-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.res-label i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }

@media (max-width: 600px) {
  .summary { grid-template-columns: 1fr; gap: 2px; }
  .summary dd { margin-bottom: 8px; }
  .app-nav { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* Sign-in, invitation and password pages */
.auth { background: radial-gradient(circle at 15% 10%, #fde3d2 0, rgba(253, 227, 210, 0) 38%), radial-gradient(circle at 90% 90%, #f3e2cf 0, rgba(243, 226, 207, 0) 40%), var(--cream); min-height: 100vh; }
.auth-box { max-width: 430px; margin: 8vh auto 40px; background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 32px 30px; box-shadow: var(--shadow); }
.auth-box h1 { margin: 24px 0 6px; font-size: 1.6rem; }
.auth-box .lead { margin-bottom: 20px; }
.auth-foot { margin-top: 16px; display: flex; justify-content: center; }
.btn-block { width: 100%; }
.option-row.is-removed { opacity: .45; }
.option-row.is-removed input:not([type=checkbox]), .option-row.is-removed select { text-decoration: line-through; }
@media (max-width: 600px) { .auth-box { margin: 0; min-height: 100vh; border-radius: 0; border: 0; padding: 28px 18px; } .option-row.form-grid { grid-template-columns: 1fr 1fr !important; } }

/* ===== Colour variants (Settings > Appearance), for the business app and the booking page:
   data-theme 1-5 or "custom" on <body class="themed">. Each variant only sets --t-* values. ===== */
body.themed {
  --t-slot: #EBD9C6; --t-slot-fg: #3B2420;
  --t-bg: #FFF7F0; --t-surface: #fff; --t-surface-2: #fff4ea; --t-border: #e8d5c2; --t-card-border: var(--t-border);
  --t-divider: #f3e6d8; --t-text: #3B2420; --t-muted: #6e4f45;
  --t-side-bg: #3B2420; --t-side-fg: #FFF7F0; --t-side-muted: #d8c1b3; --t-side-border: #3B2420;
  --t-side-hover: rgba(255, 247, 240, .08); --t-side-card: rgba(255, 247, 240, .07); --t-side-card-border: rgba(255, 247, 240, .16);
  --t-active-bg: #F39A6B; --t-active-fg: #3B2420; --t-active-bar: transparent;
  --t-primary: #3B2420; --t-primary-fg: #FFF7F0; --t-primary-hover: #563631;
  --t-btn-border: #3B2420; --t-btn-fg: #3B2420; --t-btn-hover: #f6e8da;
  --t-input-bg: #fff; --t-input-border: #e2cdb8;
  --t-soft: #F39A6B; --t-soft-fg: #3B2420; --t-soft-border: transparent; --t-accent: #F39A6B;
  --t-badge: #F39A6B; --t-badge-fg: #3B2420; --t-price-bg: transparent;
  --t-shadow: 0 1px 2px rgba(59, 36, 32, .05), 0 8px 24px rgba(59, 36, 32, .06);
  --t-toast: #3B2420; --t-toast-fg: #FFF7F0; --t-today: #fff1e4; --t-toggle-off: #e4d3c2; --t-toggle-on: #3B2420;
  --t-focus: #3B2420; --t-danger: #a3341f;
}
/* 2: Peony (soft rose and white) */
body.themed[data-theme="2"] {
  --t-slot: #fbe0e8; --t-slot-fg: #4a2633;
  --t-bg: #ffffff; --t-surface: #ffffff; --t-surface-2: #fdf2f5; --t-border: #f2d8e0; --t-divider: #f8e7ec;
  --t-text: #4a2633; --t-muted: #7d5563;
  --t-side-bg: #fdeef2; --t-side-fg: #4a2633; --t-side-muted: #7d5563; --t-side-border: #f6dbe3;
  --t-side-hover: #fbe2ea; --t-side-card: #ffffff; --t-side-card-border: #f2d1db;
  --t-active-bg: #f2a7bb; --t-active-fg: #3d1a26;
  --t-primary: #c2577a; --t-primary-fg: #ffffff; --t-primary-hover: #a9466a;
  --t-btn-border: #c2577a; --t-btn-fg: #8e3b5b; --t-btn-hover: #fdf2f5;
  --t-input-border: #efcfd9; --t-soft: #fbe0e8; --t-soft-fg: #8e3b5b; --t-accent: #e991aa;
  --t-badge: #c2577a; --t-badge-fg: #ffffff; --t-price-bg: #fdeef2;
  --t-shadow: 0 1px 2px rgba(74, 38, 51, .04), 0 8px 24px rgba(194, 87, 122, .07);
  --t-toast: #8e3b5b; --t-today: #fdf2f5; --t-toggle-off: #f1d6de; --t-toggle-on: #c2577a; --t-focus: #c2577a;
}
/* 3: lavender */
body.themed[data-theme="3"] {
  --t-slot: #eee7fb; --t-slot-fg: #2f2440;
  --t-bg: #fbfaff; --t-surface: #ffffff; --t-surface-2: #f5f1fd; --t-border: #e4dcf3; --t-divider: #efeaf9;
  --t-text: #2f2440; --t-muted: #625579;
  --t-side-bg: #ece6f8; --t-side-fg: #2f2440; --t-side-muted: #625579; --t-side-border: #e0d6f3;
  --t-side-hover: #e2d9f5; --t-side-card: #ffffff; --t-side-card-border: #ddd2f1;
  --t-active-bg: #b9a3e3; --t-active-fg: #241a36;
  --t-primary: #6d4c9f; --t-primary-fg: #ffffff; --t-primary-hover: #5b3d8a;
  --t-btn-border: #6d4c9f; --t-btn-fg: #4f3576; --t-btn-hover: #f5f1fd;
  --t-input-border: #ddd3f0; --t-soft: #eee7fb; --t-soft-fg: #4f3576; --t-accent: #b9a3e3;
  --t-badge: #6d4c9f; --t-badge-fg: #ffffff; --t-price-bg: #f3eefc;
  --t-shadow: 0 1px 2px rgba(47, 36, 64, .04), 0 8px 24px rgba(109, 76, 159, .07);
  --t-toast: #4f3576; --t-today: #f5f1fd; --t-toggle-off: #ded5ef; --t-toggle-on: #6d4c9f; --t-focus: #6d4c9f;
}
/* 4: champagne (nude and gold) */
body.themed[data-theme="4"] {
  --t-slot: #f3e3cd; --t-slot-fg: #3a2a1c;
  --t-bg: #fbf6f1; --t-surface: #ffffff; --t-surface-2: #f8efe5; --t-border: #eadccb; --t-divider: #f2e8dc;
  --t-text: #3a2a1c; --t-muted: #6f5a46;
  --t-side-bg: #f3e6d8; --t-side-fg: #3a2a1c; --t-side-muted: #6f5a46; --t-side-border: #e9d8c5;
  --t-side-hover: #ecdcc9; --t-side-card: #fbf6f1; --t-side-card-border: #e3cfb9;
  --t-active-bg: #dcb98f; --t-active-fg: #2f2114;
  --t-primary: #a8784a; --t-primary-fg: #ffffff; --t-primary-hover: #8f6339;
  --t-btn-border: #a8784a; --t-btn-fg: #7c5531; --t-btn-hover: #f8efe5;
  --t-input-border: #e5d4c0; --t-soft: #f3e3cd; --t-soft-fg: #7c5531; --t-accent: #d6b283;
  --t-badge: #a8784a; --t-badge-fg: #ffffff; --t-price-bg: #f6ead9;
  --t-shadow: 0 1px 2px rgba(58, 42, 28, .04), 0 8px 24px rgba(168, 120, 74, .08);
  --t-toast: #7c5531; --t-today: #faf1e6; --t-toggle-off: #e7d8c6; --t-toggle-on: #a8784a; --t-focus: #a8784a;
}
/* 5: berry (deep mauve menu, blush) */
body.themed[data-theme="5"] {
  --t-slot: #f6dce4; --t-slot-fg: #45222f;
  --t-bg: #fbf5f6; --t-surface: #ffffff; --t-surface-2: #f8ecef; --t-border: #ecd7dd; --t-divider: #f4e6ea;
  --t-text: #45222f; --t-muted: #76525f;
  --t-side-bg: #5e3346; --t-side-fg: #fff2f5; --t-side-muted: #e3c3cf; --t-side-border: #5e3346;
  --t-side-hover: rgba(255, 242, 245, .09); --t-side-card: rgba(255, 242, 245, .08); --t-side-card-border: rgba(255, 242, 245, .18);
  --t-active-bg: #f3b8c7; --t-active-fg: #45222f;
  --t-primary: #8c4f67; --t-primary-fg: #ffffff; --t-primary-hover: #763f56;
  --t-btn-border: #8c4f67; --t-btn-fg: #6e3a50; --t-btn-hover: #f8ecef;
  --t-input-border: #e8cfd7; --t-soft: #f6dce4; --t-soft-fg: #6e3a50; --t-accent: #e9a1b4;
  --t-badge: #f3b8c7; --t-badge-fg: #45222f; --t-price-bg: #f8e6ec;
  --t-shadow: 0 1px 2px rgba(69, 34, 47, .04), 0 8px 24px rgba(140, 79, 103, .08);
  --t-toast: #5e3346; --t-today: #faeff2; --t-toggle-off: #ead4db; --t-toggle-on: #8c4f67; --t-focus: #8c4f67;
}

.themed { background: var(--t-bg); color: var(--t-text); --focus: 0 0 0 3px var(--t-bg), 0 0 0 5px var(--t-focus); }
.themed :where(a) { color: var(--t-text); }
.themed .side { background: var(--t-side-bg); border-right-color: var(--t-side-border); color: var(--t-side-fg); }
.themed .side .wordmark, .themed .topbar .wordmark { color: var(--t-side-fg); }
.themed .side-business { background: var(--t-side-card); border-color: var(--t-side-card-border); color: var(--t-side-fg); }
.themed .side-business a, .themed .side-business summary { color: var(--t-side-muted); }
.themed .side-business a:hover, .themed .side-business li a { color: var(--t-side-fg); }
.themed .nav a { color: var(--t-side-fg); }
.themed .nav a:hover { background: var(--t-side-hover); }
.themed .nav a[aria-current="page"] { background: var(--t-active-bg); color: var(--t-active-fg); box-shadow: inset 3px 0 0 var(--t-active-bar); }
.themed .nav .badge { background: var(--t-badge); color: var(--t-badge-fg); }
.themed .nav a[aria-current="page"] .badge { background: var(--t-active-fg); color: var(--t-active-bg); }
.themed .side-bottom { border-top-color: var(--t-side-card-border); }
.themed .side-bottom form button { color: var(--t-side-muted); }
.themed .side-bottom form button:hover { background: var(--t-side-hover); color: var(--t-side-fg); }
.themed .side .langs a { color: var(--t-side-fg); }
.themed .side .langs a[aria-current] { background: var(--t-active-bg); color: var(--t-active-fg); }
.themed .topbar { background: var(--t-side-bg); border-bottom-color: var(--t-side-border); color: var(--t-side-fg); }
.themed .tabbar { background: var(--t-side-bg); border-top-color: var(--t-side-border); }
.themed .tabbar a { color: var(--t-side-muted); }
.themed .tabbar a[aria-current="page"] { background: var(--t-active-bg); color: var(--t-active-fg); }

.themed .card, .themed .calendar { background: var(--t-surface); border-color: var(--t-card-border); box-shadow: var(--t-shadow); }
.themed .page-head p, .themed .row-meta, .themed .row-end, .themed .card-head p, .themed .help, .themed .small, .themed .lead,
.themed .section-title, .themed .step-text, .themed .day-off, .themed .break, .themed .back-link, .themed .add-break,
.themed .remove-break, .themed .copy-week, .themed .empty-state, .themed .log, .themed .summary dt, .themed .check small,
.themed .day-times .dash { color: var(--t-muted); }
.themed .back-link:hover, .themed .add-break:hover, .themed .remove-break:hover, .themed .copy-week:hover { color: var(--t-text); }
.themed .list > li + li, .themed .day-row, .themed .step, .themed details.more { border-top-color: var(--t-divider); }
.themed a.row:hover { background: var(--t-surface-2); }
.themed .avatar { color: #3B2420; }
.themed .avatar-soft { background: var(--t-soft); color: var(--t-soft-fg); box-shadow: inset 0 0 0 1.5px var(--t-soft-border); }
.themed .tag { background: var(--t-surface-2); color: var(--t-text); }
.themed .tag-peach { background: var(--t-soft); color: var(--t-soft-fg); }
.themed .price { color: var(--t-text); font-weight: 650; background: var(--t-price-bg); padding: 2px 10px; border-radius: 999px; }
.themed .empty-state .icon { color: var(--t-accent); }
.themed .error, .themed .errorlist { color: var(--t-danger); }

.themed .btn { border-color: var(--t-btn-border); color: var(--t-btn-fg); }
.themed .btn:hover { background: var(--t-btn-hover); }
.themed .btn-primary { background: var(--t-primary); border-color: var(--t-primary); color: var(--t-primary-fg); }
.themed .btn-primary:hover { background: var(--t-primary-hover); border-color: var(--t-primary-hover); }
.themed .btn-quiet { border-color: var(--t-border); color: var(--t-text); }
.themed .btn-danger { border-color: rgba(163, 52, 31, .35); color: var(--t-danger); }
.themed .link { color: var(--t-text); }
.themed .input, .themed input[type=text], .themed input[type=email], .themed input[type=password], .themed input[type=tel],
.themed input[type=datetime-local], .themed input[type=date], .themed input[type=time], .themed input[type=number], .themed select, .themed textarea {
  background-color: var(--t-input-bg); border-color: var(--t-input-border); color: var(--t-text); }
.themed .input:focus, .themed input:focus, .themed select:focus, .themed textarea:focus { border-color: var(--t-focus); }
.themed .toggle { background: var(--t-toggle-off); }
.themed .toggle:checked { background: var(--t-toggle-on); }
.themed .check input, .themed .chips input { accent-color: var(--t-toggle-on); }
.themed .chips label { background: var(--t-input-bg); border-color: var(--t-input-border); }
.themed .chips label:has(input:checked) { background: var(--t-soft); border-color: var(--t-accent); color: var(--t-soft-fg); }
.themed .swatches label:has(input:checked) { box-shadow: 0 0 0 3px var(--t-surface), 0 0 0 5px var(--t-text); }
.themed .progress { background: var(--t-divider); }
.themed .progress span { background: var(--t-accent); }
.themed .step-mark { background: var(--t-surface); border-color: var(--t-border); }
.themed .step.is-done .step-mark { background: var(--t-accent); border-color: var(--t-accent); color: var(--t-text); }
.themed .share { background: var(--t-surface-2); border-color: var(--t-accent); }
.themed .sticky-actions { background: linear-gradient(to top, var(--t-bg) 70%, transparent); }
.themed .toast .msg { background: var(--t-toast); color: var(--t-toast-fg); }
.themed .panel { background: var(--t-bg); color: var(--t-text); border-color: var(--t-border); }
.themed .panel-close { color: var(--t-text); }
.themed .panel-close:hover { background: var(--t-surface-2); }
.themed .summary { background: var(--t-surface); border-color: var(--t-border); }
.themed .calendar .ec {
  --ec-color-300: var(--t-border); --ec-color-200: var(--t-divider); --ec-color-100: var(--t-surface-2); --ec-color-50: var(--t-bg);
  --ec-bg-color: var(--t-surface); --ec-text-color: var(--t-text); --ec-border-color: var(--t-border);
  --ec-button-bg-color: var(--t-surface); --ec-button-border-color: var(--t-border); --ec-button-text-color: var(--t-text);
  --ec-button-active-bg-color: var(--t-primary); --ec-button-active-border-color: var(--t-primary);
  --ec-button-active-text-color: var(--t-primary-fg); --ec-today-bg-color: var(--t-today);
  --ec-highlight-color: var(--t-soft); --ec-popup-bg-color: var(--t-surface);
}

/* Wide screens: the content stays centred in the area next to the menu */
.main { width: 100%; max-width: 1160px; margin: 0 auto; }
.main.main-narrow { max-width: 920px; }
.main.main-wide { max-width: none; }

/* Appearance card: the colour variants and your own colours */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--t-border); background: var(--t-surface); cursor: pointer; }
.theme-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.theme-card:hover { border-color: var(--t-muted); }
.theme-card.is-checked { border-color: var(--t-text); box-shadow: 0 0 0 2px var(--t-text) inset; }
.theme-card:has(input:focus-visible) { box-shadow: var(--focus); }
.theme-dots { display: flex; }
.theme-dots span { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 0 2px var(--t-surface), inset 0 0 0 1px rgba(0, 0, 0, .12); }
.theme-dots span + span { margin-left: -6px; }
.theme-name { font-weight: 600; font-size: .95rem; }
.custom-colours { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--t-divider); }
.colour-field { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.colour-input { width: 46px; height: 46px; padding: 0; border: 1.5px solid var(--t-input-border); border-radius: 12px; background: none; cursor: pointer; }
.colour-input::-webkit-color-swatch-wrapper { padding: 4px; }
.colour-input::-webkit-color-swatch { border: 0; border-radius: 8px; }
.colour-input::-moz-color-swatch { border: 0; border-radius: 8px; }

/* Logos */
.pub-logo { display: block; max-height: 52px; max-width: 220px; width: auto; height: auto; }
.side-logo { display: block; max-height: 44px; max-width: 100%; margin-bottom: 8px; border-radius: 6px; }
.logo-upload { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--t-divider, var(--line)); }
.logo-preview { width: 140px; height: 80px; border-radius: 12px; border: 1.5px dashed var(--t-border, var(--line)); display: grid; place-items: center; background: var(--t-surface-2, #fff); overflow: hidden; flex: none; }
.logo-preview img { max-width: 120px; max-height: 64px; }
.logo-preview span { font-size: .8rem; color: var(--t-muted, var(--muted)); text-align: center; padding: 6px; }
.file-input { font: inherit; font-size: .9rem; max-width: 100%; }
.custom-colours[hidden] { display: none; }

/* The booking page in the business's colours */
.themed.public { background: var(--t-bg); color: var(--t-text); }
.themed .pub-name, .themed .pub-header a { color: var(--t-text); }
.themed .pub-footer { border-top-color: var(--t-border); color: var(--t-muted); }
.themed .langs a { color: var(--t-text); }
.themed .langs a[aria-current] { background: var(--t-primary); color: var(--t-primary-fg); }
.themed .service, .themed .options, .themed .empty { background: var(--t-surface); border-color: var(--t-card-border); }
.themed .service { box-shadow: var(--t-shadow); }
.themed .service:hover { border-color: var(--t-accent); }
.themed .service-desc, .themed .meta, .themed .choice small, .themed .hold-note { color: var(--t-muted); }
.themed .choice input { accent-color: var(--t-toggle-on); }
.themed .day { background: var(--t-surface); border-color: var(--t-border); color: var(--t-text); }
.themed .day.is-selected { background: var(--t-active-bg); border-color: var(--t-active-bg); color: var(--t-active-fg); }
.themed .arrow { color: var(--t-text); }
.themed .arrow:hover { background: var(--t-surface-2); }
.themed .slot { background: var(--t-slot); border-color: var(--t-slot); color: var(--t-slot-fg); }
.themed .slot:hover { border-color: var(--t-text); }
.themed .slot:active, .themed .slot:focus-visible { background: var(--t-active-bg); border-color: var(--t-active-bg); color: var(--t-active-fg); }
.themed .warning { background: var(--t-surface-2); border-left-color: var(--t-accent); }
.themed .messages .msg { background: var(--t-surface); border-color: var(--t-border); }
.themed .messages .msg-error { border-color: var(--danger); color: var(--danger); }
/* Week and month views have no staff columns: the "not working" shading only makes sense per column */
.calendar .ec:not(.ec-resource) .ec-bg-event.ot-off { display: none; }
/* In narrow columns the status badge becomes a dot, so the client's name keeps the room */
.ec-event.ot-ev { container-type: inline-size; }
@container (max-width: 130px) {
  .ec-event .ev-badge { font-size: 0; width: 9px; height: 9px; padding: 0; flex: none; }
  .ec-event.ot-requested .ev-badge { background: #3B2420; }
  .ec-event.ot-checked_in .ev-badge { background: var(--ok); }
  .ec-event.ot-no_show .ev-badge { background: var(--danger); }
  .ec-event.ot-completed .ev-badge { background: #7a5c52; }
}

/* Today: overview numbers and the day's visits */
.day-switch { display: flex; gap: 6px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--t-surface, #fff); border: 1px solid var(--t-card-border, var(--line)); border-radius: 16px; padding: 14px 16px; box-shadow: var(--t-shadow, var(--shadow)); display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 1.45rem; line-height: 1.1; }
.stat span { font-size: .82rem; color: var(--t-muted, var(--muted)); }
.setup-banner { display: flex; align-items: center; gap: 14px; text-decoration: none; padding: 16px 20px; }
.agenda-row { display: grid; grid-template-columns: 56px 4px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 2px; }
.agenda-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; line-height: 1.2; min-width: 52px; }
.agenda-time b { font-size: 1rem; }
.agenda-time span { font-size: .8rem; color: var(--t-muted, var(--muted)); }
.agenda-bar { width: 4px; align-self: stretch; border-radius: 4px; }
.agenda-main { all: unset; cursor: pointer; min-width: 0; display: block; padding: 4px 0; }
.agenda-main:focus-visible { box-shadow: var(--focus); border-radius: 8px; }
.agenda-main .row-title, .agenda-main .row-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-end { display: flex; align-items: center; gap: 8px; }
.status-row-completed, .status-row-no_show { opacity: .6; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid var(--t-border, var(--line)); color: var(--t-text, var(--chocolate)); text-decoration: none; }
.icon-btn:hover { background: var(--t-surface-2, var(--sand)); }

/* Clients */
.search-box { position: relative; display: flex; align-items: center; margin-bottom: 14px; }
.search-box .icon { position: absolute; left: 14px; color: var(--t-muted, var(--muted)); pointer-events: none; }
.search-box .input { padding-left: 42px; }
.search-small { margin-bottom: 6px; }
.search-small .icon { left: 12px; }
.search-small .input { padding-left: 36px; }
.picker { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--t-border, var(--line)); border-radius: 12px; background: var(--t-surface, #fff); box-shadow: var(--t-shadow, var(--shadow)); }
.picker-item { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.picker-item:hover, .picker-item:focus-visible { background: var(--t-surface-2, var(--sand)); }
.picker-item span { font-size: .84rem; color: var(--t-muted, var(--muted)); }
.chosen-client { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 14px; border-radius: 14px; background: var(--t-surface-2, #fff4ea); }
.client-box [hidden], .chosen-client[hidden] { display: none !important; }
.client-link { color: inherit; text-decoration: none; }
.client-link:hover { text-decoration: underline; }
.badge-inline { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--t-badge, var(--peach)); color: var(--t-badge-fg, var(--chocolate)); font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.menu-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Services: drag to change the order */
.sort-item { display: flex; align-items: center; gap: 4px; }
.sort-item > .row { flex: 1; min-width: 0; }
.drag-handle { cursor: grab; touch-action: none; color: var(--t-muted, var(--muted)); padding: 10px 2px; display: grid; place-items: center; border-radius: 8px; }
.drag-handle:hover { background: var(--t-surface-2, var(--sand)); color: var(--t-text, var(--chocolate)); }
.sort-item.is-dragging { opacity: .9; background: var(--t-surface, #fff); box-shadow: 0 8px 24px rgba(59, 36, 32, .18); border-radius: 12px; position: relative; z-index: 5; }

/* Staff photos */
.photo-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--t-divider, var(--line)); }
.staff-photo { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; color: #3B2420; overflow: hidden; flex: none; }
.staff-photo img, .avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar { overflow: hidden; }

/* Booking page: choosing a specialist */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.person { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--t-border, var(--line)); background: var(--t-surface, #fff); cursor: pointer; }
.person input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.person:has(input:checked) { border-color: var(--t-text, var(--chocolate)); box-shadow: inset 0 0 0 1px var(--t-text, var(--chocolate)); }
.person:has(input:focus-visible) { box-shadow: var(--focus); }
.person-photo { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #3B2420; overflow: hidden; flex: none; }
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-any { background: var(--t-slot, var(--sand)); color: var(--t-text, var(--chocolate)); }
.person-text { display: flex; flex-direction: column; min-width: 0; }
.person-text small { color: var(--t-muted, var(--muted)); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.calendar-links { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-row { grid-template-columns: 48px 4px minmax(0, 1fr); }
  .agenda-end { grid-column: 3; }
}

/* Modules */
a.card.module-link { display: flex; text-decoration: none; padding: 16px 20px; }
a.card.module-link:hover { background: var(--t-surface-2, #fffaf5); }
.module-row { cursor: pointer; }
.module-row.is-locked { cursor: default; }
.module-row.is-locked .row-title, .module-row.is-locked > .avatar { opacity: .55; }
.module-row .toggle:disabled { opacity: .45; cursor: not-allowed; }
.locked-note { display: flex !important; align-items: center; gap: 6px; margin-top: 6px !important; }
.module-extra { margin: 0 0 14px 54px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sub-title { font-size: 1rem; margin: 18px 0 8px; }
.waitlist-link { margin-top: 14px; }

.danger-zone { border-color: #f0d2cb; margin-top: 26px; }
.danger-zone .card-head h2 { color: var(--danger); }

.snippet { border-top: 1px solid var(--t-divider, #f1e4d6); padding: 14px 0 6px; }
.snippet:first-of-type { border-top: 0; padding-top: 0; }
.snippet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.snippet-code { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.snippet-code code { flex: 1; min-width: 0; font-size: .8rem; background: var(--t-surface-2, #fffaf5); border: 1px solid var(--t-border, var(--line)); border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; }
.domain-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.domain-state code { font-size: 1rem; font-weight: 600; }
.in-frame .pub-header { padding-top: 10px; padding-right: 48px; }

/* Client photos */
.photo-grid { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.photo-grid li { display: flex; flex-direction: column; gap: 4px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; background: var(--t-surface-2, var(--sand)); }
.photo-meta { font-size: .8rem; color: var(--t-muted, var(--muted)); }
.photo-grid .link { padding: 0; font-size: .8rem; color: var(--t-muted, var(--muted)); }
.photo-upload { border-top: 1px solid var(--t-divider, #f1e4d6); padding-top: 12px; }
.photo-grid + .photo-upload, .photo-upload:first-child { border-top: 0; padding-top: 0; }

/* Reports */
.period-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.chips-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-link { padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--t-border, var(--line)); background: var(--t-surface, #fff); color: var(--t-text, var(--chocolate)); text-decoration: none; font-weight: 500; font-size: .92rem; }
.chip-link:hover { border-color: var(--t-text, var(--chocolate)); }
.chip-link.is-active { background: var(--t-active-bg, var(--chocolate)); border-color: var(--t-active-bg, var(--chocolate)); color: var(--t-active-fg, #fff); }
.period-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.input-date { width: auto; min-height: 38px; padding: 6px 10px; }
.report-line { margin: -6px 0 18px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--t-muted, var(--muted)); font-weight: 700; padding: 0 8px 8px 0; }
.table td { padding: 9px 8px 9px 0; border-top: 1px solid var(--t-divider, #f1e4d6); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 700px) {
  .report-grid { grid-template-columns: 1fr; }
  .module-extra { margin-left: 0; }
}

/* Several services in one visit */
.options-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.options-head h2 { margin: 0; font-size: 1.05rem; }
.options-head h2 small { font-weight: 500; color: var(--t-muted, var(--muted)); font-size: .9rem; }
.add-more { margin: 0 0 18px; background: var(--t-surface, var(--white)); border: 1px dashed var(--t-border, var(--line)); border-radius: var(--radius); padding: 10px 16px; }
.add-more summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; padding: 4px 0; }
.add-more summary::-webkit-details-marker { display: none; }
.add-more-group { margin: 10px 0 2px; font-size: .85rem; font-weight: 700; color: var(--t-muted, var(--muted)); }
.add-more-list { list-style: none; margin: 0; padding: 0; }
.add-more-list a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; color: inherit; text-decoration: none; border-top: 1px solid var(--t-divider, #f1e4d6); }
.add-more-list small { color: var(--t-muted, var(--muted)); white-space: nowrap; }

/* Visit panel blocks: invoices, forms */
.panel-block { border-top: 1px solid var(--t-divider, #f1e4d6); margin-top: 12px; padding-top: 10px; }
.panel-block h3 { margin: 0 0 6px; font-size: .95rem; }
.panel-block .plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.invoice-row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 4px 0; }
.invoice-row.is-void a, tr.is-void td { text-decoration: line-through; opacity: .6; }
.invoice-actions { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* AI assistant chat on the booking page */
.chat { position: fixed; right: 16px; bottom: 16px; z-index: 50; font-size: .95rem; }
.chat-open { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--t-primary, var(--chocolate)); color: var(--t-primary-fg, #fff); font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(59,36,32,.25); }
.chat.is-open .chat-open { display: none; }
.chat-panel { width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--t-surface, #fff); color: var(--t-text, var(--chocolate)); border: 1px solid var(--t-border, var(--line)); border-radius: 18px; box-shadow: 0 12px 40px rgba(59,36,32,.25); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--t-divider, #f1e4d6); }
.chat-head small { display: block; color: var(--t-muted, var(--muted)); font-size: .8rem; }
.chat-close { border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: inherit; padding: 0 4px; }
.chat-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg-ai, .chat-msg-staff { align-self: flex-start; background: var(--t-slot, var(--sand)); border-bottom-left-radius: 4px; }
.chat-msg-staff { border: 1px solid var(--t-text, var(--chocolate)); }
.chat-msg-client { align-self: flex-end; background: var(--t-primary, var(--chocolate)); color: var(--t-primary-fg, #fff); border-bottom-right-radius: 4px; }
.chat-msg-error { align-self: center; color: #a33; font-size: .85rem; }
.chat-typing { margin: 0 12px 6px; color: var(--t-muted, var(--muted)); font-size: .85rem; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--t-divider, #f1e4d6); }
.chat-form textarea { flex: 1; resize: none; border: 1px solid var(--t-border, var(--line)); border-radius: 12px; padding: 9px 12px; font: inherit; min-height: 40px; max-height: 120px; background: transparent; color: inherit; }
.chat-send { border: 0; border-radius: 12px; padding: 0 14px; background: var(--t-primary, var(--chocolate)); color: var(--t-primary-fg, #fff); cursor: pointer; }
.chat-foot { margin: 0; padding: 0 12px 10px; font-size: .75rem; color: var(--t-muted, var(--muted)); }
.chat-foot a { color: inherit; }
@media (max-width: 520px) { .chat { right: 12px; bottom: 12px; } .chat.is-open { inset: 0; } .chat.is-open .chat-panel { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; } }
/* Inbox */
.row.is-unread .row-title { font-weight: 800; }
.tag-ok { background: #e3f1e4; color: #2d6a33; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 14px; background: var(--t-slot, var(--sand)); }
.bubble-client { align-self: flex-start; }
.bubble-ai, .bubble-staff { align-self: flex-end; background: var(--t-surface, #fff); border: 1px solid var(--t-border, var(--line)); }
.bubble-staff { border-color: var(--t-text, var(--chocolate)); }
.bubble-who { display: block; font-size: .75rem; color: var(--t-muted, var(--muted)); margin-bottom: 2px; }
.chat-note { align-self: center; font-size: .8rem; color: var(--t-muted, var(--muted)); margin: 0; text-align: center; }
.chat-reply textarea { width: 100%; }
.chat-reply .form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Consent forms */
.consent-form { max-width: 640px; }
.consent-form h2 { margin: 22px 0 6px; font-size: 1.1rem; }
.consent-form .q { border: 1px solid var(--t-card-border, var(--line)); background: var(--t-surface, #fff); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 10px; }
.consent-form .q legend { font-weight: 600; padding: 0 4px; }
.consent-form .q.has-error { border-color: #c0392b; }
.consent-form .error { color: #a33; margin: 6px 0 0; font-size: .9rem; }
.sign-pad { display: block; width: 100%; max-width: 600px; aspect-ratio: 3 / 1; background: #fff; border: 1.5px dashed var(--t-border, var(--line)); border-radius: 12px; touch-action: none; margin: 6px 0; }
.forms-box { background: var(--t-surface, #fff); border: 1px solid var(--t-card-border, var(--line)); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; }
.forms-box h2 { margin: 0 0 8px; font-size: 1.05rem; }
.forms-box .plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.question-row { border-top: 1px solid var(--t-divider, #f1e4d6); padding-top: 10px; margin-top: 10px; }

/* Ready service lists */
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.kind-card { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin: 0; }
.check-row { cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--t-toggle-on, var(--chocolate)); flex: none; }

[hidden] { display: none !important; }

/* A toggle inside a .check label keeps its switch shape (not squeezed to a checkbox) */
.check input.toggle { width: 44px; height: 26px; margin-top: 0; }
.check-toggle { align-items: center; }
.q-switches { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
.q-options .field { margin: 0; }
