/* ============ Tokens ============ */
:root {
  color-scheme: light;
  --frame: #ebe9e3;
  --nav-hover: rgba(20, 20, 30, 0.055);
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f3f2ed;
  --surface-3: #e9e7e0;
  --ink: #16171b;
  --ink-2: #3d414a;
  --muted: #6c707a;
  --line: #e4e2db;
  --line-2: #d3d1c9;
  --accent: #4f46e5;
  --accent-2: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --ok: #15803d;
  --ok-cell: #34c26b;
  --ok-soft: #dcfce7;
  --maybe: #b45309;
  --maybe-cell: #f5b53d;
  --maybe-soft: #fef3c7;
  --no: #d92d34;
  --no-soft: #fde8e8;
  --heat: 21 163 74;
  --decision: #0f766e;
  --decision-soft: #e6f6f3;
  --question: #7c3aed;
  --question-soft: #f3edff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.04), 0 6px 24px rgba(20, 20, 30, 0.05);
  --shadow-lg: 0 20px 60px rgba(15, 15, 25, 0.18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --frame: #090a0c;
    --nav-hover: rgba(255, 255, 255, 0.06);
    --bg: #111317;
    --surface: #181a20;
    --surface-2: #1c1f25;
    --surface-3: #262a32;
    --ink: #eef0f3;
    --ink-2: #c6cad2;
    --muted: #8c929d;
    --line: #2a2e36;
    --line-2: #383d47;
    --accent: #8b85ff;
    --accent-2: #a39eff;
    --accent-ink: #0e0f12;
    --accent-soft: #24234a;
    --ok: #4ade80;
    --ok-cell: #2fb463;
    --ok-soft: #133524;
    --maybe: #fbbf24;
    --maybe-cell: #d99a1c;
    --maybe-soft: #3a2c0d;
    --no: #f87171;
    --no-soft: #3b1618;
    --heat: 52 211 120;
    --decision: #5eead4;
    --decision-soft: #12302c;
    --question: #c4b5fd;
    --question-soft: #2a2145;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  }
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--frame);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; display: inline-block; vertical-align: -0.15em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.good { color: var(--ok); }
.warn { color: var(--maybe); }
.grow { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
[hidden] { display: none !important; }

/* ============ Buttons & inputs ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 550; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
  text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--ink-2); }
.btn-danger { background: var(--no); border-color: var(--no); color: #fff; }
.btn-danger:disabled { opacity: .45; }
.btn-danger-soft { background: var(--no-soft); border-color: transparent; color: var(--no); }
.btn-danger-soft:hover { background: color-mix(in srgb, var(--no) 22%, transparent); }
.danger-text, .menu button.danger-text { color: var(--no); }
.danger-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.dl-first { justify-self: start; margin-bottom: 4px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 16px; border-radius: 12px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn.danger:hover { background: var(--no-soft); color: var(--no); }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-weight: 550; text-align: left; }
.link-btn:hover { text-decoration: underline; }

.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { padding-right: 28px; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input-sm { height: 32px; font-size: 13px; padding: 0 9px; border-radius: 8px; }
.input-lg { height: 48px; font-size: 16px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0 4px; font-size: 14px; cursor: pointer; }
.check input, input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex: none; }
.form-error { color: var(--no); font-size: 13px; margin-top: 8px; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); transition: background .15s ease, color .15s ease;
  font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.seg-sm .seg-btn { height: 28px; padding: 0 10px; font-size: 12.5px; }
.seg-btn.b-ok.on { color: var(--ok); }
.seg-btn.b-maybe.on { color: var(--maybe); }
.seg-btn.b-no.on { color: var(--no); }
.seg-btn.p-love.on { color: #e11d48; }
.seg-btn.p-ok.on { color: var(--ok); }
.seg-btn.p-no.on { color: var(--no); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px;
  background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill-good { background: var(--ok-soft); color: var(--ok); }
.pill-live { background: var(--no-soft); color: var(--no); }
.pill-sealed { background: var(--accent-soft); color: var(--accent); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; font-weight: 550; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--no); box-shadow: 0 0 0 0 rgba(217,45,52,.5); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(217,45,52,.45); } 70% { box-shadow: 0 0 0 7px rgba(217,45,52,0); } 100% { box-shadow: 0 0 0 0 rgba(217,45,52,0); } }

.avatar {
  display: inline-grid; place-items: center; border-radius: 50%; flex: none;
  background: var(--c); color: #fff; font-weight: 650; letter-spacing: .02em;
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar.ok { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ok-cell); }
.avatar.maybe { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--maybe-cell); }
.avatar.no { opacity: .35; filter: grayscale(1); }
.avatar.none { opacity: .35; outline: 1.5px dashed var(--muted); outline-offset: 1px; background: var(--surface-3); color: var(--muted); }
.avatar.online { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ok-cell); }
.people { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.section-head { display: flex; gap: 12px 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.info { position: relative; display: inline-flex; vertical-align: middle; font-weight: 400; }
.info-btn { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font: italic 700 11px/1 Georgia, "Times New Roman", serif; cursor: help; transition: color .15s, border-color .15s; }
.info-btn:hover, .info.open .info-btn { color: var(--accent); border-color: var(--accent); }
.info-pop { position: fixed; z-index: 120; left: 0; top: 0; width: max-content; max-width: min(300px, calc(100vw - 16px)); padding: 10px 12px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 500; font-style: normal; line-height: 1.5; letter-spacing: 0; text-transform: none; text-align: left; white-space: normal; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s ease, visibility .15s; }
.info-pop a { color: inherit; text-decoration: underline; }
.info-pop ol, .info-pop ul { margin: 4px 0 0; padding-left: 18px; }
.info.hover .info-pop, .info.open .info-pop { opacity: 1; visibility: visible; pointer-events: auto; }
.section-sub { font-size: 13.5px; margin-top: 3px; max-width: 62ch; }
.section-head > div:first-child { min-width: 0; }
.section-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.eyebrow { font-size: 12.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.eyebrow.live { color: var(--no); }
.banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px;
  background: var(--maybe-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--maybe-cell) 35%, transparent); font-size: 14px;
}
.banner > span { flex: 1; min-width: 180px; }
.banner.subtle { background: var(--surface-2); border-color: var(--line); }
.banner.warn { background: var(--no-soft); border-color: transparent; }
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 28px 12px; }
.empty-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.empty-title { font-weight: 650; font-size: 16px; }
.empty .muted { max-width: 46ch; }
.empty > :last-child:not(p) { margin-top: 10px; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.notfound { max-width: 520px; margin: 18vh auto; padding: 0 16px; display: grid; gap: 12px; justify-items: start; }

/* ============ Brand & chrome ============ */
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; text-decoration: none !important; }
.brand-mark { position: relative; width: 26px; height: 18px; flex: none; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; top: 0; width: 18px; height: 18px; border-radius: 50%; }
.brand-mark::before { left: 0; background: var(--accent); }
.brand-mark::after { right: 0; background: #22c55e; mix-blend-mode: multiply; opacity: .9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-mark::after { mix-blend-mode: screen; } }

.shell { display: grid; grid-template-columns: clamp(232px, 14vw, 296px) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 2px; padding: 14px 12px 12px; overflow-y: auto; scrollbar-width: thin; }
.side-head { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 8px; margin-bottom: 8px; }
.side-close { display: none; }
.side-team { display: flex; align-items: center; gap: 9px; padding: 9px 11px; margin-bottom: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.side-team span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-team-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--accent); flex: none; }
.side-nav { display: grid; gap: 2px; }
.side-section { font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 16px 11px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 11px; border-radius: 11px; color: var(--ink-2); font-weight: 550; font-size: 14px; text-decoration: none !important; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.nav-item .icon { color: var(--muted); transition: color .15s ease; }
.nav-item:hover { background: var(--nav-hover); color: var(--ink); }
.nav-item.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 0 0 1px var(--line); }
.nav-item.on .icon { color: var(--accent); }
.nav-label { flex: 1; }
.side-next { display: grid; gap: 1px; padding: 11px 13px; margin: 10px 0 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; transition: border-color .15s ease, transform .15s ease; }
.side-next:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.side-next-label { font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.conn { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 550; padding: 6px 12px; }
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.conn.on .dot { background: var(--ok-cell); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok-cell) 25%, transparent); }
.me-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; text-align: left; transition: background .15s ease; }
.me-chip:hover { background: var(--nav-hover); }
.me-text { flex: 1; display: grid; min-width: 0; line-height: 1.25; }
.me-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel { padding: 8px 8px 8px 0; min-width: 0; }
.main { min-height: calc(100vh - 16px); min-height: calc(100dvh - 16px); background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 2.2vw, 40px) clamp(20px, 2.6vw, 48px) 96px; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.main > * { max-width: clamp(1180px, 72vw, 1640px); margin-left: auto; margin-right: auto; }
.mobilebar, .scrim { display: none; }

