:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --ink: #171717;
  --muted: #737373;
  --border: #e8e8e8;
  --primary: #72e3ad;
  --primary-strong: #5fd49a;
  --primary-soft: rgba(114, 227, 173, 0.18);
  --primary-foreground: #1e2723;
  --success: #059669;
  --warning: #b45309;
  --warning-soft: #fff7ed;
  --danger: #ca3214;
  --danger-soft: #fef2f2;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --input: #f6f6f6;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-soft: none;
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 248px;
  color-scheme: light;
  font-family: Outfit, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.visually-hidden { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.muted { color: var(--muted); }
.eyebrow, .step-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.boot-screen, .lock-screen {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 14% 10%, rgba(114, 227, 173, .22), transparent 38%),
    radial-gradient(circle at 88% 90%, rgba(114, 227, 173, .12), transparent 36%),
    #fcfcfc;
}
.boot-screen { gap: 8px; align-content: center; text-align: center; }
.boot-screen strong { font-size: 1.5rem; letter-spacing: -.02em; }
.boot-screen span { color: var(--muted); font-size: .9rem; }
.brand-logo { display: block; border-radius: 10px; object-fit: contain; }
.brand-logo--lg { margin: 0 auto 14px; }
.brand-pro { color: var(--primary); font-weight: 700; }
.brand-row { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-row strong { font-weight: 700; letter-spacing: -.01em; }
.byline { margin: 0 0 8px; color: var(--muted); font-size: .84rem; font-weight: 500; }

.lock-card {
  width: min(400px, 100%);
  padding: 32px 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}
.lock-card h1 { margin: 0 0 2px; font-size: 1.75rem; letter-spacing: -.03em; }
.lock-card .stack { margin-top: 22px; }
.lock-hint { margin-top: 16px; font-size: .76rem; line-height: 1.45; }
.stack { display: grid; gap: 14px; }

.field { display: grid; gap: 7px; text-align: left; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--input); color: var(--ink); padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { min-height: 86px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-soft);
}
.field-inline { display: flex; gap: 10px; align-items: end; }
.field-inline > * { flex: 1; }
.check-row { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: .84rem; line-height: 1.4; }
.check-row input { margin-top: 3px; accent-color: var(--primary); }
.form-error { margin: 0; border-radius: 10px; background: var(--danger-soft); color: var(--danger); padding: 10px 12px; font-size: .84rem; font-weight: 600; }

