:root {
  --bg: #0b1014;
  --bg-elev: #111922;
  --bg-soft: #16212d;
  --line: #273341;
  --text: #ebf0f5;
  --muted: #9aabbc;
  --accent: #14b8a6;
  --accent-strong: #0f9b8d;
  --accent-warm: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 22px 44px rgba(0, 0, 0, 0.32);
  --sidebar-edge-offset-x: 0px;
}

.theme-light {
  --bg: #f6f7f8;
  --bg-elev: #ffffff;
  --bg-soft: #f0f3f6;
  --line: #dde2e7;
  --text: #18212a;
  --muted: #586775;
  --accent: #0f8c7d;
  --accent-strong: #0b7569;
  --shadow: 0 18px 34px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body,
input,
select,
textarea,
button {
  font-family: Manrope, Sora, Avenir Next, Segoe UI, sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, #182530 0, var(--bg) 35%), var(--bg);
  color: var(--text);
}

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

.icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  transition: grid-template-columns 0.18s ease;
  position: relative;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #101a24 0%, #0d151d 100%);
  padding: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 0 0 0.15rem;
  min-height: 58px;
}

.brand-wordmark {
  width: 300px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: -80px 0 -80px;
}

.brand-logo-collapsed {
  display: none;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-logo.large {
  width: 48px;
  height: 48px;
}

.brand-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.brand-name {
  margin: 0;
  font-size: 1.1rem;
}

.side-nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.side-link {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  color: #c7d2dd;
  border: 1px solid transparent;
}

.side-link-form {
  margin: 0;
}

.side-link-button {
  width: 100%;
  font: inherit;
  background: transparent;
  cursor: pointer;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f2f7fb;
}

.side-link.active {
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(20, 184, 166, 0.4);
  color: #d6fffa;
}

.side-footer {
  margin-top: auto;
  padding-top: 1rem;
  display: grid;
  gap: 0.55rem;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 78px 1fr;
}

.app-shell.sidebar-collapsed .app-sidebar {
  padding: 0.75rem 0.45rem;
}

.app-shell.sidebar-collapsed .brand-row {
  justify-content: center;
  gap: 0.3rem;
  min-height: 44px;
  margin-top: -8px;
}

.app-shell.sidebar-collapsed .brand-wordmark {
  display: none;
}

.app-shell.sidebar-collapsed .brand-logo-collapsed {
  display: block;
  width: 100px;
  height: 100px;
  transform: translateY(-5px);
}

.sidebar-edge-toggle {
  position: fixed;
  top: 50vh;
  left: 260px;
  transform: translate(calc(-50% + var(--sidebar-edge-offset-x)), -50%);
  width: 18px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 75;
  cursor: pointer;
  padding: 0;
}

.sidebar-edge-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

.sidebar-edge-glyph::before {
  content: "‹";
  font-size: 16px;
  line-height: 1;
}

.app-shell.sidebar-collapsed .sidebar-edge-toggle {
  left: 78px;
}

.app-shell.sidebar-collapsed .sidebar-edge-glyph::before {
  content: "›";
}

.app-shell.sidebar-collapsed .side-link {
  justify-content: center;
  padding: 0.6rem 0.42rem;
  gap: 0;
}

.app-shell.sidebar-collapsed .side-nav {
  margin-top: calc(0.3rem - 18px);
}

.app-shell.sidebar-collapsed .side-link span {
  display: none;
}

.app-shell.sidebar-collapsed .side-footer .ghost-button {
  justify-content: center;
  padding: 0.55rem 0.38rem;
}

.app-shell.sidebar-collapsed .side-footer .ghost-button span {
  display: none;
}

.ghost-button {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #c7d2dd;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}

.ghost-button:hover {
  color: #f2f7fb;
  border-color: var(--accent);
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 1rem;
}

.topbar-heading {
  min-width: 0;
}

.topbar-eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar-title {
  margin: 0.1rem 0 0;
  font-size: 1.15rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.topbar-page-tools {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
  justify-content: flex-end;
}

.topbar-dashboard-tools {
  width: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.42rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.topbar-dashboard-tools .filter-inline {
  gap: 0.4rem;
}

.topbar-dashboard-tools .input-compact {
  min-width: 92px;
}

.topbar-dashboard-tools .button {
  padding: 0.45rem 0.66rem;
}

.tag-filter-picker {
  min-width: 140px;
}

.tag-filter-picker .tag-picker-trigger {
  min-height: 34px;
}

.tag-filter-picker .tag-picker-menu {
  min-width: 210px;
  right: 0;
  left: auto;
}

.inline-form {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}

.content {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section {
  padding: 1rem;
}

.subcard {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.subcard-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
  margin-bottom: 0.45rem;
}

.kpi {
  padding: 0.95rem;
}

.kpi-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.kpi-value {
  margin: 0.35rem 0 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.cards-grid {
  display: grid;
  gap: 1rem;
}

.kpi-grid,
.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.8rem;
}

.head-actions {
  justify-content: flex-end;
}

.section-head h3,
.section-head h4 {
  margin: 0;
}

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

.tiny {
  font-size: 0.82rem;
}

.form-grid,
.inline-grid {
  display: grid;
  gap: 0.65rem;
}

.inline-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

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

.inline-grid.account-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.inline-grid.bill-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.inline-grid.installment-fields {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
}

label.is-disabled {
  opacity: 0.72;
}

label small {
  line-height: 1.35;
}

.input {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  padding: 0.56rem 0.66rem;
  border-radius: 10px;
  outline: none;
  min-height: 40px;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.input-compact {
  padding: 0.42rem 0.52rem;
  border-radius: 8px;
  min-height: 40px;
}

textarea.input {
  resize: vertical;
}

.button {
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #04110f;
  border-radius: 10px;
  padding: 0.46rem 0.66rem;
  font-size: 0.86rem;
  line-height: 1.2;
  font-weight: 700;
  cursor: pointer;
}

.button-compact {
  padding: 0.42rem 0.62rem;
  min-height: 40px;
  height: 40px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.button-soft {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.button-danger {
  border-color: #ef6d85;
  background: #91273c;
  color: #fff1f4;
}

.button-danger:hover {
  background: #a02d44;
}

.icon-button {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
}

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

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-icon-sun {
  color: currentColor;
}

.theme-icon-moon {
  color: currentColor;
}

.theme-toggle:hover .theme-icon-sun {
  color: currentColor;
}

.theme-toggle:hover .theme-icon-moon {
  color: currentColor;
}

.flash {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.8rem;
  margin: 0;
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  width: min(680px, calc(100vw - 1.4rem));
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
}

.flash-success {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.18);
}

.flash-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.2);
}

.flash-warning {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.2);
}

.stack-list {
  display: grid;
  gap: 0.6rem;
}

.inline-actions,
.split-actions,
.actions-wrap,
.import-grid,
.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.actions-wrap {
  align-items: flex-end;
  justify-content: space-between;
}

.section-filter-compact {
  padding: 0.7rem 0.9rem;
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.filter-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.filter-inline .input-compact {
  min-width: 104px;
}

.import-box summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
}

.form-top-gap {
  margin-top: 0.6rem;
}

.summary-edit {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
  list-style: none;
}

.summary-edit::-webkit-details-marker {
  display: none;
}

summary.summary-edit::marker {
  content: "";
}

.info-badge {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-soft) 78%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.info-badge .icon {
  width: 11px;
  height: 11px;
}

.edit-panel > summary > .icon:last-child {
  margin-left: auto;
}

.summary-edit.summary-left .icon:last-child {
  margin-left: 0;
}

#section-forecast .summary-edit {
  justify-content: flex-start;
}

#section-forecast:not([open]) {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
}

#section-forecast[open] {
  display: block;
  width: 100%;
}

#section-budget .forecast-card > summary.summary-edit {
  display: inline-flex;
}