/* ============ Toasts & modals ============ */
.toasts { position: fixed; z-index: 100; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; transition: opacity .3s, transform .3s; }
.toast-error { background: var(--no); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(10, 10, 15, .45); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal-wide { max-width: 640px; }
.modal-title { font-size: 20px; font-weight: 650; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 14px 0 6px; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 550; text-align: left; }
.who:hover { border-color: var(--accent); background: var(--accent-soft); }
.who.on { border-color: var(--accent); }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-new .row .input { flex: 1; min-width: 160px; }

/* ============ Sign in, setup, invites ============ */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 28px 24px; display: grid; gap: 4px; }
.auth-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; margin-bottom: 18px; }
.auth-title { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; margin: 2px 0 6px; }
.auth-go { width: 100%; margin-top: 16px; }
.auth-go + p { margin-top: 14px; }
.auth-help { margin-top: 14px; font-size: 14px; }
.auth-help summary { cursor: pointer; color: var(--muted); font-weight: 550; }
.auth-help p { margin-top: 8px; }
.auth-card .form-error { margin-top: 10px; }
.auth-card .label:first-of-type { margin-top: 6px; }
.choose-label { color: var(--ink-2); margin: 4px 0 2px; }

.pin { position: relative; display: flex; gap: 8px; margin: 16px 0 4px; flex-wrap: nowrap; }
.pin-boxes { display: contents; }
.pin-box {
  flex: 1 1 0; min-width: 0; max-width: 46px; height: 56px; border-radius: 12px; display: grid; place-items: center;
  border: 1.5px solid var(--line-2); background: var(--surface); font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.pin-box.fixed { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.pin-box.filled { border-color: var(--ink-2); }
.pin-box.optional { border-style: dashed; opacity: .55; }
.pin-box.next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pin-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; cursor: text; caret-color: transparent; }
.pin.bad { animation: shake .35s; }
.pin.bad .pin-box:not(.fixed) { border-color: var(--no); }
.pin.busy { opacity: .6; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (max-width: 400px) { .pin { gap: 6px; } .pin-box { height: 50px; font-size: 21px; } }

.code-reveal { margin: 10px 0 6px; padding: 18px; border-radius: 14px; background: var(--surface-2); text-align: center; display: grid; gap: 6px; }
.code-digits { display: flex; justify-content: center; gap: 6px; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.code-digits span { min-width: 30px; }
.code-digits .slot { color: var(--accent); }
.recovery { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.recovery h2 { font-size: 15px; display: flex; align-items: center; gap: 7px; }
.recovery-key { padding: 12px; border-radius: 10px; background: var(--surface-2); font-size: 18px; text-align: center; letter-spacing: .06em; user-select: all; }
.auth-in-modal .pin { margin-top: 10px; }

.menu { position: fixed; z-index: 90; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; animation: rise .14s ease-out; }
.menu-head { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.menu button { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 9px; background: none; cursor: pointer; text-align: left; font-weight: 550; font-size: 14px; }
.menu button:hover { background: var(--surface-2); }

.slot-badge { display: inline-grid; place-items: center; min-width: 40px; height: 24px; padding: 0 7px; border-radius: 7px; background: var(--surface-3); color: var(--ink-2); font-weight: 650; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.slot-badge.big { min-width: 32px; height: 32px; font-size: 16px; background: var(--accent-soft); color: var(--accent); }
.pill.tiny { height: 18px; font-size: 11px; margin-left: 6px; vertical-align: 1px; }
.admin-list { display: grid; }
.admin-row { display: grid; grid-template-columns: 32px 32px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.admin-row:first-child { border-top: 0; }
.admin-main { display: grid; min-width: 0; }
.admin-actions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.add-person { margin-top: 14px; }
.audit { list-style: none; margin: 0; padding: 0; display: grid; font-size: 14px; max-height: 360px; overflow: auto; }
.audit li { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.audit li.bad span:last-child { color: var(--no); }
@media (max-width: 760px) {
  .admin-row { grid-template-columns: 32px 32px minmax(0, 1fr); }
  .admin-row > .pill, .admin-row > .admin-actions { grid-column: 3; justify-self: start; }
  .audit li { grid-template-columns: 1fr; gap: 0; }
}

/* ============ Plan ============ */
.hero-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 24px; align-items: end;
  background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%), var(--surface); }
.hero-title { font-size: clamp(26px, 4vw, 36px); font-weight: 700; letter-spacing: -0.03em; margin: 6px 0 8px; }
.hero-sub { color: var(--ink-2); margin-bottom: 12px; }
.hero-time { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 17px; font-weight: 550; color: var(--ink-2); }
.hero-time .sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 6px; }
.hero-people { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.att { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.att.good { color: var(--ok); }
.att.warn { color: var(--maybe); }
.warn-text { margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.hero-actions { display: grid; gap: 8px; min-width: 210px; }
.hero-actions .btn { justify-content: flex-start; }
.hero-suggest { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.hero-suggest > div { flex: 1; min-width: 200px; }

.weeks { display: grid; }
.week-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.week-row:first-child { border-top: 0; padding-top: 0; }
.week-label { display: grid; }
.week-what { display: grid; gap: 6px; min-width: 0; }
.week-what .pill { margin-left: 8px; }
.week-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; font-weight: 550; }
.week-row.cancelled, .week-row.done { opacity: .7; }
.better { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }

.best-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.sugg { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.sugg-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--line); }
.sugg-item.top { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.rank { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.sugg-item.top .rank { background: var(--accent); color: var(--accent-ink); }
.sugg-when { font-weight: 650; font-size: 15px; }
.sugg-main { display: grid; gap: 4px; min-width: 0; }
.sugg-people { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 600; margin-top: 2px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex: none; }
.sw.ok { background: var(--ok-cell); }
.sw.maybe { background: var(--maybe-cell); }
.sw.no { background: var(--surface-3); opacity: .9; outline: 1px solid var(--line-2); }
.sw.none { border: 1.5px dashed var(--muted); }

.heat { display: grid; gap: 2px; font-size: 11.5px; user-select: none; }
.heat-day { text-align: center; font-weight: 650; color: var(--ink-2); padding-bottom: 4px; white-space: nowrap; overflow: hidden; }
.heat-time { color: var(--muted); padding-right: 6px; text-align: right; line-height: 1; transform: translateY(-5px); white-space: nowrap; font-variant-numeric: tabular-nums; }
.heat-cell { height: 14px; border: 0; padding: 0; border-radius: 3px; cursor: pointer; background: rgb(var(--heat) / calc(var(--a) * .82 + .03)); }
.heat-cell:not([style*="--a: 0.000"]) { }
.heat-cell.all { background: rgb(var(--heat) / 1); }
.heat-cell.reg { box-shadow: inset 0 0 0 2px var(--ink); }
.heat-cell.top { outline: 2px solid var(--accent); outline-offset: -1px; }
.heat-cell.sel { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 2px var(--surface); transform: scale(1.06); }
.heat-cell:hover { filter: brightness(1.08); }
.heat-detail { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; display: grid; gap: 4px; min-height: 48px; }
.heat-line { display: flex; gap: 6px; align-items: baseline; }

/* ============ Role tags ============ */
.tag-violet { --tg: #6d28d9; --tb: #ede9fe; }
.tag-blue { --tg: #1d4ed8; --tb: #dbeafe; }
.tag-teal { --tg: #0f766e; --tb: #ccfbf1; }
.tag-green { --tg: #15803d; --tb: #dcfce7; }
.tag-lime { --tg: #4d7c0f; --tb: #ecfccb; }
.tag-amber { --tg: #b45309; --tb: #fef3c7; }
.tag-orange { --tg: #c2410c; --tb: #ffedd5; }
.tag-red { --tg: #b91c1c; --tb: #fee2e2; }
.tag-pink { --tg: #be185d; --tb: #fce7f3; }
.tag-slate { --tg: #334155; --tb: #e2e8f0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag-violet { --tg: #c4b5fd; --tb: rgba(139, 92, 246, .22); }
  :root:not([data-theme="light"]) .tag-blue { --tg: #93c5fd; --tb: rgba(59, 130, 246, .22); }
  :root:not([data-theme="light"]) .tag-teal { --tg: #5eead4; --tb: rgba(20, 184, 166, .2); }
  :root:not([data-theme="light"]) .tag-green { --tg: #86efac; --tb: rgba(34, 197, 94, .2); }
  :root:not([data-theme="light"]) .tag-lime { --tg: #bef264; --tb: rgba(132, 204, 22, .2); }
  :root:not([data-theme="light"]) .tag-amber { --tg: #fcd34d; --tb: rgba(245, 158, 11, .2); }
  :root:not([data-theme="light"]) .tag-orange { --tg: #fdba74; --tb: rgba(249, 115, 22, .2); }
  :root:not([data-theme="light"]) .tag-red { --tg: #fca5a5; --tb: rgba(239, 68, 68, .22); }
  :root:not([data-theme="light"]) .tag-pink { --tg: #f9a8d4; --tb: rgba(236, 72, 153, .2); }
  :root:not([data-theme="light"]) .tag-slate { --tg: #cbd5e1; --tb: rgba(148, 163, 184, .2); }
}
.tag-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 99px; color: var(--tg); background: var(--tb); font-size: 12px; font-weight: 650; white-space: nowrap; vertical-align: middle; }
.tag-chip.sm { height: 18px; padding: 0 7px; font-size: 11px; }
.name-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: var(--tg); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; transition: box-shadow .15s ease, transform .15s ease; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--tg); }
.quick-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.tag-preview { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }

/* ============ Dashboard to-dos ============ */
.dash-pair { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.todos { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.todo { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 9px 8px; border-radius: 12px; transition: background .15s ease; }
.todo:hover { background: var(--surface-2); }
.todo input { margin-top: 3px; }
.todo-main { display: grid; gap: 3px; min-width: 0; }
.todo-text { font-size: 14.5px; overflow-wrap: anywhere; }
.todo.done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rolled { display: inline-flex; align-items: center; gap: 4px; color: var(--maybe); font-weight: 600; }
.todo .icon-btn { width: 26px; height: 26px; opacity: 0; transition: opacity .12s; }
.todo:hover .icon-btn, .todo:focus-within .icon-btn { opacity: 1; }
@media (hover: none) { .todo .icon-btn { opacity: .6; } }
.todo-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.todo-add .input:first-child { flex: 1 1 200px; }
.todo-owner { width: auto; flex: 0 0 auto; }
.todo-empty { padding: 6px 2px; }
.todo-done { margin-top: 10px; }
.todo-done summary { cursor: pointer; padding: 4px 2px; }
@media (max-width: 1180px) { .dash-pair { grid-template-columns: minmax(0, 1fr); } }

/* ============ Account site (overlap.cx) ============ */
.auth-alt { width: 100%; margin-top: 10px; }
.auth-alt-link { display: block; margin: 14px auto 0; font-size: 14px; }
.auth-alt-link.emph { font-weight: 700; text-decoration: underline; }
.email-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; margin: 4px 0 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.email-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-gap { height: 10px; }
.pin-otp .pin-box { max-width: 52px; }
.code-actions { margin-top: 12px; }
.acct { min-height: 100vh; min-height: 100dvh; }
.acct-top { display: flex; align-items: center; gap: 12px; max-width: 1080px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left)); }
.acct-chip { width: auto; max-width: 240px; }
.acct-main { max-width: 1080px; margin: 0 auto; padding: 12px 16px 80px; }
.acct-title { font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -0.02em; margin: 12px 0 20px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.proj-card { display: grid; gap: 6px; align-content: start; padding: 18px; min-height: 148px; color: var(--ink); text-decoration: none !important; text-align: left; cursor: pointer; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; font: inherit; }
.proj-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.proj-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding-right: 36px; }
.proj-wrap { position: relative; display: grid; }
.proj-more { position: absolute; top: 12px; right: 12px; }
.proj-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 18px; }
.proj-name { font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.proj-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-new { place-items: center; place-content: center; text-align: center; border-style: dashed; background: transparent; box-shadow: none; color: var(--ink-2); }
.proj-plus { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); margin: 0 auto 6px; }
.slug-row { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); overflow: hidden; }
.slug-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.slug-prefix { padding: 0 2px 0 12px; font-size: 14px; white-space: nowrap; }
.slug-input { border: 0; box-shadow: none !important; padding-left: 2px; min-width: 0; flex: 1; }
.slug-input:focus { box-shadow: none; }
.slug-state { display: block; min-height: 18px; margin-top: 6px; }
.join-tools { margin-top: 10px; }

/* ============ Plan tab: the planning chat ============ */
.main:has(> .stack > .chat-layout) { padding-bottom: clamp(20px, 2.2vw, 40px); } /* the chat fills the window exactly */
.chat-layout { display: grid; }
.chat { --chat-h: calc(100dvh - 18px - 2 * clamp(20px, 2.2vw, 40px)); display: flex; flex-direction: column; height: var(--chat-h); min-height: 460px; padding: 18px 0 12px; overflow: hidden; }
.chat-head { padding: 0 20px; }
.chat-head .section-head { margin-bottom: 12px; align-items: center; }
.chat-head .section-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat-week { width: auto; }
.chat-here { display: inline-flex; align-items: center; gap: 6px; }
.chat-here-faces, .vote-faces { display: inline-flex; }
.chat-here-faces .avatar, .vote-faces .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.chat-here-faces .avatar:first-child, .vote-faces .avatar:first-child { margin-left: 0; }
.chat-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 10px; overscroll-behavior: contain; }
.chat-empty { padding: 36px 0; }
.chat-day { display: flex; align-items: center; gap: 12px; margin: 16px 8px 6px; font-size: 12px; font-weight: 650; color: var(--muted); }
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 6px 8px; border-radius: 10px; transition: background .15s var(--ease); }
.msg:not(.cont) { margin-top: 4px; }
.msg.cont { padding-top: 1px; }
.msg:hover, .msg.show-tools { background: var(--surface-2); }
.msg.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 45% { background: var(--accent-soft); } }
.msg-side { display: flex; justify-content: center; padding-top: 2px; }
.msg-hover-time { font-size: 10.5px; line-height: 22px; color: var(--muted); white-space: nowrap; opacity: 0; transition: opacity .12s var(--ease); }
.msg:hover .msg-hover-time { opacity: 1; }
.msg-main { min-width: 0; }
.msg-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; }
.msg-meta strong { font-size: 14px; }
.msg-text { font-size: 14.5px; overflow-wrap: anywhere; }
.msg-tools { position: absolute; top: 4px; right: 8px; display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; transform: translateY(2px); pointer-events: none; transition: opacity .12s var(--ease), transform .16s var(--ease); }
.msg:hover .msg-tools, .msg:focus-within .msg-tools, .msg.show-tools .msg-tools { opacity: 1; transform: none; pointer-events: auto; }
.msg-tools .icon-btn { width: 28px; height: 28px; }
.msg.editing .msg-tools { display: none; }
.msg-editing { display: grid; gap: 6px; margin-top: 4px; }
.msg-edit { min-height: 64px; }
.msg-quote { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 3px 0; padding: 2px 8px; border: 0; border-left: 2px solid var(--line-2); border-radius: 0 6px 6px 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.msg-quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.msg-quote:hover { background: var(--surface-3); }
.msg-quote.gone { cursor: default; font-style: italic; color: var(--muted); }
.reacts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.react { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease), transform .14s var(--ease); }
.react:hover:not(:disabled) { border-color: var(--line-2); }
.react:active:not(:disabled) { transform: scale(.94); }
.react.on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); color: var(--accent); }
.react:disabled { cursor: default; }
.react-emoji { font-size: 14px; line-height: 1; }
.react-pick { display: flex; gap: 2px; padding: 4px; min-width: 0; border-radius: 999px; }
.react-pick button { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; font-size: 19px; }
.react-pick button:hover { background: var(--surface-2); transform: scale(1.12); }
.proposal { display: grid; gap: 8px; max-width: 580px; margin-top: 6px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.proposal.is-set { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.proposal.passed { opacity: .72; }
.proposal-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proposal-when .icon { color: var(--accent); }
.proposal-fit, .proposal-votes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proposal-votes { gap: 6px; }
.vote-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .14s var(--ease); }
.vote-btn:hover:not(:disabled) { background: var(--surface-2); }
.vote-btn:active:not(:disabled) { transform: scale(.97); }
.vote-btn.yes.on { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.vote-btn.no.on { background: var(--no-soft); border-color: transparent; color: var(--no); }
.vote-btn:disabled { cursor: default; }
.vote-count { font-variant-numeric: tabular-nums; }
.chat-jump { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); cursor: pointer; animation: item-in .2s var(--ease); }
.chat .typing { padding: 2px 22px 0; min-height: 22px; }
.chat-foot { padding: 0 12px; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px 8px; margin-bottom: 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.reply-bar .reply-to { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-extras { align-items: center; gap: 4px 8px; padding: 0 2px; }
.propose-btn { color: var(--accent); }
.topic-toggle { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 8px; border-radius: 9px; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; transition: background .15s var(--ease), color .15s var(--ease); }
.topic-toggle:hover { background: var(--surface-2); }
.topic-toggle:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.topic-toggle input, .msg-topic input, .topic-loose input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.btn-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-3); color: var(--ink); font-size: 11px; font-weight: 700; }
.btn-primary .btn-count { background: color-mix(in srgb, var(--accent-ink) 22%, transparent); color: inherit; }
.msg-topic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: fit-content; max-width: 100%; margin-top: 6px; padding: 4px 10px 4px 8px; border-radius: 9px; background: var(--accent-soft); font-size: 13px; font-weight: 600; color: var(--accent); }
.msg-topic label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.msg-topic.done { background: var(--ok-soft); color: var(--ok); }
.msg-topic .link-btn { font-weight: 550; }
.topic-others { display: grid; }
.topic-loose { list-style: none; margin: 0 0 6px; padding: 0 8px; display: grid; gap: 2px; }
.topic-loose li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px; border-radius: 10px; }
.topic-loose li:hover { background: var(--surface-2); }
.topic-loose label { display: inline-flex; align-items: center; gap: 9px; min-width: 0; cursor: pointer; font-size: 14.5px; }
.chat-readonly { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.propose-quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.propose-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.propose > .input { margin-top: 14px; }

/* Overlap panel: read-only previews of the chat and to-discuss */
.chat-lines { display: grid; gap: 2px; }
.chat-line { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px; border-radius: 12px; color: var(--ink); text-decoration: none !important; transition: background .15s var(--ease); }
.chat-line:hover { background: var(--surface-2); }
.chat-line-main { display: grid; gap: 1px; min-width: 0; }
.chat-line-top { display: flex; gap: 8px; align-items: baseline; }
.chat-line-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 14px; }
.chat-line-text .icon { vertical-align: -2px; color: var(--accent); }
.todos.read .todo { grid-template-columns: auto minmax(0, 1fr); }
.todo-dot { width: 6px; height: 6px; margin: 8px 4px 0; border-radius: 50%; background: var(--line-2); }
.nav-badge { margin-left: auto; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; animation: pop-in .2s var(--ease); }
.nav-badge.inline { margin-left: 8px; font-size: 11px; vertical-align: 2px; }
.menu-btn { position: relative; }
.menu-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }

/* Times & places: side by side when there's room */
@media (min-width: 1360px) {
  .tp-layout { grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); align-items: start; }
  .tp-places { position: sticky; top: clamp(20px, 2.2vw, 40px); }
}
@media (max-width: 860px) {
  .main:has(> .stack > .chat-layout) { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  /* phone bar 56 + top border 1 + padding 18 + bottom padding 14 */
  .chat { --chat-h: calc(100dvh - 89px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 360px; padding-top: 14px; }
  .chat-head { padding: 0 12px; }
  /* the phone bar already says "Plan": one compact row of tools instead */
  .chat-head .section-head { margin-bottom: 8px; }
  .chat-head .section-head > div:first-child { display: none; }
  .chat-head .section-actions { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .chat-head .lbl, .chat-here .muted { display: none; }
  .chat-head .chat-week { flex: 1 1 auto; min-width: 0; }
  .chat-scroll { padding: 4px 6px 8px; }
  .msg { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 6px; }
  .msg-tools { right: 6px; }
  .propose-row { grid-template-columns: minmax(0, 1fr); }
}
.set-meeting .day-pick small { color: inherit; opacity: .7; font-weight: 500; }
.set-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; font-weight: 550; }

/* ============ Availability painter ============ */
.grid-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 14px; }
.save-status { margin-left: 4px; }
.paint { display: grid; gap: 3px; user-select: none; touch-action: pan-y; -webkit-user-select: none; -webkit-touch-callout: none; }
.paint.ro { opacity: .55; pointer-events: none; }
.paint-day { text-align: center; font-size: 13px; padding-bottom: 6px; display: grid; line-height: 1.2; }
.paint-day small { color: var(--muted); font-size: 11.5px; }
.paint-time { font-size: 11.5px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pc { height: 22px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); cursor: crosshair; transition: background .08s; }
.pc.hour { border-top-color: var(--line-2); }
.pc.v2 { background: var(--ok-cell); border-color: transparent; }
.pc.v1 { background: repeating-linear-gradient(-45deg, var(--maybe-cell) 0 6px, color-mix(in srgb, var(--maybe-cell) 70%, var(--surface)) 6px 10px); border-color: transparent; }
.pc.painting { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 35%, transparent); }
/* A class from your imported timetable: always busy, can't be painted. */
.pc.cls { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--ink-2) 22%, var(--surface-2)) 0 3px, var(--surface-2) 3px 7px); border-color: color-mix(in srgb, var(--ink-2) 30%, transparent); cursor: not-allowed; }
.cal-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0 12px; }
.cal-row:empty { display: none; }
.cal-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; min-width: 0; }
.cal-chip.warn { color: var(--no); }
.cal-error { flex-basis: 100%; margin: 2px 0 0; color: var(--no); }
.cal-classes { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 2px; }
.cal-classes li { display: grid; grid-template-columns: 2.6em max-content minmax(0, 1fr); gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cal-classes li > span:nth-child(2) { white-space: nowrap; }
.cal-classes li > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-import .modal-actions { flex-wrap: wrap; }
.paint-wrap .hint { margin-top: 14px; }
@media (hover: hover) { .pc:hover { box-shadow: inset 0 0 0 2px var(--accent); } }

/* ============ Places ============ */
.places { display: grid; gap: 10px; }
.place { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.place-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.place-name { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.place-link { display: inline-grid; color: var(--muted); }
.place-votes { display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.vote { display: inline-flex; align-items: center; gap: 4px; color: #e11d48; }
.vote.no { color: var(--no); }
.vote .avatar { box-shadow: 0 0 0 1.5px var(--surface); }
.place-side { display: grid; gap: 6px; justify-items: end; }
.place-tools { display: flex; gap: 2px; }
.hours { display: grid; gap: 10px; }
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick { height: 34px; min-width: 46px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.day-pick.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hours .row select { width: auto; flex: 1; }

/* ============ Live notes room ============ */
.room { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.room-head { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; padding: 16px 18px; }
.room-nav { display: flex; align-items: center; gap: 8px; flex: 1 1 360px; min-width: 0; }
.room-title { min-width: 0; flex: 1; }
.room-title h1 { font-size: 22px; font-weight: 700; margin: 2px 0; }
.room-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); margin: 0 4px; }
.room-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.in-room { display: inline-flex; align-items: center; gap: 6px; }
.in-room .avatar + .avatar { margin-left: -6px; }
.room-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.room-modes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.room-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
.room-agenda, .room-actions { padding: 16px; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.panel-head h2, .feed-head h2 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.panel-sub { font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; display: flex; align-items: center; gap: 6px; }
.agenda { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 2px; counter-reset: ag; }
.agenda-item { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; padding: 7px 6px; border-radius: 10px; position: relative; }
.agenda-item:hover { background: var(--surface-2); }
.agenda-item input { margin-top: 3px; }
.agenda-item.current { background: var(--accent-soft); }
.agenda-item.filtered { box-shadow: inset 3px 0 0 var(--accent); }
.agenda-item.done .agenda-text > span:first-child { text-decoration: line-through; color: var(--muted); }
.agenda-text { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; font-size: 14px; color: var(--ink); line-height: 1.35; }
.agenda-text .now { font-size: 11.5px; font-weight: 700; color: var(--accent); }
.agenda-text .count { font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--ink-2); padding: 0 5px; }
.agenda-tools { grid-column: 2; display: none; gap: 0; margin-top: 2px; }
.agenda-tools .icon-btn { width: 24px; height: 24px; }
.agenda-item:hover .agenda-tools, .agenda-item:focus-within .agenda-tools { display: flex; }
@media (hover: none) { .agenda-tools { display: flex; } }
.agenda-add { display: flex; gap: 4px; }
.empty-note { padding: 6px 4px; }

.room-feed { display: flex; flex-direction: column; min-height: 300px; min-width: 0; }
.composer-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.composer-top .seg { flex: 0 1 auto; }
.note-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.feed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 16px 18px 6px; }
.feed { display: grid; gap: 2px; padding: 6px 10px; flex: 1; align-content: start; }
.feed-empty { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 48px 16px; text-align: center; }
.entry { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 10px 8px; border-radius: 12px; animation: rise .18s ease-out; }
.entry:hover { background: var(--surface-2); }
.entry.k-decision { background: var(--decision-soft); }
.entry.k-question { background: var(--question-soft); }
.entry-body { min-width: 0; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; margin-bottom: 2px; }
.kind { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kind-decision { color: var(--decision); }
.kind-question { color: var(--question); }
.entry-tools { display: flex; align-items: flex-start; opacity: 0; transition: opacity .1s; }
.entry:hover .entry-tools, .entry:focus-within .entry-tools { opacity: 1; }
@media (hover: none) { .entry-tools { opacity: .7; } }
.edit-wrap { display: grid; gap: 6px; margin-top: 4px; }
.typing { min-height: 22px; padding: 0 20px; }

.md { overflow-wrap: anywhere; font-size: 14.5px; color: var(--ink); }
.md p + p, .md p + ul, .md ul + p, .md p + ol, .md ol + p { margin-top: 6px; }
.md ul, .md ol { margin: 2px 0; padding-left: 20px; }
.md li { margin: 1px 0; }
.md li.task { list-style: none; margin-left: -18px; display: flex; gap: 7px; align-items: baseline; }
.md .tick { width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--muted); flex: none; transform: translateY(1px); }
.md .tick.on { background: var(--ok-cell); border-color: var(--ok-cell); }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); }

.composer-host { position: sticky; bottom: 0; padding: 10px 12px 12px; background: linear-gradient(transparent, var(--surface) 14px); border-radius: 0 0 var(--radius) var(--radius); }
.composer { min-width: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); padding: 8px; box-shadow: var(--shadow); display: grid; gap: 8px; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
.composer > * { min-width: 0; }
.composer-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-input { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; padding: 8px 6px; min-height: 40px; max-height: 260px; line-height: 1.45; outline: none; font-size: 15px; }
.composer-send { height: 38px; }
.composer-extras { display: flex; gap: 10px; flex-wrap: wrap; }
.composer-extras:empty { display: none; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mini select { width: auto; max-width: 220px; }
.composer-hint { padding: 0 6px; }

.actions { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.action { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: start; padding: 7px 6px; border-radius: 10px; }
.action:hover { background: var(--surface-2); }
.action input { margin-top: 3px; }
.action-main { display: grid; gap: 2px; min-width: 0; }
.action-text { font-size: 14px; overflow-wrap: anywhere; }
.action.done .action-text { text-decoration: line-through; color: var(--muted); }
.action-meta { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.action .icon-btn { width: 24px; height: 24px; }
.attendance .people { margin-bottom: 6px; }

.minutes-host { display: grid; gap: 12px; }
.minutes-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.minutes-wait { display: flex; gap: 14px; align-items: center; }
.minutes-doc { padding: clamp(20px, 4vw, 44px); max-width: 820px; width: 100%; margin: 0 auto; }
.minutes-doc h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -0.025em; margin: 12px 0 4px; }
.minutes-doc h2 { font-size: 16px; font-weight: 700; margin: 26px 0 8px; display: flex; gap: 8px; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.minutes-doc h3 { font-size: 14.5px; font-weight: 650; margin: 14px 0 4px; }
.minutes-doc ul, .minutes-doc ol { margin: 4px 0; padding-left: 22px; }
.minutes-doc li { margin: 4px 0; }
.minutes-doc p { margin: 4px 0; }
.minutes-badges { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.minutes-when { margin-bottom: 10px !important; }
.minutes-summary { font-size: 16px; color: var(--ink-2); line-height: 1.6; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); margin: 14px 0 !important; }
.decisions li::marker { color: var(--decision); }
.minutes-actions { width: 100%; border-collapse: collapse; font-size: 14px; }
.minutes-actions th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.minutes-actions td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* ============ Archive & team ============ */
.todo-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 24px; }
.todo-group .panel-sub { margin-top: 4px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
.archive { display: grid; }
.archive-row { display: grid; grid-template-columns: 1fr auto auto auto 16px; gap: 12px; align-items: center; padding: 12px 8px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none !important; border-radius: 8px; }
.archive-row:first-child { border-top: 0; }
.archive-row:hover { background: var(--surface-2); }
.archive-when { display: grid; min-width: 0; }
.report-item { border: 1px solid var(--line); border-radius: 14px; margin-top: 10px; overflow: hidden; }
.report-item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; cursor: pointer; }
.report-item summary::-webkit-details-marker { display: none; }
.report-item[open] .chev { transform: rotate(180deg); }
.report-item .minutes-tools { padding: 0 16px 8px; }
.report-item .minutes-doc { box-shadow: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; max-width: none; }
.invite { display: flex; gap: 8px; flex-wrap: wrap; }
.invite .input { flex: 1 1 280px; }
.invite + p { margin-top: 8px; }
.help { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.steps-list { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); }
.slack-opts { display: grid; gap: 6px; justify-items: start; margin: 8px 0 14px; }
.members { list-style: none; padding: 0; margin: 0; display: grid; }
.member { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.member:first-child { border-top: 0; }
.member-main { display: grid; min-width: 0; }
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 24px; }
.settings .field .label { margin-top: 10px; }
.settings .row select { width: auto; flex: 1; }

/* ============ Responsive ============ */
@media (max-width: 1360px) {
  .room-grid { grid-template-columns: 240px minmax(0, 1fr); }
  .room-actions { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 1180px) {
  .best-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1060px) {
  .hero-card { grid-template-columns: minmax(0, 1fr); }
  .hero-actions { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); min-width: 0; }
  .room-grid { grid-template-columns: minmax(0, 1fr); }
  .room-agenda { position: static; max-height: none; }
  .room-feed { order: -1; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); background: var(--frame); transform: translateX(-104%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); border-radius: 0 20px 20px 0; }
  body.drawer-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(10, 10, 15, .42); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .side-close { display: inline-grid; }
  .panel { padding: 0; }
  .mobilebar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; height: 56px; padding: 0 12px; background: color-mix(in srgb, var(--frame) 88%, transparent); backdrop-filter: blur(10px); }
  .menu-btn { width: 38px; height: 38px; border-radius: 11px; color: var(--ink); }
  .mobile-title { font-weight: 650; font-size: 16px; }
  .main { min-height: calc(100vh - 56px); border-radius: 20px 20px 0 0; border-width: 1px 0 0; box-shadow: none; padding: 18px 14px 96px; }
}
@media (max-width: 760px) {
  .room-grid { grid-template-columns: minmax(0, 1fr); }
  .room-agenda { position: static; max-height: none; }
  .room-feed { order: -1; }
  .week-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .row-actions { justify-content: flex-start; }
  .place { grid-template-columns: 40px 1fr; }
  .place-side { grid-column: 1 / -1; justify-items: start; grid-template-columns: 1fr auto; align-items: center; width: 100%; }
  .archive-row { grid-template-columns: 1fr auto 16px; }
  .archive-row > :nth-child(2), .archive-row > :nth-child(3) { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 14.5px; }
  .pad { padding: 16px; }
  .hero-card { padding: 18px; }
  .sugg-item { grid-template-columns: 28px 1fr; }
  .sugg-item > :last-child { grid-column: 2; justify-self: start; }
  .pc { height: 20px; }
  .paint { gap: 2px; }
  .room-head { padding: 14px; }
  .room-title h1 { font-size: 20px; }
  .room-buttons { width: 100%; }
  .room-buttons .btn { flex: 1; }
  .composer-hint { display: none; }
  .composer .seg-btn .icon { display: none; }
  .entry { grid-template-columns: 26px 1fr; }
  .entry .avatar { width: 26px !important; height: 26px !important; }
  .entry-tools { grid-column: 2; opacity: .7; }
  .composer-send span { display: none; }
  .member { grid-template-columns: 32px 1fr auto; }
  .member > :nth-child(3) { display: none; }
}

@media (min-width: 1800px) {
  body { font-size: 16px; }
  .section-title { font-size: 19px; }
  .pad { padding: 24px; }
  .nav-item { height: 40px; font-size: 14.5px; }
  .heat-cell { height: 16px; }
  .pc { height: 24px; }
}
@media (min-width: 2300px) {
  body { font-size: 17px; }
  .section-title { font-size: 20px; }
  .nav-item { height: 42px; font-size: 15px; }
  .pc { height: 26px; }
  .room-grid { grid-template-columns: 300px minmax(0, 1fr) 340px; }
}
/* phones: headings stack their controls; segmented pickers become full-width swipeable rows */
@media (max-width: 640px) {
  .section-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .section-actions { width: 100%; }
  .section-actions > .seg { width: 100%; }
  .section-actions > .seg .seg-btn { flex: 1 0 auto; }
}

/* ============ Touch & phone polish ============ */
html { -webkit-tap-highlight-color: transparent; }
body { touch-action: manipulation; }
.btn:active, .icon-btn:active, .nav-item:active, .seg-btn:active, .day-pick:active { transform: scale(.97); }
.hero-when, .hero-where { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.hero-where > span, .hero-where > a { overflow-wrap: anywhere; }
@keyframes sheet { from { transform: translateY(48px); opacity: .5; } }

@media (max-width: 860px) {
  /* iPhones zoom into any field under 16px; keep fields at 16 */
  .input, select.input, textarea.input, .composer-input { font-size: 16px; }
  .input-sm { height: 36px; font-size: 16px; }
  .mobilebar { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .sidebar { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .main { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .composer-host { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(20px + env(safe-area-inset-bottom)); }
  .room-feed { min-height: 0; }
  .feed.is-empty { padding: 0; }
  .board-list { max-height: 50vh; }
  .admin-row > .admin-actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
  /* next-meeting card: one main button, the rest as a tidy 2-up grid */
  .hero-card { padding: 18px; gap: 16px; }
  .hero-time { font-size: 15.5px; gap: 6px 12px; }
  .hero-time .sep { display: none; }
  .hero-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .hero-actions > :first-child { grid-column: 1 / -1; }
  .hero-actions .btn { justify-content: center; min-width: 0; height: 40px; padding: 0 8px; font-size: 13px; gap: 6px; overflow: hidden; }
  .hero-actions .btn:not(:first-child) .icon { width: 14px; height: 14px; }
  /* dialogs become bottom sheets */
  .backdrop { align-items: end; padding: 0; }
  .modal, .modal-wide { max-width: none; width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; max-height: 92dvh; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheet .26s cubic-bezier(.2, .8, .2, 1); }
  .modal::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--line-2); margin: -8px auto 14px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; }
  .modal-actions .grow { display: none; }
  /* live room header: title with the week arrows beside it */
  .room-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 2px 4px; flex-basis: 100%; }
  .room-nav > :nth-child(1) { grid-column: 2; grid-row: 1; }
  .room-nav > :nth-child(2) { grid-column: 1; grid-row: 1; }
  .room-nav > :nth-child(3) { grid-column: 3; grid-row: 1; }
  .room-nav > :nth-child(4) { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .composer .seg-sm .seg-btn { padding: 0 9px; }
  .set-meeting .day-pick { min-width: 0; flex: 1 1 calc(25% - 6px); }
}

/* ============ Print ============ */
@media print {
  body.printing * { visibility: hidden; }
  body.printing .print-target, body.printing .print-target * { visibility: visible; }
  body.printing .print-target { position: absolute; inset: 0 auto auto 0; width: 100%; max-width: none; border: 0; box-shadow: none; padding: 0; background: #fff; color: #111; }
  body.printing .sidebar, body.printing .mobilebar { display: none; }
  .minutes-summary { background: #f3f3f3 !important; }
}

/* ============ Motion ============
   Quick and quiet: things arrive with a short rise, presses give a little, the section highlight
   glides, and a soft light follows the cursor on the sign-in screens. All of it switches off for
   people who ask their device for reduced motion. */
:root {
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --glow: color-mix(in srgb, var(--accent) 10%, transparent);
  --glow-edge: color-mix(in srgb, var(--accent) 42%, transparent);
  --glow-card: color-mix(in srgb, var(--accent) 5%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glow: color-mix(in srgb, var(--accent) 15%, transparent);
    --glow-edge: color-mix(in srgb, var(--accent) 60%, transparent);
    --glow-card: color-mix(in srgb, var(--accent) 7%, transparent);
  }
}

@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@keyframes item-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-3px) scale(.985); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(6px) scale(.99); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(36px); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pin-pop { from { transform: scale(.88); opacity: .35; } }

/* Arrivals: a view's cards in a short stagger, new chat messages and notes, sign-in steps. */
.enter { animation: enter .34s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.item-in { animation: item-in .26s var(--ease) both; }
.entry { animation: none; }
.auth-card { animation: enter .36s var(--ease) both; }
.pin-box.just { animation: pin-pop .18s var(--ease); }

/* Dialogs, menus, tips and toasts open with a small settle and leave a little faster. */
.backdrop { animation: fade .2s var(--ease); }
.modal { animation: modal-in .26s var(--ease); }
.backdrop.leaving { animation: fade-out .15s var(--ease-in) forwards; pointer-events: none; }
.backdrop.leaving .modal { animation: modal-out .15s var(--ease-in) forwards; }
.menu { animation: pop-in .16s var(--ease); }
.menu.leaving { animation: fade-out .1s var(--ease-in) forwards; pointer-events: none; }
.info-pop { transform: translateY(3px); transition: opacity .16s var(--ease), transform .2s var(--ease), visibility .16s; }
.info.hover .info-pop, .info.open .info-pop { transform: none; }
.toast { animation: item-in .26s var(--ease); transition: opacity .22s var(--ease-in), transform .22s var(--ease-in); }

/* Presses and focus answer straight away. */
.btn { transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .2s var(--ease), transform .14s var(--ease); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 20px -12px var(--accent); }
.icon-btn { transition: background .15s var(--ease), color .15s var(--ease), transform .14s var(--ease); }
.seg-btn, .day-pick, .who, .menu button, .proj-card, .me-chip { transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), box-shadow .2s var(--ease), transform .14s var(--ease); }
.btn:active:not(:disabled), .icon-btn:active, .seg-btn:active, .nav-item:active, .day-pick:active, .menu button:active, .who:active, .me-chip:active { transform: scale(.97); transition-duration: .06s; }
.proj-card:active { transform: translateY(-1px) scale(.99); }
.input { transition: border-color .15s var(--ease), box-shadow .2s var(--ease), background .15s var(--ease); }
.pin-box { transition: border-color .15s var(--ease), box-shadow .2s var(--ease), transform .14s var(--ease); }

/* The current section's highlight glides between items instead of jumping. */
.nav-glider { position: absolute; z-index: 0; left: 0; top: 0; border-radius: 11px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 0 0 1px var(--line); pointer-events: none; }
.has-glider .nav-item { position: relative; z-index: 1; }
.has-glider .nav-item.on { background: transparent; box-shadow: none; }
.has-glider .nav-item.on:hover { background: transparent; }

/* Sign-in screens: a soft light under the cursor, and a faint edge light on the card nearest it. */
.auth { position: relative; isolation: isolate; }
.auth::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(640px circle at var(--mx, 50%) var(--my, 30%), var(--glow), transparent 62%);
  opacity: 0; transition: opacity .6s var(--ease);
}
.glow-on .auth::before { opacity: 1; }
.auth-card { position: relative; }
.glow-on .auth-card { background-image: radial-gradient(420px circle at var(--cx, 50%) var(--cy, 0%), var(--glow-card), transparent 65%); }
.auth-card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--cx, 50%) var(--cy, 0%), var(--glow-edge), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  opacity: 0; transition: opacity .5s var(--ease);
}
.glow-on .auth-card::after { opacity: 1; }
/* Touch screens have no cursor: a still, gentle light near the top instead. */
@media (hover: none) {
  .auth::before { opacity: .8; background: radial-gradient(520px circle at 50% 12%, var(--glow), transparent 65%); }
}

@media (max-width: 860px) {
  .modal, .modal-wide { animation: sheet .3s var(--ease); }
  .backdrop.leaving .modal { animation: sheet-out .18s var(--ease-in) forwards; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .glow-on .auth::before, .glow-on .auth-card::after { opacity: 0; }
}

/* First-time tip on phones: Overlap is easiest to learn on a bigger screen */
.desktop-tip { display: flex; gap: 9px; align-items: flex-start; margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.desktop-tip .icon { flex: 0 0 auto; margin-top: 1px; color: var(--accent); }
.code-reveal + .desktop-tip { margin-top: 14px; }

/* ============ Guest data request (overlap.cx/r/…) ============
   Month → week → day → time → length → thank you; each step opens out of the one you picked. */
.rq-page { align-content: center; gap: 14px; }
.rq-card { max-width: 520px; }
.rq-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rq-top .auth-brand { margin: 0; }
.rq-project { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rq-foot { max-width: 420px; text-align: center; margin: 0 auto; }
.rq-crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: -4px 0 12px; font-size: 12.5px; }
.rq-crumbs[hidden] { display: none; }
.rq-crumb { border: 0; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; animation: pop-in .22s var(--ease); transition: background .15s var(--ease), color .15s var(--ease); }
.rq-crumb:hover { background: var(--surface-3); color: var(--ink); }
.rq-crumb.on { background: var(--accent-soft); color: var(--accent); cursor: default; }
.rq-stage { position: relative; }
.rq-in .rq-item { animation: enter .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 26ms + 70ms); }
.rq-in-back .rq-item { animation: enter .3s var(--ease) both; animation-delay: calc(var(--i, 0) * 16ms); }
.rq-title { margin-bottom: 2px; }
.rq-sub { margin: 0 0 14px; }
.rq-tz { display: flex; align-items: center; gap: 6px; margin: -8px 0 8px; }
.rq-message { display: grid; gap: 6px; margin: 6px 0 16px; padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.rq-fields { display: grid; gap: 10px; margin-top: 6px; }
.rq-note { min-height: 64px; }
.rq-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rq-consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; color: var(--ink-2); font-size: 13px; line-height: 1.45; cursor: pointer; }
.rq-consent input { flex: none; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }

/* the month: whole weeks to pick, with a little ripple across the days on hover */
.rq-month-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rq-month-head .rq-title { margin: 0; text-align: center; }
.rq-month-head + .rq-sub { text-align: center; }
.rq-cal { display: grid; gap: 4px; }
.rq-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 7px; color: var(--muted); font-size: 11.5px; font-weight: 650; text-align: center; }
.rq-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 6px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease), transform .22s var(--ease); }
.rq-week:hover:not(:disabled), .rq-week:focus-visible { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); transform: scale(1.012); }
.rq-week:disabled { cursor: default; }
.rq-d { position: relative; display: grid; place-items: center; height: 40px; border-radius: 10px; font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; transition: transform .26s var(--ease); transition-delay: calc(var(--j, 0) * 18ms); }
.rq-week:hover:not(:disabled) .rq-d:not(.off) { transform: translateY(-2px); }
.rq-d.off { color: var(--muted); opacity: .45; }
.rq-d.out { opacity: .28; }
.rq-d.today { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.rq-d.has::after { content: ""; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.rq-picked { background: var(--accent-soft) !important; border-color: var(--accent) !important; }
.rq-done-link { display: flex; margin: 12px auto 0; }

/* the week: seven days */
.rq-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rq-day { display: grid; gap: 2px; justify-items: center; align-content: center; min-height: 84px; padding: 10px 2px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: transform .22s var(--ease), border-color .2s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease); }
.rq-day strong { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rq-day-name { color: var(--muted); font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.rq-day:hover:not(:disabled), .rq-day:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 26px -16px var(--accent); }
.rq-day:active:not(:disabled) { transform: translateY(-1px) scale(.97); }
.rq-day:disabled { opacity: .36; cursor: default; }
.rq-day.has { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); }
.rq-day-dot { max-width: 100%; overflow: hidden; color: var(--accent); font-size: 10.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

/* the day: start times */
.rq-glabel { margin: 10px 2px 6px; font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.rq-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.rq-time { height: 40px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), box-shadow .25s var(--ease); }
.rq-time:hover:not(:disabled), .rq-time:focus-visible { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 20px -14px var(--accent); }
.rq-time:active:not(:disabled) { transform: scale(.96); }
.rq-time.taken { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.rq-time:disabled { opacity: .32; cursor: default; }

/* how long: bars that grow to their length */
@keyframes grow { from { transform: scaleX(0); } }
.rq-lengths { display: grid; gap: 8px; }
.rq-len { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 92px; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .22s var(--ease), border-color .2s var(--ease), box-shadow .25s var(--ease); }
.rq-len:hover, .rq-len:focus-visible { transform: translateX(3px); border-color: var(--accent); box-shadow: 0 10px 24px -16px var(--accent); }
.rq-len:active { transform: scale(.985); }
.rq-len-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-weight: 650; }
.rq-len-until { text-align: right; white-space: nowrap; }
.rq-len-bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.rq-len-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--ok-cell))); transform-origin: left; animation: grow .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 160ms); }
.rq-tag { margin-left: 2px; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700; }

/* thank you: a tick that draws itself, and a small burst the first time */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes burst {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(-58px) scale(.5); }
}
.rq-thanks { display: grid; justify-items: center; text-align: center; }
.rq-check { position: relative; width: 66px; height: 66px; margin: 6px auto 10px; color: var(--ok); }
.rq-check svg { display: block; width: 66px; height: 66px; }
.rq-check .c { stroke-dasharray: 145; stroke-dashoffset: 145; animation: draw .6s var(--ease) .12s forwards; }
.rq-check .t { stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw .4s var(--ease) .58s forwards; }
.rq-check i { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)); animation: burst .9s var(--ease) calc(.5s + var(--d)) forwards; }
.rq-check i:nth-child(3n) { background: var(--ok-cell); }
.rq-check i:nth-child(3n + 1) { background: var(--maybe-cell); border-radius: 50%; }
.rq-mine { display: grid; gap: 6px; width: 100%; margin: 14px 0 8px; padding: 0; list-style: none; text-align: left; }
.rq-mine li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 8px 9px 12px; border-radius: 12px; background: var(--surface-2); }
.rq-actions { display: flex; justify-content: center; gap: 8px; }
.rq-private { width: 100%; margin-top: 18px; text-align: left; }
.rq-private p { margin: 0 0 6px; }
.rq-delete { margin-top: 14px; color: var(--muted); }

