:root {
  color-scheme: light dark;
  --bg: #f4f2ee; --card: #fff; --ink: #1d2a2f; --muted: #5f686c; --line: #ddd8d0; --soft: #ebe7e0;
  --brand: #1d2a2f; --accent: #b8925a; --accent-soft: #f5eddf; --danger: #c0392b; --ok: #2e7d4f;
  --on-accent: #1d2a2f;   /* white on gold is only 2.9:1 */
  --wordmark: #c9a56c;
  --radius-sm: 10px; --radius-md: 14px; --radius-pill: 99px;
  --shadow: 0 10px 30px rgba(29,42,47,.12);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121719; --card: #1c2326; --ink: #eef0f0; --muted: #9aa3a6; --line: #2e383b; --soft: #242c2f;
    --accent: #c9a56c; --accent-soft: #2c2a22; --ok: #5cbf86; --danger: #e5675a; --shadow: 0 10px 30px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body.embed { background: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 16px; cursor: pointer; min-height: 44px; }
button:hover { border-color: var(--accent); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); text-decoration: none; }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 650; }
button.primary:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--muted); text-decoration: underline; }
button.danger { color: var(--danger); border-color: var(--danger); }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; margin: 14px 0 0; font-size: 14px; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }
label input, label select, label textarea { margin-top: 6px; font-weight: 400; }
a { color: inherit; }
[hidden] { display: none !important; }

.top { background: var(--brand); color: #fff; padding: calc(env(safe-area-inset-top) + 18px) 16px 18px; }
.top-in { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.wordmark { font-size: 13px; font-weight: 700; letter-spacing: .18em; color: var(--wordmark); text-decoration: none; }
.top .contact { margin-left: auto; font-size: 14px; color: #c8cfd1; text-decoration: none; }
body.embed .top { display: none; }

main { max-width: 960px; margin: 0 auto; padding: 24px 16px 60px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 32px); line-height: 1.2; }
.hero p { margin: 0 0 20px; color: var(--muted); }

.steps { display: flex; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps li + li::before { content: ''; width: 18px; height: 1px; background: var(--line); }
.steps li.on { color: var(--ink); font-weight: 650; }
.steps li.done { color: var(--ink); }
.steps .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-size: 12px; }
.steps li.on .n, .steps li.done .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.type { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius-md); background: var(--card); min-height: 150px; transition: transform .12s, box-shadow .12s; }
.type:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.type .ico { font-size: 22px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); }
.type strong { font-size: 17px; }
.type .meta { font-size: 13px; color: var(--muted); }
.type p { margin: 0; font-size: 14px; color: var(--muted); }

.picker { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 720px) { .picker { grid-template-columns: 1fr; } }
.summary-chip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.summary-chip .pill { background: var(--accent-soft); border-radius: var(--radius-pill); padding: 6px 12px; font-size: 14px; font-weight: 600; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head strong { font-size: 16px; }
.cal-head button { min-width: 44px; padding: 6px 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal button { padding: 0; aspect-ratio: 1; min-height: 40px; border-radius: 50%; border: 0; background: none; font-weight: 500; position: relative; }
.cal button.avail { background: var(--accent-soft); font-weight: 700; }
.cal button.avail:hover { outline: 2px solid var(--accent); }
.cal button.sel { background: var(--accent); color: var(--on-accent); }
.cal button:disabled { color: var(--muted); opacity: .45; cursor: default; }
.cal button.today::after { content: ''; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }

.times h3 { margin: 0 0 4px; font-size: 16px; }
.times .tzline { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.times .tzline button { font-size: 13px; }
.time-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; padding: 2px; }
.time-list button { white-space: nowrap; padding: 10px 6px; font-size: 15px; font-weight: 600; border-color: var(--accent); color: var(--ink); }
.time-list button.sel { background: var(--accent); color: var(--on-accent); }
.part { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 6px; }
.next-free { margin-top: 10px; font-size: 14px; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips button { border-radius: var(--radius-pill); padding: 6px 14px; min-height: 38px; font-size: 14px; font-weight: 500; }
.chips button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.area-msg { font-size: 14px; margin: 6px 0 0; }
.area-msg.ok { color: var(--ok); }
.area-msg.bad { color: var(--danger); }
.drop { margin-top: 6px; border: 2px dashed var(--line); border-radius: var(--radius-md); padding: 16px; text-align: center; color: var(--muted); font-weight: 400; cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs figure { margin: 0; position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--soft); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs figure.busy img { opacity: .4; }
.thumbs button { position: absolute; top: 2px; right: 2px; min-height: 0; width: 22px; height: 22px; padding: 0; border-radius: 50%; font-size: 12px; line-height: 1; background: rgba(0,0,0,.6); color: #fff; border: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.actions .primary { min-width: 180px; }
.error { color: var(--danger); white-space: pre-line; }
.fine { font-size: 13px; color: var(--muted); }

.done-page { max-width: 620px; margin: 0 auto; text-align: center; }
.done-page .check { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 32px; margin: 0 auto 12px; }
.done-page h1 { margin: 0 0 6px; }
.done-page .card { text-align: left; margin-top: 18px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.done-page ul { margin: 6px 0 0; padding-left: 20px; }
.done-page .actions { justify-content: center; }
.status-cancelled { color: var(--danger); font-weight: 700; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .type { transition: none; } .spinner { animation-duration: 2s; } }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 0 16px 30px; }
body.embed .foot { display: none; }
