/* zPLANS: find a date your circle is free, usual weeks (night and split shifts too), and plans.
   Loaded after shared/zui.css: the suite theme supplies --bg, --surface*, --text*, --accent*, --positive,
   --warning, --negative and the shadows; the tokens below only add what zPLANS needs on top of them.
   Layout: one circle = three tabs (Calendar, My week, Plans). Phones get a bottom tab bar; wider screens
   get tabs under the header. Day details open in a sheet. */
:root {
  --line: var(--border);
  --line-strong: var(--border-strong);
  --accent-ink: var(--accent-text);
  --free: var(--positive);
  --free-soft: var(--positive-bg);
  --free-ink: color-mix(in oklab, var(--positive) 72%, var(--text));
  --maybe: var(--warning);
  --maybe-soft: var(--warning-bg);
  --maybe-ink: color-mix(in oklab, var(--warning) 72%, var(--text));
  --busy: var(--negative);
  --busy-soft: var(--negative-bg);
  --busy-ink: color-mix(in oklab, var(--negative) 75%, var(--text));
  --work: color-mix(in oklab, var(--text-3) 85%, var(--accent));
  --work-soft: color-mix(in oklab, var(--text-3) 24%, transparent);
  --blank: var(--text-4);
  --p1: var(--accent); --p2: #6a55cf; --p3: #1b88b0; --p4: #c03f78;
  --on-plan: #ffffff;
  --av-l: 86%; --av-ink: 30%;
  --shadow: var(--shadow-1);
  --shadow-lg: var(--shadow-3);
  --scrim: rgba(10, 8, 18, 0.42);
  --glass: var(--glass-strong);
  --f-display: "Bricolage Grotesque", var(--font-ui), system-ui, sans-serif;
  --f-body: var(--font-ui), system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
:root[data-theme="dark"] { --av-l: 30%; --av-ink: 86%; --scrim: rgba(0, 0, 0, 0.58); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--f-body); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { margin: 0; }
.ic { width: 18px; height: 18px; flex: none; stroke-width: 2; }
.muted { color: var(--text-3); }
.small { font-size: 13.5px; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Header + tabs */
.top { position: sticky; top: 0; padding-top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 10px; padding-block: 10px; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex: none; }
.home { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; min-width: 0; text-align: left; }
.home b { font-family: var(--f-display); font-size: 19px; font-weight: 800; display: block; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home small { display: flex; align-items: center; gap: 2px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.home small .ic { width: 14px; height: 14px; }
.demo { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--surface); border: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--text-3); flex: none; }
.demo select { border: 0; background: var(--surface-3); border-radius: 999px; padding: 5px 8px; font-weight: 700; color: var(--text); font-size: 13.5px; }
.tabs { display: flex; gap: 4px; padding-bottom: 8px; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; font-weight: 700; color: var(--text-2); }
.tabs button:hover { background: var(--surface-3); }
.tabs button[aria-current="page"] { background: var(--text); color: var(--bg); }
@media (max-width: 640px) {
  .demo span.lbl { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px max(10px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)); justify-content: space-around; margin: 0; max-width: none; }
  .tabs button { flex: 1; flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 12px; }
  .tabs button[aria-current="page"] { background: transparent; color: var(--accent-ink); }
  .tabs button .ic { width: 22px; height: 22px; }
}

main { padding-block: 20px 32px; }
@media (max-width: 640px) { body.has-tabs main { padding-bottom: 112px; } }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: minmax(0, 1fr); } .cols .first-on-phone { order: -1; } }
.stack-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { font-size: 21px; }
.card-h p { margin-top: 3px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 8px 15px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 14.5px; white-space: nowrap; transition: background .15s, filter .15s; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { min-height: 36px; padding: 6px 11px; font-size: 13.5px; border-radius: 9px; }
.btn.danger { color: var(--busy-ink); }
.btn.danger.armed { background: var(--busy); border-color: var(--busy); color: #fff; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); padding: 0; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.choice { display: flex; gap: 6px; flex-wrap: wrap; }
.choice button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 14px; color: var(--text-2); }
.choice button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* Avatars */
.av { --h: 24; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; background: hsl(var(--h) 60% var(--av-l)); color: hsl(var(--h) 55% var(--av-ink)); flex: none; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av.ghost { opacity: .45; }
.avs { display: inline-flex; }
.avs .av { box-shadow: 0 0 0 2px var(--surface); }
.avs .av + .av { margin-left: -8px; }

/* Find a date */
.results { display: flex; flex-direction: column; gap: 10px; }
.result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 14px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.result .when { font-family: var(--f-display); font-weight: 800; font-size: 18px; }
.result .count { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--free-ink); margin-top: 4px; }
.result .note { grid-column: 1 / -1; font-size: 13px; color: var(--text-3); }
.result.top { background: var(--free-soft); border-color: transparent; }
.rank { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-ink); }

