:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #16181d;
  --muted: #5f6673;
  --border: #e3e6eb;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: #e6f4f2;
  --warn-soft: #fff6e0;
  --warn: #8a5a00;
  --danger: #b42318;
  --ok: #067647;
  --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
p { margin: 0 0 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; margin: 0 auto; padding: 0 16px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--panel); color: var(--text); border-color: var(--border); }
.btn:hover { filter: brightness(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--danger); }
.btn.link { background: none; border: none; color: var(--brand); padding: 4px 6px; }
.btn.sm { padding: 6px 10px; font-size: 14px; }
.btn.block { width: 100%; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea { font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); width: 100%; min-width: 0; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 12px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.grey { background: #eef0f3; color: var(--muted); }
.badge.bad { background: #fdecea; color: var(--danger); }
.notice { border-radius: 10px; padding: 12px 14px; background: var(--warn-soft); color: var(--warn); margin-bottom: 16px; }
.notice.good { background: var(--brand-soft); color: var(--brand); }
.error { color: var(--danger); font-size: 14px; min-height: 1.2em; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: calc(100% - 32px); }

/* ---------- top bar ---------- */
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 60px; gap: 12px; }
.logo { font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--brand); }

/* ---------- landing ---------- */
.hero { padding: 72px 0 48px; text-align: center; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); letter-spacing: -0.03em; max-width: 780px; margin: 0 auto 16px; }
.hero p { font-size: 19px; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.section { padding: 48px 0; }
.section h2 { font-size: 30px; text-align: center; margin-bottom: 28px; letter-spacing: -0.02em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; }
.math { background: var(--text); color: #fff; border-radius: 16px; padding: 32px; text-align: center; }
.math strong { color: #5eead4; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 760px; margin: 0 auto; }
@media (max-width: 680px) { .plans { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; gap: 12px; }
.plan.featured { border: 2px solid var(--brand); }
.price { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.price small { font-size: 16px; font-weight: 500; color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ticks li::before { content: "✓ "; color: var(--brand); font-weight: 800; }
.plan .btn { margin-top: auto; }
details { border-bottom: 1px solid var(--border); padding: 14px 0; }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 8px 0 0; color: var(--muted); }
footer { padding: 32px 0 48px; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- dashboard ---------- */
.auth { padding: 48px 0; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 16px 0 20px; scrollbar-width: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }
.linkbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkbox code { background: var(--brand-soft); color: var(--brand); padding: 8px 12px; border-radius: 8px; font-size: 15px; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
.stat .n { font-size: 26px; font-weight: 800; }
.day-head { font-weight: 700; margin: 18px 0 8px; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; }
.bk { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: start; }
@media (max-width: 560px) { .bk { grid-template-columns: 1fr; } }
.bk .time { font-weight: 700; }
.bk .meta { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.hours-row { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 10px; align-items: center; }
@media (max-width: 480px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-row label.check { grid-column: 1 / -1; } }
.hours-row.closed input[type=time] { opacity: 0.4; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }

/* ---------- public booking ---------- */
.book-head { padding: 32px 0 16px; text-align: center; }
.svc { display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.svc:hover, .svc.selected { border-color: var(--brand); }
.svc.selected { box-shadow: 0 0 0 1px var(--brand); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 2px; font: inherit; cursor: pointer; text-align: center; line-height: 1.2; color: inherit; }
.day small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.day b { font-size: 18px; }
.day:disabled { opacity: 0.35; cursor: not-allowed; }
.day.selected { background: var(--brand); border-color: var(--brand); color: #fff; }
.day.selected small { color: #d7f3ef; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot { border: 1px solid var(--brand); color: var(--brand); background: #fff; border-radius: 8px; padding: 9px 4px; font: inherit; font-weight: 600; cursor: pointer; }
.slot.selected { background: var(--brand); color: #fff; }
.summary { background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; }
.powered { text-align: center; font-size: 13px; color: var(--muted); padding: 24px 0 40px; }
/* Inside a client's website (embed.js): the site supplies the page around it. */
.embed body { background: transparent; }
.embed .book-head { display: none; } /* the website already says whose page it is */
.embed .book-head.fatal { display: block; padding-top: 4px; }
.embed main { padding-top: 4px; padding-bottom: 8px; }
.embed .narrow { max-width: none; } /* the website's own box sets the width */
.embed .powered { padding-bottom: 8px; }
.status-icon { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.justify-center { justify-content: center; }
.mt { margin-top: 12px; }
.tight { margin: -8px 0 0; }
.math h2 { color: #fff; }
.math p { font-size: 19px; max-width: 640px; margin: 0 auto; }
.justify-end { justify-content: flex-end; }
.mt-sm { margin-top: 6px; }
.grow { flex: 1; width: auto; }
dialog { border: none; border-radius: var(--radius); padding: 20px; width: min(440px, calc(100% - 32px)); color: var(--text); }
dialog::backdrop { background: rgba(15, 20, 25, 0.45); }
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #1e1b4b; color: #fff; border-radius: 10px; padding: 10px 14px; }
.client-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
@media (max-width: 640px) { .client-row { grid-template-columns: 1fr; } }
.client-row .meta { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-size: 14px; }
.times-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr); align-items: center; gap: 10px; }
@media (max-width: 480px) { .times-row { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
