:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #edf2f8;
  --line: #d7e0ec;
  --text: #142033;
  --muted: #5d6b80;
  --primary: #18b93f;
  --primary-strong: #0f9631;
  --primary-soft: #e6f9eb;
  --teal: #18b93f;
  --teal-strong: #0c7f29;
  --positive: #168d5b;
  --negative: #e5485d;
  --warning: #e89a19;
  --premium: #d6a738;
  --premium-hover: #c49325;
  --premium-ink: #2f2818;
  --premium-soft: #fff6d8;
  --shadow: 0 16px 38px rgba(34, 53, 83, 0.09);
  --radius: 12px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.dark-theme {
  color-scheme: dark;
  --bg: #03130e;
  --surface: #071d16;
  --surface-soft: #0b2a1f;
  --line: #174936;
  --text: #f4faf6;
  --muted: #9ab8aa;
  --primary: #39df58;
  --primary-strong: #63ef78;
  --primary-soft: #0c321d;
  --teal: #39df58;
  --teal-strong: #73f58a;
  --positive: #42d88b;
  --negative: #ff6f86;
  --warning: #f4b647;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

body.dark-theme .side-menu,
body.dark-theme .planner-topbar,
body.dark-theme .planner-card,
body.dark-theme .metric-card,
body.dark-theme .modal-card,
body.dark-theme .pricing-card,
body.dark-theme .transaction-item,
body.dark-theme .credit-card-preview,
body.dark-theme table,
body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea,
body.dark-theme .menu-button,
body.dark-theme .round-action,
body.dark-theme .icon-button,
body.dark-theme .tutorial-button,
body.dark-theme .account-chip,
body.dark-theme .button.secondary,
body.dark-theme .period-controls,
body.dark-theme .landing-panel,
body.dark-theme .landing-features article {
  background: var(--surface);
  color: var(--text);
}

body.dark-theme .planner-topbar {
  border-bottom-color: var(--line);
}

body.dark-theme .plan-strip,
body.dark-theme .toolbar,
body.dark-theme .pricing-card.featured,
body.dark-theme .freemium-usage,
body.dark-theme .account-plan {
  background: linear-gradient(135deg, var(--surface), var(--primary-soft));
}

body.dark-theme .account-chip.pro-account {
  border-color: rgba(214, 167, 56, 0.58);
  background: #3b321d;
}

body.dark-theme .account-chip.pro-account span {
  color: #e4bf65;
}

body.dark-theme .notes-card textarea,
body.dark-theme .result-card,
body.dark-theme .side-footer,
body.dark-theme .empty-illustration span,
body.dark-theme .hero-illustration,
body.dark-theme .landing-metrics div {
  background: var(--surface-soft);
}

body.dark-theme .landing-kicker,
body.dark-theme .landing-features article > span,
body.dark-theme .user-greeting,
body.dark-theme .confirmation-mark {
  background: var(--surface-soft);
}

body.dark-theme canvas {
  filter: brightness(0.92);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

body.modal-open,
body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.planner-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: auto 1fr;
}

.side-menu {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 286px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 24px 18px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(-105%);
  transition: transform 180ms ease;
}

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

.side-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  background: rgba(30, 34, 42, 0.42);
}

body.menu-open .side-backdrop {
  display: block;
}

.side-brand,
.planner-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.side-brand img,
.planner-logo img {
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(240, 90, 36, 0.18);
}

.side-brand strong,
.planner-logo strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1.05;
}