.card.active { box-shadow: var(--shadow), 0 0 0 2px var(--accent); }
.oncal { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 9px; border-radius: 999px; }
.oncal .ic { width: 14px; height: 14px; }
.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fd-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.fd-row > span:first-child { min-width: 34px; color: var(--text-2); }
.fd-row select { min-height: 40px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); font-weight: 600; }

/* Month grid */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.month-nav h2 { font-size: 22px; }
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 4px; }
.wk span { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); text-align: center; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.blankcell { min-height: 72px; }
.day { position: relative; min-height: 72px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px; border-radius: 10px; border: 0; text-align: left; color: var(--text); background: color-mix(in oklab, var(--free) calc(var(--heat, 0) * 50%), var(--surface)); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.day:hover { box-shadow: inset 0 0 0 2px var(--line-strong); }
.day:active { filter: brightness(.96); }
.day .dn { font-size: 12.5px; font-weight: 700; color: var(--text-2); line-height: 1; }
.day.today .dn { color: var(--accent-ink); }
.day.today::before { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.day .num { font-family: var(--f-display); font-weight: 800; font-size: 22px; line-height: 1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.day .num small { font-size: 12px; font-weight: 600; color: var(--text-3); }
.day.all { box-shadow: inset 0 0 0 2px var(--free); }
.day.all .num { color: var(--free-ink); }
.day.past { opacity: .4; }
.day .bar { margin-top: auto; height: 6px; border-radius: 4px; background: var(--pc); }
.day .lbl { font-size: 11.5px; font-weight: 700; line-height: 1.25; margin-top: 4px; overflow-wrap: anywhere; }
.grid.big .day, .grid.big + .x, .grid.big .blankcell { min-height: 96px; }
.grid.big .day { padding: 8px; }
.grid.big .dn { font-size: 14px; }
.grid.big .lbl { font-size: 13px; }
.grid.big .day { overflow: hidden; }
.grid.big .day.changed::after { position: static; margin-top: auto; padding-top: 4px; }
.wrap.wide { max-width: 1320px; }
.week-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .week-cols { grid-template-columns: minmax(0, 1fr); } }
.day.k-work { background: var(--surface); }
.day.k-work .lbl { color: var(--work); }
.day.k-free { background: var(--free-soft); } .day.k-free .lbl { color: var(--free-ink); }
.day.k-custom { background: color-mix(in oklab, var(--free) 8%, var(--surface)); } .day.k-custom .lbl { color: var(--free-ink); }
.day.k-busy { background: var(--busy-soft); } .day.k-busy .lbl { color: var(--busy-ink); }
.day.k-maybe { background: var(--maybe-soft); } .day.k-maybe .lbl { color: var(--maybe-ink); }
.day.k-unknown { background: var(--surface); } .day.k-unknown .lbl { color: var(--text-3); }
.day.changed { box-shadow: inset 0 0 0 2px var(--accent); }
.day.changed::after { content: "Changed"; position: absolute; bottom: 5px; right: 6px; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-ink); }
.key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--text-3); align-items: center; }
.key i { display: inline-block; width: 14px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 640px) {
  .card { padding: 14px; border-radius: 14px; }
  .grid, .wk { gap: 3px; }
  .day, .blankcell { min-height: 60px; }
  .day { padding: 4px 5px; border-radius: 8px; }
  .day .num { font-size: 19px; }
  .day .num small { display: none; }
  .day .lbl { font-size: 10.5px; }
  .grid.big .day, .grid.big .blankcell { min-height: 78px; }
  .grid.big .day { padding: 5px; }
  .grid.big .lbl { font-size: 10.5px; }
  .grid.big .day.changed::after { position: absolute; margin: 0; padding: 0; }
  .day.changed::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); bottom: 5px; right: 5px; }
}

