:root {
  --page: #eef5f8;
  --surface: #ffffff;
  --surface-soft: #e7f0f4;
  --surface-tint: #f7fbfd;
  --ink: #132033;
  --muted: #5c6a7a;
  --line: #cfdbe5;
  --accent: #176b87;
  --accent-strong: #0e4c65;
  --accent-soft: #dceff6;
  --gold: #b86b18;
  --gold-soft: #fff1da;
  --blue: #1f4f7a;
  --blue-soft: #e2edf7;
  --income: #1f7a4d;
  --income-soft: #dcf4e7;
  --expense: #a94d18;
  --expense-soft: #f8e7d8;
  --danger: #b42318;
  --danger-soft: #fde7e5;
  --shadow: 0 10px 22px rgba(29, 37, 32, 0.07);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  overflow-x: hidden;
}

body.theme-dark {
  color-scheme: dark;
}

body {
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.12) 0%, rgba(255, 255, 255, 0) 32rem),
    linear-gradient(160deg, rgba(184, 107, 24, 0.07) 0%, rgba(255, 255, 255, 0) 28rem),
    var(--page);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

body.density-compact .surface,
body.density-compact .metric-card,
body.density-compact .list-card,
body.density-compact .empty-state,
body.density-compact .breakdown-row {
  padding: 10px;
}

body.density-compact .form-grid,
body.density-compact .list-stack,
body.density-compact .settings-grid {
  gap: 9px;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: #0a1424;
  color: var(--ink);
  border-color: var(--line);
}

body.theme-dark option {
  background: #0a1424;
  color: var(--ink);
}

body.theme-dark .topbar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-color: var(--line);
}

body.theme-dark .auth-panel,
body.theme-dark .sidebar,
body.theme-dark .surface,
body.theme-dark .metric-card,
body.theme-dark .list-card,
body.theme-dark .setting-card {
  border-color: var(--line);
}

body.theme-dark .product-proof-grid article {
  background: color-mix(in srgb, var(--surface-soft) 68%, transparent);
}

body.theme-dark .product-preview,
body.theme-dark .product-proof-list span {
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
}

body.theme-dark .auth-panel-featured {
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(184, 107, 24, 0.08)),
    var(--surface);
}

body.theme-dark .product-preview {
  border-color: var(--line);
  background:
    linear-gradient(135deg, rgba(20, 36, 58, 0.96), rgba(15, 27, 46, 0.96)),
    var(--surface);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
}

body.theme-dark .preview-metrics div,
body.theme-dark .preview-flow span,
body.theme-dark .product-proof-list span {
  border-color: var(--line);
  background: rgba(8, 17, 31, 0.62);
}

body.theme-dark .preview-bar strong,
body.theme-dark .preview-flow strong,
body.theme-dark .product-proof-list span {
  color: var(--accent);
}

body.theme-dark .page-head,
body.theme-dark .calendar-day,
body.theme-dark .calendar-event,
body.theme-dark .mini-balance {
  background:
    linear-gradient(135deg, rgba(20, 36, 58, 0.72), rgba(15, 27, 46, 0.72)),
    var(--surface);
}

body.theme-dark .account-highlight {
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(20, 36, 58, 0.72)),
    var(--surface);
}

body.theme-dark .metric-card:nth-child(5),
body.theme-dark .metric-card:nth-child(6),
body.theme-dark .metric-card:nth-child(7) {
  background:
    linear-gradient(135deg, rgba(184, 107, 24, 0.18), rgba(20, 36, 58, 0.82)),
    var(--surface);
}

body.theme-dark .button.secondary,
body.theme-dark .status-pill {
  background: var(--surface-soft);
  border-color: var(--line);
}

body.theme-dark .sidebar {
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.11), transparent 170px),
    var(--surface);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

body.theme-dark .sidebar-title,
body.theme-dark .nav-item,
body.theme-dark .nav-subitem,
body.theme-dark .sub-nav-item {
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
}

body.theme-dark .nav-item.active,
body.theme-dark .nav-item:hover {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--surface-soft) 94%, transparent));
  color: var(--ink);
}

body.theme-dark .nav-submenu {
  border-left-color: color-mix(in srgb, var(--accent) 46%, transparent);
  background: rgba(8, 18, 32, 0.74);
}

body.theme-dark .sub-sidebar,
body.theme-dark .nav-subitem,
body.theme-dark .sub-nav-item {
  background: rgba(8, 18, 32, 0.34);
}

body.theme-dark .nav-subitem.active,
body.theme-dark .nav-subitem:hover,
body.theme-dark .sub-nav-item.active,
body.theme-dark .sub-nav-item:hover {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-soft));
  color: var(--ink);
}

button,
input,
select,
textarea,
.file-button {
  font: inherit;
}

button,
a.button {
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}

.button:hover {
  filter: brightness(0.96);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.78;
  filter: none;
}

.button.secondary {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f6b8b2;
}

.button.income-action {
  background: var(--income);
}

.button.compact-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.88rem;
}

label {
  display: grid;
  gap: 7px;
}