#section-budget .forecast-card:not([open]) {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
}

#section-budget .forecast-card[open] {
  display: block;
  width: 100%;
}

.edit-panel[open] > summary {
  color: var(--accent);
}

.quick-metrics .metric-chip {
  padding: 0.6rem 0.7rem;
}

.quick-metrics .metric-chip p {
  margin: 0;
}

.quick-metrics .metric-chip strong {
  margin-top: 0.15rem;
  display: block;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.2rem 0.46rem;
  font-size: 0.72rem;
  color: #111111;
  font-weight: 700;
}

.badge.success {
  color: #0d0d0d;
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.14);
}

.badge.warning {
  color: #111111;
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.14);
}

.badge-default {
  color: #111111;
  border-color: rgba(125, 170, 255, 0.75);
  background: rgba(125, 170, 255, 0.86);
}

.table-wrap {
  overflow: auto;
}

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

.table th,
.table td {
  padding: 0.6rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.86rem;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.checkbox-inline {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.84rem;
}

.bill-form-grid > label.checkbox-inline {
  align-self: end;
  min-height: 40px;
  margin-bottom: 1px;
}

.multi-checks {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
}

.multi-checks legend {
  padding: 0 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.reserve-checks p {
  margin: 0 0 0.55rem;
}

.reserve-check-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.section-footer {
  margin-top: 0.75rem;
}

.goals-due-grid {
  align-items: start;
}

.due-head {
  align-items: center;
  flex-wrap: wrap;
}

.due-period-switch {
  margin-left: auto;
}

.due-year-input {
  width: 6.2rem;
}

.goal-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.goal-main {
  display: grid;
  gap: 0.28rem;
}

.goal-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
}

.goal-progress-track {
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 84%, transparent);
  overflow: hidden;
}

.goal-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #2dd4bf 100%);
}

.goal-progress-percent {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}

.goal-actions {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: 182px;
}

.goal-reached-slot {
  min-width: 0;
}

.goal-reached-slot.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.due-item {
  display: grid;
  gap: 0.42rem;
}

.due-row-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem;
}

.due-title-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.due-name {
  min-width: 0;
}

.due-payment-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.due-amount-value {
  font-size: 0.84rem;
  font-weight: 600;
}

.due-status {
  font-size: 0.78rem;
  border-radius: 999px;
  padding: 0.17rem 0.48rem;
  border: 1px solid var(--line);
  font-weight: 700;
}

.due-status.is-paid {
  color: #111111;
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.14);
}

.due-status.is-due {
  color: #111111;
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.5);
}

.due-status.is-missing {
  color: #111111;
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(148, 163, 184, 0.12);
}

.due-actions {
  justify-content: flex-end;
  align-items: center;
}

.due-modal-actions {
  justify-content: flex-end;
}

.due-comment {
  margin: 0;
}

.due-delete {
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.38);
}

.due-delete:hover {
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.6);
}

body.modal-open {
  overflow: hidden;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1150;
  background: rgba(2, 5, 8, 0.56);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.app-modal-dialog {
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100vh - 0.9rem);
  overflow: auto;
}

