:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-strong: #faf9f5;
  --ink: #141414;
  --muted: #667085;
  --line: #e3ded3;
  --line-strong: #cfc6b6;
  --income: #0f7a55;
  --income-soft: #e4f6ed;
  --expense: #bd3d3a;
  --expense-soft: #fbe7e5;
  --accent: #9b6b1d;
  --accent-soft: #fff4d8;
  --gold: #b98226;
  --gold-soft: #fff5db;
  --violet: #5256a4;
  --sidebar: #111214;
  --sidebar-soft: #1b1d21;
  --shadow: 0 18px 48px rgba(20, 20, 20, 0.08);
  --shadow-soft: 0 8px 24px rgba(20, 20, 20, 0.05);
  --shadow-premium: 0 22px 60px rgba(20, 20, 20, 0.1);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  overflow-x: hidden;
  width: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  overflow-x: hidden;
  width: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 243, 239, 0.45) 360px),
    linear-gradient(90deg, rgba(185, 130, 38, 0.055) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(17, 18, 20, 0.035) 0 1px, transparent 1px 100%),
    var(--bg);
  background-size: auto, 42px 42px, 42px 42px, auto;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
  min-width: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

input,
select,
textarea {
  max-width: 100%;
}

input[type="date"],
input[type="month"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"],
input[type="month"] {
  line-height: 1.25;
}

.public-shell {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) clamp(16px, 4vw, 52px) max(24px, env(safe-area-inset-bottom));
}

.public-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 32px;
}

.public-brand {
  border: 0;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  text-align: left;
}

.public-brand small,
.hero-panel small {
  display: block;
  color: var(--muted);
}

.public-nav,
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.public-nav button:not(.primary-button):not(.secondary-button) {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  padding: 10px 8px;
}

.public-main {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.public-view {
  display: none;
}

.public-view.active {
  display: block;
}

.hero-grid {
  min-height: min(620px, calc(100vh - 140px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 20px;
  align-items: center;
}

.premium-hero {
  position: relative;
  isolation: isolate;
}

.premium-hero::before {
  content: "";
  position: absolute;
  inset: 10% 0 auto 46%;
  z-index: -1;
  width: min(480px, 42vw);
  height: min(480px, 42vw);
  border: 1px solid rgba(185, 130, 38, 0.22);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 247, 218, 0.72), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(90deg, rgba(17, 18, 20, 0.08) 0 1px, transparent 1px 18px);
  filter: blur(0.2px);
}

.hero-copy h1,
.public-section-head h1,
.auth-card h1,
.legal-card h1 {
  font-size: clamp(34px, 7vw, 64px);
  line-height: 1;
  margin-bottom: 14px;
}

.hero-copy p,
.public-section-head p {
  max-width: 660px;
  font-size: 18px;
  line-height: 1.5;
}

.hero-panel,
.auth-card,
.legal-card,
.pricing-card,
.premium-modal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 226, 0.84)),
    var(--surface);
  box-shadow: var(--shadow-premium);
}

.hero-panel {
  min-height: 280px;
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.command-preview {
  min-height: 360px;
  background:
    linear-gradient(145deg, rgba(20, 20, 20, 0.96), rgba(43, 34, 20, 0.94)),
    #111214;
  color: #fff9e8;
  border-color: rgba(226, 194, 117, 0.36);
}

.command-preview small,
.command-preview span {
  color: #d9c89c;
}

.command-preview strong {
  font-size: clamp(28px, 4vw, 46px);
}

.command-metrics,
.hero-proof,
.public-feature-band,
.testimonial-grid {
  display: grid;
  gap: 12px;
}

.command-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.command-metrics div {
  min-width: 0;
  border: 1px solid rgba(255, 242, 191, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
}

.command-metrics b,
.command-metrics small {
  display: block;
  overflow-wrap: anywhere;
}

.hero-proof {
  grid-template-columns: repeat(3, minmax(0, max-content));
  margin-top: 18px;
}

.hero-proof span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
}

.public-feature-band,
.testimonial-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.public-feature-band article,
.testimonial-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.public-feature-band span,
.testimonial-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.public-feature-band h2 {
  margin-top: 8px;
}

.public-story {
  margin-top: 54px;
}

.testimonial-card p {
  min-height: 74px;
}

.hero-panel span,
.pricing-card small {
  color: var(--muted);
  font-weight: 900;
}

.hero-panel strong {
  font-size: clamp(42px, 8vw, 76px);
  line-height: 1;
}

.auth-card,
.legal-card {
  width: min(540px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 34px);
}

.wide-auth-card {
  width: min(720px, 100%);
}

.auth-plan-hint,
.auth-mini-form {
  border: 1px solid rgba(185, 130, 38, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 246, 220, 0.64);
  padding: 12px;
}

.auth-mini-form {
  margin-top: 12px;
}

.public-section-head {
  margin-bottom: 18px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 12px;
}

.compact-pricing {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.pricing-card {
  min-width: 0;
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: space-between;
}

.pricing-card.selected {
  border-color: rgba(185, 130, 38, 0.75);
  box-shadow: 0 18px 44px rgba(185, 130, 38, 0.16);
}

.pricing-card-head {
  display: grid;
  gap: 8px;
}

.pricing-card h2 {
  font-size: 17px;
}

.pricing-card strong {
  font-size: 28px;
}

.pricing-card ul,
.payment-instructions ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.plan-badge,
.subscription-pill {
  min-height: 30px;
  width: fit-content;
  border: 1px solid #ecd8a7;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.subscription-pill {
  cursor: pointer;
  white-space: nowrap;
}

.payment-instructions {
  border: 1px solid rgba(185, 130, 38, 0.22);
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: #5f4215;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.premium-lock-panel {
  text-align: left;
}

.premium-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 18, 20, 0.46);
  backdrop-filter: blur(10px);
}