.side-brand span,
.planner-logo span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.planner-logo .granou-logo-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 1px solid rgba(57, 223, 88, 0.38);
  border-radius: 13px;
  background-color: #042319;
  background-image: url("./assets/granou-logo.png");
  background-repeat: no-repeat;
  background-position: 50% 18%;
  background-size: 360% auto;
  box-shadow:
    0 10px 28px rgba(28, 215, 68, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.planner-logo strong {
  letter-spacing: 0;
}

.brand-home-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.brand-home-button:hover .granou-logo-mark,
.brand-home-button:focus-visible .granou-logo-mark {
  border-color: var(--primary);
  box-shadow:
    0 10px 32px rgba(28, 215, 68, 0.28),
    0 0 0 3px rgba(57, 223, 88, 0.12);
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.side-close-button {
  display: none;
  flex: 0 0 auto;
}

.side-nav-label {
  margin: 4px 10px 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-nav-label.side-nav-group {
  margin-top: 18px;
}

.side-nav a,
.side-nav button {
  width: 100%;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  text-align: left;
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.25;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.side-nav a.active,
.side-nav .nav-tab.active {
  border-color: rgba(57, 223, 88, 0.72);
  background: var(--primary);
  color: #03130e;
  box-shadow: 0 10px 28px rgba(28, 215, 68, 0.16);
}

.side-nav a:hover,
.side-nav button:hover {
  border-color: rgba(57, 223, 88, 0.3);
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateX(2px);
}

.side-nav .nav-tab.active:hover {
  background: var(--primary);
  color: #03130e;
  transform: none;
}

.calculator-nav-group {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.calculator-subnav {
  min-width: 0;
  display: grid;
  gap: 3px;
  margin: 0 0 4px 17px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.side-nav .calculator-nav-option {
  min-width: 0;
  min-height: 34px;
  border-radius: 7px;
  gap: 7px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.side-nav .calculator-nav-option > span {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 1rem;
  line-height: 1;
}

.side-nav .calculator-nav-option.active {
  border-color: rgba(57, 223, 88, 0.28);
  background: var(--primary-soft);
  color: var(--primary);
}

.side-nav .calculator-nav-option:hover {
  transform: none;
}

.side-nav .nav-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid currentColor;
  border-radius: 7px;
  font-size: 1rem;
  opacity: 0.9;
}

.side-footer {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.side-footer strong {
  color: var(--teal-strong);
}

.side-footer span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.planner-main {
  min-width: 0;
  grid-column: 1 / -1;
}

.topbar-menu-button {
  display: none;
}

.planner-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 16px 32px;
  background: rgba(248, 250, 251, 0.96);
  border-bottom: 1px solid #d7dee2;
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.theme-selector {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.theme-option {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 5px 8px;
  font-size: 0.66rem;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
}

.theme-option:hover {
  color: var(--text);
}

.theme-option.active {
  background: var(--primary);
  color: #03130e;
  box-shadow: 0 5px 16px rgba(28, 215, 68, 0.18);
}

.top-nav {
  min-width: 0;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.top-nav .nav-tab {
  flex: 0 0 auto;
  min-height: 48px;
  border: 1px solid #d9e0e4;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  color: #525c6a;
  padding: 10px 14px;
  font-size: 0.98rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(45, 59, 72, 0.04);
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.top-nav .nav-tab:hover,
.top-nav .nav-tab.active {
  background: var(--teal);
  color: #03130e;
  box-shadow: 0 10px 20px rgba(24, 185, 63, 0.2);
}

.top-nav .nav-tab:hover {
  transform: translateY(-1px);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 950;
  line-height: 1;
}

.menu-button,
.round-action,
.icon-button {
  min-width: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 8px 18px rgba(34, 38, 48, 0.08);
  font-weight: 950;
}

.premium-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 950;
  padding: 10px 8px;
}

.premium-upgrade {
  min-height: 40px;
  border: 1px solid #b9871d;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--premium);
  color: var(--premium-ink);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 950;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(166, 117, 19, 0.2);
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.premium-upgrade:hover,
.premium-upgrade:focus-visible {
  background: var(--premium-hover);
  box-shadow: 0 10px 22px rgba(166, 117, 19, 0.28);
  transform: translateY(-1px);
}

.premium-badge {
  border: 1px solid rgba(47, 40, 24, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.38);
  padding: 2px 5px;
  font-size: 0.66rem;
  line-height: 1.2;
  font-weight: 950;
}

.tutorial-button,
.account-chip {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: #e9e9ea;
  color: var(--text);
  padding: 8px 14px;
  font-weight: 950;
}

.account-chip {
  display: grid;
  gap: 2px;
  min-width: 132px;
  text-align: left;
}

.account-chip span {
  color: var(--muted);
  font-size: 0.78rem;
}

.account-chip strong {
  font-size: 0.94rem;
}

.account-chip.pro-account {
  border: 1px solid rgba(185, 135, 29, 0.55);
  background: var(--premium-soft);
}

.account-chip.pro-account span {
  color: #8b6418;
}

.planner-content {
  width: min(1920px, 100%);
  margin: 0 auto;
  padding: 28px 30px 50px;
}

.public-landing {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 42px 30px 56px;
}

.email-confirmation {
  width: min(720px, 100%);
  min-height: calc(100vh - 150px);
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 42px 30px 56px;
}

.email-confirmation-card {
  width: min(100%, 620px);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 42px 34px;
  border: 1px solid rgba(24, 185, 63, 0.22);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.confirmation-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e6f9eb;
  color: var(--teal-strong);
  font-size: 2.5rem;
  font-weight: 950;
}

.email-confirmation-card h1 {
  max-width: 560px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
}

.email-confirmation-card p {
  max-width: 480px;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.5;
}

.email-confirmation-card .button {
  min-width: 220px;
  margin-top: 4px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: 34px;
  min-height: calc(100vh - 210px);
}

.landing-copy {
  display: grid;
  gap: 20px;
}

.landing-kicker {
  width: fit-content;
  border: 1px solid rgba(24, 185, 63, 0.22);
  border-radius: 999px;
  background: #e6f9eb;
  color: var(--teal-strong);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 950;
}

.landing-copy h1 {
  max-width: 780px;
  color: var(--text);
  font-size: 3.4rem;
  line-height: 1.02;
}

.landing-copy p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.55;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-actions .button {
  min-width: 150px;
}

.landing-panel,
.landing-features article {
  border: 1px solid #d7dee2;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.landing-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.landing-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.landing-panel-header span,
.landing-metrics span {
  color: var(--muted);
  font-weight: 850;
}

.landing-panel-header strong {
  color: var(--teal-strong);
  font-size: 1.35rem;
}

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

.landing-metrics div {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  border-radius: 12px;
  background: #f2f5f6;
  padding: 14px;
}

.landing-metrics strong {
  color: var(--text);
  font-size: 1.35rem;
  white-space: nowrap;
}

.landing-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebee;
}

.landing-progress span {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--primary));
}

.landing-panel p {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

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

.landing-features article {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 190px;
  padding: 18px;
}

.landing-features article > span {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: #e6f9eb;
  color: var(--teal-strong);
  font-size: 1.25rem;
  font-weight: 950;
}

.landing-features h2 {
  font-size: 1.12rem;
}

.landing-features p {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.view-panel {
  display: none;
}

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

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.page-heading h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
}

.page-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.user-greeting {
  width: fit-content;
  margin: 0 0 8px !important;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid rgba(24, 185, 63, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, #e0f7e6, #ffffff);
  color: #0c7f29 !important;
  padding: 8px 14px;
  font-size: clamp(2.15rem, 4vw, 3.35rem);
  line-height: 1;
  font-weight: 950 !important;
  box-shadow: 0 10px 24px rgba(24, 185, 63, 0.12);
}

.period-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(360px, 100%);
  padding: 6px;
  border: 2px solid #cfcfd1;
  border-radius: 12px;
  background: #ffffff;
}

.period-controls select {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 900;
  font-size: 1.1rem;
}

.plan-strip,
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(240, 90, 36, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff, var(--primary-soft));
  box-shadow: var(--shadow);
}

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

.plan-strip strong,
.toolbar strong {
  display: block;
  margin-top: 3px;
  font-size: 1.08rem;
}

.plan-strip p {
  color: var(--muted);
  margin-top: 4px;
  font-weight: 700;
}

.plan-usage {
  min-width: min(320px, 100%);
  display: grid;
  gap: 10px;
}

.freemium-usage {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 320px) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(24, 185, 63, 0.2);
  border-radius: 12px;
  background: rgba(223, 243, 243, 0.55);
}

.freemium-usage > div:first-child {
  display: grid;
  gap: 2px;
}

.freemium-usage strong {
  color: var(--teal-strong);
  font-size: 0.84rem;
}

.freemium-usage span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.freemium-usage button {
  border: 0;
  background: transparent;
  color: var(--teal-strong);
  padding: 6px 4px;
  font-weight: 900;
  white-space: nowrap;
}

.mini-progress,
.usage-bar,
.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eeeeee;
}

.mini-progress span,
.usage-bar span,
.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 200ms ease, background 200ms ease;
}

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

.investment-overview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  border-color: rgba(24, 185, 63, 0.26);
  background: linear-gradient(110deg, var(--surface), #ebf8ee);
}

.investment-overview-card .card-heading {
  margin-bottom: 0;
}

.home-investment-content {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  text-align: right;
}

.home-investment-content span,
.home-investment-content small {
  color: var(--muted);
  font-weight: 850;
}

.home-investment-content span {
  display: block;
  margin-bottom: 5px;
}

.home-investment-content strong {
  color: var(--teal-strong);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.home-investment-content small {
  max-width: 150px;
  line-height: 1.35;
}

.planner-card,
.metric-card {
  min-width: 0;
  border: 2px solid #d0d0d2;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 7px 20px rgba(34, 38, 48, 0.04);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  min-height: 132px;
}

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

.metric-card strong {
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  line-height: 1;
}

.metric-card.positive strong {
  color: var(--positive);
}

.metric-card.negative strong {
  color: var(--negative);
}

.metric-card.balance strong {
  color: var(--teal-strong);
}

.negative-text {
  color: var(--negative) !important;
}

.positive-text {
  color: var(--positive) !important;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.12fr) minmax(320px, 0.95fr) minmax(280px, 0.6fr);
  gap: 18px;
  align-items: start;
}

.home-grid {
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, 0.85fr);
}

.financial-chart-card,
.health-card {
  min-height: 330px;
}

.financial-chart-card {
  overflow: hidden;
}

.financial-chart-content {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.financial-chart-content canvas {
  width: min(100%, 280px);
  height: auto;
  justify-self: center;
}

.financial-chart-legend {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
}

.financial-legend-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.financial-legend-row span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.financial-legend-row i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
}

.financial-legend-row strong {
  min-width: 0;
  color: var(--text);
  font-size: clamp(0.72rem, 0.8vw, 0.86rem);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.investment-layout .investment-chart-card {
  grid-column: span 2;
}

.planner-card {
  padding: 20px;
}

.wide-card,
.full-card {
  min-height: 280px;
}

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

.hero-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  min-height: 250px;
}

.hero-illustration {
  height: 190px;
  display: grid;
  place-items: center;
  color: #c8c8c9;
  font-size: 8rem;
  font-weight: 950;
  line-height: 1;
  background:
    radial-gradient(circle at 50% 62%, #e5e5e6 0 34%, transparent 35%),
    linear-gradient(transparent, transparent);
}

.hero-copy {
  display: grid;
  gap: 20px;
  justify-items: start;
}

.hero-copy h2,
.card-heading h2,
.pending-card h2,
.health-card h2 {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 950;
}

.add-launch-button {
  min-height: 74px;
  border: 0;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 30px;
  background: var(--teal);
  color: #03130e;
  box-shadow: 0 12px 24px rgba(24, 185, 63, 0.22);
  font-size: 1.2rem;
  font-weight: 950;
}

.add-launch-button span {
  font-size: 2.7rem;
  line-height: 1;
}

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

.card-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
}

.card-heading > span,
.card-heading > strong {
  color: var(--muted);
  font-weight: 950;
}

.split-heading {
  align-items: center;
}

.split-heading > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.small-segment {
  grid-template-columns: repeat(2, minmax(92px, 1fr));
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  border: 0;
  border-radius: 12px;
  padding: 4px;
  background: #e9e9eb;
}

.segmented button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8c8f96;
  font-weight: 950;
}

.segmented button.active {
  background: var(--primary);
  color: #ffffff;
}

.empty-illustration {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  text-align: center;
}

.empty-illustration span {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eeeeef;
  color: #b8b8ba;
  font-size: 3rem;
  font-weight: 950;
}

.empty-illustration strong {
  max-width: 360px;
  font-size: 1.2rem;
  line-height: 1.35;
}

.credit-card-preview {
  position: relative;
  display: grid;
  gap: 14px;
  max-width: 420px;
  padding: 22px;
  border: 2px solid #d6d6d8;
  border-radius: 24px;
  background: #ffffff;
}

.credit-card-preview > div:first-child {
  display: grid;
  gap: 3px;
}

.credit-card-preview strong {
  font-size: 1.12rem;
}

.credit-card-preview span,
.credit-card-preview p {
  color: var(--muted);
  font-weight: 850;
}

.credit-card-preview > button {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.notes-card textarea {
  width: 100%;
  min-height: 268px;
  border: 0;
  border-radius: 14px;
  padding: 14px;
  background: #fafafa;
  color: var(--text);
  resize: vertical;
  outline: none;
  font-weight: 700;
  line-height: 1.5;
}

.health-card {
  display: grid;
  gap: 14px;
}

.health-card p {
  color: var(--muted);
  line-height: 1.55;
  font-weight: 750;
}

.compact-chart {
  min-height: 246px;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.categories-card,
.transactions-card {
  min-height: 360px;
}

.category-breakdown,
.transaction-list {
  display: grid;
  gap: 12px;
}

.category-row {
  display: grid;
  gap: 8px;
}

.category-row-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 900;
}

.category-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #eeeeef;
}

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

.transaction-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #dfdfe1;
  border-radius: 14px;
  background: #ffffff;
}

.transaction-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-weight: 950;
}

.pill {
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 950;
}

.transaction-meta {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.45;
}

.transaction-value {
  text-align: right;
  font-size: 1.05rem;
  font-weight: 950;
}

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

.transaction-value.expense {
  color: var(--negative);
}

.item-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
  margin-top: 8px;
}