/* My week */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.preset { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; border-radius: 13px; border: 1.5px solid var(--line-strong); background: var(--surface-2); }
.preset:hover { border-color: var(--accent); }
.preset b { font-size: 15px; }
.preset span { font-size: 13px; color: var(--text-3); }
.wrows { display: flex; flex-direction: column; }
.wrow { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px 12px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.wbody { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.block { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.block select { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); font-weight: 600; }
.next { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 9px; border-radius: 999px; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 9px; }
.carry { font-size: 13px; color: var(--text-3); }
.wrow:first-child { border-top: 0; }
.wday { font-family: var(--f-display); font-weight: 800; font-size: 17px; padding-top: 8px; }
.wctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wctl select { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); font-weight: 600; }
.wctl .to { color: var(--text-3); font-weight: 600; }
.wrow .tl { grid-column: 2; }
.saved { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--free-ink); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.field input, .field textarea, .field select { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.field textarea { min-height: 76px; resize: vertical; }
.inline-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-field input { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); width: 140px; font-weight: 600; }
.changes { list-style: none; margin: 12px 0 0; padding: 0; }
.changes li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.changes li:first-child { border-top: 0; }
.changes b { display: block; }
.changes span { font-size: 13px; color: var(--text-3); }

/* Timeline bars (6 am to midnight) */
.tl { position: relative; height: 16px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.tl.unknown { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line-strong) 5px 6px); }
.tl.maybe { background: var(--maybe-soft); box-shadow: inset 0 0 0 1.5px var(--maybe); }
.tl.busy { background: var(--busy-soft); }
.tl i { position: absolute; top: 0; bottom: 0; }
.tl i.f { background: var(--free); }
.tl i.w { background: repeating-linear-gradient(135deg, var(--work) 0 3px, var(--work-soft) 3px 7px); }
.tl i.h { background: color-mix(in oklab, var(--free) calc(var(--heat) * 100%), var(--surface-3)); }
.tl i.best { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 4px; }
.axis { position: relative; height: 16px; font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3); margin-top: 4px; }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.axis span:first-child { transform: none; } .axis span:last-child { transform: translateX(-100%); }
.wrows + .axis { margin-left: 64px; }
.people + .axis { margin-left: 40px; }
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.legend-row i { display: inline-block; width: 16px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }

/* Sheet */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }
.scrim.opening { animation: fade .22s ease both; }
.sheet { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-right: env(safe-area-inset-right, 0px); }
.sheet.opening { animation: slideR .34s cubic-bezier(.2,.8,.2,1) both; }
.sheet-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { font-size: 23px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 18px calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 640px) {
  .sheet { top: auto; left: 0; width: 100%; max-height: 88%; border-radius: 20px 20px 0 0; padding-left: env(safe-area-inset-left, 0px); }
  .sheet.opening { animation-name: slideU; }
  .sheet::before { content: ""; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes slideR { from { transform: translateX(30px); opacity: 0; } }
@keyframes slideU { from { transform: translateY(40px); opacity: .4; } }
.sec-t { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 10px; }
.people { display: flex; flex-direction: column; gap: 12px; }
.person { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.person .nm { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.person .nm small { font-weight: 600; font-size: 12.5px; color: var(--text-3); text-align: right; }
.person .tl { grid-column: 2; }
.callout { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.callout.good { background: var(--free-soft); }
.mine { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--accent); background: color-mix(in oklab, var(--accent) 5%, var(--surface)); }
.mine .now { font-size: 14px; }
.between { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.between select { min-height: 40px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; }

/* Vertical day view: time runs down, one column per person */
.dv { --hp: 28px; }
.dv-head, .dv-body { display: grid; grid-template-columns: 40px repeat(var(--cols), minmax(0, 1fr)); gap: 4px; }
.dv-head { position: sticky; top: -16px; z-index: 2; background: var(--surface); padding: 8px 0 8px; }
.dv-h { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; min-width: 0; }
.dv-h b { font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-h small { font-size: 10.5px; font-weight: 800; line-height: 1.15; }
.dv-all { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.dv-all .ic { width: 16px; height: 16px; }
.dv-body { height: calc(var(--rows) * var(--hp)); }
.dv-times { position: relative; font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3); }
.dv-times span { position: absolute; right: 4px; transform: translateY(-50%); white-space: nowrap; }
.dv-times span:first-child { transform: none; }
.dv-times span:last-child { transform: translateY(-100%); }
.dv-col { position: relative; border-radius: 8px; background-color: var(--surface-2); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% calc(100% / var(--rows)); overflow: hidden; }
.dv-col i { position: absolute; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: center; }
.dv-col i span { font-size: 10.5px; font-weight: 800; padding: 4px 2px 0; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.dv-col i.f { background: var(--free-soft); box-shadow: inset 3px 0 0 var(--free); }
.dv-col i.f span { color: var(--free-ink); }
.dv-col i.w { background: repeating-linear-gradient(135deg, var(--work-soft) 0 4px, transparent 4px 8px), var(--surface-3); box-shadow: inset 3px 0 0 var(--work); }
.dv-col i.w span { color: var(--text-2); }
.dv-col i.whole { top: 0; bottom: 0; align-items: center; }
.dv-col i.whole span { writing-mode: vertical-rl; transform: rotate(180deg); padding: 0; font-size: 12px; letter-spacing: 0.04em; }
.dv-col i.whole.busy { background: var(--busy-soft); } .dv-col i.whole.busy span { color: var(--busy-ink); }
.dv-col i.whole.maybe { background: var(--maybe-soft); } .dv-col i.whole.maybe span { color: var(--maybe-ink); }
.dv-col i.whole.unknown { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--line-strong) 6px 7px); } .dv-col i.whole.unknown span { color: var(--text-3); }
.dv-col.all i.h { background: color-mix(in oklab, var(--free) calc(var(--heat) * 80%), transparent); }
.dv-col.all i.best { box-shadow: inset 0 0 0 2.5px var(--accent); border-radius: 7px; z-index: 1; }
.dv-col.all i.best span { color: var(--accent-ink); }
.verdict.yes { color: var(--free-ink); } .verdict.maybe { color: var(--maybe-ink); } .verdict.no { color: var(--busy-ink); } .verdict.unknown { color: var(--text-3); }
.said { list-style: none; padding: 0; margin: 14px 0 0; font-size: 13.5px; display: flex; flex-direction: column; gap: 5px; color: var(--text-2); }
.dv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 640px) {
  .dv { --hp: 24px; }
  .dv-head, .dv-body { grid-template-columns: 32px repeat(var(--cols), minmax(0, 1fr)); gap: 3px; }
  .dv-h small { display: none; }
  .dv-h .av, .dv-all { width: 26px; height: 26px; font-size: 11px; }
  .dv-col i span { font-size: 9.5px; }
}

/* Plan form: live availability */
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.avail { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
.avail-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.avail-h b { font-family: var(--f-display); font-size: 18px; }
.avail-h.all b { color: var(--free-ink); }
.wl { display: flex; flex-direction: column; }
.wl-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.wl-row:first-child { border-top: 0; }
.wl-row b { display: block; font-size: 14px; }
.wl-row small { display: block; font-size: 12.5px; color: var(--text-3); }
.wl-row .verdict { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.sugg { display: flex; flex-direction: column; gap: 8px; }
.sugg .choice button { min-height: 38px; font-size: 13.5px; }
.sugg .choice button b { color: var(--free-ink); }

/* Modal */
.modal { position: fixed; z-index: 51; inset: 0; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.scrim.top { z-index: 50; }
.dialog { pointer-events: auto; width: min(600px, 100%); max-height: calc(100% - 20px); overflow-y: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); }
.dialog.opening { animation: pop .28s cubic-bezier(.2,.8,.2,1) both; }
.dialog .sheet-h { border-bottom: 0; padding-bottom: 0; }
.dialog form { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.err { color: var(--busy-ink); font-size: 13.5px; font-weight: 700; }
.actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Plans */
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-card { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px 14px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); text-align: left; width: 100%; overflow: hidden; }
.plan-card .stripe { align-self: stretch; background: var(--pc); }
.plan-card b { display: block; font-family: var(--f-display); font-size: 18px; font-weight: 800; }
.plan-card .d { font-size: 13.5px; color: var(--text-3); }
.back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 0; color: var(--text-2); font-weight: 700; margin-bottom: 10px; }
.plan-hero { position: relative; padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 18px; }
.plan-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--pc); }
.plan-hero h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.05; margin: 8px 0 10px; }
.meta { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--text-2); font-weight: 600; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; background: color-mix(in oklab, var(--pc) 16%, var(--surface)); color: var(--pc); }
.notes { margin-top: 12px; color: var(--text-2); max-width: 65ch; }
.daytabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 6px; }
.daytabs button { flex: none; border: 1.5px solid var(--line); background: var(--surface-2); border-radius: 11px; padding: 7px 12px; text-align: left; }
.daytabs button b { display: block; font-size: 14px; }
.daytabs button span { font-size: 12px; color: var(--text-3); }
.daytabs button[aria-pressed="true"] { border-color: var(--pc); background: color-mix(in oklab, var(--pc) 12%, var(--surface)); }
.itin { list-style: none; margin: 8px 0 0; padding: 0; }
.itin li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.itin li:first-child { border-top: 0; }
.itin .t { font-family: var(--f-mono); font-size: 13px; color: var(--text-2); }
.itin .x { overflow-wrap: anywhere; font-weight: 600; }
.ctl { display: flex; gap: 2px; }
.ctl button { width: 38px; height: 38px; border: 0; background: none; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); padding: 0; }
.ctl button:hover { background: var(--surface-3); color: var(--text); }
.ctl button:disabled { opacity: .3; cursor: not-allowed; }
.addrow { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
.addrow input, .addrow select { min-height: 42px; padding: 8px 11px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface-2); min-width: 0; }
.addrow.chk { grid-template-columns: minmax(0, 1fr) 130px auto; }
@media (max-width: 520px) { .addrow, .addrow.chk { grid-template-columns: minmax(0, 1fr) auto; } .addrow > :first-child { grid-column: 1 / -1; } }
.rsvp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.rsvp button { min-height: 44px; border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6px; }
.rsvp button[aria-pressed="true"].going { border-color: var(--free); background: var(--free-soft); color: var(--free-ink); }
.rsvp button[aria-pressed="true"].maybe { border-color: var(--maybe); background: var(--maybe-soft); color: var(--maybe-ink); }
.rsvp button[aria-pressed="true"].no { border-color: var(--busy); background: var(--busy-soft); color: var(--busy-ink); }
.rows { display: flex; flex-direction: column; gap: 9px; }
.rows > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 14px; }
.rows .lab { font-weight: 700; color: var(--text-2); }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; }
.progress i { display: block; height: 100%; background: var(--free); }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--free); margin: 0; }
.checks li.done .tx { text-decoration: line-through; color: var(--text-3); }
.checks select { border: 0; background: var(--surface-2); border-radius: 8px; padding: 6px; font-size: 13px; font-weight: 600; max-width: 104px; min-height: 36px; }
.empty { padding: 16px; border-radius: 12px; border: 1px dashed var(--line-strong); color: var(--text-3); font-size: 14px; text-align: center; }