.app-modal-dialog.app-modal-large {
  width: min(1080px, calc(100vw - 1.4rem));
  max-height: calc(100vh - 0.35rem);
}

.app-modal-dialog.app-modal-large.app-modal-tall {
  height: auto;
  max-height: min(90vh, 980px);
}

.app-modal-dialog.app-modal-large.app-modal-bill {
  height: auto;
  max-height: min(94vh, 1120px);
}

.app-modal-dialog.app-modal-accounts {
  max-height: calc(100vh - 1.6rem);
}

.app-modal[data-modal="modal-accounts-manage"] {
  place-items: start center;
  overflow: auto;
  padding-top: 0.65rem;
}

.app-modal-dialog.app-modal-narrow {
  width: min(520px, calc(100vw - 2rem));
}

.app-modal-mini .app-modal-dialog.app-modal-narrow {
  width: min(460px, calc(100vw - 2rem));
}

.tag-picker {
  position: relative;
}

.tag-picker-trigger {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 39px;
}

.tag-picker-menu {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.45rem;
  display: grid;
  gap: 0.4rem;
  max-height: var(--tag-menu-max-height, min(52vh, 420px));
  overflow: hidden;
}

.tag-picker-menu[data-position="up"] {
  top: auto;
  bottom: calc(100% + 6px);
}

.tag-picker-list {
  display: grid;
  gap: 0.35rem;
  max-height: var(--tag-list-max-height, min(34vh, 260px));
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.app-modal .tag-picker-menu {
  z-index: 1205;
  max-height: var(--tag-menu-max-height, min(44vh, 380px));
}

.app-modal .tag-picker-list {
  max-height: var(--tag-list-max-height, min(30vh, 220px));
  min-height: 0;
}

.app-modal-dialog.app-modal-bill .tag-picker-menu {
  --tag-menu-max-height: min(50vh, 500px);
}

.app-modal-dialog.app-modal-tall .tag-picker-menu {
  --tag-menu-max-height: min(42vh, 360px);
}

.forecast-card {
  margin-top: 0.62rem;
}

.forecast-preview-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.forecast-preview-grid .subcard {
  padding: 0.58rem;
}

.forecast-preview-grid .subcard p {
  margin: 0;
}

.forecast-preview-grid .subcard strong {
  margin-top: 0.14rem;
  display: block;
}

.accounts-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
}

.account-metric-card {
  padding: 0.7rem 0.78rem;
}

.account-metric-card p {
  margin: 0;
}

.account-metric-card strong {
  margin-top: 0.18rem;
  display: block;
}

.account-target-suffix {
  margin-left: 0.16rem;
  color: color-mix(in srgb, var(--muted) 84%, transparent);
  font-size: 0.74em;
  font-weight: 500;
}

.account-summary {
  align-items: center;
}

.drag-handle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.account-item.is-dragging {
  opacity: 0.72;
  border-color: var(--accent);
}

.payer-row-actions {
  align-items: center;
  gap: 0.24rem;
}

.payer-row-actions .icon-button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.payer-default-badge {
  padding: 0.18rem 0.52rem;
  font-size: 0.72rem;
  line-height: 1.2;
}

.payer-card {
  padding: 0.44rem 0.58rem;
}

.payer-card .subcard-head {
  margin-bottom: 0;
  align-items: center;
}

.payer-card .subcard-head > strong {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

.tag-card {
  padding: 0.55rem 0.62rem;
}

.tag-card .subcard-head {
  margin-bottom: 0;
  align-items: center;
}

.tag-row-actions {
  align-items: center;
  gap: 0.3rem;
}

.tag-row-actions .icon-button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.tag-picker-option {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  padding: 0.2rem;
  display: flex;
  justify-content: flex-start;
  cursor: pointer;
}

.tag-picker-option:hover,
.tag-picker-option.active {
  border-color: var(--line);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
}

.tag-picker-add {
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 9px;
  padding: 0.42rem 0.55rem;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}

.tag-picker-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bar-chart {
  display: grid;
  gap: 0.42rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.8rem;
}

.bar-track {
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 10px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #2dd4bf 100%);
}

.bar-fill.alt {
  background: linear-gradient(90deg, var(--accent-warm) 0%, #fcd34d 100%);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.calendar-head {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.calendar-cell {
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 92px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.4rem;
}

.calendar-cell.is-empty {
  opacity: 0.38;
}

.calendar-day {
  margin: 0 0 0.24rem;
  font-weight: 700;
  font-size: 0.82rem;
}

.calendar-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.2rem 0.32rem;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  display: grid;
}

.calendar-pill.status-paid {
  border-color: rgba(34, 197, 94, 0.5);
}

.calendar-pill.status-due {
  border-color: rgba(245, 158, 11, 0.5);
}

.calendar-pill.status-planned {
  border-color: rgba(20, 184, 166, 0.45);
}

.forecast-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.market-chart-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  min-height: 280px;
  position: relative;
}

.market-chart {
  width: 100%;
  height: 280px;
}

.market-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
}

.market-area {
  fill: rgba(20, 184, 166, 0.18);
}

.market-shell {
  display: grid;
  gap: 0.85rem;
  overflow: visible;
}

.market-form {
  align-items: end;
  overflow: visible;
}

.market-form > .button,
.market-load-button {
  align-self: end;
  justify-self: start;
}

.market-asset-picker {
  position: relative;
}

.market-asset-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  cursor: pointer;
}

.market-asset-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow: auto;
  padding: 0.35rem;
  display: grid;
  gap: 0.24rem;
}