.icon-button {
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 7px 10px;
  font-size: 0.8rem;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
}

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  font-size: 0.9rem;
  font-weight: 950;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.compact-button {
  width: fit-content;
  min-width: 0;
}

.button:hover,
.menu-button:hover,
.round-action:hover,
.tutorial-button:hover,
.account-chip:hover,
.add-launch-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--teal);
  color: #03130e;
}

.button.primary:hover {
  background: var(--teal-strong);
}

.button.secondary {
  background: #ffffff;
  border-color: #d5d5d7;
  color: var(--text);
}

.export-toolbar {
  margin-top: 18px;
}

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

.field {
  display: grid;
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(240, 90, 36, 0.14);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 86px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-height: 32px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--teal-strong);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 950;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #e0f7e6;
}

.text-button {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--teal-strong);
  padding: 0;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button[hidden] {
  display: none;
}

.account-identity {
  display: grid;
  gap: 3px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.account-identity strong {
  font-size: 1.05rem;
}

.account-identity span {
  color: var(--muted);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.account-plan {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(24, 185, 63, 0.2);
  border-radius: 12px;
  background: rgba(223, 243, 243, 0.48);
}

.account-plan > div:first-child {
  display: grid;
  gap: 4px;
}

.account-plan span,
.account-plan small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}

.account-plan > div > strong {
  color: var(--teal-strong);
  font-size: 1.05rem;
}

.account-plan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.account-plan-actions .button {
  min-height: 42px;
  padding: 9px 13px;
}

.account-plan-actions .premium-upgrade {
  min-width: 180px;
}

.danger-link {
  color: #b83232;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.account-security {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.account-security-toggle {
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 14px;
  text-align: left;
}

.account-security-toggle > span:first-child {
  display: grid;
  gap: 3px;
}

.account-security-toggle strong {
  font-size: 1rem;
}

.account-security-toggle small {
  color: var(--muted);
  font-weight: 750;
}

.account-security-toggle:hover {
  background: rgba(24, 185, 63, 0.09);
}

.account-security-icon {
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 150ms ease;
}

.account-security-icon.expanded {
  transform: rotate(180deg);
}

.account-password-panel {
  border-top: 1px solid var(--line);
  padding: 16px 14px;
}

.account-password-actions {
  justify-content: flex-end;
}

.danger-button {
  color: #b83232;
}

.transaction-form,
.million-form,
.auth-form {
  display: grid;
  gap: 16px;
}

.quick-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

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

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

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

.select-inline {
  max-width: 160px;
}

.million-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.calculator-stack {
  display: grid;
  gap: 20px;
}

.calculator-page-hidden {
  display: none;
}

.calculator-card {
  width: 100%;
  min-height: 0;
}

.sac-calculator-card {
  display: grid;
  gap: 20px;
}

.sac-main-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.sac-extra-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.field-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 7px;
}