.premium-modal-card {
  width: min(460px, 100%);
  padding: 24px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 26px 18px;
  position: sticky;
  top: 0;
  align-self: start;
  background:
    linear-gradient(180deg, rgba(255, 231, 168, 0.13), rgba(17, 18, 20, 0.01) 280px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 42%),
    var(--sidebar);
  color: #f7fbff;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 14px 0 46px rgba(17, 18, 20, 0.08);
}

.brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #15120b;
  background:
    linear-gradient(135deg, #fff7d4, #d6a348 48%, #7d5518);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 10px 24px rgba(185, 130, 38, 0.28);
}

.brand-text {
  min-width: 0;
}

.brand strong {
  display: block;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand span {
  color: #a9b7c3;
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.brand-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.sidebar-collapse {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 242, 191, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #f7fbff;
  display: inline-grid;
  place-items: center;
  font-weight: 900;
}

.menu-toggle {
  display: none;
  min-height: 34px;
  border: 1px solid rgba(255, 242, 191, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #f7fbff;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-button,
.tool-button {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #d8d9dc;
  text-decoration: none;
  min-height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
}

.nav-button:hover,
.tool-button:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(1px);
}

.nav-button.active {
  background: linear-gradient(135deg, #fff8e2, #f4efe2);
  color: #15120b;
  border-color: rgba(255, 242, 191, 0.62);
  box-shadow:
    inset 3px 0 0 var(--gold),
    0 10px 26px rgba(0, 0, 0, 0.16);
}

.nav-button.nav-locked {
  position: relative;
}

.nav-button.nav-locked::after {
  content: attr(data-lock-label);
  margin-left: auto;
  border: 1px solid rgba(255, 242, 191, 0.2);
  border-radius: 999px;
  background: rgba(255, 231, 168, 0.14);
  color: #f6dd99;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
}

.account-card {
  width: 100%;
  margin-top: auto;
  border: 1px solid rgba(255, 242, 191, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 241, 195, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.05);
  color: #f7fbff;
  padding: 14px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.account-card span,
.account-card small {
  color: #a9b7c3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card strong {
  overflow-wrap: anywhere;
}

.account-card em {
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 231, 168, 0.16);
  color: #f5dfa4;
  padding: 4px 8px;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 92px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  padding-inline: 14px;
}

body.sidebar-collapsed .brand {
  grid-template-columns: 48px;
  justify-content: center;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .privacy-toggle,
body.sidebar-collapsed .account-card span,
body.sidebar-collapsed .account-card strong,
body.sidebar-collapsed .account-card small,
body.sidebar-collapsed .account-card em,
body.sidebar-collapsed .nav-button:not(.active)::after {
  display: none;
}

body.sidebar-collapsed .brand-actions {
  grid-column: 1;
  justify-content: center;
  flex-wrap: wrap;
}

body.sidebar-collapsed .nav-button {
  justify-content: center;
  padding-inline: 8px;
  font-size: 0;
}

body.sidebar-collapsed .nav-icon {
  font-size: 17px;
}

body.sidebar-collapsed .account-card {
  min-height: 52px;
  padding: 10px;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: inherit;
}

.sidebar-tools {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-label {
  padding: 0 12px 4px;
  color: #9da3ad;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-button {
  min-height: 38px;
  color: #c9cbd1;
  font-size: 14px;
}

.danger-text {
  color: #f3afa9;
}

.main {
  min-width: 0;
  padding: 32px clamp(18px, 3vw, 40px);
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
}

.voice-button {
  width: 36px;
  height: 36px;
  border: 1px solid #d7c59e;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, #fff9e5, #d49b3c 56%, #9a661c),
    #fff;
  color: #15120b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 10px 24px rgba(185, 130, 38, 0.26);
  padding: 0;
  flex: 0 0 36px;
}

.voice-icon {
  position: relative;
  width: 12px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 999px;
  display: block;
}

.voice-icon::before,
.voice-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  background: currentColor;
  transform: translateX(-50%);
}

.voice-icon::before {
  width: 2px;
  height: 7px;
  bottom: -8px;
  border-radius: 999px;
}

.voice-icon::after {
  width: 11px;
  height: 2px;
  bottom: -9px;
  border-radius: 999px;
}

.voice-button.listening {
  color: #fff;
  background: var(--income);
  border-color: var(--income);
  box-shadow:
    0 0 0 5px rgba(18, 128, 92, 0.16),
    0 10px 24px rgba(18, 128, 92, 0.26);
}

.topbar-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

p {
  color: var(--muted);
}

.topbar-controls,
.filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.section-heading p {
  margin-bottom: 0;
}

.health-pill {
  min-width: 140px;
  min-height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: #f8edcf;
  color: var(--accent);
  font-weight: 800;
  border: 1px solid #ecd8a7;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: saturate(1.08);
}

.metric-card {
  min-height: 128px;
  padding: 20px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  border-top: 0;
  position: relative;
  box-shadow: var(--shadow);
}

.metric-card::before {
  content: "";
  width: 42px;
  height: 3px;
  border-radius: 999px;
  position: absolute;
  left: 20px;
  top: 16px;
  background: var(--accent);
}

.metric-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  padding-top: 14px;
}

.metric-card strong {
  margin-top: 12px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.metric-card small {
  color: var(--muted);
}

.income-card {
  background: linear-gradient(180deg, #ffffff, #f7fffb);
}

.income-card::before {
  background: var(--income);
}

.expense-card {
  background: linear-gradient(180deg, #ffffff, #fff8f7);
}

.expense-card::before {
  background: var(--expense);
}

.net-card {
  background: linear-gradient(180deg, #ffffff, #fffcf4);
}

.net-card::before {
  background: var(--gold);
}

.year-card {
  background: linear-gradient(180deg, #ffffff, #f8f8ff);
}

.year-card::before {
  background: var(--violet);
}

.premium-plan {
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(255, 246, 220, 0.9), rgba(255, 255, 255, 0.98) 58%, rgba(248, 251, 255, 0.82)),
    var(--surface);
  border-color: rgba(185, 130, 38, 0.22);
  box-shadow: var(--shadow-premium);
}

.privacy-toggle {
  min-height: 34px;
  border: 1px solid rgba(255, 242, 191, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #f7fbff;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.privacy-toggle.active {
  background: #f7f4ec;
  border-color: #fff2bf;
  color: #15120b;
  box-shadow: 0 8px 18px rgba(185, 130, 38, 0.18);
}

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

.plan-card {
  min-height: 96px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 252, 244, 0.96)),
    #fffdfa;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.plan-card span,
.plan-card small {
  color: var(--muted);
  font-size: 13px;
}

.plan-card strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.workspace-grid,
.quick-layout,
.goal-layout,
.category-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.quick-layout {
  grid-template-columns: minmax(320px, 1.15fr) minmax(320px, 0.85fr);
  margin-bottom: 22px;
}

.priority-panel {
  border-color: #d5b46d;
  background:
    linear-gradient(180deg, rgba(255, 247, 224, 0.84), rgba(255, 255, 255, 0.97) 145px),
    var(--surface);
  box-shadow: 0 22px 56px rgba(185, 130, 38, 0.14);
}

.summary-heading {
  margin-top: 10px;
}

.panel {
  min-width: 0;
  padding: 20px;
  box-shadow: var(--shadow);
}

.wide-panel {
  grid-column: 1 / -1;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header p {
  margin-bottom: 0;
  font-size: 14px;
}

.panel-header.split {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.stacked-form {
  display: grid;
  gap: 14px;
}

.compact-form {
  gap: 12px;
}

.form-row {
  display: grid;
  gap: 12px;
}

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

.form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
}

.onboarding-diagnostic {
  border: 1px solid rgba(18, 128, 92, 0.22);
  border-radius: var(--radius);
  background: var(--income-soft);
  color: #104d38;
  padding: 12px 14px;
}

.onboarding-diagnostic p {
  margin: 4px 0 0;
}

.gentle-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(250, 248, 242, 0.8);
}

.field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: linear-gradient(180deg, #fff, #fffdfa);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.field textarea {
  min-height: 78px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 130, 38, 0.18);
}

.compact-field {
  width: 168px;
}

.inline-field {
  width: 156px;
}

.quick-entry {
  display: none;
  gap: 8px;
}

.quick-entry > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.quick-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.quick-chip {
  min-height: 36px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 900;
}

.quick-chip:hover {
  border-color: var(--gold);
  color: var(--accent);
}

.profit-preview {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--income-soft);
  color: var(--income);
  font-weight: 900;
}

.smart-rule-note {
  min-height: 32px;
  border: 1px solid #ecd8a7;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: var(--accent);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
}

.smart-rule-note[hidden] {
  display: none;
}

.is-expense-entry .cost-field,
.is-expense-entry .profit-preview {
  display: none;
}

.target-account-field,
.debt-target-field {
  display: none;
}

.needs-target-account .target-account-field,
.needs-debt-target .debt-target-field {
  display: grid;
}

.segmented {
  min-height: 44px;
  padding: 4px;
  border-radius: var(--radius);
  background: #f1eee7;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.segment {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segment.active[data-type="income"] {
  color: #fff;
  background: var(--income);
}

.segment.active[data-type="expense"] {
  color: #fff;
  background: var(--expense);
}

.chart-toolbar {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf8f2;
}

.flow-toggle {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.mode-button {
  min-width: 88px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  padding: 8px 10px;
}

.mode-button.active {
  background: #171717;
  color: #fff;
}

.analysis-controls {
  min-width: 0;
  width: min(100%, 320px);
  display: none;
  align-items: end;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 92px;
}

.chart-toolbar.show-period-controls .analysis-controls {
  display: grid;
}

.analysis-controls .compact-field {
  width: auto;
}

#selectedMonth,
#selectedYear {
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 15px;
  text-align: center;
}

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

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.primary-button {
  background: linear-gradient(135deg, #101114, #3c2d18 58%, #7c551c);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 28px rgba(20, 20, 20, 0.16);
}

.primary-button:hover {
  background: linear-gradient(135deg, #090a0c, #4b371d);
  transform: translateY(-1px);
}

.secondary-button {
  background: linear-gradient(180deg, #fff, #fbfaf6);
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(20, 20, 20, 0.04);
}

.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.ghost-button {
  background: #f7f4ee;
  border-color: var(--line);
  color: var(--muted);
}

.danger-button {
  color: #fff;
  background: var(--expense);
}

.icon-button {
  min-width: 38px;
  min-height: 34px;
  padding: 6px 9px;
  background: var(--surface-strong);
  color: var(--ink);
  border-color: var(--line);
}

.icon-button:hover {
  border-color: var(--accent);
}

.daily-balance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.daily-balance div {
  min-height: 86px;
  border-radius: var(--radius);
  background: #faf8f2;
  border: 1px solid var(--line);
  padding: 12px;
  display: grid;
  align-content: space-between;
}

.daily-balance span {
  color: var(--muted);
  font-size: 13px;
}

.daily-balance strong {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.day-close,
.insight-stack,
.wallet-list,
.budget-stack,
.pending-list,
.recurring-list {
  display: grid;
  gap: 10px;
}

.day-close {
  margin-bottom: 14px;
}

.close-line,
.insight-item,
.wallet-row,
.budget-row,
.pending-row,
.recurring-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  padding: 12px;
}

.close-line,
.wallet-row,
.budget-head,
.pending-row,
.recurring-row,
.pending-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.close-line span,
.insight-item span,
.wallet-row span,
.budget-head span,
.pending-row span,
.recurring-row span {
  color: var(--muted);
  font-size: 13px;
}

.recurring-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.recurring-row.posted {
  background: #f8fbf7;
  border-color: #cbead8;
}

.insight-item {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--gold);
}

.insight-item.good {
  border-left-color: var(--income);
}

.insight-item.risk {
  border-left-color: var(--expense);
}

.budget-row {
  display: grid;
  gap: 10px;
}

.budget-row.risk .progress-track div {
  background: var(--expense);
}

.budget-row.warn .progress-track div {
  background: var(--gold);
}

.budget-row.good .progress-track div {
  background: var(--income);
}

.pending-layout,
.budget-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.pending-side {
  justify-content: flex-end;
}

.align-bottom {
  align-self: end;
}

.mini-list,
.breakdown-list,
.goals-list,
.category-list {
  display: grid;
  gap: 10px;
}

.mini-row,
.breakdown-row,
.category-row,
.goal-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
}

.mini-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.mini-row strong,
.mini-row span {
  display: block;
}

.mini-row span {
  color: var(--muted);
  font-size: 13px;
}

.money-income {
  color: var(--income);
  font-weight: 900;
}

.money-expense {
  color: var(--expense);
  font-weight: 900;
}

.money-neutral {
  color: var(--ink);
  font-weight: 900;
}

canvas {
  width: 100%;
  min-height: 260px;
  display: block;
}

.flow-chart {
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  padding: 12px;
}

.annual-chart {
  margin-top: 8px;
}

.flow-chart.is-empty {
  padding: 0;
  border: 0;
  background: transparent;
}

.flow-empty {
  min-height: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13px;
}

.flow-bars {
  display: grid;
  gap: 12px;
}

.flow-compact-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.flow-mini-bars {
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 26px;
  gap: 8px;
  align-items: end;
  overflow-x: auto;
  padding: 8px 2px 2px;
}

.flow-mini {
  min-height: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 5px;
}

.flow-mini-columns {
  height: 84px;
  display: flex;
  align-items: end;
  gap: 3px;
}

.flow-mini-columns span {
  width: 9px;
  border-radius: 999px 999px 2px 2px;
  display: block;
}

.mini-income {
  background: var(--income);
}

.mini-expense {
  background: var(--expense);
}

.flow-mini strong {
  color: var(--muted);
  font-size: 11px;
}

.flow-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.flow-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.flow-pair {
  display: grid;
  gap: 6px;
}

.flow-line {
  min-height: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.flow-line span {
  height: 12px;
  min-width: 0;
  border-radius: 999px;
  display: block;
  transition: width 120ms ease;
}

.flow-line strong {
  min-width: 86px;
  text-align: right;
  font-size: 12px;
}

.income-line span {
  background: var(--income);
}

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

.expense-line span {
  background: var(--expense);
}

.expense-line strong {
  color: var(--expense);
}

.legend,
.year-totals {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.legend span,
.year-totals span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.legend-income {
  background: var(--income);
}

.legend-expense {
  background: var(--expense);
}

.progress-stack {
  display: grid;
  gap: 16px;
}

.progress-item {
  display: grid;
  gap: 8px;
}

.progress-item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-item span {
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--income-soft);
}

.progress-track div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--income);
  transition: width 180ms ease;
}

.progress-track.warning {
  background: var(--expense-soft);
}

.progress-track.warning div {
  background: var(--expense);
}

.progress-track.neutral {
  background: var(--gold-soft);
}

.progress-track.neutral div {
  background: var(--gold);
}

.breakdown-row {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.breakdown-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.breakdown-head span {
  color: var(--muted);
}

.bar-track {
  height: 9px;
  background: #e8edf3;
  border-radius: 999px;
  overflow: hidden;
}

.bar-track div {
  height: 100%;
  width: 0%;
  border-radius: inherit;
}

.empty-state {
  min-height: 68px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.filters {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.filters .field {
  min-width: 180px;
  flex: 1 1 180px;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f7f4ee;
}

tr:last-child td {
  border-bottom: 0;
}

.amount-cell {
  text-align: right;
}

.action-cell {
  width: 120px;
  text-align: right;
}

.type-badge,
.category-chip {
  min-height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

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

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

.category-chip {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  gap: 6px;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: var(--accent);
}

.goal-layout,
.category-layout {
  grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.15fr);
}

.goal-row {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.goal-top,
.category-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.goal-top strong,
.category-row strong {
  display: block;
}

.goal-top span,
.category-row span {
  color: var(--muted);
  font-size: 13px;
}

.goal-actions,
.row-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: end;
  flex-wrap: wrap;
  min-width: 0;
}

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

.category-row {
  min-height: 62px;
  padding: 10px 12px;
}

.financial-snapshot-panel {
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 226, 0.78)),
    var(--surface);
}

.financial-snapshot,
.finance-module {
  display: grid;
  gap: 16px;
}

.finance-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.finance-stat {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 252, 244, 0.95)),
    #fff;
  padding: 14px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.finance-stat::before {
  content: "";
  width: 36px;
  height: 3px;
  position: absolute;
  left: 14px;
  top: 12px;
  border-radius: 999px;
  background: var(--gold);
}

.finance-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  padding-top: 10px;
}

.finance-stat strong {
  font-size: 24px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.finance-stat small {
  color: var(--muted);
}

.risk-good::before {
  background: var(--income);
}

.risk-good strong,
.finance-alert.good strong {
  color: var(--income);
}

.risk-medium::before {
  background: var(--gold);
}

.risk-medium strong,
.finance-alert.warn strong {
  color: var(--accent);
}

.risk-high::before {
  background: var(--expense);
}

.risk-high strong,
.finance-alert.risk strong {
  color: var(--expense);
}

.snapshot-message {
  border: 1px solid rgba(185, 130, 38, 0.22);
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: #5f4215;
  padding: 12px 14px;
  line-height: 1.45;
}

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

.finance-alert {
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: #fffdfa;
  padding: 11px 12px;
  display: grid;
  gap: 3px;
}

.finance-alert span {
  color: var(--muted);
  font-size: 13px;
}

.finance-alert.risk {
  border-left-color: var(--expense);
  background: #fff8f7;
}

.finance-alert.warn {
  border-left-color: var(--gold);
  background: #fffaf0;
}

.finance-alert.good {
  border-left-color: var(--income);
  background: #f7fffb;
}

.module-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.module-form {
  min-width: 0;
}

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

.module-row {
  display: grid;
  gap: 11px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #fffdfa),
    var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.module-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.module-row-main strong {
  display: block;
  overflow-wrap: anywhere;
}

.module-row-main span,
.mini-metrics span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.status-pill {
  min-height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #f7f4ee;
  color: var(--muted);
}

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

.status-pill.warn {
  background: var(--gold-soft);
  color: var(--accent);
  border-color: #ecd8a7;
}

.status-pill.risk {
  background: var(--expense-soft);
  color: var(--expense);
  border-color: #f0c1bd;
}

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

.mini-metrics span {
  min-height: 36px;
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #faf8f2;
  padding: 7px 8px;
}

.debt-insight-strip,
.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.debt-insight-strip article,
.report-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.debt-insight-strip span,
.report-card span,
.report-card small {
  color: var(--muted);
  font-size: 13px;
}

.debt-insight-strip strong,
.report-card strong {
  overflow-wrap: anywhere;
}

.card-only,
.credit-only,
.cash-only,
.interest-only,
.capital-only {
  min-width: 0;
}

.capital-account-form:not([data-kind="card"]) .card-only {
  display: none;
}

.capital-account-form[data-kind="card"] .balance-field {
  display: none;
}

.personal-debt-form[data-mode="interest_only"] .capital-only,
.personal-debt-form[data-mode="capital_payment"] .interest-only {
  display: none;
}

.financial-project-form[data-mode="cash"] .credit-only,
.financial-project-form[data-mode="credit"] .cash-only {
  display: none;
}

.data-footer {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 246, 220, 0.8), rgba(255, 255, 255, 0.94)),
    var(--surface);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, auto);
  gap: 18px;
  align-items: center;
}

.data-footer h2 {
  margin-bottom: 4px;
}

.data-footer p:last-child {
  margin-bottom: 0;
}

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

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 32px));
  min-height: 46px;
  border-radius: var(--radius);
  background: #111214;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-action {
  border: 0;
  background: transparent;
  color: #fff2bf;
  font-weight: 900;
  margin-left: 10px;
  padding: 0;
}

.voice-panel {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 45;
  width: min(460px, calc(100vw - 28px));
  transform: translateX(-50%);
}

.voice-panel[hidden] {
  display: none;
}

.voice-card {
  border: 1px solid rgba(185, 130, 38, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 248, 226, 0.98), rgba(255, 255, 255, 0.99)),
    #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 28px 80px rgba(20, 20, 20, 0.22);
  padding: 14px;
  display: grid;
  gap: 12px;
}

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

