/* Overlap styles. Layout: month calendar in the wide golden-ratio column, people + best time in the narrow one.
   Days zoom open for finer times. Tokens first; components only use tokens. See docs/product.md. */
:root{
  --bg:#F4F7F8; --surface:#FFFFFF; --cell:#EEF2F4; --cell-we:#E3E9EE; --ink:#13202B; --muted:#5B6976; --line:#DCE3E8;
  --accent:#2950D6; --accent-ink:#FFFFFF; --agree:#0E8159; --agree-soft:#DDF2E8; --warn:#9A5B00;
  --shadow:0 12px 32px rgba(19,32,43,.16),0 2px 6px rgba(19,32,43,.08);
  --f-display:"Helvetica Neue",Helvetica,Arial,sans-serif;
  --f-body:"Helvetica Neue",Helvetica,Arial,sans-serif;
  --f-mono:"Helvetica Neue",Helvetica,Arial,sans-serif;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0E1419; --surface:#151D24; --cell:#1B252E; --cell-we:#121920; --ink:#E4ECF2; --muted:#8C9BA8; --line:#26323C;
  --accent:#7D9BFF; --accent-ink:#0B1020; --agree:#3CC48D; --agree-soft:#15372A; --warn:#E3A84A;
  --shadow:0 12px 32px rgba(0,0,0,.5),0 2px 6px rgba(0,0,0,.4); color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#0E1419; --surface:#151D24; --cell:#1B252E; --cell-we:#121920; --ink:#E4ECF2; --muted:#8C9BA8; --line:#26323C;
  --accent:#7D9BFF; --accent-ink:#0B1020; --agree:#3CC48D; --agree-soft:#15372A; --warn:#E3A84A;
  --shadow:0 12px 32px rgba(0,0,0,.5),0 2px 6px rgba(0,0,0,.4); color-scheme:dark}

/* base reset */
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%;scrollbar-gutter:stable} /* keep width equal with or without a scrollbar, so the header does not shift */
body{margin:0;-webkit-font-smoothing:antialiased}
:root{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:15px;line-height:1.5;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:0 48px}
button,input{font:inherit;color:inherit}
body,button,input{font-variant-numeric:tabular-nums}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.top{display:flex;align-items:center;gap:12px;max-width:1120px;margin:0 auto;padding-block:16px}
.brand{background:none;border:0;cursor:pointer;padding:4px;display:flex}
.brand i{width:24px;height:16px;position:relative;display:inline-block}
.brand i::before,.brand i::after{content:"";position:absolute;top:0;width:16px;height:16px;border-radius:50%;border:2px solid var(--ink)}
.brand i::before{left:0}.brand i::after{right:0;background:var(--accent);border-color:var(--accent);opacity:.85}
#title{flex:1;min-width:0;font-family:var(--f-display);font-weight:700;font-size:22px;letter-spacing:0;border:0;background:none;padding:2px 0;border-bottom:1px dashed transparent;border-radius:0}
#title:hover:not(:disabled){border-bottom-color:var(--line)}
#title:focus{outline:none;border-bottom-color:var(--accent)}
.tag{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent);font-weight:600}
.btn{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:8px 16px;font-weight:500;cursor:pointer;white-space:nowrap}
.btn:hover{border-color:var(--muted)}
.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.btn.ghost{border-color:transparent;background:none;color:var(--muted)}
.btn.small{padding:5px 12px;font-size:13px}

.wrap{max-width:1120px;margin:0 auto}
.layout{display:grid;grid-template-columns:minmax(0,1.618fr) minmax(0,1fr);gap:32px;align-items:start}
@media (max-width:820px){.layout{grid-template-columns:minmax(0,1fr)}}
.main{min-width:0}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
#month{font-family:var(--f-display);font-weight:700;font-size:20px;letter-spacing:0;margin:0}
.nav{display:flex;gap:6px}
.nav button{width:34px;height:34px;border-radius:50%;border:1px solid var(--line);background:var(--surface);cursor:pointer;display:grid;place-items:center;font-size:16px}
.nav button:disabled{opacity:.35;cursor:default}
.below{display:flex;justify-content:space-between;align-items:baseline;gap:4px 16px;flex-wrap:wrap;margin-top:10px}
.meta{color:var(--muted);font-size:12px;margin:0;display:flex;gap:4px 14px;flex-wrap:wrap}
/* save status: sits where a Save button would, bottom right of the calendar (ADR 0025) */
.saved{margin:0 0 0 auto;min-height:20px;display:flex;align-items:center;gap:7px;font-size:13px;color:var(--muted)}
.saved:empty{display:none}
.saved .chk{width:16px;height:16px;box-shadow:none}
.saved .txt{color:var(--ink)}
.saved.warn{color:var(--warn)}
.saved.just .chk{animation:pop .35s ease}
@keyframes pop{0%{transform:scale(.4)}60%{transform:scale(1.18)}100%{transform:none}}
.meta .warn{color:var(--warn)}