label span,
.overline {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field-hint {
  display: block;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.field-hint[data-status="ok"] {
  color: var(--income);
}

.field-hint[data-status="warning"] {
  color: var(--expense);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 0 48px;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  min-height: 72px;
  border: 1px solid rgba(216, 223, 215, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 42px rgba(29, 37, 32, 0.08);
  padding: 12px 14px;
  backdrop-filter: blur(12px);
}

.sidebar-toggle {
  flex: 0 0 auto;
  min-width: 72px;
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: min(260px, 100%);
  max-width: 380px;
}

.brand-block > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-slogan {
  display: block;
  max-width: 100%;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-block .overline {
  margin: 0;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, var(--accent), var(--blue));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(23, 107, 135, 0.22);
}

.topbar h1,
.page h2,
.surface h3,
.auth-panel h2 {
  margin: 0;
}

.topbar h1 {
  font-size: 1.28rem;
  line-height: 1.1;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  row-gap: 8px;
}

.topbar-quick-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-right: 4px;
  flex: 0 0 auto;
}

.topbar-quick-actions .button {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.month-control {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  gap: 8px;
  align-items: center;
  flex: 1 1 220px;
  min-width: 210px;
  max-width: 280px;
}

.month-control input,
.month-control select {
  width: 100%;
  min-width: 0;
}

.topbar-actions .button,
.topbar-actions .status-pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

#session-label {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  max-width: 100%;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.status-pill.ok {
  background: var(--income-soft);
  border-color: #a6d8bd;
  color: var(--income);
}

.status-pill.warning {
  background: #fff4e6;
  border-color: #efc08b;
  color: #9a4d0f;
}

.status-pill.danger {
  background: #fff0ef;
  border-color: #efaaa4;
  color: var(--danger);
}

.flash {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.flash.success {
  color: var(--accent);
  border-color: #9ad8ce;
}

.flash.error {
  color: var(--danger);
  border-color: #f1aaa2;
}

.auth-view {
  display: grid;
  place-items: start center;
  padding-top: 28px;
}

body.is-auth-screen .month-control,
body.is-auth-screen .sidebar-toggle,
body.is-auth-screen .topbar-quick-actions,
body.is-auth-screen .topbar-actions .status-pill,
body.is-auth-screen #logout-button {
  display: none;
}

.auth-panel {
  width: min(720px, 100%);
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel-featured {
  width: min(820px, 100%);
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.12), rgba(184, 107, 24, 0.08)),
    var(--surface);
}

.auth-panel-featured h2 {
  font-size: 3.05rem;
  line-height: 1;
  margin: 4px 0 10px;
  max-width: 760px;
}

.commercial-auth {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.landing-auth {
  width: min(1180px, 100%);
  display: grid;
  gap: 18px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 24px;
  align-items: end;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.14), rgba(255, 255, 255, 0.76) 48%, rgba(184, 107, 24, 0.08)),
    var(--surface);
  box-shadow: var(--shadow);
}

.landing-hero-copy {
  display: grid;
  gap: 10px;
  max-width: 820px;
}

.landing-hero-copy h2 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: 3.05rem;
  line-height: 1;
}

.landing-hero-copy .modal-copy {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.62;
}

.landing-hero-points {
  display: grid;
  gap: 12px;
}

.landing-hero-points span {
  display: grid;
  gap: 3px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(23, 107, 135, 0.22);
}

.landing-hero-points strong {
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.landing-hero-points small {
  color: var(--muted);
  font-weight: 700;
}

.landing-login-card {
  justify-self: center;
  width: min(520px, 100%);
}

.landing-dashboard-story {
  display: grid;
  gap: 20px;
  padding: 8px 0 0;
}

.landing-story-copy {
  display: grid;
  gap: 8px;
  max-width: 860px;
}

.landing-story-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.08;
}

.landing-story-copy .modal-copy {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.dashboard-print {
  --surface: #ffffff;
  --surface-soft: #e7f0f4;
  --ink: #132033;
  --muted: #5c6a7a;
  --line: #cfdbe5;
  --accent: #176b87;
  --accent-strong: #0e4c65;
  --accent-soft: #dceff6;
  --blue: #1f4f7a;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(226, 237, 247, 0.86)),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dashboard-print-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-print-brand,
.dashboard-print-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-print-brand span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #fff;
  font-weight: 900;
}

.dashboard-print-brand strong {
  color: var(--ink);
  font-size: 1rem;
}

.dashboard-print-controls small {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 750;
}

.dashboard-print-body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.dashboard-print-menu {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border-right: 1px solid var(--line);
}

.dashboard-print-menu span {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 800;
}

.dashboard-print-menu span.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.dashboard-print-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.dashboard-print-head {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
}

.dashboard-print-head h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.05;
}

.dashboard-print-head button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 850;
}

