/* Presence — styles taken from the Claude Design file (Geist, ink / teal palette). */
:root {
  --ink: #222831;
  --graphite: #393E46;
  --teal: #00ADB5;
  --deep: #00747A;
  --mist: #EEEEEE;
  --muted: #5A616B;
  --line: rgba(34, 40, 49, 0.12);
  --line-strong: rgba(34, 40, 49, 0.28);
  --tint: rgba(34, 40, 49, 0.045);
  --seg: rgba(34, 40, 49, 0.07);
  --sel: rgba(0, 173, 181, 0.12);
  --white: #fff;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--mist); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.deep { color: var(--deep); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- transitions ---------- */
.btn, .ni, .chip, .seg button, .lrow, .lnk { transition: background-color .15s ease-out, color .15s ease-out, box-shadow .15s ease-out, transform .1s ease-out, border-color .15s ease-out; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 20px; border-radius: 12px; border: 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-ink { background: var(--ink); color: var(--mist); }
.btn-ink:hover { background: var(--graphite); }
.btn-teal { background: var(--teal); color: var(--ink); }
.btn-teal:hover { box-shadow: inset 0 0 0 999px rgba(255, 255, 255, .14); }
.btn-line { background: transparent; color: var(--ink); border: 1px solid var(--ink); font-weight: 500; }
.btn-line:hover { background: rgba(34, 40, 49, .06); }
.btn-line:disabled { border-color: rgba(34, 40, 49, .2); color: rgba(34, 40, 49, .4); background: transparent; }
.btn-ghost { background: transparent; border: 0; color: var(--muted); }
.btn-ghost:hover { background: rgba(34, 40, 49, .06); color: var(--ink); }
.btn-danger { background: transparent; border: 1px solid #b3261e; color: #b3261e; font-weight: 500; }
.btn-danger:hover { background: rgba(179, 38, 30, .06); }
.btn-lg { height: 52px; font-size: 15px; padding: 0 24px; }
.btn-xl { height: 56px; font-size: 16px; border-radius: 14px; padding: 0 28px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.link { background: none; border: 0; padding: 0; min-height: 44px; font-size: 14px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.link.muted { color: var(--muted); }
.lnk { font-size: 13px; color: var(--deep); text-decoration: underline; text-underline-offset: 4px; }
.lnk:hover { color: var(--ink); }

/* ---------- form fields ---------- */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 500; }
.input, select.input { height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; color: var(--ink); width: 100%; min-width: 0; }
.input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(0, 173, 181, .18); }
.input.sm { height: 48px; font-size: 15px; padding: 0 14px; }
.input:disabled { background: rgba(34, 40, 49, .05); color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; }

/* ---------- segmented control & chips ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--seg); flex-wrap: wrap; }
.seg button { height: 44px; min-width: 56px; padding: 0 16px; border: 0; border-radius: 9px; font-size: 14px; font-weight: 500; background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(34, 40, 49, .12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 44px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.chip:hover { background: rgba(34, 40, 49, .05); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--mist); border-color: var(--ink); }
.chip .n { font-family: var(--mono); font-size: 12px; opacity: .8; }
.chip.sm { height: 40px; padding: 0 14px; font-size: 13px; background: #fff; border-color: rgba(34, 40, 49, .2); }
.chip.sm[aria-pressed="true"] { background: var(--teal); color: var(--ink); border-color: var(--teal); }

/* ---------- status dots ---------- */
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot.s8 { width: 8px; height: 8px; }
.dot-ink { background: var(--ink); }
.dot-teal { background: var(--teal); }
.dot-deep { background: var(--deep); }
.dot-muted { background: var(--muted); }
.dot-ring-ink { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); }
.dot-ring-teal { background: #fff; box-shadow: inset 0 0 0 2px var(--teal); }
.dot-ring-deep { background: #fff; box-shadow: inset 0 0 0 2px var(--deep); }
.tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }

/* ---------- app shell ---------- */
.app { min-height: 100vh; display: flex; background: var(--mist); }
.side { width: 248px; flex: none; background: var(--ink); color: var(--mist); padding: 28px 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-top { display: flex; flex-direction: column; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.ni { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; font-size: 14px; color: rgba(238, 238, 238, .78); background: transparent; border: 0; text-align: left; width: 100%; }
.ni:hover { background: rgba(238, 238, 238, .08); color: #fff; }
.ni[aria-current="page"] { color: #fff; font-weight: 500; background: rgba(0, 173, 181, .18); }
.ni[aria-current="page"] svg { stroke: var(--teal); }
.ni .badge { margin-left: auto; font-family: var(--mono); font-size: 12px; color: rgba(238, 238, 238, .7); }
.side-foot { display: flex; flex-direction: column; gap: 16px; }
.who { display: flex; align-items: center; gap: 12px; padding: 0 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--graphite); color: var(--mist); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.avatar.lg { width: 72px; height: 72px; font-size: 22px; background: var(--ink); }
.who-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.who-text b { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text span { font-size: 12px; color: rgba(238, 238, 238, .7); }
.main { flex: 1; min-width: 0; padding: 24px; display: flex; }
.panel { flex: 1; min-width: 0; background: #fff; border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 32px; }
.panel.roomy { padding: 40px; gap: 40px; }

.topbar { display: none; }
.scrim { display: none; }

/* ---------- headings ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page-head .t { display: flex; flex-direction: column; gap: 6px; }
.h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.sub { font-size: 14px; color: var(--muted); }
.h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.h2.lg { font-size: 20px; letter-spacing: -0.015em; }
.h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.sec { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.note { font-size: 13px; line-height: 1.55; color: var(--muted); max-width: 680px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 24px; }
.stat { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.stat.hl { border-top: 2px solid var(--teal); }
.stat .l { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 38px; line-height: 1; font-weight: 500; letter-spacing: -0.035em; }
.stat.hl .v { color: var(--deep); }
.stat .v.sm { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.stat .v.xs { font-family: var(--mono); font-size: 15px; font-weight: 400; letter-spacing: 0; }
.big-num { font-size: 44px; line-height: 1; font-weight: 500; letter-spacing: -0.035em; }

/* ---------- lists & tables ---------- */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 40px; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); min-height: 60px; }
.nm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.li .nm b, .nm b { font-size: 15px; font-weight: 500; }
.li .nm span, .nm span { font-size: 13px; color: var(--muted); }
.empty { padding: 28px 14px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.scroll { max-height: 640px; overflow-y: auto; }
.lrow { border: 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; padding: 12px 14px; min-height: 68px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 8px 16px; align-items: center; color: var(--ink); background: transparent; }
.lrow:hover { background: rgba(34, 40, 49, .04); }
.lrow[aria-pressed="true"] { background: var(--sel); }
.table { overflow-x: auto; }
.table-inner { min-width: 620px; display: flex; flex-direction: column; }
.tr { display: grid; gap: 16px; align-items: center; padding: 12px 14px; min-height: 64px; border-top: 1px solid var(--line); }
.tr.th { min-height: 0; padding: 0 14px 10px; border-top: 0; font-size: 12px; color: var(--muted); }
button.tr { width: 100%; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; color: var(--ink); }
.tr.click:hover, button.tr:hover { background: rgba(34, 40, 49, .04); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager span { display: flex; gap: 8px; }

/* ---------- split layouts (list + detail) ---------- */
.split { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.split > .a { flex: 999 1 500px; min-width: 0; display: flex; flex-direction: column; }
.split > .b { flex: 1 1 340px; min-width: 0; }
.card-tint { background: var(--tint); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.dark-card { background: var(--ink); color: var(--mist); border-radius: 20px; padding: 32px; }

/* ---------- notes ---------- */
.notes { display: flex; flex-direction: column; gap: 12px; }
.note-item { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.note-item small { font-size: 12px; color: var(--muted); }
.note-item span { font-size: 14px; line-height: 1.5; }

/* ---------- charts ---------- */
.chart { display: flex; gap: 12px; align-items: stretch; }
.chart .y { display: flex; flex-direction: column; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 28px; text-align: right; }
.chart .plot { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; position: relative; }
.chart svg { width: 100%; display: block; overflow: visible; }
.x { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--mist); font-size: 12px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -120%); opacity: 0; transition: opacity .1s; z-index: 5; }
.tip.on { opacity: 1; }
.bar-track { height: 6px; border-radius: 3px; background: rgba(34, 40, 49, .1); overflow: hidden; }
.bar-track > div { height: 100%; background: var(--teal); }

/* ---------- QR ---------- */
.qr-wrap { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.qr-box { width: 100%; max-width: 340px; aspect-ratio: 1; background: #fff; border-radius: 16px; padding: 20px; display: flex; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-meta { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; }
.progress { height: 4px; border-radius: 2px; background: rgba(238, 238, 238, .16); overflow: hidden; }
.progress > div { height: 100%; background: var(--teal); transition: width 1s linear; }
.live { display: flex; align-items: center; gap: 8px; }
.live .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.fs-qr { position: fixed; inset: 0; z-index: 80; background: var(--ink); color: var(--mist); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px; }
.fs-qr .qr-box { max-width: min(70vh, 88vw); }
.fs-qr .qr-meta { max-width: min(70vh, 88vw); }

/* ---------- member: streak card, calendar ---------- */
.streak-card { background: var(--ink); color: var(--mist); border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 32px; }
.streak-num { font-size: 88px; line-height: .9; font-weight: 500; letter-spacing: -0.04em; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: rgba(238, 238, 238, .75); }
.week .c { width: 100%; max-width: 44px; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; font-family: var(--mono); }
.c-present { background: var(--teal); color: var(--ink); }
.c-today { border: 2px solid var(--mist); color: var(--mist); }
.c-future { border: 1px solid rgba(238, 238, 238, .28); color: rgba(238, 238, 238, .65); }
.c-closed { border: 1px dashed rgba(238, 238, 238, .4); color: rgba(238, 238, 238, .65); }
.c-missed { background: rgba(238, 238, 238, .12); color: rgba(238, 238, 238, .75); }
.cal-h, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.cal-h { text-align: center; font-size: 12px; color: var(--muted); }
.cal .c { aspect-ratio: 1; max-height: 72px; width: 100%; justify-self: center; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 500; font-family: var(--mono); }
.k-present { background: var(--teal); color: var(--ink); }
.k-missed { background: rgba(34, 40, 49, .14); color: var(--ink); }
.k-closed { border: 1px dashed rgba(34, 40, 49, .5); color: var(--muted); }
.k-today { border: 2px solid var(--ink); color: var(--ink); }
.k-future, .k-none { color: var(--muted); }
.k-out { visibility: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 8px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* ---------- scanner ---------- */
.viewfinder { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 24px; background: var(--ink); overflow: hidden; }
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.viewfinder .frame { position: absolute; left: 30%; top: 14%; width: 40%; height: 72%; }
.scanline { position: absolute; left: 32%; right: 32%; height: 2px; border-radius: 1px; background: var(--teal); opacity: .9; top: 20%; animation: scan 2.2s ease-in-out infinite alternate; box-shadow: 0 0 12px var(--teal); }
@keyframes scan { from { top: 18%; } to { top: 82%; } }
.state { display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }
.disc { width: 112px; height: 112px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.disc.sm { width: 96px; height: 96px; background: var(--ink); color: var(--teal); }
.disc.ok { background: var(--teal); color: var(--ink); animation: pop .35s ease-out; }
.disc.err { border: 3px solid var(--ink); color: var(--ink); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.steps .st { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); align-items: baseline; font-size: 16px; }
.steps .st:last-child { border-bottom: 1px solid var(--line); }
.steps .st span:first-child { font-family: var(--mono); font-size: 13px; color: var(--deep); }

/* ---------- planner ---------- */
.days { flex: 1 1 260px; max-width: 340px; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.days button { width: 100%; min-height: 56px; padding: 0 14px; border: 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; font-size: 15px; color: var(--ink); background: transparent; }
.days button:hover { background: rgba(34, 40, 49, .04); }
.days button[aria-pressed="true"] { background: var(--sel); }
.days b { font-weight: 500; }
.days small { display: block; font-size: 13px; color: var(--muted); }
.title-input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 0 10px; font-size: 36px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); border-radius: 0; }
.title-input:focus { outline: none; border-bottom-color: var(--teal); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; background: var(--mist); }
.auth-art { flex: 1 1 440px; min-height: 420px; background: var(--ink); color: var(--mist); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.dots-grid { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 8px; max-width: 520px; width: 100%; }
.dots-grid i { aspect-ratio: 1; border-radius: 50%; display: block; }
.auth-art h2 { font-size: 40px; line-height: 1.1; font-weight: 500; letter-spacing: -0.025em; max-width: 420px; text-wrap: balance; }
.auth-form { flex: 1 1 480px; min-height: 560px; display: flex; flex-direction: column; justify-content: space-between; padding: 32px 48px; gap: 32px; }
.auth-box { width: 100%; max-width: 380px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.auth-box h1 { font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; }
.auth-box .lead { font-size: 15px; line-height: 1.5; color: var(--muted); }
.role-seg { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--seg); }
.role-seg button { flex: 1; height: 44px; border: 0; border-radius: 9px; font-weight: 500; font-size: 14px; background: transparent; color: var(--muted); }
.role-seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(34, 40, 49, .12); }
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp input { width: 100%; height: 56px; text-align: center; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-family: var(--mono); font-size: 22px; color: var(--ink); padding: 0; }
.otp input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(0, 173, 181, .18); }
.err { font-size: 13px; color: #b3261e; }
.demo-hint { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--muted); line-height: 1.5; display: flex; flex-direction: column; gap: 8px; }
.demo-hint .row { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-hint button { height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: #fff; font-size: 13px; font-weight: 500; }
.demo-hint button:hover { border-color: var(--ink); }
.foot-legal { text-align: center; font-size: 13px; line-height: 1.5; color: var(--muted); }
.foot-legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- legal ---------- */
.legal { min-height: 100vh; background: var(--mist); }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 32px; max-width: 1040px; margin: 0 auto; }
.legal-top nav { display: flex; gap: 20px; font-size: 14px; }
.legal-top nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.legal-body { max-width: 1040px; margin: 0 auto 48px; padding: 0 32px; }
.legal-card { background: #fff; border-radius: 20px; padding: 48px; display: flex; flex-direction: column; gap: 32px; }
.legal-sec { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 8px 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.legal-sec h2 { font-size: 17px; font-weight: 600; }
.legal-sec p { font-size: 15px; line-height: 1.6; color: var(--graphite); grid-column: span 2; }

/* ---------- modal, toast, demo menu ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(34, 40, 49, .5); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 640px; padding: 32px; display: flex; flex-direction: column; gap: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: rise .2s ease-out; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }
.modal-foot .r { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 16px; }
.mini-stats div { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.mini-stats b { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--mist); padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }
.demo-fab { position: fixed; right: 16px; bottom: 16px; z-index: 70; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 14px rgba(34, 40, 49, .14); }
.demo-fab .dot { width: 8px; height: 8px; }
.demo-pop { position: fixed; right: 16px; bottom: 64px; z-index: 71; width: 320px; max-width: calc(100vw - 32px); background: #fff; border-radius: 16px; box-shadow: 0 16px 48px rgba(34, 40, 49, .25); padding: 20px; display: flex; flex-direction: column; gap: 14px; animation: rise .15s ease-out; }
.demo-pop h3 { font-size: 15px; font-weight: 600; }
.demo-pop p { font-size: 12px; color: var(--muted); line-height: 1.5; }
.demo-pop .grp { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.demo-pop .btn { height: 40px; font-size: 13px; justify-content: flex-start; padding: 0 14px; }
.demo-pop .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-pop .two .btn { justify-content: center; }

/* ---------- settings ---------- */
.set-sec { display: flex; flex-wrap: wrap; gap: 16px 48px; padding: 28px 0; border-top: 1px solid var(--line); }
.set-sec > .l { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.set-sec > .l span { font-size: 13px; line-height: 1.5; color: var(--muted); }
.set-sec > .r { flex: 3 1 380px; max-width: 560px; display: flex; flex-direction: column; gap: 16px; }
.daypick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.daypick button { height: 52px; border-radius: 12px; font-size: 14px; font-weight: 500; background: transparent; color: var(--muted); border: 1px dashed rgba(34, 40, 49, .4); }
.daypick button[aria-pressed="true"] { background: var(--ink); color: var(--mist); border: 1px solid var(--ink); }
.stepper { display: flex; align-items: center; gap: 16px; }
.stepper button { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--ink); background: transparent; font-size: 22px; line-height: 1; }
.stepper button:hover { background: rgba(34, 40, 49, .06); }
.stepper .v { min-width: 72px; text-align: center; font-size: 38px; line-height: 1; font-weight: 500; letter-spacing: -0.035em; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .app { flex-direction: column; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--mist); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; font-size: 16px; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: auto; z-index: 60; width: 280px; max-width: 84%; transform: translateX(-105%); transition: transform .22s ease-out; padding: 20px 16px; }
  body.drawer-open .side { transform: none; }
  body.drawer-open .scrim { display: block; position: fixed; inset: 0; background: rgba(34, 40, 49, .5); z-index: 55; }
  .main { padding: 12px; }
  .panel, .panel.roomy { padding: 24px 20px; gap: 28px; border-radius: 18px; }
}
@media (max-width: 600px) {
  .main { padding: 0; }
  .panel, .panel.roomy { border-radius: 0; padding: 20px 16px; background: var(--mist); }
  .h1 { font-size: 26px; }
  .stat .v { font-size: 32px; }
  .streak-num { font-size: 72px; }
  .streak-card { padding: 24px; border-radius: 20px; }
  .auth-art { padding: 28px 24px; min-height: 0; gap: 28px; }
  .auth-art h2 { font-size: 30px; }
  .auth-form { padding: 24px 16px; min-height: 0; }
  .legal-top, .legal-body { padding-left: 16px; padding-right: 16px; }
  .legal-card { padding: 24px 20px; }
  .legal-sec p { grid-column: auto; }
  .modal { padding: 24px 18px; }
  .title-input { font-size: 28px; }
  .dark-card { padding: 24px 18px; }
  .card-tint { padding: 20px 16px; background: #fff; }
}