.market-asset-option {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.4rem 0.48rem;
  cursor: pointer;
}

.market-asset-option:hover,
.market-asset-option.active {
  border-color: var(--line);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
}

.community-reddit-form .button {
  align-self: end;
  justify-self: start;
}

.community-reddit-list {
  margin-top: 0.92rem;
}

.feedback-card {
  display: grid;
  gap: 0.58rem;
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.feedback-title-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.feedback-title {
  font-size: 0.95rem;
}

.feedback-body {
  margin: 0;
  line-height: 1.45;
}

.feedback-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.feedback-actions .icon-button {
  width: 30px;
  height: 30px;
}

.backup-actions {
  margin-bottom: 0.5rem;
}

.backup-import-form {
  align-items: end;
}

.backup-import-form .button {
  justify-self: start;
}

.vault-upload-form > .button {
  justify-self: start;
  align-self: end;
  margin-left: 0.55rem;
}

.market-stats .subcard {
  padding: 0.68rem;
}

.market-hover {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 90%, transparent);
  border-radius: 10px;
  padding: 0.42rem 0.56rem;
  min-width: 160px;
  pointer-events: none;
}

.market-hover strong {
  display: block;
}

.market-hover span {
  color: var(--muted);
  font-size: 0.75rem;
}

.market-cross {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.28);
  z-index: 2;
  pointer-events: none;
}

.value-positive {
  color: #34d399;
}

.value-negative {
  color: #fb7185;
}

.market-down .market-line {
  stroke: #fb7185;
}