.field-with-unit select {
  padding-inline: 9px;
  font-size: 0.82rem;
}

.sac-readonly-field {
  align-content: center;
  min-height: 70px;
  border: 1px solid rgba(57, 223, 88, 0.32);
  border-radius: 9px;
  background: var(--primary-soft);
  padding: 10px 12px;
}

.sac-readonly-field span,
.sac-readonly-field small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.sac-readonly-field strong {
  color: var(--primary-strong);
  font-size: 1.02rem;
}

.sac-result-section {
  display: grid;
  gap: 16px;
}

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

.sac-result-card {
  min-width: 0;
}

.sac-result-card strong {
  overflow-wrap: anywhere;
}

.sac-result-card small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.35;
}

.sac-result-card.positive strong {
  color: var(--positive);
}

.sac-result-card.negative strong {
  color: var(--negative);
}

.sac-chart-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 14px;
}

.sac-chart-panel .card-heading {
  align-items: center;
  margin-bottom: 8px;
}

.sac-chart-panel h3,
.sac-extra-section h3 {
  color: var(--text);
  font-size: 1rem;
}

.sac-chart-panel canvas {
  width: 100%;
  height: auto;
  display: block;
}

.sac-extra-section {
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.sac-extra-section > .card-heading {
  margin-bottom: 0;
}

.sac-result-narrative {
  border: 1px solid rgba(57, 223, 88, 0.28);
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--muted);
  padding: 13px 14px;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.55;
}