.button {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 11px; padding: 8px 14px;
  font-weight: 600; color: var(--ink); background: transparent;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.button:hover { background: var(--surface-2); }
.button:focus-visible, .nav-item:focus-visible, .icon-button:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.button--primary {
  color: var(--primary-foreground); background: var(--primary);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset;
}
.button--primary:hover { background: var(--primary-strong); }
.button--secondary { border-color: var(--border); background: var(--surface); }
.button--secondary:hover { background: var(--surface-2); }
.button--ghost { color: var(--muted); border-color: transparent; }
.button--ghost:hover { color: var(--ink); background: var(--surface-2); }
.button--danger { color: #fff; background: var(--danger); }
.button--large { min-height: 48px; font-size: .95rem; }
.button--full { width: 100%; }
.icon-button {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 1.15rem;
}
.icon-button:hover { background: var(--surface-2); color: var(--ink); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar);
  padding: 16px 12px; display: flex; flex-direction: column;
  border-right: 1px solid var(--border); background: #fff; color: var(--ink);
}
.sidebar-brand { padding: 6px 10px 18px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sidebar-brand .brand-logo { width: 32px; height: 32px; border-radius: 8px; }
.sidebar-brand small { display: block; margin-top: 2px; color: var(--muted); font-size: .7rem; font-weight: 500; }
.nav-list { display: grid; gap: 2px; padding: 0 2px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 11px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  padding: 10px 11px; text-align: left; font-size: .9rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item > span:first-child {
  width: 22px; color: #a3a3a3; font-size: .95rem; text-align: center; opacity: .9;
}
.nav-item:hover { color: var(--ink); background: var(--surface-2); }
.nav-item.active {
  color: var(--primary-foreground);
  background: var(--primary-soft);
  font-weight: 600;
}
.nav-item.active > span:first-child { color: #059669; }
.sidebar-footer {
  margin-top: auto; display: grid; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.privacy-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; padding: 0 6px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.status-dot.is-offline { background: #a3a3a3; box-shadow: 0 0 0 3px #ededed; }
.status-dot.is-error { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.sidebar .button--ghost { color: var(--muted); border: 1px solid var(--border); }
.sidebar .button--ghost:hover { color: var(--ink); background: var(--surface-2); }

.main-content { margin-left: var(--sidebar); min-height: 100vh; padding: 0 28px 40px; }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(247,247,247,.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232,232,232,.9);
}
.topbar h1 { margin: 0; font-size: 1.28rem; font-weight: 700; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.month-nav {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 3px;
}
.month-nav__btn {
  width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent;
  color: var(--ink); font-size: 1.25rem; line-height: 1; font-weight: 600;
}
.month-nav__btn:hover { background: var(--surface-2); }
.month-nav__label {
  min-width: 118px; height: 34px; border: 0; border-radius: 9px; background: transparent;
  color: var(--ink); font-size: .88rem; font-weight: 700; letter-spacing: -.01em;
  text-transform: capitalize; padding: 0 8px;
}
.month-nav__label:hover { background: var(--primary-soft); }
.month-nav__today {
  height: 34px; margin-left: 2px; border: 0; border-radius: 9px;
  background: #dbeafe; color: #1d4ed8; font-size: .72rem; font-weight: 700; padding: 0 10px;
}
.month-nav__today:hover { filter: brightness(0.97); }
.month-nav__today.hidden { display: none; }
.view-root { width: min(1180px, 100%); margin: 0 auto; padding-top: 22px; }

.grid { display: grid; gap: 14px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--dashboard { grid-template-columns: minmax(0, 1.4fr) minmax(280px, .7fr); }
.grid--settings { grid-template-columns: minmax(0, 1fr) minmax(280px, .5fr); }
.section-gap { margin-top: 14px; }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.card-body { padding: 18px; }
.card-header {
  min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { margin: 0; font-size: .95rem; font-weight: 650; letter-spacing: -.01em; }
.card-header p { margin: 3px 0 0; font-size: .78rem; color: var(--muted); font-weight: 450; }
.card-actions { display: flex; gap: 8px; align-items: center; }

.card--dark,
.status-hero {
  color: var(--ink);
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(114,227,173,.16), transparent 42%),
    #fff;
}
.card--dark .muted,
.status-hero .muted { color: var(--muted); }
.card--dark .card-header { border-color: var(--border); }
.card--accent {
  border-color: rgba(114,227,173,.45);
  background: linear-gradient(160deg, rgba(114,227,173,.08), #fff 55%);
}

.status-hero {
  position: relative; min-height: 220px; padding: 24px;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.status-hero::after { display: none; }
.status-hero > * { position: relative; z-index: 1; }
.status-label {
  display: inline-flex; width: fit-content; align-items: center; gap: 7px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px 10px; color: var(--muted); font-size: .7rem; font-weight: 700;
}
.status-label .status-dot { box-shadow: none; }
.status-hero h2 {
  margin: 14px 0 8px; font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -.04em; line-height: 1.05; color: var(--ink);
}
.status-hero p { max-width: 640px; margin: 0; color: var(--muted); line-height: 1.55; font-size: .92rem; }
.hero-footer { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-top: 22px; }
.hero-kicker { color: var(--muted); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.hero-value { display: block; margin-top: 4px; font-size: 1.55rem; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.hero-action {
  max-width: 380px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--ink); font-size: .82rem; line-height: 1.45;
}

.metric-card { padding: 16px; }
.metric-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.metric-label { color: var(--muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.metric-icon {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 9px; background: var(--primary-soft); color: #059669; font-weight: 700; font-size: .85rem;
}
.metric-value { display: block; margin-top: 12px; font-size: 1.4rem; font-weight: 700; letter-spacing: -.03em; }
.metric-foot { margin-top: 6px; color: var(--muted); font-size: .75rem; }
.metric-value.negative { color: var(--danger); }
.metric-value.positive { color: var(--success); }

.progress { width: 100%; height: 7px; overflow: hidden; border-radius: 999px; background: #efefef; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .35s ease; }
.progress--warning > span { background: #f59e0b; }
.progress--danger > span { background: #dc2626; }
.progress--dark { background: #efefef; }
.progress--dark > span { background: var(--primary); }
.progress-row { display: grid; gap: 7px; }
.progress-labels { display: flex; justify-content: space-between; gap: 12px; font-size: .76rem; }
.progress-labels span:last-child { color: var(--muted); font-weight: 600; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px;
  border-radius: 999px; padding: 3px 9px; font-size: .66rem; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
}
.pill--success { background: var(--primary-soft); color: var(--success); }
.pill--danger { background: var(--danger-soft); color: var(--danger); }
.pill--warning { background: var(--warning-soft); color: var(--warning); }
.pill--info { background: #dbeafe; color: #1d4ed8; }
.pill--neutral { background: #f3f3f3; color: #525252; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 34px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--muted); padding: 6px 12px; font-size: .8rem; font-weight: 600;
}
.chip.active, .chip:hover { border-color: transparent; background: #dbeafe; color: #1d4ed8; }
.choice-card {
  border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 16px;
  text-align: left; font-weight: 650;
}
.choice-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.dialog-fields--choices { grid-template-columns: repeat(2, 1fr); }
.button--tiny { min-height: 30px; padding: 4px 10px; font-size: .72rem; border-radius: 8px; }
.list--actions .list-item, .entry-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px 0;
}
.entry-row .row-actions {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px;
}
.span-2 { grid-column: 1 / -1; }

@media (max-width: 840px) {
  .nav-list { grid-template-columns: repeat(5, 1fr); }
}

.list { display: grid; }
.list-item { min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-icon {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 10px; background: var(--surface-2); font-weight: 700; color: #059669; font-size: .85rem;
}
.list-main { min-width: 0; flex: 1; }
.list-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; font-weight: 600; }
.list-main small { display: block; margin-top: 3px; color: var(--muted); font-size: .73rem; }
.list-value { flex: 0 0 auto; text-align: right; font-weight: 650; font-size: .86rem; }
.list-value small { display: block; margin-top: 3px; color: var(--muted); font-weight: 500; font-size: .68rem; }

.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th {
  padding: 11px 14px; border-bottom: 1px solid var(--border); background: #fafafa;
  color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; text-align: left; white-space: nowrap; font-weight: 600;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .84rem; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table .number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .actions { text-align: right; white-space: nowrap; }
.table-title { font-weight: 650; }
.table-subtitle { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.empty-state { padding: 40px 22px; text-align: center; }
.empty-state .empty-icon {
  width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center;
  border-radius: 12px; background: var(--primary-soft); color: #059669; font-size: 1.2rem;
}
.empty-state h3 { margin: 0 0 6px; font-size: 1rem; }
.empty-state p { max-width: 420px; margin: 0 auto 16px; color: var(--muted); line-height: 1.5; font-size: .88rem; }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); border-bottom: 1px solid var(--border); }
.stat-strip > div { padding: 14px 16px; border-right: 1px solid var(--border); }
.stat-strip > div:last-child { border-right: 0; }
.stat-strip span { display: block; color: var(--muted); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-strip strong { display: block; margin-top: 5px; font-size: 1.05rem; font-weight: 700; }

.scenario-grid { display: grid; grid-template-columns: repeat(11, minmax(72px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.scenario-card {
  min-width: 72px; padding: 10px 8px; border: 1px solid var(--border);
  border-radius: 11px; text-align: center; background: #fff;
}
.scenario-card.current { border-color: var(--primary); background: var(--primary-soft); }
.scenario-card.freedom:not(.current) { border-color: rgba(114,227,173,.55); background: rgba(114,227,173,.08); }
.scenario-card strong { display: block; font-size: 1.05rem; font-weight: 700; }
.scenario-card small { display: block; margin-top: 3px; color: var(--muted); font-size: .65rem; }
.scenario-card .scenario-value { margin-top: 8px; font-size: .74rem; font-weight: 650; }
.scenario-card.negative .scenario-value { color: var(--danger); }
.scenario-card.positive .scenario-value { color: var(--success); }

.envelope-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.envelope-card { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.envelope-card.over { border-color: #fecaca; background: #fffafa; }
.envelope-card h3 { margin: 0 0 2px; font-size: .9rem; font-weight: 650; }
.envelope-card .envelope-value { margin: 12px 0 3px; font-size: 1.3rem; font-weight: 700; letter-spacing: -.03em; }
.envelope-card .envelope-note { color: var(--muted); font-size: .72rem; }
.envelope-actions { display: flex; gap: 8px; margin-top: 14px; }
.envelope-actions .button { flex: 1; min-height: 34px; padding: 6px 10px; font-size: .75rem; }

.projection-chart { position: relative; min-height: 240px; display: flex; align-items: end; gap: 5px; padding: 20px 4px 26px; border-bottom: 1px solid var(--border); }
.projection-chart::before {
  content: ""; position: absolute; inset: 20px 0 26px;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #efefef 25%);
  pointer-events: none;
}
.projection-bar-wrap { position: relative; z-index: 1; height: 180px; flex: 1; min-width: 14px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.projection-bar { width: min(20px, 70%); min-height: 3px; border-radius: 4px 4px 1px 1px; background: var(--primary); }
.projection-bar.negative { border-radius: 1px 1px 4px 4px; background: var(--danger); }
.projection-label { position: absolute; bottom: -20px; color: var(--muted); font-size: .58rem; white-space: nowrap; }

.callout {
  display: flex; gap: 11px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 12px; background: #fafafa; padding: 13px;
}
.callout--warning { border-color: #fed7aa; background: #fff7ed; }
.callout--danger { border-color: #fecaca; background: #fef2f2; }
.callout--info { border-color: #bfdbfe; background: #eff6ff; }
.callout:not(.callout--warning):not(.callout--danger):not(.callout--info) {
  border-color: rgba(114,227,173,.4); background: rgba(114,227,173,.08);
}
.callout-icon {
  width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 8px; background: #fff; border: 1px solid var(--border); font-weight: 700; font-size: .8rem;
}
.callout strong { display: block; font-size: .84rem; font-weight: 650; }
.callout p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }

.coach-stack { gap: 8px; align-content: start; }
.spend-board {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff;
}
.spend-board > .eyebrow { margin: 0; padding: 12px 14px 0; }
.spend-board .stat-strip { border-bottom: 0; }
.spend-board .list { padding: 0 10px 8px; }
.coach-note { margin: 10px 14px 14px; font-size: .78rem; line-height: 1.45; color: var(--muted); }
.positive { color: var(--success); }

.settings-section { display: grid; gap: 14px; padding: 18px; }
.settings-section h3 { margin: 0; font-size: .92rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.danger-zone { border-color: #fecaca; }
.danger-zone .card-header { background: #fffafa; }
.backup-actions { display: grid; gap: 8px; }

.dialog { width: min(600px, calc(100% - 28px)); max-height: min(820px, calc(100% - 28px)); border: 0; border-radius: 16px; padding: 0; background: transparent; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(23,23,23,.4); backdrop-filter: blur(4px); }
.dialog--small { width: min(430px, calc(100% - 28px)); }
.dialog-card { max-height: inherit; overflow: auto; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.dialog-header h2 { margin: 0; font-size: 1.1rem; }
.dialog-fields { padding: 18px 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dialog-fields .span-2 { grid-column: 1 / -1; }
.dialog-card > .muted { padding: 0 20px; }
.dialog-card > .form-error { margin: 0 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }

.toast-region { position: fixed; z-index: 2000; top: 84px; right: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast {
  width: min(360px, calc(100vw - 40px)); display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--shadow); padding: 12px 13px;
  animation: toast-in .22s ease-out;
}
.toast strong { display: block; font-size: .82rem; }
.toast span { display: block; margin-top: 2px; color: var(--muted); font-size: .74rem; line-height: 1.4; }
.toast.success { border-color: rgba(114,227,173,.55); }
.toast.error { border-color: #fecaca; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.mobile-summary { display: none; }

@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--dashboard { grid-template-columns: 1fr; }
  .envelope-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 840px) {
  :root { --sidebar: 0px; }
  .sidebar {
    inset: auto 0 0 0; width: auto; height: 68px;
    padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border: 0; border-top: 1px solid var(--border); background: #fff;
  }
  .sidebar-brand, .sidebar-footer { display: none; }
  .nav-list { height: 100%; grid-template-columns: repeat(5, 1fr); gap: 2px; overflow-x: auto; }
  .nav-item {
    min-width: 58px; height: 52px; flex-direction: column; justify-content: center; gap: 2px;
    padding: 4px 2px; border-radius: 10px; font-size: .58rem; text-align: center;
  }
  .nav-item > span:first-child { width: auto; font-size: .95rem; }
  .nav-item.active { box-shadow: inset 0 -2px var(--primary); }
  .main-content { margin-left: 0; padding: 0 14px 90px; }
  .topbar { min-height: 68px; }
  .topbar-actions .button--secondary { display: none !important; }
  .topbar-actions .button--primary { width: 38px; overflow: hidden; padding: 8px; font-size: 0; }
  .topbar-actions .button--primary span { font-size: 1.05rem; }
  .month-nav__label { min-width: 96px; font-size: .8rem; padding: 0 4px; }
  .month-nav__today { padding: 0 8px; }
  .grid--settings, .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .hero-footer { align-items: stretch; flex-direction: column; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip > div { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .stat-strip > div:nth-child(2n) { border-right: 0; }
  .stat-strip > div:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 560px) {
  .lock-card { padding: 26px 18px; }
  .topbar h1 { font-size: 1.08rem; }
  .topbar .eyebrow { font-size: .6rem; }
  .grid--4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 13px; }
  .metric-value { font-size: 1.15rem; }
  .metric-icon { width: 28px; height: 28px; }
  .metric-foot { display: none; }
  .status-hero { min-height: auto; padding: 18px; }
  .status-hero h2 { font-size: 1.7rem; }
  .card-header, .card-body { padding-left: 14px; padding-right: 14px; }
  .envelope-grid { grid-template-columns: 1fr; }
  .form-grid, .dialog-fields { grid-template-columns: 1fr; }
  .dialog-fields .span-2 { grid-column: auto; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .stat-strip { grid-template-columns: 1fr; }
  .stat-strip > div { border-right: 0; }
}

@media print {
  .sidebar, .topbar-actions, .button, .toast-region { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .topbar { position: static; background: white; }
  .card { break-inside: avoid; box-shadow: none; }
}