.dashboard-print-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-print-metrics article {
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.dashboard-print-metrics span,
.dashboard-print-columns span {
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-print-metrics strong {
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.dashboard-print-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-print-columns section {
  display: grid;
  gap: 8px;
  min-height: 124px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.dashboard-print-columns strong {
  color: var(--ink);
  line-height: 1.25;
}

.landing-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-detail-grid article {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.landing-detail-grid strong {
  color: var(--accent-strong);
  line-height: 1.25;
}

.landing-detail-grid span {
  color: var(--muted);
  line-height: 1.45;
}

body.theme-dark .landing-hero-points strong,
body.theme-dark .landing-detail-grid strong {
  color: var(--accent);
}

body.theme-dark .landing-hero {
  background:
    linear-gradient(135deg, rgba(20, 36, 58, 0.98), rgba(15, 27, 46, 0.96)),
    var(--surface);
}

.product-entry-panel,
.auth-card {
  width: 100%;
}

.product-entry-panel {
  display: grid;
  align-content: space-between;
  gap: 20px;
  min-height: 520px;
  overflow: hidden;
}

.product-hero-copy {
  display: grid;
  gap: 8px;
}

.product-hero-copy .modal-copy {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.product-preview {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(23, 107, 135, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(226, 237, 247, 0.82)),
    var(--surface-tint);
  box-shadow: 0 16px 30px rgba(19, 32, 51, 0.08);
}

.preview-bar,
.preview-flow span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-bar {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.preview-bar span,
.preview-metrics span,
.preview-flow span {
  color: var(--muted);
}

.preview-bar strong,
.preview-flow strong {
  color: var(--accent-strong);
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.preview-metrics div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(207, 219, 229, 0.88);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
}

.preview-metrics span,
.preview-flow span {
  font-size: 0.86rem;
  line-height: 1.35;
}

.preview-metrics strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.preview-flow {
  display: grid;
  gap: 8px;
}

.preview-flow span {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.product-proof-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.product-proof-list span {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  color: var(--accent-strong);
  font-weight: 750;
  line-height: 1.35;
}

.product-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.product-proof-grid article {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
}

.product-proof-grid strong,
.product-proof-grid span {
  display: block;
}

.product-proof-grid span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-card {
  display: grid;
  align-content: start;
  gap: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.auth-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.auth-link-row {
  display: flex;
  justify-content: center;
}

.link-button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
  padding: 6px 10px;
}

.link-button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.commercial-auth-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.onboarding-note {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(23, 107, 135, 0.18);
  border-radius: 8px;
  background: rgba(23, 107, 135, 0.08);
  color: var(--ink);
}

.onboarding-note strong {
  font-size: 0.92rem;
}

.onboarding-note span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.onboarding-checklist {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
}

.onboarding-head-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 850;
  line-height: 1;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.onboarding-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.onboarding-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--income));
  transition: width 180ms ease;
}

.onboarding-grid {
  display: flex;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 2px 6px;
  scroll-behavior: smooth;
  scroll-padding: 2px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.onboarding-step {
  flex: 0 0 clamp(260px, 31vw, 460px);
  min-width: 0;
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-tint);
  scroll-snap-align: start;
}

body.theme-dark .onboarding-step {
  border-color: var(--line);
  background:
    linear-gradient(135deg, rgba(15, 27, 46, 0.96), rgba(8, 18, 32, 0.96)),
    var(--surface);
}

body.theme-dark .onboarding-step strong {
  color: #f7fbff;
}

body.theme-dark .onboarding-step span {
  color: #d4e3f2;
}

.onboarding-step strong,
.onboarding-step span {
  display: block;
}

.onboarding-step span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.onboarding-step.done {
  border-color: color-mix(in srgb, var(--income) 36%, var(--line));
  background: var(--income-soft);
}

body.theme-dark .onboarding-step.done {
  border-color: color-mix(in srgb, var(--income) 52%, var(--line));
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(8, 18, 32, 0.92));
}

body.theme-dark .onboarding-step.done strong {
  color: #f7fbff;
}

body.theme-dark .onboarding-step.done span {
  color: #d4e3f2;
}

.onboarding-step em {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface);
  color: var(--income);
  font-style: normal;
  font-weight: 850;
  font-size: 0.82rem;
}

body.theme-dark .onboarding-step em {
  background: color-mix(in srgb, var(--income) 16%, var(--surface));
  color: color-mix(in srgb, var(--income) 72%, #ffffff);
}

.action-card {
  width: min(560px, 100%);
}

.action-card-actions {
  justify-content: flex-start;
  margin-top: 4px;
}

body[data-action-state="success"] .action-card {
  border-color: rgba(33, 163, 130, 0.34);
}

body[data-action-state="error"] .action-card {
  border-color: rgba(199, 74, 58, 0.34);
}

.form-intro {
  display: grid;
  gap: 4px;
}

.form-intro h2 {
  font-size: 2rem;
  line-height: 1.05;
}

.form-intro span {
  color: var(--muted);
}

.auth-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(8, 20, 32, 0.36);
  backdrop-filter: blur(2px);
}

.sidebar-scrim[hidden] {
  display: none;
}

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 16px auto 16px 16px;
  width: min(300px, calc(100vw - 32px));
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(23, 107, 135, 0.08), transparent 150px),
    var(--surface);
  box-shadow: 0 18px 38px rgba(29, 37, 32, 0.09);
  padding: 12px;
  transform: translateX(calc(-100% - 24px));
  transition: transform 180ms ease;
  will-change: transform;
}

body.sidebar-open .sidebar {
  transform: translateX(0);
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-close {
  min-height: 30px;
  padding: 4px 8px;
  text-transform: none;
}

.nav-menu {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.nav-item {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 760;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-item.active,
.nav-item:hover {
  background:
    linear-gradient(135deg, var(--accent-soft), rgba(230, 240, 247, 0.82));
  color: var(--accent-strong);
  transform: translateX(2px);
}

.nav-submenu {
  display: none;
  grid-template-columns: 1fr;
  gap: 4px;
  margin: -2px 0 6px;
  padding: 4px 0 4px 14px;
  border-left: 2px solid rgba(23, 107, 135, 0.22);
}

.nav-item.active + .nav-submenu,
.nav-submenu:has(.active) {
  display: grid;
}

.nav-subitem {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 750;
}

.nav-subitem.active,
.nav-subitem:hover {
  background: var(--surface-soft);
  color: var(--accent-strong);
}

.outflow-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.sub-sidebar {
  display: none;
}

.sub-nav,
.outflow-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.sub-nav-item {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 9px 11px;
  cursor: pointer;
  font-weight: 800;
}

.sub-nav-item.active,
.sub-nav-item:hover {
  border-color: #9ad8ce;
  background: var(--accent-soft);
  color: var(--accent);
}

.content {
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 981px) {
  .topbar {
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  }

  .topbar > .sidebar-toggle {
    display: none;
  }

  .app-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
  }

  .sidebar-scrim {
    display: none !important;
  }

  .sidebar {
    position: sticky;
    z-index: 1;
    top: 16px;
    inset: auto;
    width: auto;
    max-height: calc(100dvh - 32px);
    transform: none;
    transition: none;
  }

  .sidebar-close {
    display: none;
  }

  .content {
    overflow: visible;
  }
}

.page {
  display: none;
}

.page.active {
  display: grid;
  gap: 16px;
}

.page-head,
.section-head,
.list-card-head,
.list-card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.page-head {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 245, 0.92)),
    var(--surface);
  padding: 16px 18px;
  box-shadow: 0 12px 28px rgba(29, 37, 32, 0.06);
}

.page-head h2 {
  font-size: 1.55rem;
  line-height: 1.05;
}

.surface,
.metric-card,
.list-card,
.empty-state,
.breakdown-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(29, 37, 32, 0.06);
}

