/* Flow — app stylesheet. Mobile-first, light & dark, phase colours as tokens. */
:root {
  --bg: #fbf6f7;
  --bg-elev: #ffffff;
  --bg-soft: #f5edf0;
  --text: #2b2226;
  --muted: #7a6b70;
  --border: #ece2e5;
  --accent: #e05d7a;
  --accent-ink: #ffffff;
  --accent-soft: #fde8ee;
  --c-menstrual: #e05d7a;
  --c-follicular: #8b6fd6;
  --c-ovulation: #2aa198;
  --c-luteal: #e3a53b;
  --c-menstrual-soft: #fde3e9;
  --c-follicular-soft: #ece6fa;
  --c-ovulation-soft: #dcf2ef;
  --c-luteal-soft: #fcefd6;
  --danger: #d64545;
  --success: #2e9e6b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 12px rgba(80, 30, 50, 0.07);
  --tab-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16121a; --bg-elev: #221c27; --bg-soft: #2b2331; --text: #f3ecef; --muted: #a99ba3; --border: #372d3d;
    --accent: #f06d8a; --accent-soft: #3a2230;
    --c-menstrual-soft: #45232d; --c-follicular-soft: #2f2745; --c-ovulation-soft: #1f3b39; --c-luteal-soft: #3f3220;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16121a; --bg-elev: #221c27; --bg-soft: #2b2331; --text: #f3ecef; --muted: #a99ba3; --border: #372d3d;
  --accent: #f06d8a; --accent-soft: #3a2230;
  --c-menstrual-soft: #45232d; --c-follicular-soft: #2f2745; --c-ovulation-soft: #1f3b39; --c-luteal-soft: #3f3220;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
body.no-scroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 0.6em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 0.86rem; margin-top: 4px; }
.noscript { padding: 24px; text-align: center; }

/* layout */
.app { min-height: 100vh; }
.main { max-width: 720px; margin: 0 auto; padding: 0 16px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
.boot { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); margin: 0 -16px 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.topbar-inner { display: flex; align-items: center; gap: 12px; max-width: 720px; margin: 0 auto; }
.topbar-text { flex: 1; min-width: 0; }
.topbar-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.topbar-sub { color: var(--muted); font-size: 0.9rem; }
.topbar-actions { display: flex; gap: 6px; align-items: center; }
.logo { border-radius: 10px; flex-shrink: 0; }

/* cards */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-title { font-size: 1.02rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-sub { color: var(--muted); font-size: 0.9rem; margin: -6px 0 10px; }
.card-actions { display: flex; gap: 6px; }
.card-accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 55%, var(--bg-elev)); }
.card-warn { border-color: color-mix(in srgb, var(--c-luteal) 55%, var(--border)); background: color-mix(in srgb, var(--c-luteal-soft) 60%, var(--bg-elev)); }