.voice-head strong,
.voice-head span {
  display: block;
}

.voice-head span,
.voice-transcript,
.voice-preview span {
  color: var(--muted);
  font-size: 13px;
}

.voice-transcript {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #fffdfa);
  padding: 10px;
  color: #475467;
}

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

.voice-preview div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #fffdfa);
  padding: 9px;
  display: grid;
  gap: 3px;
}

.voice-preview .voice-warning {
  grid-column: 1 / -1;
  border-color: rgba(194, 65, 61, 0.28);
  background: #fff8f7;
}

.voice-warning strong {
  color: var(--expense);
}

.voice-complete {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(185, 130, 38, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 240, 0.96)),
    #fffdfa;
  padding: 10px;
}

.voice-complete label {
  display: grid;
  gap: 5px;
}

.voice-complete select,
.voice-complete input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

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

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(17, 18, 20, 0.28);
  backdrop-filter: blur(3px);
}

.nav-backdrop[hidden] {
  display: none;
}

.floating-register {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 35;
  min-width: 118px;
  min-height: 48px;
  border: 1px solid rgba(255, 242, 191, 0.52);
  border-radius: 999px;
  background:
    linear-gradient(135deg, #fff8d9, #d7a24a 52%, #7c551d),
    var(--gold);
  color: #15120b;
  padding: 12px 18px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 18px 48px rgba(132, 92, 31, 0.28);
}

.quick-register {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 36;
  width: min(320px, calc(100vw - 32px));
}

.quick-register[hidden] {
  display: none;
}

.quick-register-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(185, 130, 38, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.99), rgba(255, 255, 255, 0.98)),
    #fff;
  box-shadow: 0 22px 60px rgba(17, 18, 20, 0.18);
}