.surface {
  padding: 18px;
  min-width: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 118px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.metric-card-secondary {
  display: none;
}

.forecast-surface {
  grid-column: 1 / -1;
}

.forecast-row strong:last-child {
  color: var(--expense);
}

.income-forecast-row strong:last-child {
  color: var(--income);
}

.forecast-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.income-forecast-edit {
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(150px, 1fr) auto;
}

.income-forecast-edit label {
  min-width: 0;
}

.income-expected-card::after {
  background: rgba(27, 148, 92, 0.36);
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px auto;
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: rgba(23, 107, 135, 0.22);
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.35;
}

.metric-card strong {
  font-size: 1.6rem;
  line-height: 1.1;
}

.account-highlight {
  border-color: rgba(23, 107, 135, 0.24);
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.14), rgba(226, 237, 247, 0.62)),
    var(--surface);
}

.account-highlight::after {
  background: var(--accent);
}

.metric-card:nth-child(5),
.metric-card:nth-child(6),
.metric-card:nth-child(7) {
  border-color: rgba(184, 107, 24, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 241, 218, 0.74), rgba(255, 255, 255, 0.86)),
    var(--surface);
}

.metric-card:nth-child(5)::after,
.metric-card:nth-child(6)::after,
.metric-card:nth-child(7)::after {
  background: rgba(184, 107, 24, 0.42);
}

.personal-highlight {
  border-color: rgba(176, 83, 18, 0.34);
  background:
    linear-gradient(135deg, rgba(176, 83, 18, 0.12), transparent 70%),
    #fff8ed;
}

.external-expense-row {
  border-color: rgba(176, 83, 18, 0.28);
  background: #fffaf2;
}

.master-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.master-mini-grid span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 10px;
  line-height: 1.3;
}

.master-mini-grid strong {
  display: block;
  color: var(--ink);
  margin-top: 4px;
}

.master-month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.master-month-card small {
  color: var(--muted);
  line-height: 1.45;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.two-column.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-balance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-balance {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.mini-balance.active {
  border-color: #9ad8ce;
  background: var(--accent-soft);
}

.mini-balance span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}

.mini-balance small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

.mini-balance strong {
  font-size: 1.35rem;
}

.context-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.account-event-list {
  margin-top: 14px;
}

.budget-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece5;
  margin: 12px 0 4px;
}

.budget-bar span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #b45a18);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.calendar-day {
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.calendar-day.has-events {
  border-color: rgba(0, 119, 108, 0.28);
  box-shadow: 0 12px 28px rgba(26, 66, 54, 0.08);
}

