/* Overlap — mobile first, follows the system light/dark setting. */

:root {
  --bg: #f3f5f9; --surf: #ffffff; --ink: #10131a; --muted: #5b6474; --line: #e2e6ee;
  --track: #e3e7ef; --chip: #e3e7ef; --chip-bd: #d5dae3; --field-bd: #c3cad6;
  --link: #1a3fd1; --accent: #2d5bff; --danger: #b4232a; --danger-bd: #f0c4c6; --dot: #e5484d;
  --you: #ffd60a; --you-edge: #c9a300;
  --heat-lo: 226 229 236; --heat-hi: 24 28 38;
  --hl: #e3e7ef; --shadow: 0 1px 2px rgb(16 19 26 / 6%), 0 8px 24px rgb(16 19 26 / 6%);
  --radius: 14px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --surf: #181c25; --ink: #e9ecf2; --muted: #9aa3b2; --line: #262c38;
    --track: #222835; --chip: #232937; --chip-bd: #343b4a; --field-bd: #3a4252;
    --link: #a9b9ff; --accent: #7b95ff; --danger: #ff8a8e; --danger-bd: #5a2a2d; --dot: #ff6b70;
    --you: #ffe14d; --you-edge: #ffe14d;
    --heat-lo: 38 43 58; --heat-hi: 236 239 245;
    --hl: #232937; --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.4 var(--font); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.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; }
[hidden] { display: none !important; }

.page { max-width: 520px; margin: 0 auto; padding: 0 16px 28px; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0 6px; }
.brand { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0; border: 0; background: none; }
.brand span { font: 800 23px/1 var(--display); letter-spacing: -0.02em; }
.bar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surf); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
.icon-btn .dot { position: absolute; top: 5px; right: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--dot); border: 2px solid var(--bg); }
.seg { display: flex; background: var(--chip); border-radius: 999px; padding: 3px; }
.seg button { height: 38px; min-width: 48px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--surf); color: var(--ink); }
.back { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px 0 0; color: var(--link); font-weight: 600; border: 0; background: none; }

/* ---------- filter panel ---------- */
.filter { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 14px; top: 14px; color: var(--muted); }
.search input { width: 100%; height: 48px; padding: 0 14px 0 42px; border: 1px solid var(--field-bd); border-radius: 12px; background: var(--surf); font-size: 16px; }
.chip-row { display: flex; align-items: center; gap: 8px; margin-right: -16px; }
.chip-add { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px dashed var(--chip-bd); background: var(--surf); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.chips { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; padding-right: 16px; scrollbar-width: none; }
.chip { flex: none; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--chip-bd); background: var(--surf); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.dashed { border-style: dashed; color: var(--link); background: transparent; display: inline-flex; align-items: center; gap: 6px; }
.linkish { align-self: flex-start; min-height: 36px; padding: 0 2px; border: 0; background: none; color: var(--link); font-weight: 600; font-size: 14px; }

/* ---------- banner ---------- */
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 4px 0; border-radius: var(--radius); background: var(--surf); border: 1px solid var(--line); font-size: 14px; }
.banner p { margin: 0; flex: 1; }
.banner.warn { border-color: var(--danger-bd); }

/* ---------- dial ---------- */
.dial { width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 1; }
.dial-svg { display: block; width: 100%; height: 100%; font-family: var(--font); user-select: none; -webkit-user-select: none; }
.dial-svg .ring-hit { pointer-events: stroke; cursor: pointer; }
.dial-time { font: 800 30px var(--display); }
.dial-sub { font: 700 12px var(--font); letter-spacing: 0.06em; }

.pick { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px 12px; margin: 6px 0 12px; border-radius: var(--radius); background: var(--surf); border: 1px solid var(--line); }
.pick-top { display: flex; align-items: flex-start; gap: 10px; }
.pick-acts { display: flex; gap: 8px; padding-left: 22px; }
.pick .swatch { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; }
.pick .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick .who b { font-size: 15px; }
.pick .who span { font-size: 12px; color: var(--muted); }
.btn-sm { flex: none; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; }
.btn-sm.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }

.headline { margin: 4px 0 8px; text-align: center; font: 800 28px/1.15 var(--display); letter-spacing: -0.01em; }

/* ---------- people lists ---------- */
.list-h { margin: 10px 0 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 9px 8px; margin: 0 -8px; border-radius: 10px; }
.row:hover { background: var(--hl); }
.row.hl { background: var(--hl); }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; border: 1.5px solid transparent; }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .main b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .main span, .row .side span { font-size: 13px; color: var(--muted); }
.row .side { flex: none; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.row .side b { font-size: 14px; font-weight: 600; }
.row .chev { flex: none; color: var(--muted); }
.badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--you); color: #10131a; font-size: 11px; font-weight: 700; vertical-align: 1px; }

.empty { margin: 12px 0; padding: 18px; border-radius: var(--radius); background: var(--surf); border: 1px dashed var(--chip-bd); text-align: center; color: var(--muted); }
.empty p { margin: 0 0 12px; }

.cta { margin-top: auto; padding-top: 16px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; border: 0; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 16px; }
.btn.secondary { background: var(--surf); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--surf); color: var(--danger); border: 1px solid var(--danger-bd); }
.btn-pill { height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; display: inline-flex; align-items: center; }

/* ---------- forms ---------- */
h1.title { margin: 4px 0 12px; font: 800 30px/1.1 var(--display); }
.intro { margin: -4px 0 14px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input[type=text], .field input[type=search], .field select { height: 48px; padding: 0 14px; border: 1px solid var(--field-bd); border-radius: 12px; background: var(--surf); font-size: 16px; font-weight: 600; width: 100%; }
.field input.call { border-style: dashed; border-width: 1.5px; border-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); min-height: 18px; }
.hint.ok { color: var(--link); }
.hint.bad { color: var(--danger); }
.error { color: var(--danger); font-weight: 600; font-size: 14px; }