/* Circles */
.page-h { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-h h1 { font-size: clamp(30px, 5vw, 40px); }
.circles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.circle { display: flex; flex-direction: column; gap: 12px; padding: 18px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }
.circle:hover { border-color: var(--line-strong); }
.circle h2 { font-size: 24px; }
.circle .facts { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.circle .facts span { display: flex; align-items: center; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); animation: toastIn .32s cubic-bezier(.2,.8,.2,1); }
@media (max-width: 640px) { .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
/* Header tools */
.top-main { min-width: 0; display: flex; }
.top-tools { display: flex; align-items: center; gap: 8px; }
.save-state { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.save-state.saving::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; animation: pulse 1s ease-in-out infinite; }
.save-state.saved { color: var(--free-ink); animation: fadeAway 2.6s ease forwards; }
.save-state.error { color: var(--busy-ink); }
.top-in .btn-theme-toggle, .top-in .zauth-chip { flex: none; }
.foot { text-align: center; font-size: 12.5px; color: var(--text-3); padding: 0 16px 28px; }
@media (max-width: 640px) {
  .save-state.saving, .save-state.saved { font-size: 0; }
  .save-state.saving::before { margin: 0; }
  .top-tools .icon-btn { width: 38px; height: 38px; }
  body.has-tabs .foot { padding-bottom: 100px; }
}

/* New circle + settings */
.dbody { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-radius: 999px; background: var(--surface-3); font-weight: 600; font-size: 14px; animation: pop .22s ease both; }
.chip .av { width: 24px; height: 24px; font-size: 10px; }
.chip button { border: 0; background: none; padding: 2px; display: grid; color: var(--text-3); }
.chip button .ic { width: 15px; height: 15px; }
.addline { display: flex; gap: 8px; }
.addline input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.people-edit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.people-edit li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.people-edit input { min-height: 40px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; min-width: 0; }
.people-edit .you { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 9px; border-radius: 999px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in oklab, var(--busy) 30%, transparent); }
.danger-zone b, .danger-zone span { display: block; }

/* Empty and loading */
.hero-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 40px 24px; max-width: 560px; margin: 10px auto; }
.hero-empty p { max-width: 46ch; }
.logo.big { width: 56px; height: 56px; border-radius: 16px; }
.logo.big .ic { width: 28px; height: 28px; }
.private-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; text-align: center; }
.private-note .ic { width: 15px; height: 15px; }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.card-skel { height: 170px; border-radius: 18px; }