.quick-register-card button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  padding: 9px 10px;
  text-align: center;
}

.quick-register-card button:hover {
  border-color: var(--gold);
  color: var(--accent);
}

.module-row,
.panel,
.metric-card,
.finance-stat,
.close-line,
.insight-item,
.wallet-row,
.budget-row,
.pending-row,
.recurring-row,
.goal-row,
.category-row,
.report-card,
.debt-insight-strip article {
  max-width: 100%;
}

.module-row-main > div,
.finance-stat,
.report-card,
.debt-insight-strip article,
td,
th {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .metric-grid,
  .plan-grid,
  .finance-card-grid,
  .debt-insight-strip,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid,
  .quick-layout,
  .module-layout,
  .pending-layout,
  .budget-layout,
  .recurring-layout,
  .goal-layout,
  .category-layout,
  .data-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 42;
    min-height: auto;
    padding: calc(8px + env(safe-area-inset-top)) 10px 10px;
    gap: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 26px rgba(17, 18, 20, 0.12);
  }

  .brand {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand span {
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  .brand-actions {
    gap: 5px;
  }

  .privacy-toggle,
  .menu-toggle {
    min-height: 32px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .voice-button {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    position: fixed;
    top: calc(58px + env(safe-area-inset-top));
    right: 12px;
    z-index: 61;
    width: min(300px, calc(100vw - 24px));
    max-height: calc(100dvh - 82px - env(safe-area-inset-top));
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 242, 191, 0.2);
    border-radius: var(--radius);
    background:
      linear-gradient(180deg, rgba(255, 231, 168, 0.13), rgba(17, 18, 20, 0.02)),
      var(--sidebar);
    box-shadow: 0 24px 80px rgba(17, 18, 20, 0.32);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 160ms ease, transform 160ms ease;
  }

  body.nav-open .nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .nav-button {
    justify-content: flex-start;
    text-align: center;
    flex-wrap: wrap;
    min-height: 42px;
    text-align: left;
  }

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

  .tool-label {
    grid-column: 1 / -1;
  }

  .main {
    padding: 14px 12px calc(96px + env(safe-area-inset-bottom));
  }

  .topbar {
    display: none;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-controls,
  .analysis-controls {
    align-items: stretch;
  }

  .compact-field,
  .topbar-controls .secondary-button,
  .analysis-controls .field {
    width: auto;
    flex: 1 1 150px;
  }

  .data-actions {
    justify-content: stretch;
  }

  .data-actions button {
    flex: 1 1 180px;
  }
}

body.has-onboarding {
  overflow: hidden;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  min-height: 100dvh;
  padding: 18px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(17, 18, 20, 0.72), rgba(17, 18, 20, 0.88)),
    rgba(17, 18, 20, 0.82);
}

.onboarding-overlay[hidden] {
  display: none;
}

.onboarding-card {
  width: min(560px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 248, 226, 0.96), rgba(255, 255, 255, 0.98) 180px),
    #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  padding: 22px;
}