.market-down .market-area {
  fill: rgba(251, 113, 133, 0.17);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.notification-wrap {
  position: relative;
}

.notifications-panel {
  width: 320px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
}

.panel-header {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.panel-body {
  max-height: 360px;
  overflow: auto;
  padding: 0.6rem;
  display: grid;
  gap: 0.5rem;
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
  position: absolute;
  top: 4px;
  right: 4px;
}

.auth-shell {
  --auth-card-offset-y: 0px;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 1.35rem 1rem 1rem;
  overflow-y: auto;
}

.auth-locale {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.auth-locale .auth-locale-home {
  margin-left: 0.2rem;
}

.auth-shell.guest-landing-shell {
  min-height: 100vh;
  place-items: stretch;
  padding: 0;
  overflow: auto;
}

.auth-shell.guest-landing-shell .auth-locale {
  display: none;
}

.landing-page {
  min-height: 100vh;
  overflow: auto;
  padding: 0.46rem clamp(0.95rem, 2.4vw, 2rem) 0;
  display: grid;
  grid-template-rows: auto auto;
  gap: clamp(0.8rem, 1.9vw, 1.2rem);
  scroll-snap-type: y proximity;
  scroll-padding-top: 0.35rem;
  background-color: #06090d;
  background:
    radial-gradient(1100px 620px at -4% -16%, rgba(16, 185, 129, 0.22), transparent 72%),
    radial-gradient(960px 560px at 106% -12%, rgba(34, 197, 94, 0.13), transparent 76%),
    radial-gradient(880px 460px at 52% 118%, rgba(20, 184, 166, 0.14), transparent 78%),
    linear-gradient(132deg, #0a1118 0%, #0b161f 42%, #0f2221 100%);
  background-attachment: fixed;
}

.theme-light .landing-page {
  background-color: #e5ebf2;
  background:
    radial-gradient(1040px 560px at -8% -12%, rgba(16, 185, 129, 0.24), transparent 74%),
    radial-gradient(820px 420px at 104% -8%, rgba(245, 158, 11, 0.19), transparent 76%),
    radial-gradient(900px 440px at 56% 112%, rgba(20, 184, 166, 0.16), transparent 79%),
    linear-gradient(145deg, #edf2f7 0%, #dce5ef 44%, #e8eef6 100%);
  background-attachment: fixed;
}

.landing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.72rem;
  padding: 0.68rem 0.76rem;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 14px;
  background: linear-gradient(180deg, #101a24 0%, #0d151d 100%);
  box-shadow: 0 12px 30px color-mix(in srgb, #000 12%, transparent);
  position: relative;
  top: 0;
  z-index: 2;
  backdrop-filter: none;
}

.landing-brand img {
  width: min(214px, 36vw);
  height: auto;
  display: block;
}

.landing-top-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.42rem;
}

.landing-topbar .chip {
  border-color: rgba(170, 187, 204, 0.34);
  background: rgba(10, 17, 24, 0.74);
  color: #c6d2de;
}

.landing-topbar .chip:hover {
  border-color: rgba(214, 232, 248, 0.42);
  background: rgba(16, 26, 36, 0.9);
  color: #eef5fb;
}

.landing-topbar .chip.active {
  border-color: rgba(20, 184, 166, 0.58);
  background: rgba(20, 184, 166, 0.2);
  color: #d8fffb;
}

.landing-topbar .icon-button,
.landing-topbar .button.button-soft,
.landing-topbar .landing-help-link {
  border-color: rgba(170, 187, 204, 0.34);
  background: rgba(10, 17, 24, 0.74);
  color: #d9e3ed;
}

.landing-topbar .icon-button:hover,
.landing-topbar .button.button-soft:hover,
.landing-topbar .landing-help-link:hover {
  border-color: rgba(214, 232, 248, 0.42);
  background: rgba(16, 26, 36, 0.92);
  color: #f4f9fd;
  filter: none;
}

.landing-topbar .button.button-compact:not(.button-soft) {
  border-color: rgba(20, 184, 166, 0.62);
  background: rgba(20, 184, 166, 0.22);
  color: #defef9;
}

.landing-topbar .button.button-compact:not(.button-soft):hover {
  border-color: rgba(20, 184, 166, 0.78);
  background: rgba(20, 184, 166, 0.3);
  color: #f0fffc;
  filter: none;
}

.landing-locale {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.landing-locale .chip {
  position: static;
}

.lp-main {
  width: min(1320px, 100%);
  margin: 0 auto;
  min-height: 0;
  display: grid;
  gap: 0;
  padding-bottom: 0;
  align-content: start;
}

.lp-stage {
  min-height: auto;
  display: grid;
  scroll-snap-align: start;
}

.lp-stage-hero {
  min-height: calc(100vh - 92px);
  min-height: calc(100svh - 92px);
  align-items: center;
}

.lp-stage-overview {
  min-height: calc(100vh - 92px);
  min-height: calc(100svh - 92px);
  align-content: start;
  gap: clamp(0.75rem, 1.45vw, 1.05rem);
  padding-top: 0;
  padding-bottom: 1.44rem;
}

.lp-stage-overview > .lp-key-section {
  margin-top: -0.55rem;
}

.lp-stage-overview > .lp-showcase {
  margin-top: -0.38rem;
}

.lp-legal {
  margin: 0;
  opacity: 0.82;
}

.lp-hero {
  width: min(1180px, 100%);
  padding-top: 0;
  min-height: auto;
  display: grid;
  align-content: center;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(0.9rem, 2vw, 1.35rem);
}

.lp-hero-copy {
  display: grid;
  align-content: start;
  padding: clamp(0.35rem, 1.2vw, 0.95rem);
}

.lp-section-kicker {
  margin: 0 0 0.5rem;
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.lp-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3.7rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  max-width: 15ch;
}

.lp-hero-text {
  margin: 0.85rem 0 0;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  max-width: 58ch;
  line-height: 1.55;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

.lp-hero-ambient {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 6%, transparent);
  min-height: clamp(250px, 34vh, 350px);
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 50%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 48%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
}

.lp-ambient-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.lp-ambient-glow-a {
  width: 180px;
  height: 180px;
  top: -70px;
  right: -28px;
  background: color-mix(in srgb, var(--accent) 36%, transparent);
}

.lp-ambient-glow-b {
  width: 220px;
  height: 220px;
  bottom: -120px;
  left: -74px;
  background: color-mix(in srgb, var(--accent-warm) 22%, transparent);
}

.lp-ambient-cards {
  position: absolute;
  top: 0.72rem;
  left: 0.8rem;
  right: 0.8rem;
  display: flex;
  gap: 0.3rem;
  z-index: 3;
}

.lp-ambient-card {
  display: block;
  height: 13px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
}

.lp-market-svg {
  position: absolute;
  inset: 0.85rem 0.85rem 2.65rem 0.85rem;
  width: calc(100% - 1.7rem);
  height: calc(100% - 3.5rem);
  z-index: 1;
}

.lp-market-area {
  fill: color-mix(in srgb, var(--accent) 14%, transparent);
}

.lp-market-line {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 96%, #fff);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 28%, transparent));
}

.lp-market-arrow {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 98%, #fff);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lp-market-point {
  fill: color-mix(in srgb, var(--accent) 96%, #fff);
  stroke: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  stroke-width: 2;
}

.lp-ambient-goals {
  position: absolute;
  left: 0.92rem;
  right: 38%;
  top: 3.2rem;
  display: grid;
  gap: 0.34rem;
  z-index: 2;
}

.lp-ambient-goal-track {
  display: block;
  height: 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  overflow: hidden;
}

.lp-ambient-goal-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 76%, var(--text)), color-mix(in srgb, var(--accent) 95%, white));
}

.lp-ambient-tags {
  position: absolute;
  right: 0.96rem;
  top: 1.98rem;
  display: inline-flex;
  flex-wrap: wrap;
  width: 112px;
  gap: 0.3rem;
  justify-content: flex-end;
  z-index: 3;
}

.lp-ambient-tag {
  width: 22px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
}

.lp-ambient-tag.tag-a { background: rgba(45, 212, 191, 0.34); border-color: rgba(45, 212, 191, 0.5); }
.lp-ambient-tag.tag-b { background: rgba(217, 70, 239, 0.3); border-color: rgba(217, 70, 239, 0.48); }
.lp-ambient-tag.tag-c { background: rgba(249, 115, 22, 0.3); border-color: rgba(249, 115, 22, 0.46); }
.lp-ambient-tag.tag-d { background: rgba(6, 182, 212, 0.3); border-color: rgba(6, 182, 212, 0.46); }

.lp-market-bars {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.8rem;
  height: 62px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: end;
  gap: 0.34rem;
  z-index: 2;
}

.lp-market-bars span {
  border-radius: 6px 6px 2px 2px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 68%, var(--text)), color-mix(in srgb, var(--accent) 24%, transparent));
}

.lp-key-section {
  display: grid;
  place-items: center;
}

.lp-key-content {
  width: min(980px, 100%);
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-elev) 90%, transparent);
  box-shadow: 0 18px 38px color-mix(in srgb, #000 14%, transparent);
  padding: clamp(1rem, 2.4vw, 1.5rem);
  display: grid;
  gap: 0.8rem;
  text-align: center;
}

.lp-key-content h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}

.lp-key-content > .muted {
  margin: 0;
  max-width: 66ch;
  justify-self: center;
}