/* month */
.grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;user-select:none;-webkit-user-select:none}
.gh{font-size:11px;text-align:center;color:var(--muted);letter-spacing:.04em}
.day{position:relative;min-width:0}
.c{position:relative;border:1px solid transparent;border-radius:9px;background:var(--cell);cursor:pointer;padding:0;transition:background .12s;width:100%;touch-action:manipulation}
.c:hover:not(:disabled){border-color:var(--muted)}
.c:disabled{cursor:default;background:repeating-linear-gradient(135deg,var(--cell) 0 6px,transparent 6px 9px);opacity:.5}
.dayc{display:block;min-height:clamp(64px,10vw,108px)}
.dayc .d{position:absolute;left:8px;top:6px;font-family:var(--f-display);font-weight:700;font-size:16px;display:flex;align-items:center;gap:6px;line-height:1.3}
.day.out .dayc .d{color:var(--muted);font-weight:500}
.day.today .dayc .d{color:var(--accent)}
.dayc .n{position:absolute;right:7px;bottom:7px;font-family:var(--f-mono);font-size:11px}
.dayc .f{position:absolute;left:8px;bottom:7px;font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;background:var(--agree);color:var(--surface);padding:1px 6px;border-radius:4px;line-height:1.5}
.rng{position:absolute;left:8px;bottom:7px;right:8px;font-size:11px;font-weight:700;color:var(--ink);white-space:nowrap;overflow:hidden;text-align:left}
.rng .s{display:none}
.c.fin .rng{bottom:22px}
/* Group availability: one blue scale (set inline by app.js); everyone = solid blue with inverted text. */
.c.all .d,.c.all .n,.c.all .rng,.c.all small,.c.all .t,.c.all .w{color:var(--accent-ink)}
.c.all .n{font-weight:600}
/* You: a check badge, solid when you're free for the whole cell, outlined when partly. */
.chk{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:4px;background:var(--ink);color:var(--bg);flex:none;box-shadow:0 0 0 1.5px var(--cell)}
.chk svg{width:10px;height:10px}
.chk.part{background:var(--cell);color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--ink)}
.c.fin{box-shadow:inset 0 0 0 3px var(--agree)}
.zoom{position:absolute;top:4px;right:4px;width:26px;height:26px;border-radius:50%;border:1px solid var(--line);background:var(--surface);color:var(--muted);display:grid;place-items:center;cursor:pointer;opacity:0;transition:opacity .12s;padding:0}
.zoom svg{width:14px;height:14px}
.day:hover .zoom,.zoom:focus-visible,.zoom[aria-expanded="true"]{opacity:1}
.zoom:hover,.zoom[aria-expanded="true"]{color:var(--accent);border-color:var(--accent)}
@media (hover:none){.zoom{opacity:.85;width:22px;height:22px;top:auto;bottom:3px;right:3px}.zoom svg{width:12px;height:12px}.rng{right:28px}}

/* day zoom */
.sheet{position:absolute;z-index:20;width:290px;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:12px;display:grid;gap:10px}
.sh-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.sh-head b{font-family:var(--f-display);font-weight:700;font-size:17px}
.sh-close{width:30px;height:30px;border-radius:50%;border:0;background:var(--cell);cursor:pointer;font-size:16px;line-height:1}
.parts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.chip{min-height:46px;display:grid;align-content:center;justify-items:center;gap:0;font-size:13px;font-weight:500;line-height:1.2}
.chip small{font-family:var(--f-mono);font-size:10px;color:var(--muted);font-weight:400}
.hours{display:grid;gap:3px;touch-action:none}
.hr{display:flex;align-items:center;gap:10px;min-height:26px;padding:0 8px;border-radius:6px;text-align:left}
.hr .t{font-family:var(--f-mono);font-size:11px;color:var(--muted);width:3.2em}
.hr .w{flex:1;font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hr .n{font-family:var(--f-mono);font-size:11px}
.hr.fin{box-shadow:inset 3px 0 0 var(--agree),inset 0 0 0 1px var(--agree)}
.hr .slot{width:16px;flex:none;display:grid}
.chip .lb{display:flex;align-items:center;gap:5px}
.chip .chk{width:14px;height:14px}
.chip .chk svg{width:9px;height:9px}
@media (max-width:640px){
  .sheet{position:fixed;left:0;right:0;bottom:0;top:auto!important;width:auto;max-height:82vh;overflow:auto;border-radius:16px 16px 0 0;
    padding:14px max(16px,env(safe-area-inset-right,0px)) calc(14px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px))}
  .hr{min-height:28px}
}