.onboarding-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.onboarding-brand span {
  color: var(--accent);
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.onboarding-brand strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.onboarding-copy {
  max-width: 48ch;
  margin-bottom: 18px;
  color: var(--muted);
}

.onboarding-form {
  display: grid;
  gap: 14px;
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

@media (max-width: 640px) {
  h1 {
    font-size: 26px;
  }

  .metric-grid,
  .finance-card-grid,
  .debt-insight-strip,
  .report-grid,
  .form-row.two,
  .daily-balance,
  .category-columns,
  .chart-toolbar {
    grid-template-columns: 1fr;
  }

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

  .brand span {
    max-width: 104px;
  }

  .privacy-toggle {
    width: 34px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    position: relative;
  }

  .privacy-toggle::after {
    content: "P";
    color: #f7fbff;
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
  }

  .privacy-toggle.active::after {
    color: #15120b;
  }

  .menu-toggle {
    width: 34px;
    padding: 0;
    font-size: 0;
    position: relative;
  }

  .menu-toggle::after {
    content: "≡";
    font-size: 18px;
    line-height: 1;
  }

  .section-heading {
    margin-bottom: 12px;
  }

  .section-heading h2 {
    font-size: 20px;
  }

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

  .plan-card {
    min-height: 92px;
    padding: 12px;
  }

  .plan-card strong {
    font-size: 18px;
  }

  .chart-toolbar {
    display: grid;
    align-items: stretch;
  }

  .chart-toolbar.show-period-controls .analysis-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    width: 100%;
  }

  .flow-toggle {
    width: 100%;
  }

  .mode-button {
    min-width: 0;
  }

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

  .panel-header.split,
  .progress-item > div:first-child,
  .close-line,
  .wallet-row,
  .budget-head,
  .pending-row,
  .pending-side,
  .module-row-main,
  .goal-top,
  .category-row {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .quick-actions {
    flex-wrap: nowrap;
  }

  .inline-field {
    width: 100%;
  }

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

  .row-actions,
  .goal-actions {
    justify-content: start;
    width: 100%;
  }

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

  .finance-stat,
  .metric-card {
    min-height: 104px;
    padding: 16px;
  }

  .finance-stat strong,
  .metric-card strong {
    font-size: clamp(20px, 7vw, 28px);
  }

  .field input,
  .field select,
  .field textarea,
  .voice-complete select,
  .voice-complete input {
    min-height: 46px;
    font-size: 16px;
  }

  input[type="date"],
  input[type="month"] {
    padding-right: 8px;
  }

  .inline-field,
  .compact-field {
    width: 100%;
  }

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

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    padding: 10px;
  }

  td {
    border-bottom: 0;
    padding: 6px 0;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  td:nth-child(1)::before {
    content: "Fecha";
  }

  td:nth-child(2)::before {
    content: "Tipo";
  }

  td:nth-child(3)::before {
    content: "Concepto";
  }

  td:nth-child(4)::before {
    content: "Categoría";
  }

  td:nth-child(5)::before {
    content: "Cuenta";
  }

  td:nth-child(6)::before {
    content: "Uso";
  }

  td:nth-child(7)::before {
    content: "Monto";
  }

  td:nth-child(8)::before {
    content: "Acción";
  }

  td.amount-cell,
  td.action-cell {
    width: 100%;
    text-align: left;
  }

  .quick-register {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .quick-register-card {
    grid-template-columns: 1fr;
  }

  .floating-register {
    right: 12px;
    min-width: 108px;
    min-height: 46px;
  }

  .onboarding-overlay {
    align-items: start;
    padding: 12px;
  }

  .onboarding-card {
    padding: 18px;
  }

  .onboarding-brand strong {
    font-size: 21px;
  }

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

  .voice-panel {
    bottom: 12px;
  }

  .voice-preview {
    grid-template-columns: 1fr;
  }

  .voice-complete {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .public-header {
    align-items: stretch;
    flex-direction: column;
  }

  .public-nav {
    justify-content: start;
  }

  .public-nav .primary-button,
  .public-nav .secondary-button {
    flex: 1 1 140px;
  }

  .pricing-grid,
  .compact-pricing {
    grid-template-columns: 1fr;
  }

  .hero-copy h1,
  .public-section-head h1,
  .auth-card h1,
  .legal-card h1 {
    font-size: clamp(32px, 12vw, 48px);
  }

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

  .subscription-pill {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .profile-layout,
  .public-feature-band,
  .testimonial-grid {
    grid-template-columns: 1fr;
  }

  .command-metrics,
  .hero-proof {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  body.sidebar-collapsed .app-shell {
    grid-template-columns: initial;
  }

  body.sidebar-collapsed .brand {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .privacy-toggle {
    display: block;
  }

  body.sidebar-collapsed .brand-actions {
    grid-column: auto;
    justify-content: flex-end;
  }

  body.sidebar-collapsed .nav-button {
    justify-content: flex-start;
    padding-inline: 12px;
    font-size: inherit;
  }

  .sidebar-collapse,
  .account-card {
    display: none;
  }
}

@media (max-width: 640px) {
  .form-row.three,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .command-preview {
    min-height: auto;
  }

  .testimonial-card p {
    min-height: auto;
  }
}