.calendar-day-head,
.calendar-event {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.calendar-day-head strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.calendar-weekday,
.calendar-balance,
.calendar-event span {
  color: var(--muted);
  font-size: 0.85rem;
}

.calendar-day-totals {
  font-weight: 800;
}

.calendar-day-totals .positive {
  color: var(--accent);
}

.calendar-day-totals .negative {
  color: var(--danger);
}

.calendar-events {
  display: grid;
  gap: 8px;
}

.calendar-event {
  padding: 9px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.calendar-event.income {
  background: rgba(212, 245, 232, 0.9);
}

.calendar-event.expense {
  background: rgba(255, 244, 230, 0.9);
}

.calendar-event.scheduled {
  border: 1px dashed rgba(176, 83, 18, 0.42);
}

.calendar-event strong,
.calendar-event span {
  display: block;
}

.calendar-event b {
  white-space: nowrap;
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.legal-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.legal-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.legal-summary-card {
  display: grid;
  gap: 8px;
}

.legal-summary-card span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.legal-summary-card strong {
  color: var(--ink);
  font-size: 1.06rem;
}

.legal-summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.legal-section {
  scroll-margin-top: 18px;
}

.legal-list {
  display: grid;
  gap: 12px;
}

.legal-list article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.legal-list strong {
  color: var(--ink);
  font-size: 1rem;
}

.legal-list span {
  color: var(--muted);
  line-height: 1.55;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--muted);
}

.app-footer div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.app-footer strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.app-footer span {
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.footer-links button,
.footer-links a {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.footer-links button:hover,
.footer-links a:hover,
.footer-links button.active {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  color: var(--accent-strong);
}

.readiness-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.readiness-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-tint);
}

.readiness-row > span {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.readiness-row.ok > span {
  background: var(--income-soft);
  color: var(--income);
}

.readiness-row.todo > span {
  background: #fff4e6;
  color: #9a4d0f;
}

.readiness-row strong,
.readiness-row small {
  display: block;
}

.readiness-row small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

.setting-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
  min-width: 0;
}

.setting-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.setting-card a,
.setting-card strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.setting-card small,
.setting-card em {
  color: var(--muted);
  font-size: 0.9rem;
}

.setting-card em {
  font-style: normal;
  font-weight: 750;
  color: var(--accent);
}

.user-setting-card {
  position: relative;
}

.family-invite-form {
  margin-top: 14px;
}

.invite-setting-card {
  margin-top: 8px;
}

.invite-setting-card a {
  color: var(--accent);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.member-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.member-picker legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.member-options {
  display: grid;
  gap: 8px;
}

.member-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 750;
}

.setting-card .member-options span,
.member-options span {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
  text-transform: none;
}

.member-options input {
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--accent);
}

.bank-account-card {
  gap: 9px;
}

.bank-account-card .button {
  justify-self: start;
}

.account-member-form {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.account-member-form .button {
  margin-top: 4px;
}

.compact-empty {
  padding: 10px;
  min-height: auto;
}

.salary-setting-card {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
}

.salary-estimate {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.salary-estimate strong {
  color: var(--income);
}

.salary-confirm-card .form-grid {
  margin-top: 12px;
}

.appearance-preview {
  align-self: stretch;
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 70%),
    var(--surface-soft);
  padding: 14px;
}

.appearance-preview span,
.appearance-preview small {
  color: var(--muted);
}

.appearance-preview strong {
  font-size: 1.35rem;
}

.full {
  grid-column: 1 / -1;
}

.form-actions,
.list-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 240px) auto;
  gap: 12px;
  align-items: end;
}

.chips,
.chip-group,
.list-stack {
  display: grid;
  gap: 10px;
}

.compact-list .list-card {
  padding: 12px;
}

.alert-surface {
  border-color: rgba(176, 83, 18, 0.18);
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.alert-card.warning {
  border-color: #efc08b;
  background: #fff7ed;
}

.alert-card.success {
  border-color: #9fd5b6;
  background: var(--income-soft);
}

.alert-card.danger {
  border-color: #efaaa4;
  background: #fff0ef;
}

.alert-card span {
  color: var(--muted);
}

.duplicate-card {
  border-color: #efc08b;
}

.duplicate-hint {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #efc08b;
  border-radius: 16px;
  background: #fff7ed;
}

.duplicate-hint span {
  color: var(--muted);
}

.chips {
  margin-top: 16px;
}

.chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--line);
}

.chip small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.chip.expense {
  color: var(--expense);
  background: var(--expense-soft);
}

.chip.income {
  color: var(--income);
  background: var(--income-soft);
}

.list-card,
.empty-state,
.breakdown-row {
  padding: 14px;
  min-width: 0;
}

.list-card-head {
  align-items: flex-start;
}

.list-card-head strong {
  display: block;
  margin-bottom: 4px;
}

.list-card-meta {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 8px;
}

.list-actions {
  margin-top: 12px;
}

.muted,
.empty-state {
  color: var(--muted);
}

.amount {
  font-weight: 800;
  white-space: nowrap;
}

.amount.expense {
  color: var(--expense);
}

.amount.income {
  color: var(--income);
}

.positive {
  color: var(--income);
}

.negative {
  color: var(--danger);
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.expense-entry-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), rgba(255, 255, 255, 0.04)),
    var(--surface-soft);
}

.qr-entry-card {
  min-height: 118px;
}

.expense-entry-choice > div:first-child {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.expense-entry-choice strong {
  font-size: 1.22rem;
  line-height: 1.3;
}

.expense-entry-choice .field-hint {
  max-width: 58ch;
  color: var(--muted);
}

.qr-primary-cta {
  justify-self: end;
  min-width: 150px;
  min-height: 52px;
  padding-inline: 24px;
}

.entry-option h4,
.entry-option p {
  margin: 0;
}

.entry-option p {
  color: var(--muted);
  line-height: 1.4;
}

.compact-form {
  margin-top: 6px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 220px) auto;
  gap: 12px;
  align-items: center;
}