.sac-result-narrative strong {
  color: var(--primary-strong);
}

.sac-table-scroll {
  max-height: 430px;
  overflow: auto;
}

.sac-table-scroll table {
  min-width: 720px;
}

.sac-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.sac-eliminated-row {
  background: var(--primary-soft);
}

.sac-eliminated-row td:last-child {
  color: var(--positive);
  font-weight: 900;
}

.chart-inline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.chart-inline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.chart-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.chart-dot.original {
  background: #9ab4a7;
}

.chart-dot.strategy {
  background: #39df58;
}

.calculator-disclaimer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding-top: 14px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.5;
}

.investment-summary {
  margin-bottom: 18px;
}

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

.goal-progress-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-weight: 900;
}

.allocation-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.allocation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.allocation-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.allocation-row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.allocation-row strong {
  color: var(--text);
}

.result-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.result-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.result-card strong {
  font-size: 1.2rem;
}

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

.locked-result {
  cursor: pointer;
  border-color: rgba(240, 90, 36, 0.28);
  background: var(--primary-soft);
}

.table-scroll {
  width: 100%;
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: #ffffff;
}

caption {
  padding: 12px;
  color: var(--muted);
  font-weight: 950;
  text-align: left;
}

th,
td {
  padding: 12px;
  border-top: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.upgrade-callout,
.upgrade-link {
  width: 100%;
  border: 1px solid rgba(240, 90, 36, 0.28);
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 12px;
  font-weight: 950;
  text-align: center;
}

.locked-row td {
  text-align: center;
  background: #fff9f6;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 34, 42, 0.56);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(31, 34, 42, 0.28);
  padding: 22px;
}

.launch-modal {
  width: min(880px, 100%);
}

.small-modal {
  width: min(480px, 100%);
}

.email-sent-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 32px;
  text-align: center;
}

.email-sent-card .eyebrow {
  margin: 0;
}

.email-sent-card h2 {
  font-size: 1.75rem;
}

.email-sent-card > p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.5;
}

.email-sent-card > p strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.email-sent-hint {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 0.92rem;
}

.email-sent-card .auth-actions {
  width: 100%;
  margin-top: 4px;
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upgrade-reason {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 18px;
}

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

.pricing-card {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
}

.pricing-card.featured {
  border-color: rgba(240, 90, 36, 0.35);
  background: linear-gradient(180deg, var(--primary-soft), #ffffff);
  box-shadow: 0 16px 32px rgba(240, 90, 36, 0.1);
}

.pricing-card span {
  color: var(--primary);
  font-weight: 950;
  text-transform: uppercase;
}

.pricing-card strong {
  font-size: 1.4rem;
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.price-line strong {
  color: var(--text);
  font-size: 1.85rem;
}

.price-line small {
  color: var(--muted);
  font-weight: 800;
}

.pricing-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.4;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 14px;
  background: #303544;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

/* Technological visual system */
.planner-topbar {
  min-height: 92px;
  background: rgba(248, 250, 253, 0.96);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 30px rgba(30, 48, 76, 0.06);
}

.landing-hero {
  min-height: calc(100vh - 250px);
}

.side-brand img,
.planner-logo img {
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(24, 185, 63, 0.24);
}

.top-nav .nav-tab {
  min-height: 44px;
  border-color: var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: none;
}

.top-nav .nav-tab:hover,
.top-nav .nav-tab.active {
  background: var(--primary);
  color: #03130e;
  box-shadow: 0 8px 22px rgba(24, 185, 63, 0.24);
}

.menu-button,
.round-action,
.icon-button,
.tutorial-button,
.account-chip {
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 7px 18px rgba(34, 53, 83, 0.07);
}

.round-action {
  color: var(--primary);
}

.planner-card,
.metric-card,
.landing-panel,
.landing-features article,
.email-confirmation-card,
.pricing-card,
.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  overflow: hidden;
  border-top: 2px solid var(--line);
}

.metric-card.positive {
  border-top-color: var(--positive);
}

.metric-card.negative {
  border-top-color: var(--negative);
}

.metric-card.balance {
  border-top-color: var(--teal);
}

.investment-overview-card {
  border-left: 3px solid var(--teal);
  background: var(--surface);
}

.period-controls {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(34, 53, 83, 0.06);
}

.button,
input,
select,
textarea,
.password-toggle,
.segmented,
.segmented button,
.add-launch-button {
  border-radius: 9px;
}

.button.primary,
.add-launch-button {
  background: var(--primary);
  color: #03130e;
}

.button.primary:hover,
.add-launch-button:hover {
  background: var(--primary-strong);
}

.button.expense-action,
#typeExpense.active {
  border-color: var(--negative);
  background: var(--negative);
  color: #27060d;
}

.button.expense-action:hover,
#typeExpense.active:hover {
  border-color: #ff8b9d;
  background: #ff8b9d;
  color: #27060d;
}