/* Motion: things move when they come into view (a new screen, a sheet opening, a new month or plan type),
   never on an ordinary edit. All of it switches off under prefers-reduced-motion. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes cellIn { from { opacity: 0; transform: scale(.9); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes growX { from { transform: scaleX(0); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pulse { 50% { opacity: .35; transform: scale(.75); } }
@keyframes fadeAway { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } }
#view.enter .card, #view.enter .circle, #view.enter .plan-card, #view.enter .plan-hero, #view.enter .page-h, #view.enter .back { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 55ms); }
#view.enter .tl i, #view.enter .progress i { animation: growX .7s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; animation-delay: .18s; }
.grid.refresh .day { animation: cellIn .4s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--k, 0) * 9ms); }
.results.refresh .result { animation: rise .42s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 60ms + 80ms); }
.sheet.opening .dv-col i { animation: grow .55s cubic-bezier(.2,.8,.2,1) both; transform-origin: top; animation-delay: calc(var(--c, 0) * 45ms + 140ms); }
.sheet.opening .mine, .sheet.opening .callout { animation: rise .4s cubic-bezier(.2,.8,.2,1) both; animation-delay: .08s; }
#pf-avail .wl-row { animation: fadeIn .25s ease both; }
.day { transition: box-shadow .15s, transform .15s, filter .15s; }
.day:not(.past):hover { transform: translateY(-1px); }
.choice button, .tabs button, .daytabs button, .rsvp button { transition: background .18s, border-color .18s, color .18s, transform .12s; }
.choice button:active, .tabs button:active, .rsvp button:active { transform: scale(.96); }
.plan-card, .circle { transition: transform .18s, border-color .18s, box-shadow .18s; }
.plan-card:hover, .circle:hover { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Focus lands on the page itself when the thing that had it is gone: no ring around the whole screen */
#view:focus-visible { outline: none !important; }