/* hero */
.hero { --hero: var(--accent); border: none; color: #fff; background: linear-gradient(135deg, var(--hero), color-mix(in srgb, var(--hero) 70%, #3a1b2a)); padding: 18px; }
.hero-main { display: flex; align-items: center; gap: 12px; }
.hero-text { flex: 1; min-width: 0; }
.hero-sub { opacity: 0.9; font-size: 0.92rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.hero-headline { font-size: 1.55rem; font-weight: 800; margin: 4px 0 8px; letter-spacing: -0.01em; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-note { opacity: 0.9; font-size: 0.84rem; margin-top: 8px; }
.hero-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hero .cycle-ring { flex-shrink: 0; }
.hero .ring-big { fill: #fff; font-weight: 800; font-size: 1.35rem; }
.hero .ring-small { fill: rgba(255,255,255,0.85); font-size: 0.72rem; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: rgba(255,255,255,0.2); color: #fff; }
.pill-fert-high { background: rgba(255,255,255,0.92); color: var(--c-ovulation); }
.pill-fert-medium { background: rgba(255,255,255,0.75); color: #1f7a73; }
.cycle-ring { display: block; }
.ring-big { fill: var(--text); font-weight: 800; font-size: 1.3rem; }
.ring-small { fill: var(--muted); font-size: 0.72rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 0.97rem; text-decoration: none; transition: filter 0.12s, transform 0.08s; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(0.97); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-light { background: rgba(255,255,255,0.94); color: var(--text); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.88rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: none; background: transparent; color: var(--text); }
.icon-btn:hover { background: var(--bg-soft); text-decoration: none; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }

/* forms */
.field { margin-bottom: 14px; }
.field-label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.field-error { color: var(--danger); font-size: 0.86rem; margin-top: 6px; }
.input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; }
textarea.input { min-height: 96px; resize: vertical; }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row .input { flex: 1; }
.input-inline { display: flex; align-items: center; gap: 8px; }
.input-inline .input { width: 120px; }
.input-inline input[type=date].input { width: auto; min-width: 165px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-text { flex: 1; min-width: 0; }
.toggle-label { font-weight: 600; font-size: 0.95rem; cursor: pointer; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 999px; border: none; background: var(--border); flex-shrink: 0; transition: background 0.15s; padding: 0; }
.switch.is-on { background: var(--accent); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform 0.15s; }
.switch.is-on .switch-knob { transform: translateX(20px); }
.segmented { display: inline-flex; background: var(--bg-soft); border-radius: 999px; padding: 3px; gap: 2px; max-width: 100%; }
.seg { border: none; background: transparent; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 0.9rem; color: var(--muted); min-height: 38px; }
.seg.is-active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-elev); display: inline-flex; align-items: center; justify-content: center; }
.stepper-value { min-width: 64px; text-align: center; font-weight: 700; }
.stepper-clear { width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; color: var(--muted); }
.checkbox-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.checkbox-row input { width: 22px; height: 22px; accent-color: var(--accent); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-size: 0.92rem; font-weight: 500; }
.chip.is-selected { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 600; }
.chip-sm { min-height: 34px; padding: 4px 11px; font-size: 0.85rem; }
.chip-emoji { font-size: 1.05em; }
.chip:disabled { opacity: 0.5; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: none; }
.row-icon { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--bg-soft); }
.tone-menstrual { color: var(--c-menstrual); background: var(--c-menstrual-soft); }
.tone-follicular { color: var(--c-follicular); background: var(--c-follicular-soft); }
.tone-ovulation { color: var(--c-ovulation); background: var(--c-ovulation-soft); }
.tone-luteal { color: var(--c-luteal); background: var(--c-luteal-soft); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 600; }
.row-sub { color: var(--muted); font-size: 0.86rem; }
.row-end { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.row-end-actions { display: flex; gap: 2px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; background: var(--bg-soft); color: var(--muted); margin-left: 6px; }
.badge-warn { background: var(--c-luteal-soft); color: #8a5a00; }
.kv { margin: 0; }
.kv-row { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.kv-row:last-child { border-bottom: none; }
.kv dt { color: var(--muted); width: 110px; flex-shrink: 0; font-size: 0.9rem; }
.kv dd { margin: 0; flex: 1; }

/* insight */
.insight { position: relative; padding-left: 20px; }
.insight-bar { position: absolute; left: 0; top: 14px; bottom: 14px; width: 5px; border-radius: 3px; }
.insight-text { margin: 0; }

/* calendar */
.cal-card { padding: 12px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-nav h2 { font-size: 1.1rem; }
.cal-grid { position: relative; }
.cal-grid.is-loading { opacity: 0.6; }
.cal-head, .cal-body { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; color: var(--muted); font-size: 0.75rem; font-weight: 600; padding: 4px 0; }
.cal-day { position: relative; aspect-ratio: 1 / 1; min-height: 42px; border-radius: 12px; border: 2px solid transparent; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; color: var(--text); font-size: 0.95rem; }
.cal-day.is-static { cursor: default; }
.cal-day.is-outside { opacity: 0.35; }
.cal-day.is-fertile { background: var(--c-ovulation-soft); }
.cal-day.is-period { background: var(--c-menstrual); color: #fff; }
.cal-day.is-prefilled { background: repeating-linear-gradient(135deg, var(--c-menstrual-soft) 0 4px, color-mix(in srgb, var(--c-menstrual) 45%, var(--c-menstrual-soft)) 4px 8px); color: var(--text); }
.cal-day.is-predicted { border-color: var(--c-menstrual); border-style: dashed; }
.cal-day.is-ovulation { box-shadow: inset 0 0 0 2px var(--c-ovulation); }
.cal-day.is-today { font-weight: 800; }
.cal-day.is-today .cal-num { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.cal-day.is-today:not(.is-period):not(.is-prefilled) { border-color: var(--accent); }
.cal-day.is-selected { outline: 3px solid var(--accent); outline-offset: 1px; }
.cal-day:not(.is-static):hover { filter: brightness(0.95); }
.cal-num { line-height: 1; }
.cal-dots { display: flex; gap: 3px; height: 6px; margin-top: 3px; }
.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.dot-log { background: currentColor; opacity: 0.8; }
.dot-pms { background: var(--c-luteal); }
.cal-day.is-period .dot-log { background: #fff; }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 0.8rem; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 16px; height: 16px; border-radius: 5px; display: inline-block; border: 2px solid transparent; }
.lg-period { background: var(--c-menstrual); }
.lg-prefilled { background: repeating-linear-gradient(135deg, var(--c-menstrual-soft) 0 3px, color-mix(in srgb, var(--c-menstrual) 45%, var(--c-menstrual-soft)) 3px 6px); }
.lg-predicted { border-color: var(--c-menstrual); border-style: dashed; }
.lg-fertile { background: var(--c-ovulation-soft); }
.lg-ovulation { box-shadow: inset 0 0 0 2px var(--c-ovulation); }
.lg-pms { background: var(--c-luteal); border-radius: 50%; width: 10px; height: 10px; }
.lg-log { background: var(--text); border-radius: 50%; width: 8px; height: 8px; }
.lg-today { border-color: var(--accent); }

/* quick log */
.quick-log { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.quick-log::-webkit-scrollbar { display: none; }
.quick-log .chip { flex-shrink: 0; }

/* sheet / dialog */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 8, 14, 0.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg-elev); color: var(--text); width: 100%; max-width: 720px; max-height: 92vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; box-shadow: 0 -8px 30px rgba(0,0,0,0.18); animation: sheet-in 0.18s ease-out; }
.sheet-center { border-radius: 20px; max-width: 440px; margin: 16px; align-self: center; }
.sheet-backdrop:has(.sheet-center) { align-items: center; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; }
.sheet-title { font-size: 1.1rem; font-weight: 700; }
.sheet-body { padding: 6px 20px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; }
.dialog-text { margin-bottom: 14px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* toast */
.toast-host { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; padding: 0 16px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 0.92rem; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,0.2); max-width: 100%; }
.toast-error { background: var(--danger); color: #fff; }
.toast-success { background: var(--success); color: #fff; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg-elev) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); display: flex; justify-content: center; z-index: 10; }
.tab { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 0.72rem; font-weight: 600; text-decoration: none; }
.tab.is-active { color: var(--accent); }
.tab:hover { text-decoration: none; }
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* auth */
.auth { max-width: 440px; margin: 0 auto; padding: 32px 0; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand h1 { font-size: 1.6rem; }
.auth-lead { color: var(--muted); text-align: center; margin-bottom: 18px; }
.auth-card .card-title { margin-bottom: 14px; }
.invite-preview { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); margin: -4px 0 14px; font-size: 0.92rem; background: var(--bg-soft); }
.invite-preview.is-valid { background: var(--c-ovulation-soft); color: #176b65; }
.invite-preview.is-invalid { background: var(--c-menstrual-soft); color: #a3243f; }
.invite-form.is-compact .field { margin-bottom: 0; }

/* states */
.state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 12px; text-align: center; color: var(--muted); }
.state-compact { padding: 10px; flex-direction: row; text-align: left; }
.state-title { font-weight: 700; color: var(--text); }
.state-detail { font-size: 0.9rem; }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.sk-line { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--bg-soft), var(--border), var(--bg-soft)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* charts & stats */
.chart { display: block; max-width: 100%; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-tick, .chart-label { fill: var(--muted); font-size: 11px; }
.chart-value { fill: var(--text); font-size: 11px; font-weight: 600; }
.chart-avg { stroke: var(--text); stroke-dasharray: 4 4; stroke-width: 1.5; opacity: 0.7; }
.chart-avg-label { fill: var(--muted); font-size: 10px; }
.bar-muted { opacity: 0.4; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
.stat-label { color: var(--muted); font-size: 0.84rem; }
.phase-block { margin-bottom: 12px; }
.phase-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.phase-swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* settings */
.settings-section { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow); }
.settings-section summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 700; }
.settings-section summary::-webkit-details-marker { display: none; }
.settings-section summary .icon { color: var(--accent); }
.settings-section summary .chev { margin-left: auto; color: var(--muted); transition: transform 0.15s; }
.settings-section[open] summary .chev { transform: rotate(180deg); }
.settings-body { padding: 0 16px 16px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--c-luteal-soft); color: var(--text); margin-bottom: 12px; font-size: 0.9rem; }
.banner .grow { flex: 1; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--bg-soft); border-radius: var(--radius-sm); padding: 8px 8px 8px 12px; margin: 8px 0; }
.link-box code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; }
.save-indicator { color: var(--muted); font-size: 0.85rem; min-width: 60px; text-align: right; }
.save-indicator.is-error { color: var(--danger); }
.log-section { margin-bottom: 16px; }
.log-section h3 { font-size: 0.95rem; margin-bottom: 8px; }
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.day-nav h2 { font-size: 1.1rem; text-align: center; flex: 1; }
.inline-confirm { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px; margin-top: 10px; }
.inline-confirm .dialog-actions { justify-content: flex-start; }
.onboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.period-row .row-end { display: flex; gap: 2px; }
.empty-inline { color: var(--muted); font-size: 0.9rem; padding: 6px 0; }

/* wide screens: side rail */
@media (min-width: 900px) {
  .main { padding-left: 120px; padding-bottom: 32px; max-width: 840px; }
  .tabbar { left: 0; right: auto; top: 0; bottom: 0; height: auto; width: 96px; flex-direction: column; justify-content: flex-start; padding-top: 24px; border-top: none; border-right: 1px solid var(--border); }
  .tab { flex: 0 0 auto; width: 100%; max-width: none; padding: 12px 0; font-size: 0.78rem; }
  .toast-host { bottom: 24px; left: 96px; }
  .topbar { margin-left: -16px; }
  .sheet { border-radius: 22px; margin-bottom: 24px; }
  .sheet-backdrop { align-items: center; }
}
@media (max-width: 380px) {
  .hero-headline { font-size: 1.3rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .kv dt { width: 90px; }
}