.add-launch-button {
  box-shadow: 0 12px 28px rgba(24, 185, 63, 0.24);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(57, 223, 88, 0.17);
}

.landing-kicker,
.landing-features article > span,
.confirmation-mark {
  border: 1px solid rgba(24, 185, 63, 0.28);
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
}

.landing-progress span,
.mini-progress span,
.usage-bar span,
.progress-fill,
.category-bar span {
  background: var(--primary);
}

.hero-illustration {
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
}

.user-greeting {
  border-color: rgba(24, 185, 63, 0.32);
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary) !important;
  box-shadow: 0 10px 26px rgba(24, 185, 63, 0.12);
}

.plan-strip,
.toolbar,
.freemium-usage,
.account-plan {
  border-color: var(--line);
  background: var(--surface);
}

body.dark-theme {
  background: var(--bg);
}

body.dark-theme .planner-topbar {
  background: rgba(3, 19, 14, 0.96);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.32);
}

body.dark-theme .top-nav .nav-tab {
  border-color: #1a4d39;
  background: #092118;
  color: #a3bdaf;
}

body.dark-theme .top-nav .nav-tab:hover,
body.dark-theme .top-nav .nav-tab.active {
  border-color: #63ef78;
  background: var(--primary);
  color: #03130e;
  box-shadow: 0 8px 24px rgba(57, 223, 88, 0.24);
}

body.dark-theme .menu-button,
body.dark-theme .round-action,
body.dark-theme .icon-button,
body.dark-theme .tutorial-button,
body.dark-theme .account-chip,
body.dark-theme .button.secondary,
body.dark-theme .period-controls {
  border-color: var(--line);
  background: #082019;
  color: var(--text);
  box-shadow: none;
}

body.dark-theme .theme-selector {
  border-color: var(--line);
  background: #082019;
}

body.dark-theme .theme-option {
  color: var(--muted);
}

body.dark-theme .theme-option:hover {
  color: var(--text);
}

body.dark-theme .theme-option.active {
  background: var(--primary);
  color: #03130e;
}

body.dark-theme .round-action {
  color: #72f188;
}

body.dark-theme .planner-card,
body.dark-theme .metric-card,
body.dark-theme .landing-panel,
body.dark-theme .landing-features article,
body.dark-theme .email-confirmation-card,
body.dark-theme .pricing-card,
body.dark-theme .modal-card,
body.dark-theme .transaction-item {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

body.dark-theme .metric-card.positive {
  border-top-color: var(--positive);
}

body.dark-theme .metric-card.negative {
  border-top-color: var(--negative);
}

body.dark-theme .metric-card.balance {
  border-top-color: var(--teal);
}

body.dark-theme .investment-overview-card {
  border-left-color: var(--teal);
  background: var(--surface);
}

body.dark-theme .landing-kicker,
body.dark-theme .landing-features article > span,
body.dark-theme .confirmation-mark,
body.dark-theme .user-greeting {
  border-color: rgba(57, 223, 88, 0.4);
  background: var(--primary-soft);
  color: #73f58a !important;
}

body.dark-theme .landing-panel-header strong,
body.dark-theme .home-investment-content strong,
body.dark-theme .metric-card.balance strong {
  color: var(--teal-strong);
}

body.dark-theme .landing-metrics div,
body.dark-theme .hero-illustration,
body.dark-theme .result-card,
body.dark-theme .account-identity,
body.dark-theme .account-security-toggle,
body.dark-theme .email-sent-hint,
body.dark-theme .empty-illustration span {
  border-color: var(--line);
  background: var(--surface-soft);
}

body.dark-theme .landing-progress,
body.dark-theme .mini-progress,
body.dark-theme .usage-bar,
body.dark-theme .progress-track,
body.dark-theme .category-bar {
  background: #123528;
}

body.dark-theme .plan-strip,
body.dark-theme .toolbar,
body.dark-theme .freemium-usage,
body.dark-theme .account-plan,
body.dark-theme .pricing-card.featured {
  border-color: var(--line);
  background: var(--surface);
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  border-color: #1b503b;
  background: #041711;
  color: var(--text);
}

body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(57, 223, 88, 0.2);
}

body.dark-theme .password-toggle:hover,
body.dark-theme .password-toggle:focus-visible {
  background: #123b2b;
}

body.dark-theme .segmented {
  background: #09241a;
}

body.dark-theme .segmented button {
  color: var(--muted);
}

body.dark-theme .segmented button.active {
  background: var(--primary);
  color: #03130e;
}

body.dark-theme #typeExpense.active {
  background: var(--negative);
  color: #27060d;
}

body.dark-theme .table-scroll,
body.dark-theme table {
  border-color: var(--line);
  background: var(--surface);
}

body.dark-theme .locked-row td {
  background: #121a27;
}

body.dark-theme .modal-backdrop {
  background: rgba(2, 6, 12, 0.78);
  backdrop-filter: blur(5px);
}

#authModal .modal-backdrop {
  background: rgba(3, 7, 14, 0.86);
  backdrop-filter: blur(9px);
}