/* embedded in another site: no page around it */
html.embed, html.embed body { background: transparent; }
.rq-embed { min-height: 0; padding: 0; }
.rq-embed::before { display: none; }
.rq-embed .rq-card { max-width: none; box-shadow: none; }

@media (max-width: 480px) {
  .rq-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rq-len { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .rq-len-until { grid-column: 2; grid-row: 1; }
  .rq-len-bar { grid-column: 1 / -1; grid-row: 2; }
  .rq-d { height: 36px; font-size: 14px; }
}

/* Guests on the Team page, and Root's requests */
.avatar.guest { outline: 1.5px dashed color-mix(in srgb, var(--ink-2) 55%, transparent); outline-offset: 2px; }
.guest-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.guest { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; }
.guest:hover { background: var(--surface-2); }
.guest-main { display: grid; gap: 2px; min-width: 0; }
.guest-main strong { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.guest-chip { padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 11px; font-weight: 650; }
.guest-email { color: var(--accent); font-weight: 550; }
.guest-note { padding: 4px 8px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.req-list { display: grid; gap: 8px; }
.req { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .2s var(--ease); }
.req.open { border-color: var(--line-2); }
.req-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; flex-wrap: wrap; }
.req-toggle { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; padding: 4px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.req-title { display: grid; min-width: 0; }
.req-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-tools { display: flex; align-items: center; gap: 2px; }
.req-body { display: grid; gap: 8px; padding: 2px 12px 12px; border-top: 1px solid var(--line); animation: item-in .24s var(--ease); }
.req-body > .check { margin-top: 10px; }
.req-form .day-picks { flex-wrap: wrap; }
.req-dates { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.req-dates .input { width: auto; flex: 1 1 0; min-width: 0; }
.req-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 12px; align-items: end; }
.req-form > .check { margin-top: 12px; }
.req-embed { resize: none; font-size: 12px; line-height: 1.5; }
@media (max-width: 560px) { .req-row { grid-template-columns: minmax(0, 1fr); } }
.rq-challenge { display: grid; gap: 6px; margin-top: 14px; animation: item-in .24s var(--ease); }
.rq-challenge[hidden] { display: none; }
.rq-challenge p { margin: 0; }
.rq-len.busy { border-color: var(--accent); background: var(--accent-soft); }
.rq-len.busy .rq-len-until::after { content: " · saving…"; }
.rq-len:disabled { cursor: default; }