.lp-key-grid {
  margin-top: 0.18rem;
  display: grid;
  gap: 0.56rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lp-key-item {
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-soft) 76%, transparent);
  padding: 0.62rem 0.68rem;
  display: flex;
  align-items: flex-start;
  gap: 0.56rem;
  text-align: left;
}

.lp-key-icon,
.landing-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, var(--accent));
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
  color: color-mix(in srgb, var(--text) 86%, var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lp-key-item strong,
.lp-key-item p {
  margin: 0;
}

.lp-showcase {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(0.9rem, 2.1vw, 1.25rem);
  align-items: start;
}

.lp-copy-stack {
  display: grid;
  align-content: start;
  gap: 0.02rem;
}

.lp-preview-stack {
  display: grid;
  align-content: start;
  gap: 0.02rem;
}

.lp-copy-stack .lp-legal {
  margin-top: 3rem;
}

.lp-showcase-copy {
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-elev) 90%, transparent);
  box-shadow: 0 16px 36px color-mix(in srgb, #000 13%, transparent);
  padding: clamp(0.95rem, 2vw, 1.35rem);
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.theme-light .lp-showcase-copy,
.theme-light .lp-moneta-view,
.theme-light .lp-hero-ambient {
  background: color-mix(in srgb, #f4f7fb 92%, transparent);
}

.lp-showcase-copy h2,
.lp-showcase-copy p,
.lp-showcase-list {
  margin: 0;
}

.lp-showcase-list {
  padding-left: 1.1rem;
  display: grid;
  gap: 0.3rem;
  color: color-mix(in srgb, var(--text) 89%, var(--muted));
}

.lp-moneta-view {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  box-shadow: 0 16px 36px color-mix(in srgb, #000 13%, transparent);
  padding: 0.88rem;
  display: grid;
  gap: 0.56rem;
}

.lp-moneta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.landing-preview-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-preview-title strong {
  font-size: 1.05rem;
}

.landing-preview-signal {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 22%, transparent);
  animation: landingPulse 2.1s ease-in-out infinite;
}

@keyframes landingPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 22%, transparent);
  }
  60% {
    transform: scale(1.08);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 0%, transparent);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
  }
}

.lp-official-view {
  min-height: 0;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-soft) 74%, transparent);
  padding: 0.58rem;
  display: grid;
  gap: 0.5rem;
  overflow: hidden;
}

.lp-official-budget {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.46rem;
}

.lp-official-budget .subcard,
.lp-official-goals,
.lp-official-due,
.lp-official-charts .subcard {
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  padding: 0.48rem;
  display: grid;
  gap: 0.34rem;
  min-height: 0;
}

.lp-official-budget .subcard p,
.lp-official-budget .subcard strong,
.lp-official-goals p,
.lp-official-goals strong,
.lp-official-due p,
.lp-official-due strong,
.lp-official-charts .subcard p,
.lp-official-charts .subcard strong {
  margin: 0;
}

.lp-official-mid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.46rem;
}

.lp-official-goals {
  display: grid;
  gap: 0.28rem;
}

.lp-official-goal-item {
  display: grid;
  gap: 0.2rem;
}

.lp-official-goal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.lp-official-goal-head strong {
  font-size: 0.84rem;
}

.lp-official-goal-head .tag-chip {
  font-size: 0.64rem;
  padding: 0.08rem 0.36rem;
}

.lp-official-due {
  display: grid;
  gap: 0.3rem;
}

.lp-official-due-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.3rem;
}

.lp-official-due-item .tag-chip {
  font-size: 0.64rem;
  padding: 0.08rem 0.36rem;
}

.lp-official-due-item .badge {
  font-size: 0.64rem;
  padding: 0.08rem 0.4rem;
}

.landing-preview-progress {
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
  overflow: hidden;
}

.landing-preview-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 72%, var(--text)), color-mix(in srgb, var(--accent) 92%, white));
}

.lp-official-charts {
  display: grid;
  grid-template-columns: 1fr;
}

.lp-moneta-note {
  margin: 0;
}