.auth-modal-card {
  width: min(560px, 100%);
  border-color: rgba(57, 223, 88, 0.42);
  padding: 30px;
  box-shadow:
    0 32px 90px rgba(5, 12, 24, 0.48),
    0 0 0 1px rgba(57, 223, 88, 0.08),
    0 0 54px rgba(57, 223, 88, 0.12);
}

.auth-secure-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-right: 80px;
}

.auth-secure-heading .eyebrow {
  margin: 0;
  color: var(--primary);
}

.auth-secure-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(57, 223, 88, 0.36);
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 950;
}

.auth-modal-heading {
  align-items: flex-start;
  margin-bottom: 24px;
}

.auth-modal-heading #closeAuthBtn {
  position: absolute;
  top: 30px;
  right: 30px;
}

.auth-modal-heading > div:first-child {
  min-width: 0;
}

.auth-modal-heading h2 {
  font-size: clamp(1.8rem, 4vw, 2.25rem);
  line-height: 1.08;
}

.auth-modal-heading .upgrade-reason {
  max-width: 390px;
  margin: 10px 0 0;
}

#authModal .auth-form {
  gap: 18px;
}

#authModal label {
  color: var(--text);
  font-size: 0.9rem;
}

#authModal input {
  min-height: 54px;
  padding: 12px 14px;
  font-size: 1rem;
}

#authModal .password-field input {
  padding-right: 92px;
}

#authModal .text-button {
  justify-self: end;
}

#authModal .auth-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 2px;
}

#authModal .auth-actions .button {
  width: 100%;
  min-height: 52px;
}

body.dark-theme .auth-modal-card {
  border-color: #1d5a40;
  background: #061b14;
}

body.dark-theme .auth-secure-mark {
  border-color: #26894c;
  background: #0c321d;
  color: #73f58a;
  box-shadow: 0 9px 24px rgba(57, 223, 88, 0.16);
}

body.public-auth-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(57, 223, 88, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 223, 88, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 40px 40px;
}

body.public-auth-page .planner-topbar {
  position: relative;
  z-index: 52;
  justify-content: center;
  min-height: 108px;
  padding: 18px 32px;
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.public-auth-page .planner-logo .granou-logo-mark {
  width: 58px;
  height: 58px;
}

body.public-auth-page .planner-logo strong {
  font-size: 1.08rem;
}

body.public-auth-page .topbar-actions {
  position: absolute;
  top: 28px;
  right: 32px;
  width: auto;
}

body.public-auth-page #openAuthBtn,
body.public-auth-page #topUpgradeBtn,
body.public-auth-page .topbar-menu-button {
  display: none !important;
}

body.public-auth-page .public-access-surface {
  display: none !important;
}

body.public-auth-page #authModal {
  position: fixed;
  inset: 108px 0 0;
  z-index: 51;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 26px 18px 64px;
  background: transparent;
}

body.public-auth-page #authModal .modal-backdrop,
body.public-auth-page #closeAuthBtn {
  display: none;
}

body.public-auth-page .auth-modal-card {
  margin: auto;
  max-height: none;
}

body.public-auth-page.modal-open {
  overflow: auto;
}

body.authenticated-shell .planner-app {
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
}

body.authenticated-shell .side-menu {
  position: sticky;
  inset: auto;
  top: 0;
  z-index: 20;
  grid-column: 1;
  grid-row: 1;
  width: 270px;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 14px 0 38px rgba(0, 0, 0, 0.16);
  transform: none;
}

body.authenticated-shell .side-brand .granou-logo-mark {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
}

body.authenticated-shell .side-brand strong {
  font-size: 1.14rem;
}

body.authenticated-shell .side-brand span {
  max-width: 150px;
  font-size: 0.72rem;
  line-height: 1.25;
}

body.authenticated-shell .side-close-button {
  display: none;
}

body.authenticated-shell .planner-main {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
}

body.authenticated-shell .planner-topbar {
  min-height: 82px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  padding: 12px 28px;
}

body.authenticated-shell .planner-topbar .topbar-left,
body.authenticated-shell .planner-topbar .topbar-brand {
  display: none;
}

body.authenticated-shell .topbar-actions {
  margin-left: auto;
}

body.authenticated-shell .side-footer {
  border: 1px solid var(--line);
  border-radius: 9px;
}

body.dark-theme.authenticated-shell .side-menu {
  background: #051912;
  border-right-color: #174936;
}

body.dark-theme.authenticated-shell .side-footer {
  background: #09271d;
}

body.dark-theme .toast {
  border: 1px solid #31435d;
  background: #131d2b;
}

.premium-upgrade {
  border-radius: 9px;
}

.hidden,
.visually-hidden {
  display: none !important;
}

@media (min-width: 921px) and (max-width: 1500px) {
  .planner-topbar {
    flex-wrap: wrap;
    gap: 12px 20px;
  }

  .top-nav {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    padding-bottom: 2px;
  }
}

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

  .financial-chart-content {
    grid-template-columns: 1fr;
  }

  .financial-chart-content canvas {
    width: min(100%, 250px);
  }

  .sac-main-form,
  .sac-extra-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .landing-copy h1 {
    font-size: 3rem;
  }

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

