:root {
  --bg: #f7f7f4; --card: #fff; --ink: #1c1d21; --muted: #5d6170; --line: #dcdde3;
  --brand: #3c4fe0; --brand-ink: #fff; --brand-soft: #e7eafd; --good: #1f8a4c; --good-soft: #e3f4ea;
  --warn-soft: #fff6dc; --danger: #b3261e; --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 17px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
main { max-width: 560px; margin: 0 auto; padding: 8px 16px 32px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 12px 0 6px; }
h2 { font-size: 1.15rem; margin: 20px 0 8px; }
h3 { font-size: 0.95rem; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.top { padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--brand); text-decoration: none; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px 40px; }
.foot a { color: var(--muted); }
.lede { color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.error { color: var(--danger); font-weight: 600; }
.ok { color: var(--good); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=date], input[type=time], select {
  font: inherit; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 48px;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1 1 160px; width: auto; }
.small-row { margin-top: 10px; }
.btn { font: inherit; font-weight: 600; border-radius: 12px; padding: 12px 16px; min-height: 48px; border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-secondary { background: var(--card); color: var(--brand); border-color: var(--brand); }
.btn-danger { background: var(--card); color: var(--danger); border-color: var(--danger); }
.btn-small { min-height: 44px; padding: 8px 12px; }
.btn-block { display: flex; width: 100%; margin-top: 16px; }
.btn:disabled { opacity: .6; }
.link-btn { font: inherit; background: none; border: 0; color: var(--brand); text-decoration: underline; padding: 8px 0; cursor: pointer; min-height: 44px; }
.day-card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 12px 0; }
.panel { padding: 4px 14px 14px; }
.day-head { display: flex; justify-content: space-between; align-items: center; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.chip { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 4px; min-height: 52px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.slot.on { background: var(--good); border-color: var(--good); }
.chip-time { font-weight: 700; }
.chip-label { font-size: .75rem; opacity: .85; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-size: .9rem; }
.warn { background: var(--warn-soft); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.warn p { margin: 0 0 8px; }
.best-box { background: var(--good-soft); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.best-box p { margin: 2px 0; }
.best-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--good); font-weight: 700; }
.best-slot { font-size: 1.25rem; font-weight: 700; }
.grid-row { display: grid; grid-template-columns: 84px 1fr 44px; grid-template-areas: "time bar count" "names names badge"; gap: 2px 8px; align-items: center; padding: 8px; border-radius: 10px; }
.grid-row.best { background: var(--good-soft); outline: 2px solid var(--good); }
.g-time { grid-area: time; font-weight: 700; }
.bar { grid-area: bar; height: 12px; background: #eceef3; border-radius: 6px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--good); }
.g-count { grid-area: count; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.g-names { grid-area: names; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.g-badge { grid-area: badge; font-size: .78rem; color: var(--good); font-weight: 700; text-align: right; }
.next-links { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.next-links li { display: flex; flex-direction: column; gap: 4px; }
.next-links .btn { width: 100%; }
.placeholder-tag { font-size: .78rem; color: #7a5b00; background: var(--warn-soft); border-radius: 6px; padding: 2px 6px; align-self: flex-start; }
.prose li { margin: 4px 0; }
@media (min-width: 640px) { .chips { grid-template-columns: repeat(6, 1fr); } }
.panel .row { margin-top: 10px; }
.optional-q { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 4px; margin: 12px 0; background: var(--card); }
.optional-q legend { font-weight: 600; padding: 0 4px; }
.radio-row { display: flex; gap: 12px; }
label.radio { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 6px 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; flex: 1; }
label.radio input { width: 20px; height: 20px; margin: 0; }
/* Create screen: day strip, broad times, sticky action */
.step { margin-top: 18px; }
.day-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-left: 2px; padding: 4px 2px 10px; -webkit-overflow-scrolling: touch; }
.day-chip { flex: 0 0 auto; min-width: 64px; min-height: 60px; scroll-snap-align: start; padding: 6px 8px; }
.chip-month { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; min-height: 1em; opacity: .8; }
.broad-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.broad-row .chip { min-height: 48px; }
.has-sticky main { padding-bottom: 120px; }
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(247,247,244,.97); border-top: 1px solid var(--line); padding: 8px 16px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.sticky-bar p { margin: 0 auto; max-width: 528px; text-align: center; }
.sticky-bar .btn-block { max-width: 528px; margin: 6px auto 0; }
.offscreen { position: fixed; left: -9999px; top: 0; }
.q-text { font-weight: 600; margin: 4px 0 8px; }
#share-view .optional-q { padding: 10px 12px; }
#share-view .radio-row .btn { flex: 1; }
.day-head { gap: 8px; flex-wrap: wrap; }
#pick-slots .chip-time { font-size: .95rem; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.month-label { font-weight: 700; font-size: 1.05rem; text-align: center; flex: 1; }
.icon-btn { font: inherit; font-size: 1.6rem; line-height: 1; width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--brand); cursor: pointer; }
.icon-btn:disabled { color: var(--line); cursor: default; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--brand); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.seg { font: inherit; font-size: .95rem; font-weight: 600; min-height: 44px; border: 0; border-left: 1px solid var(--brand); background: var(--card); color: var(--brand); cursor: pointer; }
.seg:first-child { border-left: 0; }
.seg.on { background: var(--brand); color: #fff; }
#slot-count.error { color: var(--danger); font-weight: 600; }