/* side */
aside{display:grid;gap:22px;padding-top:4px}
.panel h2{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:0 0 8px}
.people{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.people li{display:flex;align-items:center;gap:10px;font-size:14px}
.people li.me{margin-bottom:8px}
.av{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:600;background:var(--cell);flex:none}
.people li.me .av{background:var(--ink);color:var(--bg)}
#name{flex:1;min-width:0;border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:6px 10px}
#name.need{border-color:var(--warn);box-shadow:0 0 0 3px color-mix(in srgb,var(--warn) 20%,transparent)}
/* Best keeps one size in every state (ADR 0024): heading on top, actions at the bottom, the middle takes the rest. */
.banner{border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:10px;border:1px solid var(--line);background:var(--surface)}
.banner .hd{display:grid;gap:2px}
.banner .who.all{color:var(--ink);font-weight:700}
.banner .msg{overflow-wrap:anywhere}
.banner .lbl{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600}
.banner .when{font-family:var(--f-display);font-weight:700;font-size:19px;letter-spacing:0;line-height:1.25}
.banner .who{color:var(--muted);font-size:13px}
.banner .acts{display:flex;gap:6px;flex-wrap:wrap}
.banner .acts:empty{display:none}
.banner.final{background:var(--agree-soft);border-color:var(--agree)}
.banner.final .lbl{color:var(--agree)}
.banner.quiet .when{font-size:15px;font-family:var(--f-body);font-weight:500;color:var(--muted)}

.msg{font-size:13px;line-height:1.45;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:10px 12px;white-space:pre-wrap;word-break:break-word;color:var(--ink)}
.msg a{color:var(--accent)}

/* confirmation page */
.done{max-width:440px;margin:32px auto 0;display:grid;gap:22px;text-align:center}
.done .ok-badge{width:44px;height:44px;border-radius:50%;background:var(--agree-soft);color:var(--agree);display:grid;place-items:center;margin:0 auto}
.done .ok-badge svg{width:22px;height:22px}
.done h1{font-size:15px;font-weight:500;color:var(--muted);margin:0}
.done .what{font-size:22px;font-weight:700;margin:4px 0 0;line-height:1.25;text-wrap:balance}
.done .date{font-size:32px;font-weight:700;line-height:1.1;margin:0}
.done .time{font-size:20px;margin:6px 0 0}
.done .tz{font-size:13px;color:var(--muted);margin:6px 0 0}
.done .tz b{color:var(--ink);font-weight:500}
.cal{display:grid;gap:8px}
.cal a,.cal button{display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px;border-radius:12px;border:1px solid var(--line);background:var(--surface);font-weight:500;color:var(--ink);text-decoration:none;cursor:pointer;width:100%}
.cal a:hover,.cal button:hover{border-color:var(--muted)}
.cal .first{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.cal small{color:var(--muted);font-weight:400}
.alt{font-size:13px;color:var(--muted);margin:-2px 0 0}
.alt a{color:var(--muted)}
.with{font-size:13px;color:var(--muted);margin:0}
.done .links{display:flex;justify-content:center;gap:20px;flex-wrap:wrap;margin:0}
.back{font-size:13px;color:var(--muted);background:none;border:0;cursor:pointer;text-decoration:underline;justify-self:center}

.toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:8px 16px;border-radius:999px;font-size:13px;opacity:0;pointer-events:none;transition:opacity .2s;z-index:30}
.toast.on{opacity:1}
.state{padding:48px 0;text-align:center;color:var(--muted);display:grid;gap:14px;justify-items:center}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
@media (max-width:480px){.top{flex-wrap:wrap}#title{order:3;flex-basis:100%;font-size:19px}.grid{gap:4px}.dayc .d{left:6px;font-size:14px;gap:4px}.dayc .chk{width:14px;height:14px}.dayc .chk svg{width:9px;height:9px}.dayc .n{display:none}.dayc .f{display:none}.rng{left:5px;right:5px;bottom:5px;font-size:10px}.rng .x{display:none}.rng .s{display:inline}}

/* landing */
.landing{max-width:400px;margin:12vh auto 0;display:grid;gap:18px}
.landing h1{font-size:28px;font-weight:700;margin:0;line-height:1.15}
.landing form{display:grid;gap:12px}
.landing label{display:grid;gap:6px;font-size:13px;color:var(--muted);font-weight:500}
.landing input{border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:12px 14px;font-size:16px;color:var(--ink)}
.landing input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
.landing .err:empty{display:none}
.landing .btn{min-height:44px;padding:0 24px;font-size:15px;justify-self:end;margin-top:14px}
.err{color:var(--warn);font-size:13px;margin:0;min-height:1.2em}
a.btn{text-decoration:none;display:inline-flex;align-items:center;color:var(--ink)}
/* your own name: plain text like everyone else's, editable on click */
.nm{display:inline-flex;align-items:center;gap:6px;border:0;background:none;padding:2px 6px;margin-left:-6px;border-radius:6px;cursor:pointer;font-size:14px;color:var(--ink);text-align:left;min-width:0}
.nm span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nm .pen{width:13px;height:13px;color:var(--muted);flex:none;opacity:0;transition:opacity .12s}
.nm:hover,.nm:focus-visible{background:var(--cell)}
.nm:hover .pen,.nm:focus-visible .pen{opacity:1}
@media (hover:none){.nm .pen{opacity:.7}}
/* "Is that you?" when your name is already in the poll (trust names, ADR 0016) */
.claim{margin:-2px 0 14px;padding:12px;border-radius:10px;background:var(--surface);border:1px solid var(--accent);display:grid;gap:8px;font-size:13px}
.claim p{margin:0}
.claim .acts{display:flex;gap:6px;flex-wrap:wrap}
.claim.pulse{animation:pulse .5s ease}
@keyframes pulse{0%,100%{transform:none}30%{transform:translateX(-3px)}60%{transform:translateX(3px)}}
/* merge and remove, for anyone with a row (ADR 0029) */
.person{flex-wrap:wrap}
.nm.other{font-size:14px}
.rowtools{flex-basis:100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:4px 0 6px 38px;font-size:12px;color:var(--muted)}
.rowtools select{font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:4px 6px;margin-left:4px}
.btn.danger{background:var(--warn);border-color:var(--warn);color:var(--surface)}
@media (prefers-reduced-motion:reduce){.claim.pulse,.saved.just .chk{animation:none}}
/* weekends: a slightly cooler background and a quieter label; the blue scale takes over once people mark */
.day.we .c.dayc:not(:disabled){background:var(--cell-we)}
.gh.we{opacity:.7}
/* in-context hint under your name on a new device (ADR 0017) */
.banner .note{color:var(--muted);font-size:13px;line-height:1.4}
.people li.name-hint{display:block;font-size:12px;color:var(--muted);margin:-4px 0 10px 38px}
.nm.pick{position:relative}
.nm.pick::after{content:"That's me";margin-left:8px;font-size:11px;color:var(--accent);opacity:0;transition:opacity .12s}
.nm.pick:hover::after,.nm.pick:focus-visible::after{opacity:1}
@media (hover:none){.nm.pick::after{opacity:.8}}
/* help button and help page (ADR 0021) */
.help-btn{flex:none;margin-left:auto;height:32px;padding:0 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--muted);font-weight:500;font-size:13px;cursor:pointer;display:grid;place-items:center;text-decoration:none;white-space:nowrap}
.help-btn:hover{color:var(--ink);border-color:var(--muted)}
#title:not([hidden])~.help-btn{margin-left:0}
.help-btn[hidden]{display:none}
@media (max-width:480px){#title:not([hidden])~.help-btn{margin-left:auto}}
.helppage{max-width:560px;margin:4vh auto 0;padding-bottom:48px}
.helppage .backbtn{margin-bottom:28px}
.helppage h1{font-size:28px;font-weight:700;margin:0 0 10px;line-height:1.15;outline:none}
.helppage .about{margin:0;font-size:16px;line-height:1.55;text-wrap:pretty}
.helppage h2{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:36px 0 4px}
.helppage details{border-bottom:1px solid var(--line)}
.helppage summary{cursor:pointer;padding:12px 0;font-weight:600;font-size:15px;list-style:none;display:flex;justify-content:space-between;gap:12px}
.helppage summary::-webkit-details-marker{display:none}
.helppage summary::after{content:"+";color:var(--muted);font-weight:400;flex:none}
.helppage details[open] summary::after{content:"–"}
.helppage details p{margin:0 0 14px;font-size:15px;color:var(--muted);line-height:1.55}
.seg{display:inline-flex;gap:2px;padding:3px;margin-top:10px;background:var(--cell);border-radius:999px}
.seg button{border:0;background:none;border-radius:999px;min-height:36px;padding:0 16px;font-size:14px;font-weight:500;color:var(--muted);cursor:pointer}
.seg button:hover{color:var(--ink)}
.seg button[aria-checked="true"]{background:var(--surface);color:var(--ink);box-shadow:0 0 0 1px var(--line),0 1px 2px rgba(0,0,0,.12)}