.card { padding: 14px; background: var(--surf); border-radius: 16px; display: flex; flex-direction: column; gap: 6px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.card-h b { font-weight: 600; }
.card-h span { font-size: 12px; color: var(--muted); }

/* day bar */
.daybar { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.nudge { flex: none; width: 40px; height: 44px; border-radius: 10px; border: 1px solid var(--chip-bd); background: var(--surf); display: flex; align-items: center; justify-content: center; padding: 0; }
.track { position: relative; flex: 1; min-width: 0; height: 44px; border-radius: 10px; background: var(--track); overflow: hidden; touch-action: none; }
.track .blk { position: absolute; top: 0; bottom: 0; }
.track .blk.core { cursor: grab; }
.track .blk.core.s::before, .track .blk.core.e::after { content: ""; position: absolute; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: rgb(255 255 255 / 85%); cursor: ew-resize; }
.track .blk.core.s::before { left: 4px; }
.track .blk.core.e::after { right: 4px; }
.track .blk.brk { box-sizing: border-box; background: var(--surf); border: 2px dashed currentColor; cursor: grab; }
.track .blk.call { top: 8px; bottom: 8px; border-radius: 6px; }
.track .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); pointer-events: none; }
.track.dragging, .track.dragging .blk { cursor: grabbing; }
.ticks { display: flex; justify-content: space-between; padding: 0 46px; font-size: 11px; font-weight: 600; color: var(--muted); }
.keys { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
.keys span { display: inline-flex; align-items: center; gap: 6px; }
.keys i { display: inline-block; width: 16px; height: 8px; border-radius: 3px; }

.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 40px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surf); display: flex; align-items: center; justify-content: center; padding: 0; }
.sw[aria-checked="true"] { border-color: var(--ink); }
.sw i { width: 24px; height: 24px; border-radius: 50%; display: block; }
.sw-custom { position: relative; height: 44px; padding: 0 10px 0 6px; border-radius: 12px; border: 1px dashed var(--chip-bd); background: var(--surf); color: var(--muted); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.sw-custom[aria-checked="true"] { border: 2px solid var(--ink); color: var(--ink); }
.sw-custom i { width: 24px; height: 24px; border-radius: 50%; background: conic-gradient(#e5484d, #e8590c, #ffd60a, #12a150, #0d9488, #2d5bff, #8e4ec6, #d6409f, #e5484d); }
.sw-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.days button { height: 44px; border-radius: 12px; border: 1px solid var(--chip-bd); background: var(--surf); color: var(--muted); font-weight: 600; }
.days button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--chip); border-radius: 999px; padding: 3px; margin-bottom: 12px; }
.tabs a { height: 38px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; color: var(--muted); }
.tabs a[aria-selected="true"] { background: var(--surf); color: var(--ink); }

.section { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.section h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.section .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.share-out { width: 100%; min-height: 70px; padding: 10px; border-radius: 12px; border: 1px solid var(--field-bd); background: var(--surf); font: 12px/1.4 ui-monospace, monospace; resize: vertical; word-break: break-all; }
.note { font-size: 13px; color: var(--muted); margin: 0; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); z-index: 10; }

/* ---------- wider screens: dial and list side by side ---------- */
@media (min-width: 900px) {
  .page.wide { max-width: 1080px; }
  .clock-grid { display: grid; grid-template-columns: minmax(380px, 480px) minmax(340px, 1fr); gap: 8px 40px; align-items: start; }
  .clock-grid .left { position: sticky; top: 8px; }
  .clock-grid .dial { max-width: 480px; }
  .clock-grid .right { padding-top: 8px; }
  .clock-grid .headline { text-align: left; margin-top: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .row, .chip, .icon-btn, .seg button { transition: background-color .12s ease, color .12s ease; }
}

/* ---------- peak line, own-ring tap ---------- */
.peak { margin: -2px 0 10px; text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.dial-svg .me-hit { cursor: pointer; pointer-events: all; }
.dial-svg path.me-hit { pointer-events: stroke; }

/* ---------- demo bar ---------- */
.demo-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 16px; background: var(--you); color: #10131a; font-size: 13px; }
.demo-bar p { margin: 0; flex: 1; min-width: 0; }
.demo-bar .btn-sm { background: #10131a; color: #fff; height: 34px; }
.demo-bar .btn-x { color: #10131a; width: 36px; height: 36px; }

/* ---------- home ---------- */
.hero { padding: 12px 0 4px; }
.hero-title { margin: 0; font: 800 40px/1.02 var(--display); letter-spacing: -0.025em; }
.hero-sub { margin: 12px 0 0; font-size: 16px; color: var(--muted); max-width: 34em; }
.home-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.home .dial { max-width: 400px; }
.tour { padding: 16px; background: var(--surf); border-radius: 16px; border: 1px solid var(--line); min-height: 172px; display: flex; flex-direction: column; }
.tour:has(> .linkish:only-child) { min-height: 0; padding: 6px 12px; }
.tour-k { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.tour h2 { margin: 4px 0 6px; font: 800 22px/1.15 var(--display); }
.tour p { margin: 0; color: var(--muted); }
.tour-nav { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 14px; }
.tour-nav .linkish { margin-right: auto; }
.dots { display: flex; gap: 5px; margin-right: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--chip-bd); }
.dots i.on { background: var(--ink); }
.hero-cta { display: grid; gap: 8px; margin-top: 12px; }
.points { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.points b { color: var(--ink); }
@media (min-width: 900px) {
  .page.home { max-width: 1080px; }
  .hero-title { font-size: 56px; }
  .home-grid { display: grid; grid-template-columns: minmax(380px, 460px) minmax(320px, 1fr); gap: 40px; align-items: center; }
  .clock-grid .peak { text-align: left; }
}