.landing-help-link {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.landing-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.landing-theme-toggle {
  border-color: rgba(170, 187, 204, 0.34);
  background: rgba(10, 17, 24, 0.74);
  color: #d9e3ed;
}

.landing-theme-toggle:hover {
  border-color: rgba(214, 232, 248, 0.42);
  background: rgba(16, 26, 36, 0.92);
  color: #f4f9fd;
}

.app-modal-landing .app-modal-dialog {
  width: min(1040px, calc(100vw - 1.4rem));
  max-height: min(91vh, 940px);
}

.landing-preview-dialog {
  display: grid;
  gap: 0.72rem;
}

.landing-preview-scope {
  margin: -0.22rem 0 0;
}

.landing-dashboard-preview {
  display: grid;
  gap: 0.68rem;
}

.landing-preview-chart-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.landing-popup-bar-chart {
  gap: 0.34rem;
}

.landing-popup-bar-chart .bar-row {
  grid-template-columns: 58px 1fr auto;
  gap: 0.42rem;
  font-size: 0.75rem;
}

.landing-popup-bar-chart .bar-track {
  height: 9px;
}

.landing-popup-bar-chart strong {
  font-size: 0.76rem;
  white-space: nowrap;
}

.lp-official-view-expanded .lp-official-budget {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.help-page {
  min-height: 100vh;
  padding: 0.92rem clamp(0.9rem, 2.6vw, 2rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.82rem;
  background:
    radial-gradient(900px 460px at 10% -8%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(760px 380px at 94% 6%, color-mix(in srgb, var(--accent-warm) 20%, transparent), transparent 73%);
}

.help-topbar {
  margin-bottom: 0.2rem;
}

.help-card-wrap {
  display: grid;
  place-items: center;
}

.help-card {
  width: min(740px, 100%);
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  display: grid;
  gap: 0.72rem;
}

.help-card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.help-card-head .landing-feature-icon {
  margin-top: 0;
}

.help-card-head h1 {
  margin: 0;
}

.help-subtitle {
  margin: -0.2rem 0 0;
}

.help-form textarea.input {
  min-height: 170px;
}

.help-form-actions {
  justify-content: flex-end;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.62rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg-elev);
}

.chip.active {
  border-color: var(--accent);
  color: var(--text);
}

.auth-card {
  --auth-logo-balance-gap: 1.82rem;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-elev);
  padding: var(--auth-logo-balance-gap) 1rem 1rem;
  box-shadow: var(--shadow);
  transform: translateY(var(--auth-card-offset-y));
}

.auth-brand {
  display: grid;
  gap: 0;
  justify-items: start;
  margin-bottom: 0.58rem;
}

.auth-brand.auth-brand-centered {
  justify-items: center;
  text-align: center;
}

.auth-wordmark {
  width: min(220px, 72%);
  height: auto;
  display: block;
  margin: 0 auto;
}

.auth-brand h1 {
  margin: var(--auth-logo-balance-gap) 0 0;
}

.auth-brand p {
  margin: 0.2rem 0 0;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.auth-links a {
  color: var(--muted);
}

.auth-links a:hover {
  color: var(--text);
}

.tour-modal {
  position: fixed;
  inset: 0;
  background: transparent;
  display: block;
  z-index: 1200;
}

.tour-modal::before {
  content: "";
  position: fixed;
  left: var(--tour-spot-x, 50%);
  top: var(--tour-spot-y, 50%);
  width: var(--tour-spot-w, 0px);
  height: var(--tour-spot-h, 0px);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(2, 5, 8, 0.66);
  pointer-events: none;
}

.tour-card {
  width: min(620px, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
  padding: 1rem;
  position: fixed;
  z-index: 1302;
}

.tour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.tour-kicker {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
}

.tour-card h3 {
  margin: 0.3rem 0 0.6rem;
}

.tour-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
}

body.tour-open .app-shell,
body.tour-open .notes-drawer,
body.tour-open .calendar-modal,
body.tour-open .app-modal {
  pointer-events: none;
}

body.tour-open .tour-modal {
  pointer-events: auto;
}

body.tour-open .guide-focus {
  transition: box-shadow 0.16s ease, outline-color 0.16s ease;
  filter: saturate(1.04) brightness(1.05);
  pointer-events: none;
}

body.calendar-open {
  overflow: hidden;
}

.guide-focus {
  position: relative;
  z-index: 1202;
  outline: 2px solid rgba(20, 184, 166, 0.95);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.28), 0 0 36px rgba(20, 184, 166, 0.35);
}

.theme-dark .tag-chip,
.theme-dark .badge,
.theme-dark .due-status {
  color: #f4f8ff;
}

.notes-drawer {
  position: fixed;
  left: calc(260px + 0.8rem);
  right: auto;
  bottom: 1rem;
  width: min(320px, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  z-index: 70;
  padding: 0.85rem;
}

body.sidebar-collapsed .notes-drawer {
  left: calc(78px + 0.8rem);
}

.notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.notes-textarea {
  min-height: 265px;
  line-height: 1.45;
}

[data-quick-notes-root] {
  display: grid;
  gap: 0.55rem;
}

.calendar-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 8, 0.58);
  display: grid;
  place-items: center;
  z-index: 1100;
  padding: 1rem;
}

.calendar-dialog {
  width: min(1060px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.color-swatch {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.color-swatch > span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--swatch);
}

.color-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.world-map {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.world-map svg {
  width: 100%;
  height: 160px;
  display: block;
}

.qr-code {
  width: min(220px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.tag-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #111111;
  font-weight: 700;
}

.tag-chip.tag-all {
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
  border-color: var(--line);
}

.tag-rose { background: rgba(217, 70, 239, 0.13); border-color: rgba(217, 70, 239, 0.4); }
.tag-rouge { background: rgba(220, 38, 38, 0.13); border-color: rgba(220, 38, 38, 0.4); }
.tag-orange { background: rgba(249, 115, 22, 0.13); border-color: rgba(249, 115, 22, 0.4); }
.tag-ambre { background: rgba(245, 158, 11, 0.13); border-color: rgba(245, 158, 11, 0.4); }
.tag-jaune { background: rgba(234, 179, 8, 0.13); border-color: rgba(234, 179, 8, 0.4); }
.tag-vert { background: rgba(22, 163, 74, 0.13); border-color: rgba(22, 163, 74, 0.4); }
.tag-menthe { background: rgba(45, 212, 191, 0.13); border-color: rgba(45, 212, 191, 0.4); }
.tag-cyan { background: rgba(6, 182, 212, 0.13); border-color: rgba(6, 182, 212, 0.4); }
.tag-bleu { background: rgba(37, 99, 235, 0.13); border-color: rgba(37, 99, 235, 0.4); }
.tag-indigo { background: rgba(79, 70, 229, 0.13); border-color: rgba(79, 70, 229, 0.4); }
.tag-violet { background: rgba(139, 92, 246, 0.13); border-color: rgba(139, 92, 246, 0.4); }
.tag-brun { background: rgba(124, 74, 33, 0.13); border-color: rgba(124, 74, 33, 0.4); }

.danger {
  border-color: rgba(239, 68, 68, 0.38);
}

.mobile-only {
  display: none;
}

@media (max-width: 980px) {
  .landing-page {
    min-height: 100vh;
    overflow: auto;
    padding-bottom: 0;
  }

  .lp-main {
    gap: 0;
  }

  .lp-showcase {
    grid-template-columns: 1fr;
  }

  .lp-stage {
    min-height: auto;
  }

  .lp-stage-hero {
    min-height: calc(100vh - 90px);
    min-height: calc(100svh - 90px);
  }

  .lp-stage-overview {
    min-height: calc(100vh - 90px);
    min-height: calc(100svh - 90px);
    align-content: start;
    padding-top: 0;
    padding-bottom: 0.42rem;
  }

  .lp-stage-overview > .lp-key-section {
    margin-top: -0.46rem;
  }

  .lp-stage-overview > .lp-showcase {
    margin-top: -0.3rem;
  }

  .lp-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    align-content: center;
  }

  .lp-ambient-goals {
    right: 45%;
  }

  .lp-ambient-tags {
    width: 92px;
  }

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

  .lp-official-mid {
    grid-template-columns: 1fr;
  }

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

  .help-card {
    width: min(680px, 100%);
  }
}

@media (max-width: 1180px) {
  .kpi-grid,
  .four-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-cols,
  .three-cols {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-edge-toggle {
    display: none;
  }

  .app-sidebar {
    position: fixed;
    left: -280px;
    width: 260px;
    transition: left 0.2s ease;
    z-index: 50;
  }

  .app-shell.sidebar-collapsed .app-sidebar {
    width: 260px;
    padding: 1rem;
  }

  .app-shell.sidebar-collapsed .brand-wordmark {
    display: block;
  }

  .app-shell.sidebar-collapsed .brand-logo-collapsed {
    display: block;
    transform: translateY(-100px);
  }

  .app-shell.sidebar-collapsed .side-link {
    justify-content: flex-start;
    gap: 0.65rem;
  }

  .app-shell.sidebar-collapsed .side-link span {
    display: inline;
  }

  .app-shell.sidebar-collapsed .side-footer .ghost-button {
    justify-content: flex-start;
    padding: 0.6rem 0.75rem;
  }

  .app-shell.sidebar-collapsed .side-footer .ghost-button span {
    display: inline;
  }

  .app-shell.nav-open .app-sidebar {
    left: 0;
  }

  .mobile-only {
    display: inline-flex;
  }

  .notes-drawer {
    left: 0.7rem;
    bottom: 0.7rem;
  }

  .topbar-page-tools {
    flex-basis: 100%;
    order: 3;
  }
}

@media (max-width: 720px) {
  .auth-shell {
    --auth-card-offset-y: 0px;
    padding-top: 1rem;
  }

  .landing-page {
    padding: 0.42rem 0.78rem 0;
    gap: 0.72rem;
  }

  .lp-main {
    gap: 0;
  }

  .landing-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-top-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .lp-stage {
    min-height: auto;
  }

  .lp-stage-hero {
    min-height: calc(100vh - 84px);
    min-height: calc(100svh - 84px);
  }

  .lp-stage-overview {
    min-height: calc(100vh - 84px);
    min-height: calc(100svh - 84px);
    align-content: start;
    padding-top: 0;
    padding-bottom: 0.38rem;
  }

  .lp-stage-overview > .lp-key-section {
    margin-top: -0.36rem;
  }

  .lp-stage-overview > .lp-showcase {
    margin-top: -0.24rem;
  }

  .lp-hero h1 {
    font-size: clamp(1.74rem, 8.1vw, 2.08rem);
  }

  .lp-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    align-content: center;
    padding-top: 0;
  }

  .lp-ambient-goals {
    top: 3.55rem;
    right: 42%;
  }

  .lp-market-svg {
    inset: 1rem 0.8rem 2.6rem 0.8rem;
    width: calc(100% - 1.6rem);
    height: calc(100% - 3.6rem);
  }

  .lp-key-content {
    text-align: left;
  }

  .lp-key-content > .muted {
    justify-self: start;
  }

  .lp-key-grid,
  .lp-showcase,
  .landing-preview-chart-grid {
    grid-template-columns: 1fr;
  }

  .lp-showcase-copy,
  .lp-moneta-view,
  .help-card {
    padding: 0.78rem;
  }

  .lp-official-budget {
    grid-template-columns: 1fr;
  }

  .lp-official-due-item {
    grid-template-columns: 1fr;
    justify-items: start;
  }

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

  .content,
  .topbar {
    padding: 0.72rem;
  }

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

  .calendar-head {
    display: none;
  }

  .bar-row {
    grid-template-columns: 54px 1fr;
  }

  .bar-row strong {
    display: none;
  }

  .notifications-panel {
    right: -28px;
    width: min(92vw, 340px);
  }

  .due-row-line {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .due-period-switch {
    width: 100%;
    margin-left: 0;
  }

  .due-actions {
    justify-content: flex-start;
  }

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

  .app-modal-dialog.app-modal-large.app-modal-tall {
    height: auto;
    max-height: 92vh;
  }

  .app-modal-dialog.app-modal-large.app-modal-bill {
    height: auto;
    max-height: 95vh;
  }

  .app-modal-dialog.app-modal-accounts {
    max-height: calc(100vh - 1rem);
  }
}