.breakdown-row span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--expense);
}

.goal-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.goal-progress .bar-track span {
  background: var(--income);
}

.goal-allocation-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(92px, 120px) auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.plan-card {
  display: grid;
  gap: 16px;
  grid-template-rows: auto auto auto auto 1fr auto;
  align-content: start;
  position: relative;
  overflow: hidden;
  min-height: 100%;
  border-width: 1px;
}

.plan-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--line);
}

.plan-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  box-shadow: 0 16px 42px color-mix(in srgb, var(--accent) 14%, transparent);
}

.plan-card.is-active::after {
  background: var(--accent);
}

.plan-card.featured {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent 58%),
    var(--surface);
}

.plan-card-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.plan-card h3 {
  margin-top: 4px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 2px;
}

.plan-price-stack {
  display: grid;
  gap: 6px;
}

.plan-price-stack p {
  max-width: 420px;
  color: var(--muted);
  font-size: 0.94rem;
}

.plan-price strong {
  display: block;
  color: var(--accent-strong);
  font-size: clamp(2rem, 2.8vw, 2.75rem);
  line-height: 1;
}

.plan-price span {
  color: var(--muted);
  font-weight: 800;
}

.plan-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.billing-cycle-selector {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    color-mix(in srgb, var(--surface-tint) 84%, var(--surface));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent);
}

.billing-cycle-selector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.billing-cycle-selector .status-pill {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.billing-cycle-selector h4 {
  margin: 3px 0 0;
  font-size: 1rem;
  line-height: 1.25;
  max-width: 20rem;
}

.billing-cycle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.billing-cycle-option {
  min-width: 0;
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 102px;
  padding: 13px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 44%, transparent), transparent),
    var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.billing-cycle-option:hover,
.billing-cycle-option.is-selected,
.billing-cycle-option[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--surface);
}

.billing-cycle-option.is-selected,
.billing-cycle-option[aria-checked="true"] {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 46%, transparent),
    0 12px 24px color-mix(in srgb, var(--accent) 10%, transparent);
}

.billing-cycle-option span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.billing-cycle-option strong {
  color: var(--accent-strong);
  font-size: clamp(1rem, 1.55vw, 1.18rem);
  line-height: 1.05;
}

.billing-cycle-option small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.2;
}

.billing-cycle-option.lifetime strong {
  color: var(--income);
}

.billing-cycle-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%),
    var(--surface);
}

.billing-cycle-summary > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.billing-cycle-summary strong {
  font-size: 1.1rem;
  line-height: 1.15;
}

.billing-cycle-summary p {
  display: grid;
  gap: 2px;
}

.billing-cycle-summary p span:first-child {
  color: var(--accent-strong);
  font-weight: 900;
}

body.theme-dark .billing-cycle-selector {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%),
    linear-gradient(135deg, rgba(16, 32, 51, 0.96), rgba(12, 24, 40, 0.96));
}

body.theme-dark .billing-cycle-selector .status-pill {
  background: rgba(8, 17, 31, 0.74);
  color: var(--accent-strong);
}

body.theme-dark .billing-cycle-option {
  border-color: color-mix(in srgb, var(--line) 86%, transparent);
  background:
    linear-gradient(180deg, rgba(20, 36, 58, 0.9), rgba(11, 22, 38, 0.96));
}

body.theme-dark .billing-cycle-option:hover,
body.theme-dark .billing-cycle-option.is-selected,
body.theme-dark .billing-cycle-option[aria-checked="true"] {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 72%),
    #0b1728;
}

body.theme-dark .billing-cycle-summary {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    #0b1728;
}

.plan-feature-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-feature-list li {
  position: relative;
  padding-left: 24px;
  color: var(--ink);
  line-height: 1.35;
}

.plan-feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25em;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--accent), var(--income)),
    var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.plan-card > .button {
  align-self: end;
  width: 100%;
  min-height: 48px;
}

.plan-card > .button:disabled {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--surface-soft);
  color: var(--accent-strong);
}

body.theme-dark .plan-card > .button:disabled {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    #102033;
  color: var(--accent-strong);
}

.billing-panel {
  display: grid;
  gap: 12px;
}

.billing-receipt {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 56%),
    var(--surface-tint);
}

.billing-receipt::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.billing-receipt.lifetime::before {
  background: linear-gradient(180deg, var(--accent), var(--income));
}

.billing-receipt-head {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-start;
}

.billing-receipt-head strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.15;
}

.billing-receipt-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
  line-height: 1;
}

.billing-receipt-lines {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.billing-receipt-lines div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.billing-receipt-lines dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.billing-receipt-lines dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.addon-disabled {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.camera-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.file-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  text-transform: none;
}

.recurring-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.recurring-box legend,
.recurring-box span {
  text-transform: none;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.recurring-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(96px, 0.6fr);
  gap: 10px;
}

.pending-label {
  color: var(--expense);
  font-weight: 800;
}

.recurring-transaction {
  border-color: rgba(15, 128, 115, 0.28);
  background:
    linear-gradient(90deg, rgba(15, 128, 115, 0.08), transparent 38%),
    var(--surface);
}

.recurring-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--income-soft);
  color: var(--accent);
  font-weight: 850;
}