@media (max-width: 920px) {
  body.authenticated-shell .planner-app {
    display: block;
  }

  body.authenticated-shell .side-menu {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(300px, calc(100vw - 34px));
    height: 100vh;
    transform: translateX(-105%);
  }

  body.authenticated-shell.menu-open .side-menu {
    transform: translateX(0);
  }

  body.authenticated-shell .side-close-button {
    display: inline-flex;
  }

  body.authenticated-shell .planner-main {
    width: 100%;
  }

  body.authenticated-shell .planner-topbar {
    min-height: 76px;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 12px 18px;
  }

  body.authenticated-shell .planner-topbar .topbar-left {
    display: flex;
    margin-right: auto;
  }

  body.authenticated-shell .topbar-menu-button {
    display: inline-flex;
  }

  body.authenticated-shell .topbar-actions {
    width: auto;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-left: auto;
  }

  .planner-topbar,
  .page-heading,
  .plan-strip,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-left,
  .topbar-actions,
  .toolbar-actions,
  .form-actions,
  .auth-actions {
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: start;
  }

  .top-nav {
    order: 3;
    width: 100%;
    justify-content: start;
    padding-bottom: 2px;
  }

  .public-landing {
    padding: 28px 16px 44px;
  }

  .email-confirmation {
    min-height: calc(100vh - 120px);
    padding: 28px 16px 44px;
  }

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

  .landing-copy h1 {
    font-size: 2.45rem;
  }

  .dashboard-grid,
  .summary-row,
  .pricing-grid,
  .million-result,
  .goal-progress-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }

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

  .freemium-usage {
    grid-template-columns: 1fr;
  }

  .investment-overview-card {
    grid-template-columns: 1fr;
  }

  .home-investment-content {
    justify-content: space-between;
    text-align: left;
  }

  .investment-layout .investment-chart-card {
    grid-column: auto;
  }

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

  .hero-illustration {
    height: 120px;
    font-size: 5rem;
  }

  .button,
  .tutorial-button,
  .add-launch-button {
    width: 100%;
  }

  .account-chip {
    width: auto;
  }

  .period-controls {
    min-width: 0;
  }

  .modal-heading {
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .planner-topbar {
    padding: 14px;
  }

  body.public-auth-page .planner-topbar {
    min-height: 154px;
    align-items: start;
    flex-direction: row;
    justify-content: center;
    padding: 14px;
  }

  body.public-auth-page .planner-logo .granou-logo-mark {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }

  body.public-auth-page .planner-logo strong {
    font-size: 0.98rem;
  }

  body.public-auth-page .planner-logo span {
    font-size: 0.72rem;
  }

  body.public-auth-page .topbar-actions {
    top: 94px;
    right: 50%;
    width: min(270px, calc(100vw - 28px));
    transform: translateX(50%);
  }

  body.public-auth-page #authModal {
    inset: 154px 0 0;
    padding: 18px 14px 38px;
  }

  .auth-modal-card {
    padding: 22px 18px;
  }

  .auth-secure-heading {
    margin-bottom: 14px;
    padding-right: 72px;
  }

  .auth-secure-mark {
    width: 42px;
    height: 42px;
  }

  .auth-modal-heading {
    margin-bottom: 20px;
  }

  .auth-modal-heading #closeAuthBtn {
    top: 22px;
    right: 18px;
  }

  .auth-modal-heading h2 {
    font-size: 1.7rem;
  }

  .topbar-actions {
    width: 100%;
    gap: 8px;
  }

  body.authenticated-shell .planner-topbar {
    min-height: 126px;
    display: grid;
    grid-template-areas:
      "menu spacer account"
      "theme theme theme";
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 10px 12px;
  }

  body.authenticated-shell .planner-topbar .topbar-left {
    grid-area: menu;
  }

  body.authenticated-shell .topbar-actions {
    display: contents;
  }

  body.authenticated-shell .top-upgrade {
    display: none !important;
  }

  body.authenticated-shell .theme-selector {
    grid-area: theme;
    width: fit-content;
    justify-self: center;
  }

  body.authenticated-shell .account-chip {
    grid-area: account;
    min-width: 108px;
  }

  .theme-selector {
    width: fit-content;
  }

  .theme-option {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 0.64rem;
  }

  .top-upgrade {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .account-chip {
    min-width: 118px;
    padding: 8px 11px;
  }

  .planner-content {
    padding: 18px 12px 42px;
  }

  .landing-copy h1 {
    font-size: 2.05rem;
  }

  .email-confirmation-card {
    padding: 32px 20px;
  }

  .email-sent-card {
    padding: 26px 18px;
  }

  .landing-copy p {
    font-size: 1rem;
  }

  .landing-metrics,
  .landing-features {
    grid-template-columns: 1fr;
  }

  .landing-features article {
    min-height: auto;
  }

  .planner-logo strong {
    font-size: 0.98rem;
  }

  .planner-logo .granou-logo-mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .planner-card,
  .metric-card,
  .plan-strip,
  .toolbar {
    padding: 14px;
  }

  .financial-chart-content,
  .sac-main-form,
  .sac-extra-form,
  .sac-summary-cards {
    grid-template-columns: 1fr;
  }

  .financial-chart-card,
  .health-card {
    min-height: 0;
  }

  .financial-legend-row {
    gap: 10px;
  }

  .field-with-unit {
    grid-template-columns: minmax(0, 1fr) 86px;
  }

  .compact-button {
    width: 100%;
  }

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

  .transaction-item {
    grid-template-columns: 1fr;
  }

  .transaction-value {
    text-align: left;
  }

  .item-actions {
    justify-content: start;
  }

  .side-menu {
    width: min(286px, calc(100vw - 34px));
  }
}