.receipt-link-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #9ad8ce;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.info-strip {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.info-strip strong {
  font-size: 0.95rem;
}

.info-strip span {
  color: var(--muted);
}

.info-strip.ok {
  border-color: #a6d8bd;
  background: var(--income-soft);
}

.info-strip.warn {
  border-color: #e7c19d;
  background: var(--expense-soft);
}

.manual-hint {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--expense-soft);
  color: var(--expense);
  font-weight: 650;
}

.manual-hint span {
  color: var(--expense);
  font-weight: 500;
}

.manual-hint .button {
  width: fit-content;
}

.modal-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.details-grid {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.detail-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-row strong {
  overflow-wrap: anywhere;
}

.qr-copy-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #9ad8ce;
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
}

.qr-text-copy {
  width: 100%;
  max-height: 180px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfa;
  color: var(--ink);
  font: 700 0.78rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: auto;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: pre-wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(29, 37, 32, 0.42);
}

.modal-panel {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 38px rgba(29, 37, 32, 0.2);
  padding: 18px;
}

.qr-scanner-panel {
  width: min(680px, 100%);
  max-height: calc(100dvh - 20px);
  overflow: auto;
}

.confirm-panel {
  width: min(560px, 100%);
}

.confirm-input {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.confirm-input span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.qr-camera-box {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(72vh, 520px);
  overflow: hidden;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #050908;
}

.qr-camera-box video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: min(72vh, 520px);
  background: #050908;
  filter: none;
  object-fit: cover;
}

.qr-scanner-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

#qr-torch-button[aria-pressed="true"] {
  background: #f8d56b;
  border-color: #e6b84a;
  color: #2f2507;
  box-shadow: 0 12px 26px rgba(230, 184, 74, 0.3);
}

.qr-camera-box::before {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.qr-scan-frame {
  position: absolute;
  width: min(82vw, 440px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 24px;
  box-shadow: 0 0 30px rgba(15, 128, 115, 0.45);
  pointer-events: none;
}

.qr-scan-frame::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #5cf0d3, transparent);
  animation: scan-line 1.8s ease-in-out infinite;
}

.qr-scan-frame span {
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: #5cf0d3;
}

.qr-scan-frame span:nth-child(1) {
  top: -2px;
  left: -2px;
  border-top: 5px solid;
  border-left: 5px solid;
  border-radius: 22px 0 0 0;
}

.qr-scan-frame span:nth-child(2) {
  top: -2px;
  right: -2px;
  border-top: 5px solid;
  border-right: 5px solid;
  border-radius: 0 22px 0 0;
}

.qr-scan-frame span:nth-child(3) {
  bottom: -2px;
  right: -2px;
  border-bottom: 5px solid;
  border-right: 5px solid;
  border-radius: 0 0 22px 0;
}

.qr-scan-frame span:nth-child(4) {
  bottom: -2px;
  left: -2px;
  border-bottom: 5px solid;
  border-left: 5px solid;
  border-radius: 0 0 0 22px;
}

#qr-scanner-status[data-status="ok"] {
  color: var(--income);
  font-weight: 750;
}

#qr-scanner-status[data-status="warning"] {
  color: var(--expense);
  font-weight: 750;
}

@keyframes scan-line {
  0%,
  100% {
    transform: translateY(-120px);
    opacity: 0.4;
  }

  50% {
    transform: translateY(120px);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .brand-block {
    max-width: none;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .month-control {
    max-width: none;
  }

  .landing-hero {
    grid-template-columns: 1fr;
  }

  .dashboard-print-body {
    grid-template-columns: 1fr;
  }

  .dashboard-print-menu {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 12px;
  }

  .dashboard-print-menu span {
    flex: 0 0 auto;
  }

  .dashboard-print-metrics,
  .dashboard-print-columns,
  .landing-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commercial-auth {
    grid-template-columns: 1fr;
  }

  .product-entry-panel {
    min-height: auto;
  }

  .preview-metrics,
  .product-proof-grid,
  .product-proof-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-layout,
  .outflow-shell,
  .two-column,
  .two-column.compact,
  .pricing-grid,
  .billing-cycle-grid,
  .metrics-grid,
  .salary-setting-card {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 10px auto 10px 10px;
    width: min(300px, calc(100vw - 20px));
    padding: 10px;
    border-radius: 10px;
  }

  .sub-sidebar {
    position: static;
  }

  .sub-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sub-nav-item {
    text-align: center;
  }

  .nav-menu {
    grid-template-columns: 1fr;
  }

  .nav-submenu {
    grid-template-columns: 1fr;
    padding: 4px 0 4px 14px;
    border-left: 2px solid rgba(23, 107, 135, 0.22);
    border-radius: var(--radius);
    background: transparent;
  }

  .nav-item,
  .nav-subitem {
    text-align: left;
    white-space: normal;
    transform: none;
  }

  .sidebar-title {
    display: flex;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: 100%;
    padding: 8px 10px 28px;
  }

  .auth-view {
    padding-top: 4px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .topbar h1 {
    font-size: 1.15rem;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 8px;
    grid-template-columns: auto minmax(0, 1fr);
    border-radius: 10px;
    min-height: auto;
    padding: 10px 12px;
  }

  .topbar > .sidebar-toggle {
    display: inline-flex;
    width: auto;
    min-width: 72px;
  }

  body.is-auth-screen .brand-slogan {
    display: none;
  }

  .topbar,
  .auth-grid,
  .commercial-auth-form,
  .product-proof-grid,
  .product-proof-list,
  .billing-receipt-lines,
  .form-grid,
  .expense-entry-choice,
  .goal-allocation-form,
  .inline-form,
  .breakdown-row,
  .detail-row,
  .account-balance-grid,
  .salary-setting-card {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .qr-primary-cta {
    justify-self: stretch;
    width: 100%;
  }

  .auth-panel {
    padding: 14px;
  }

  .landing-auth {
    gap: 12px;
  }

  .landing-hero {
    gap: 12px;
    padding: 16px;
  }

  .landing-hero-copy h2 {
    font-size: 1.72rem;
    line-height: 1.04;
  }

  .landing-hero-copy .modal-copy {
    font-size: 0.94rem;
    line-height: 1.48;
  }

  .landing-hero-points {
    display: none;
  }

  .landing-login-card {
    width: 100%;
  }

  .landing-story-copy h2 {
    font-size: 1.5rem;
  }

  .dashboard-print-topbar,
  .dashboard-print-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-print-controls {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .dashboard-print-body {
    padding: 12px;
  }

  .dashboard-print-metrics,
  .dashboard-print-columns,
  .landing-detail-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-print-metrics article,
  .dashboard-print-columns section,
  .landing-detail-grid article {
    min-height: auto;
  }

  .commercial-auth {
    gap: 10px;
  }

  .commercial-auth .auth-card {
    order: -1;
  }

  .auth-panel-featured h2 {
    font-size: 1.55rem;
    line-height: 1.02;
  }

  .product-entry-panel {
    gap: 8px;
    padding: 12px;
  }

  .product-entry-panel .product-preview,
  .product-entry-panel .product-proof-list {
    display: none;
  }

  .product-hero-copy .modal-copy {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .auth-card .form-intro h2 {
    font-size: 1.55rem;
  }

  .auth-card .form-intro span {
    font-size: 0.94rem;
  }

  .product-preview {
    padding: 12px;
    gap: 10px;
  }

  .preview-bar,
  .preview-flow span {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .preview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .preview-metrics div,
  .preview-flow span,
  .product-proof-list span {
    padding: 9px 10px;
  }

  .auth-tabs button {
    min-height: 44px;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 8px;
  }

  .topbar-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding-right: 0;
  }

  .onboarding-head-actions {
    justify-content: space-between;
    width: 100%;
  }

  .onboarding-step {
    flex-basis: min(84vw, 340px);
  }

  .topbar-quick-actions .button {
    width: 100%;
    min-height: 38px;
    padding: 8px 6px;
  }

  .month-control {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .topbar-actions .status-pill,
  #logout-button {
    min-height: 38px;
  }

  .nav-menu,
  .nav-submenu {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .nav-item,
  .sub-nav-item,
  .nav-subitem {
    min-height: 38px;
    padding: 8px 8px;
    font-size: 0.9rem;
  }

  .sub-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button:not(.sidebar-toggle),
  .topbar-actions .status-pill {
    width: 100%;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .footer-links {
    width: 100%;
    justify-content: flex-start;
  }

  .footer-links button,
  .footer-links a {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  .qr-scanner-panel {
    width: 100%;
    max-height: calc(100dvh - 12px);
    padding: 12px;
  }

  .qr-camera-box,
  .qr-camera-box video {
    min-height: min(62dvh, 520px);
  }

  .qr-scan-frame {
    width: min(82vw, 390px);
  }

  .qr-scanner-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-actions,
  .list-actions {
    justify-content: stretch;
  }

  .form-actions .button,
  .list-actions .button {
    flex: 1 1 100%;
  }

  .camera-actions {
    grid-template-columns: 1fr;
  }

  .recurring-fields {
    grid-template-columns: 1fr;
  }

  .page-head,
  .surface,
  .metric-card,
  .list-card,
  .empty-state,
  .breakdown-row,
  .modal-panel {
    box-shadow: none;
  }

  .page-head,
  .surface {
    padding: 12px;
  }

  .page-head {
    min-height: auto;
  }

  .page-head h2 {
    font-size: 1.32rem;
  }

  .metrics-grid {
    gap: 8px;
  }

  .metric-card {
    min-height: auto;
    padding: 12px;
  }

  .metric-card strong {
    font-size: 1.25rem;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .calendar-day {
    min-height: auto;
    padding: 12px;
    border-radius: 10px;
  }

  .calendar-day-head,
  .calendar-event {
    align-items: flex-start;
    display: grid;
    grid-template-columns: 1fr;
  }

  .list-card,
  .empty-state,
  .breakdown-row {
    padding: 12px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 8px;
  }

  .modal-panel {
    max-height: calc(100vh - 16px);
    padding: 12px;
  }

  .manual-hint .button {
    width: 100%;
  }

  .list-card-head,
  .list-card-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .master-mini-grid {
    grid-template-columns: 1fr;
  }

  .amount {
    white-space: normal;
  }
}
