@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

:root {
  --bg: #f2eee9;
  --surface: #ffffff;
  --surface-2: #faf7f2;
  --ink: #101010;
  --muted: #746b64;
  --line: #ded4ca;
  --line-strong: #c9b9aa;
  --rail: #070707;
  --rail-2: #1a100d;
  --cyan: #e11d48;
  --blue: #be123c;
  --green: #15803d;
  --red: #dc2626;
  --gold: #f59e0b;
  --violet: #991b1b;
  --shadow: 0 22px 60px rgba(16, 16, 16, 0.14);
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
}

html {
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(120deg, rgba(225, 29, 72, 0.12), transparent 38%),
    linear-gradient(320deg, rgba(220, 38, 38, 0.1), transparent 42%),
    var(--bg);
  color: var(--ink);
}

body:not(.authenticated) .app-shell,
body.auth-loading .app-shell {
  display: none;
}

body.authenticated .auth-screen {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(130deg, rgba(5, 5, 5, 0.94), rgba(136, 19, 55, 0.82)),
    radial-gradient(circle at 72% 22%, rgba(225, 29, 72, 0.38), transparent 34%),
    var(--rail);
}

.auth-card {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.auth-mark {
  margin-bottom: 18px;
}

.auth-card h1 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 0.9;
}

.auth-copy {
  margin: 12px 0 24px;
  color: var(--muted);
  font-weight: 650;
}

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

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

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.auth-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(136, 19, 55, 0.16);
  border-radius: 10px;
  background: rgba(255, 245, 248, 0.78);
}

.auth-check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--cyan);
}

.auth-check span {
  display: grid;
  gap: 3px;
}

.auth-check strong {
  color: var(--ink);
  font-weight: 900;
}

.auth-check small,
.auth-note {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.passkey-button {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid rgba(136, 19, 55, 0.22);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.auth-link-button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.passkey-button:hover {
  border-color: rgba(225, 29, 72, 0.5);
  box-shadow: 0 12px 24px rgba(136, 19, 55, 0.12);
}

.auth-note {
  margin: 14px 0 0;
}

.auth-error {
  min-height: 1.4em;
  margin: 16px 0 0;
  color: var(--red);
  font-weight: 800;
}

.user-pill {
  min-width: 0;
  color: var(--muted);
  font-weight: 800;
}

.subtle-action {
  padding-inline: 18px;
}

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

button {
  cursor: pointer;
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 16px;
  background:
    linear-gradient(180deg, rgba(225, 29, 72, 0.18), transparent 34%),
    linear-gradient(140deg, rgba(220, 38, 38, 0.12), transparent 46%),
    var(--rail);
  color: #eef5f7;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  font-weight: 900;
}

.brand-block strong,
.sidebar-footer strong {
  display: block;
}

.brand-block span,
.sidebar-footer span {
  display: block;
  margin-top: 3px;
  color: #9aa7b8;
  font-size: 0.84rem;
}

.app-tabs {
  display: grid;
  gap: 7px;
}

.app-tab-divider {
  display: block;
  height: 1px;
  margin: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
}

.app-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 12px;
  background: transparent;
  color: #b9c4d2;
  text-align: left;
  font-weight: 760;
}

.app-tab-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 7px;
  background: rgba(var(--tab-rgb, 255, 255, 255), 0.14);
  color: rgb(var(--tab-rgb, 255, 237, 213));
}

.app-tab[data-app="dashboard"] {
  --tab-rgb: 56, 189, 248;
}

.app-tab[data-app="budget"] {
  --tab-rgb: 251, 191, 36;
}

.app-tab[data-app="expenses"] {
  --tab-rgb: 244, 63, 94;
}

.app-tab[data-app="opportunity"] {
  --tab-rgb: 168, 85, 247;
}

.app-tab[data-app="networth"] {
  --tab-rgb: 34, 197, 94;
}

.app-tab[data-app="freedom"] {
  --tab-rgb: 45, 212, 191;
}

.app-tab[data-app="advisor"] {
  --tab-rgb: 236, 72, 153;
}

.app-tab[data-app="invoices"] {
  --tab-rgb: 249, 115, 22;
}

.app-tab[data-app="intake"] {
  --tab-rgb: 129, 140, 248;
}

.app-tab-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tab.active,
.app-tab:hover {
  background: var(--rail-2);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.app-tab.active .app-tab-icon {
  background: rgb(var(--tab-rgb, 225, 29, 72));
  color: #fff;
  box-shadow: 0 0 0 4px rgba(var(--tab-rgb, 225, 29, 72), 0.18);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-action {
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  padding: 10px 11px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 850;
}

.sidebar-action.subtle {
  background: rgba(255, 255, 255, 0.06);
  color: #dbe5f0;
}

.save-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.05);
  color: #dbe5f0;
  font-size: 0.78rem;
  font-weight: 850;
}

.save-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.55);
}

.save-status.saving .save-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.65);
  animation: savePulse 900ms ease-in-out infinite;
}

.save-status.offline .save-status-dot {
  background: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.55);
}

.save-status.error .save-status-dot {
  background: var(--red);
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.6);
}

@keyframes savePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.35);
    opacity: 1;
  }
}

.main-stage {
  min-width: 0;
  padding: 24px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar .eyebrow {
  display: none;
}

.demo-workspace-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 18px;
  padding: 10px 14px;
  border: 1px solid rgba(225, 29, 72, 0.22);
  border-radius: 14px;
  background: rgba(255, 241, 244, 0.9);
  color: #7f1d35;
  font-size: 0.82rem;
}

.demo-workspace-notice[hidden] {
  display: none;
}

.demo-workspace-notice strong {
  flex: 0 0 auto;
}

.section-header .eyebrow {
  display: none;
}

.top-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.year-picker {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.year-picker select {
  min-width: 112px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1,
h2,
h3,
.brand-block strong,
.brand-mark,
.confidence-hero h2,
.hero-number,
.probability-meter strong {
  font-family: "Syne", "Arial Black", "Space Grotesk", sans-serif;
  letter-spacing: 0;
}

.metric-card strong {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.5vw, 2.25rem);
}

h3 {
  margin-bottom: 0;
  font-size: 1.02rem;
}

.ghost-button,
.secondary-button,
.primary-button {
  min-height: 40px;
  border-radius: 9px;
  padding: 0 14px;
  font-weight: 820;
}

.ghost-button,
.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.secondary-button {
  cursor: pointer;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, #101010, #991b1b 58%, #e11d48);
  color: #fff;
}

.app-view,
.sheet {
  display: none;
}

.app-view.active,
.sheet.active {
  display: block;
}

.sub-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
}

.month-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: -4px 0 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.history-month-tabs {
  margin: 0 0 16px;
}

.month-tab {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.month-tab:hover {
  background: #fff1f2;
  color: var(--ink);
}

.month-tab.active {
  background: linear-gradient(135deg, #101010, #991b1b 58%, #e11d48);
  color: #fff;
}

.month-select-fallback {
  min-width: 170px;
}

.sheet-tab {
  flex: 0 0 auto;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 820;
}

.sheet-tab.active {
  background: linear-gradient(135deg, #101010, #7f1d1d);
  color: #fff;
}

.confidence-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 270px);
  gap: 26px;
  align-items: center;
  min-height: 210px;
  margin-bottom: 16px;
  padding: 26px;
  border-radius: 14px;
  background:
    linear-gradient(115deg, rgba(8, 8, 8, 0.97), rgba(127, 29, 29, 0.9) 58%, rgba(225, 29, 72, 0.86)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 56px);
  color: #fff;
  box-shadow: var(--shadow);
}

.confidence-hero > div:first-child {
  min-width: 0;
}

.confidence-hero .eyebrow,
.confidence-hero p {
  color: rgba(255, 255, 255, 0.74);
}

.confidence-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(2.2rem, 4.4vw, 3.75rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.hero-number {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
}

.hero-number > span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  font-weight: 850;
}

.hero-number > strong {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1;
}

.hero-number > small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  font-weight: 750;
  text-align: right;
}

.hero-forecast-probability {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-forecast-probability span {
  max-width: 150px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.hero-forecast-probability strong {
  flex: 0 0 auto;
  font-size: 1.2rem;
  line-height: 1;
}

@media (max-width: 900px) {
  .confidence-hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .hero-number {
    width: 100%;
    box-sizing: border-box;
    justify-items: start;
  }

  .hero-number > small {
    text-align: left;
  }
}

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

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

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 14px 34px rgba(16, 16, 16, 0.08);
}

.metric-card {
  min-height: 116px;
  padding: 16px;
  border-top: 4px solid var(--blue);
}

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

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

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

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

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 850;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(1.45rem, 2.6vw, 2.15rem);
  line-height: 1;
}

.dashboard-groups {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-group {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 247, 0.88)),
    repeating-linear-gradient(90deg, rgba(225, 29, 72, 0.05) 0 1px, transparent 1px 34px);
  box-shadow: 0 14px 34px rgba(16, 16, 16, 0.08);
}

.dashboard-group::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #e11d48, #991b1b, #ff5a1f);
}

.dashboard-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-group-head span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #180809;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
}

.dashboard-group-head h3 {
  font-size: 1.1rem;
}

.dashboard-rows {
  display: grid;
  gap: 0;
}

.dashboard-rows div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-rows div:last-child {
  border-bottom: 0;
}

.dashboard-rows span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.dashboard-rows strong {
  color: var(--ink);
  font-size: clamp(1.12rem, 2vw, 1.55rem);
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.dashboard-rows strong.bad {
  color: var(--red);
}

.dashboard-rows strong.good {
  color: var(--green);
}

.budget-group .dashboard-rows {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
}

.budget-group .dashboard-rows div:nth-child(3) {
  grid-column: 1 / -1;
}

.budget-group {
  grid-column: 1 / -1;
  min-height: 0;
}

.dashboard-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.72fr);
  gap: 14px;
  align-items: stretch;
}

.income-confidence-panel,
.balance-sheet-panel {
  height: 100%;
}

.operating-funds-dashboard-panel {
  grid-column: 1 / -1;
}

.confidence-interaction {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  border-radius: 9px;
  background: #fff7f7;
}

.confidence-chart-wrap {
  position: relative;
}

.confidence-hover-marker {
  position: absolute;
  z-index: 2;
  width: 0;
  pointer-events: none;
}

.confidence-hover-line {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, rgba(225, 29, 72, 0.46) 0 7px, transparent 7px 13px);
}

.confidence-hover-dot {
  position: absolute;
  left: 0;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(16, 16, 16, 0.25);
}

.confidence-hover-dot.booked {
  background: #e11d48;
}

.confidence-hover-dot.expected {
  background: #111827;
}

.confidence-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.confidence-line-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.confidence-line-legend i {
  display: inline-block;
  width: 34px;
  height: 0;
  border-top: 3px solid #e11d48;
}

.confidence-line-legend .expected-line {
  border-color: #111827;
  border-top-style: dashed;
}

.confidence-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  font-size: 0.84rem;
}

.confidence-readout span:first-child {
  color: var(--muted);
  font-weight: 700;
}

.confidence-readout strong {
  color: var(--ink);
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.94rem;
}

.confidence-readout span:last-child {
  color: #991b1b;
  font-weight: 700;
}

.overview-grid,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.58fr);
  gap: 14px;
  align-items: start;
}

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

.budget-repeat-toolbar,
.budget-repeat-actions,
.budget-template-item-actions,
.budget-copied-entry {
  align-items: center;
  display: flex;
  gap: 10px;
}

.budget-repeat-toolbar {
  grid-column: 1 / -1;
  justify-content: flex-end;
  min-height: 40px;
}

.budget-repeat-toolbar > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  margin-right: auto;
}

.budget-repeat-actions button {
  min-width: 126px;
}

.budget-template-modal {
  width: min(680px, 100%);
}

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

.budget-template-save-form label,
.budget-template-list-item label {
  color: var(--muted);
  display: grid;
  font-size: 0.72rem;
  font-weight: 850;
  gap: 5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.budget-template-save-form input,
.budget-template-list-item input {
  min-height: 38px;
  width: 100%;
}

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

.budget-template-list-item {
  align-items: end;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 11px;
}

.budget-template-list-item > span,
.budget-copied-entry span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.budget-template-item-actions button {
  min-height: 38px;
}

.budget-copied-entry {
  border-top: 1px solid var(--line);
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
}

.budget-copied-entry > div {
  display: grid;
  gap: 3px;
}

.budget-copied-entry button:disabled,
.budget-template-save-form button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.budget-repeat-status {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  margin: 12px 0 0;
}

.ledger-copy-button {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.ledger-columns .panel {
  padding: 12px;
}

.ledger-columns .panel-heading {
  margin-bottom: 8px;
}

.ledger-columns .data-table {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.ledger-columns table {
  min-width: 760px;
  table-layout: fixed;
  font-size: 0.82rem;
}

.ledger-columns th,
.ledger-columns td {
  padding: 9px 7px;
  vertical-align: middle;
}

.ledger-columns th {
  font-size: 0.7rem;
  letter-spacing: 0;
}

.ledger-columns th:nth-child(1),
.ledger-columns td:nth-child(1) {
  width: 46px;
}

.ledger-columns th:nth-child(2),
.ledger-columns td:nth-child(2) {
  width: 27%;
}

.ledger-columns th:nth-child(3),
.ledger-columns td:nth-child(3) {
  width: 108px;
}

.ledger-columns th:nth-child(4),
.ledger-columns td:nth-child(4) {
  width: 122px;
}

.ledger-columns th:nth-child(5),
.ledger-columns td:nth-child(5) {
  width: 122px;
}

.ledger-columns th:nth-child(6),
.ledger-columns td:nth-child(6) {
  width: 128px;
}

.ledger-columns th:nth-child(7),
.ledger-columns td:nth-child(7) {
  width: 104px;
}

.ledger-row-actions {
  align-items: center;
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.ledger-copy-button {
  font-size: 0.72rem;
  min-height: 28px;
  padding: 0 8px;
}

.ledger-columns th:nth-child(3),
.ledger-columns td:nth-child(3) {
  text-align: right;
}

.ledger-paid-cell {
  text-align: center;
}

.paid-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.paid-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.paid-toggle span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(225, 29, 72, 0.36);
  border-radius: 6px;
  background: #fff7f7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.paid-toggle span::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  opacity: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

.paid-toggle input:checked + span {
  border-color: rgba(22, 163, 74, 0.72);
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.paid-toggle input:checked + span::after {
  opacity: 1;
}

.ledger-notes {
  min-width: 180px;
}

.ledger-category {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ledger-columns input,
.ledger-columns select {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  border: 1px solid rgba(69, 26, 31, 0.16);
  border-radius: 7px;
  padding: 5px 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.ledger-columns input:focus,
.ledger-columns select:focus {
  outline: 2px solid rgba(225, 29, 72, 0.25);
  border-color: rgba(225, 29, 72, 0.5);
}

.ledger-money-input {
  text-align: right;
}

.ledger-money-input.good {
  color: #15803d;
}

.ledger-money-input.bad {
  color: #dc2626;
}

.ledger-columns .quick-add-row input {
  min-height: 30px;
  padding: 5px 7px;
  font-size: 0.78rem;
}

.ledger-columns .quick-category {
  min-width: 0;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 0.76rem;
}

.category-entry {
  display: grid;
  gap: 5px;
}

.auto-category-hint {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.25;
  text-transform: none;
  white-space: nowrap;
}

.inline-category-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 4px;
}

.inline-category-add[hidden] {
  display: none;
}

.ledger-columns .inline-category-name {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 0.76rem;
}

.inline-category-save {
  min-height: 28px;
  border: 1px solid rgba(225, 29, 72, 0.38);
  border-radius: 7px;
  background: #fff1f2;
  color: #be123c;
  font-weight: 900;
}

.category-add-button {
  min-height: 28px;
  border: 1px solid rgba(225, 29, 72, 0.38);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: #be123c;
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
}

.category-add-button:hover {
  background: #fff1f2;
}

.ledger-columns .quick-add-button {
  min-height: 30px;
  padding: 0 5px;
  font-size: 0.7rem;
}

.generated-rollup-row {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.08), rgba(255, 255, 255, 0.6));
}

.generated-rollup-row td {
  font-weight: 800;
}

.expense-tracker-panel .data-table,
.expense-category-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.charging-costs-panel {
  border-top: 4px solid #0ea5e9;
}

.charging-rule-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(14, 165, 233, 0.24);
  border-radius: 10px;
  padding: 13px 14px;
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.82), rgba(255, 255, 255, 0.94));
}

.charging-rule-strip strong {
  color: #075985;
}

.charging-rule-strip span,
.charging-rule-strip small {
  color: var(--muted);
  line-height: 1.4;
}

.charging-rule-strip small {
  grid-column: 2;
}

.charging-network-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.charging-network-pill.manual {
  background: #f1f5f9;
  color: #475569;
}

.charging-ledger-table th:nth-child(2),
.charging-ledger-table td:nth-child(2) {
  width: 132px;
}

.charging-ledger-table th:nth-child(3),
.charging-ledger-table td:nth-child(3) {
  width: 130px;
  text-align: left;
}

.charging-ledger-table th:nth-child(4),
.charging-ledger-table td:nth-child(4) {
  width: 120px;
  text-align: right;
}

.expense-ledger-table table {
  min-width: 980px;
  table-layout: fixed;
  font-size: 0.82rem;
}

.expense-ledger-table th,
.expense-ledger-table td {
  padding: 9px 7px;
  vertical-align: middle;
}

.expense-ledger-table th:nth-child(1),
.expense-ledger-table td:nth-child(1) {
  width: 48px;
}

.expense-ledger-table th:nth-child(2),
.expense-ledger-table td:nth-child(2) {
  width: 28%;
}

.expense-ledger-table th:nth-child(3),
.expense-ledger-table td:nth-child(3) {
  width: 118px;
  text-align: right;
}

.expense-ledger-table th:nth-child(4),
.expense-ledger-table td:nth-child(4),
.expense-ledger-table th:nth-child(5),
.expense-ledger-table td:nth-child(5) {
  width: 132px;
}

.expense-ledger-table th:nth-child(6),
.expense-ledger-table td:nth-child(6) {
  width: 150px;
}

.expense-ledger-table input,
.expense-ledger-table select {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(69, 26, 31, 0.16);
  border-radius: 7px;
  padding: 5px 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.expense-category-table table {
  min-width: 1040px;
  table-layout: fixed;
  font-size: 0.82rem;
}

#expenseCategoryMonthTable table {
  min-width: 1120px;
  table-layout: fixed;
}

#expenseCategoryMonthTable th:first-child,
#expenseCategoryMonthTable td:first-child {
  width: 130px;
  text-align: left;
}

#expenseCategoryMonthTable th:not(:first-child),
#expenseCategoryMonthTable td.expense-month-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

#expenseCategoryMonthTable td.expense-month-money {
  padding-inline: 8px;
}

#expenseCategoryMonthTable td.expense-category-name-cell {
  overflow-wrap: anywhere;
  line-height: 1.15;
}

#expenseCategoryMonthTable td.expense-total-money {
  font-weight: 850;
}

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

.expense-chart-frame {
  width: 100%;
  height: 220px;
  max-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.expense-chart-frame canvas {
  width: 100%;
  height: 100%;
  max-height: 220px;
  border: 0;
  border-radius: 0;
}

.expense-status-card {
  border: 1px solid rgba(69, 26, 31, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: #fff7f7;
}

.expense-status-card span,
.small-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.expense-status-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.expense-status-card small {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  font-weight: 650;
  margin-top: 4px;
}

.setup-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.7;
}

.import-result {
  border: 1px solid rgba(69, 26, 31, 0.14);
  border-radius: 8px;
  padding: 14px;
  background: #fff7f7;
  color: var(--muted);
  font-weight: 700;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(310px, 0.7fr);
}

.history-chart-panel {
  margin-bottom: 14px;
}

.history-chart-panel canvas {
  height: 150px;
}

#yearShapeChart {
  height: 180px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: var(--legend-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--legend-color) 40%, transparent);
}

.planned-bookings-panel {
  margin-top: 14px;
}

.income-category-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.income-category-mode {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 8px;
  background: #fff8f8;
}

.chart-mode-button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 850;
}

.chart-mode-button.active {
  color: #fff;
  background: linear-gradient(135deg, #3b080b, #e11d48);
  box-shadow: 0 10px 24px rgba(225, 29, 72, 0.16);
}

.income-category-compare-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.income-category-compare-controls[hidden],
#bookingYearToggles[hidden] {
  display: none !important;
}

.income-category-compare-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.income-category-compare-controls select {
  min-height: 34px;
  min-width: 112px;
  border: 1px solid rgba(17, 17, 17, 0.13);
  border-radius: 7px;
  padding: 0 28px 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.year-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.year-toggle {
  min-height: 30px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
}

.year-toggle.active {
  border-color: rgba(225, 29, 72, 0.55);
  background: linear-gradient(135deg, #3b080b, #e11d48);
  color: #fff;
  box-shadow: 0 10px 24px rgba(225, 29, 72, 0.16);
}

.booking-visibility-table {
  max-height: 380px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

#incomeCategoryStackChart {
  width: 100%;
  height: 520px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 8px;
  background: #fff;
}

.planned-bookings-panel.compare-mode #incomeCategoryStackChart {
  height: 610px;
}

.income-category-legend {
  margin-top: 10px;
  align-items: center;
  gap: 8px 14px;
}

.income-category-legend .comparison-line {
  width: 28px;
  height: 0;
  border-top: 3px dashed var(--legend-color);
  border-radius: 0;
  background: transparent;
}

.income-category-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.income-category-readout div {
  border: 1px solid rgba(225, 29, 72, 0.14);
  border-radius: 7px;
  padding: 10px;
  background: #fff8f8;
}

.income-category-readout span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.income-category-readout strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.15;
}

.income-category-readout strong.good {
  color: #15803d;
}

.income-category-readout strong.bad {
  color: #dc2626;
}

.booking-visibility-table table {
  min-width: 760px;
  table-layout: fixed;
}

.booking-visibility-table th:first-child,
.booking-visibility-table td:first-child {
  width: 130px;
  color: var(--ink);
  font-weight: 800;
}

.table-footnote {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.panel.wide,
.split-layout .wide {
  min-width: 0;
}

.panel {
  position: relative;
  min-width: 0;
  padding: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.panel-heading,
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.83rem;
  white-space: nowrap;
}

.panel-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #111, #991b1b 58%, #e11d48);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.icon-action.subtle {
  border: 1px solid var(--line);
  background: #fff1f2;
  color: #991b1b;
}

.info-button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff1f2;
  color: #9a3412;
  font-size: 0.78rem;
  font-weight: 900;
  vertical-align: middle;
}

.info-button.inverse {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.info-button.micro-info {
  width: 17px;
  height: 17px;
  margin-left: 4px;
  font-size: 0.62rem;
}

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

.formula-card {
  min-height: 132px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff7f7;
}

.formula-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.formula-card strong {
  display: block;
  margin: 8px 0;
  font-size: 1.25rem;
}

.formula-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.info-popover {
  position: absolute;
  z-index: 20;
  right: 16px;
  top: 54px;
  width: min(520px, calc(100% - 32px));
  padding: 14px;
  border: 1px solid rgba(225, 29, 72, 0.24);
  border-radius: 12px;
  background: rgba(255, 252, 248, 0.98);
  box-shadow: 0 22px 60px rgba(20, 6, 2, 0.22);
}

.info-popover[hidden] {
  display: none;
}

.generic-info-popover {
  right: auto;
  max-width: calc(100vw - 24px);
}

.popover-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.popover-heading strong {
  font-size: 1rem;
}

.popover-heading .icon-action {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 0.86rem;
}

.info-popover p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

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

.compact-formula .formula-card {
  min-height: 104px;
  padding: 11px;
}

.compact-formula .formula-card strong {
  margin: 5px 0;
  font-size: 1.05rem;
}

.compact-formula .formula-card p {
  font-size: 0.78rem;
}

.plaid-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border-color: rgba(225, 29, 72, 0.22);
  background:
    linear-gradient(135deg, rgba(17, 17, 17, 0.96), rgba(87, 13, 13, 0.92) 56%, rgba(225, 29, 72, 0.88)),
    #101010;
  color: #fff;
}

.plaid-panel::after {
  position: absolute;
  inset: auto -10% -45% 48%;
  height: 170px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  content: "";
  filter: blur(22px);
}

.plaid-panel .panel-heading,
.plaid-grid,
.plaid-actions,
.plaid-note {
  position: relative;
  z-index: 1;
}

.plaid-panel .panel-heading span,
.plaid-grid span,
.plaid-note {
  color: rgba(255, 255, 255, 0.72);
}

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

.plaid-grid div {
  min-height: 76px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.plaid-grid span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.plaid-grid strong {
  font-size: 1.05rem;
}

.plaid-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.plaid-panel .primary-button {
  background: #fff;
  color: #111;
}

.plaid-panel .ghost-button {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.plaid-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.88rem;
  line-height: 1.4;
}

.plaid-note.active {
  color: rgba(255, 255, 255, 0.88);
}

.networth-live-panel {
  margin-bottom: 16px;
}

.networth-chart-wrap {
  position: relative;
}

#netWorthLiveChart {
  height: 180px;
  cursor: crosshair;
}

.networth-hover-marker {
  position: absolute;
  z-index: 2;
  width: 0;
  pointer-events: none;
}

.networth-hover-line {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, rgba(225, 29, 72, 0.42) 0 7px, transparent 7px 13px);
}

.networth-hover-dot {
  position: absolute;
  left: 0;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e11d48;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(16, 16, 16, 0.24);
}

.networth-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff7f7;
  font-size: 0.84rem;
}

.networth-readout span:first-child {
  color: var(--muted);
  font-weight: 800;
}

.networth-readout strong {
  color: var(--ink);
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}

.networth-readout span:last-child {
  color: #991b1b;
  font-weight: 750;
}

.networth-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.networth-strip div {
  min-height: 74px;
  padding: 13px;
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7f7, #fff);
}

.networth-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.networth-strip strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.modal-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 8, 8, 0.58);
  backdrop-filter: blur(14px);
}

body.modal-open {
  overflow: hidden;
}

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

.modal-card {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: 14px;
  background: rgba(255, 252, 248, 0.98);
  box-shadow: 0 28px 80px rgba(20, 6, 2, 0.42);
}

.compact-modal {
  width: min(430px, 100%);
}

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

.modal-heading p,
.plaid-choice p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.account-mode-panel {
  margin-top: 14px;
}

.user-admin-modal {
  width: min(760px, 100%);
}

.user-create-form {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

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

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.form-status {
  min-height: 1.35em;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.form-status.error {
  color: var(--red);
}

.form-status.success {
  color: var(--green);
}

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

.user-admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.user-admin-identity {
  min-width: 0;
}

.user-admin-identity strong,
.user-admin-identity span {
  display: block;
}

.user-admin-identity span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.role-badge {
  display: inline-flex;
  width: max-content;
  margin-left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(225, 29, 72, 0.1);
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.user-feature-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-toggle {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid rgba(116, 107, 100, 0.28);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
}

.feature-toggle.enabled {
  border-color: rgba(21, 128, 61, 0.28);
  background: rgba(21, 128, 61, 0.1);
  color: var(--green);
}

.account-danger-section {
  border-color: rgba(220, 38, 38, 0.3) !important;
  background: rgba(254, 242, 242, 0.72) !important;
}

.danger-button {
  min-height: 44px;
  border: 1px solid #b91c1c;
  border-radius: 10px;
  background: #b91c1c;
  color: #fff;
  font: inherit;
  font-weight: 900;
}

.user-admin-actions input {
  width: min(220px, 100%);
}

.user-admin-card.inactive {
  opacity: 0.64;
}

.account-security-stack {
  display: grid;
  gap: 12px;
}

.account-security-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.account-security-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.account-security-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
}

.account-security-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-security-heading span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 900;
}

.account-security-heading span.verified {
  background: rgba(21, 128, 61, 0.12);
  color: var(--green);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.data-table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.data-table table,
.panel > table {
  margin-bottom: 0;
}

.balance-row,
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.balance-row span,
.summary-row span {
  color: var(--ink);
  font-weight: 650;
}

.balance-row strong,
.summary-row strong {
  flex: 0 0 auto;
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.balance-row strong.good,
.summary-row strong.good {
  color: #15803d;
}

.balance-row strong.bad,
.summary-row strong.bad {
  color: var(--red);
}

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

.account-summary-grid div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 247, 247, 0.78);
}

.account-summary-grid span,
.account-section-heading span {
  display: block;
  color: var(--muted);
  font-weight: 780;
}

.account-summary-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.account-summary-grid strong.good {
  color: var(--green);
}

.account-summary-grid strong.bad {
  color: var(--red);
}

.account-section {
  display: grid;
  gap: 10px;
  border-radius: 12px;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.account-section + .account-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.account-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.account-section-heading h4 {
  margin: 0;
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
}

.account-section.drag-target {
  background: rgba(225, 29, 72, 0.06);
  box-shadow: inset 0 0 0 2px rgba(225, 29, 72, 0.3);
}

.account-table {
  table-layout: fixed;
}

.account-table th:nth-child(1),
.account-table td:nth-child(1) {
  width: 42px;
}

.account-table th:nth-child(4),
.account-table td:nth-child(4) {
  width: 150px;
}

.account-table th:nth-child(5),
.account-table td:nth-child(5) {
  width: 130px;
}

.account-table th:nth-child(6),
.account-table td:nth-child(6) {
  width: 112px;
}

.account-row.dragging {
  opacity: 0.45;
}

.account-drag-cell {
  text-align: center;
}

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7f7;
  color: var(--accent);
  cursor: grab;
  font-weight: 950;
  letter-spacing: -0.08em;
  user-select: none;
}

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

.synced-account-name {
  display: block;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operating-funds-panel {
  display: grid;
  gap: 14px;
}

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

.operating-funds-dashboard-panel .funds-snapshot {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.operating-funds-dashboard-panel .funds-snapshot div.comfort-spend {
  grid-column: span 2;
}

.funds-snapshot div {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 247, 247, 0.7);
}

.funds-snapshot div.comfort-spend {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(24, 8, 9, 0.96), rgba(225, 29, 72, 0.9));
  color: #fff;
}

.funds-snapshot span,
.funds-snapshot small {
  display: block;
  color: var(--muted);
  font-weight: 780;
}

.funds-snapshot small {
  margin-top: 5px;
  font-size: 0.72rem;
}

.funds-snapshot strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.funds-snapshot .comfort-spend span,
.funds-snapshot .comfort-spend small,
.funds-snapshot .comfort-spend strong {
  color: #fff;
}

.funds-snapshot strong.good {
  color: var(--green);
}

.funds-snapshot strong.bad {
  color: var(--red);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  table-layout: fixed;
  font-size: 0.94rem;
  line-height: 1.25;
}

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

th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

td {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}

td.number,
td.percent,
td:has(input[type="number"]),
td:has(input[type="date"]),
td:has(select),
td:has(button),
td:has(.paid-toggle) {
  white-space: nowrap;
  overflow-wrap: normal;
}

tbody tr:hover {
  background: #fff1f2;
}

td.number,
td.percent {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
  overflow-wrap: normal;
}

.stable-table {
  isolation: isolate;
}

.compact .stable-table {
  min-width: 0;
}

.stable-table th,
.stable-table td {
  max-width: 320px;
}

.stable-table input,
.stable-table select,
.stable-table button {
  max-width: 100%;
}

.empty-table-cell,
.table-error {
  color: var(--muted);
  font-weight: 750;
}

.table-error {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff7f7;
}

.good {
  color: #15803d;
  font-weight: 850;
}

.bad {
  color: var(--red);
  font-weight: 850;
}

.ok {
  color: #a16207;
  font-weight: 850;
}

.warn {
  color: #c2410c;
  font-weight: 850;
}

.status {
  font-weight: 850;
}

.decision-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  image-rendering: auto;
}

#confidenceLineChart {
  height: clamp(340px, 38vw, 420px);
  max-height: none;
  cursor: crosshair;
}

.form-grid,
.inline-control,
.ai-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.form-grid {
  gap: 12px;
}

.field-hint {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.35;
  margin-top: 4px;
}

.ai-evaluation-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-evaluation-panel .panel-heading {
  margin-bottom: 0;
}

.ai-evaluation-panel .primary-button {
  width: auto;
  min-width: 112px;
  min-height: 42px;
  padding-inline: 18px;
}

.ai-box {
  gap: 7px;
}

.ai-box textarea {
  min-height: 128px;
  border-radius: 10px;
  line-height: 1.45;
}

.ai-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.intake-command-panel {
  margin-bottom: 18px;
}

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

.intake-status-card {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  background: #fff7f7;
}

.intake-status-card span,
.intake-card-head span,
.intake-raw summary {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.intake-status-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.05rem;
}

.intake-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.35fr);
  gap: 18px;
  align-items: start;
}

.data-import-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.55fr);
  gap: 18px;
  align-items: start;
}

.data-import-upload-panel,
.data-import-preview-panel {
  min-width: 0;
}

.data-import-upload-panel {
  border-top: 4px solid var(--accent);
}

.data-import-form,
.data-import-form label {
  display: grid;
  gap: 9px;
}

.data-import-form label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.data-import-file-label {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fff8f8;
}

.data-import-file-label span,
.data-import-status,
.data-import-privacy span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.data-import-privacy {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(22, 163, 74, 0.08);
  color: var(--ink);
}

.data-import-status {
  margin: 12px 0 0;
}

.data-import-status.is-busy::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}

.data-import-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.data-import-summary > div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffafa;
  min-width: 0;
}

.data-import-summary span,
.data-import-history-item span {
  color: var(--muted);
  font-size: 0.76rem;
}

.data-import-summary strong {
  overflow-wrap: anywhere;
}

.data-import-warnings {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #fff3cd;
  color: #6f5100;
  font-size: 0.8rem;
}

.data-import-review-controls {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 12px;
}

.data-import-review-controls > label:last-child {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.data-import-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.data-import-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #fff;
}

.data-import-table th,
.data-import-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-import-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff5f5;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.data-import-table input:not([type="checkbox"]),
.data-import-table select {
  min-width: 120px;
  padding: 8px;
}

.data-import-table td:nth-child(4) input {
  min-width: 210px;
}

.data-import-table tr.is-excluded {
  opacity: 0.45;
}

.data-import-period-fields {
  display: flex;
  gap: 6px;
}

.data-import-period-fields input {
  width: 92px;
}

.data-import-apply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.data-import-history-panel {
  margin-top: 18px;
}

.data-import-history-list {
  display: grid;
  gap: 9px;
}

.data-import-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.data-import-history-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.data-import-history-item.is-undone {
  opacity: 0.6;
}

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

.intake-primary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.intake-primary-actions .primary-button,
.intake-primary-actions .ghost-button {
  min-height: 46px;
}

.intake-automation-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.intake-advanced-settings {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff7f7;
  overflow: hidden;
}

.intake-advanced-settings summary {
  padding: 12px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.intake-advanced-settings summary::-webkit-details-marker {
  display: none;
}

.intake-advanced-settings[open] {
  padding-bottom: 12px;
}

.intake-advanced-settings label,
.intake-advanced-settings .connector-toggle-grid,
.intake-advanced-settings button {
  margin: 0 12px 12px;
}

.intake-form label,
.intake-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.intake-form textarea {
  min-height: 260px;
  resize: vertical;
}

.intake-connector-panel {
  border-top: 4px solid var(--accent);
}

.connector-toggle-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff7f7;
}

.checkbox-control {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px !important;
  color: var(--ink) !important;
  font-size: 0.9rem !important;
  text-transform: none;
}

.checkbox-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.connector-route-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.connector-route-list div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 241, 241, 0.78));
}

.connector-route-list div.connected {
  border-color: rgba(25, 126, 76, 0.25);
  background: linear-gradient(135deg, rgba(245, 255, 249, 0.96), rgba(255, 255, 255, 0.86));
}

.connector-route-list div:not(.connected) {
  border-color: rgba(226, 27, 60, 0.22);
}

.connector-route-list strong,
.connector-route-list span {
  display: block;
}

.connector-route-list strong {
  color: var(--ink);
  margin-bottom: 4px;
}

.connector-route-list span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.connector-route-list div.connected span {
  color: #1b7f4e;
}

.intake-api-guide {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.intake-guide-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.intake-guide-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.intake-guide-heading span,
.intake-guide-heading strong {
  color: var(--muted);
  font-size: 0.82rem;
}

.intake-guide-heading strong {
  white-space: nowrap;
}

.intake-guide-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.intake-guide-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
  list-style: none;
}

.intake-guide-card summary::-webkit-details-marker {
  display: none;
}

.intake-guide-card summary em {
  color: var(--accent);
  font-size: 0.75rem;
  font-style: normal;
  text-align: right;
}

.intake-guide-card ol {
  margin: 0;
  padding: 0 14px 10px 32px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.intake-guide-card li + li {
  margin-top: 5px;
}

.api-snippet {
  display: block;
  margin: 0 12px 12px;
  padding: 10px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(226, 27, 60, 0.18);
  border-radius: 8px;
  background: #fff7f7;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre;
}

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

.hermes-activity-panel {
  margin-top: 0;
}

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

.hermes-activity-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.hermes-activity-item.is-undone {
  opacity: 0.72;
}

.hermes-activity-copy {
  min-width: 0;
}

.hermes-activity-copy strong,
.hermes-activity-copy span {
  display: block;
}

.hermes-activity-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.hermes-activity-original {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hermes-activity-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hermes-status-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(56, 118, 86, 0.12);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hermes-activity-item.is-undone .hermes-status-pill {
  background: rgba(114, 102, 96, 0.12);
  color: var(--muted);
}

@media (max-width: 680px) {
  .hermes-activity-item {
    grid-template-columns: 1fr;
  }

  .hermes-activity-actions {
    justify-content: space-between;
  }
}

.intake-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.intake-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.intake-card-head strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.05rem;
}

.intake-fields {
  display: grid;
  grid-template-columns: 1.25fr 0.55fr 0.7fr 0.7fr 0.75fr 0.85fr;
  gap: 10px;
  align-items: end;
}

.intake-fields textarea {
  min-height: 42px;
  max-height: 96px;
  resize: vertical;
}

.intake-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.intake-actions .primary-button,
.intake-actions .ghost-button {
  width: auto;
  min-height: 38px;
  padding: 8px 14px;
}

.subtle-action {
  background: #fff;
}

.intake-raw {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.intake-raw p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.empty-state {
  display: grid;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 18px;
  color: var(--muted);
  background: #fff7f7;
}

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

.table-input {
  width: 100%;
  min-width: 120px;
  min-height: 34px;
  border-radius: 7px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.table-money-input {
  min-width: 110px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.source-pill,
.locked-row {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.manual-source {
  background: #fff7f7;
  color: #991b1b;
}

.plaid-source {
  background: #eef2ff;
  color: #3730a3;
}

.locked-row {
  background: #f3f4f6;
  color: #6b7280;
}

.quick-add-row {
  background: #fff7f7;
}

.quick-add-row input {
  min-height: 34px;
  border-radius: 7px;
  padding: 6px 8px;
}

.opportunity-table table {
  min-width: 1120px;
  table-layout: fixed;
}

.opportunity-table .inline-select,
.opportunity-table input,
.opportunity-table select {
  min-height: 34px;
  border-radius: 7px;
  font-size: 0.88rem;
  background: #fff;
}

.opportunity-table th:nth-child(1),
.opportunity-table td:nth-child(1) {
  width: 24%;
}

.opportunity-table th:nth-child(2),
.opportunity-table td:nth-child(2) {
  width: 13%;
}

.opportunity-table th:nth-child(3),
.opportunity-table td:nth-child(3) {
  width: 13%;
}

.opportunity-table th:nth-child(4),
.opportunity-table td:nth-child(4) {
  width: 17%;
}

.opportunity-table th:nth-child(5),
.opportunity-table td:nth-child(5) {
  width: 11%;
}

.opportunity-table th:nth-child(6),
.opportunity-table td:nth-child(6) {
  width: 18%;
}

.opportunity-table th:nth-child(7),
.opportunity-table td:nth-child(7) {
  width: 4%;
}

.opportunity-analytics {
  margin-top: 16px;
}

#reasonStackChart {
  height: 280px;
}

.potential-total {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.potential-total span,
.potential-legend small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.potential-total strong {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.potential-bar {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1e7dd;
}

.potential-bar span {
  min-width: 2px;
}

.potential-bar .booked,
.swatch.booked {
  background: #111;
}

.potential-bar .missed,
.swatch.missed {
  background: linear-gradient(90deg, #991b1b, #e11d48);
}

.swatch.blocked {
  background: repeating-linear-gradient(135deg, #f1e7dd 0 5px, #b45309 5px 8px);
}

.potential-legend {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.potential-legend div {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 8px;
  align-items: center;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

#potentialRevenueVisual p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.quick-add-button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  background: linear-gradient(135deg, #101010, #b91c1c);
  color: #fff;
  font-weight: 850;
}

textarea {
  resize: vertical;
  line-height: 1.4;
}

.inline-select {
  min-height: 32px;
  padding: 4px 8px;
}

.delete-button {
  min-height: 30px;
  border: 1px solid #f0c6c6;
  border-radius: 8px;
  background: #fff3f3;
  color: var(--red);
  font-weight: 900;
  padding: 0 10px;
  white-space: nowrap;
  cursor: pointer;
}

.action-cell {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.segmented-bar {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  margin: 14px 0 16px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid rgba(225, 29, 72, 0.36);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(225, 29, 72, 0.2), transparent var(--probability), rgba(17, 17, 17, 0.08) var(--probability)),
    repeating-linear-gradient(135deg, rgba(127, 29, 29, 0.18) 0 2px, transparent 2px 13px),
    #fff7f7;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 26px rgba(225, 29, 72, 0.18);
}

.segmented-bar::before {
  content: "";
  position: absolute;
  inset: -24px auto -24px calc(var(--probability) - 34px);
  width: 76px;
  background:
    conic-gradient(from 45deg, transparent 0 24%, rgba(251, 113, 133, 0.55) 25% 36%, transparent 37% 100%),
    radial-gradient(circle at 50% 68%, rgba(225, 29, 72, 0.52), transparent 54%);
  filter: blur(1px);
  opacity: 0.75;
  animation: flamePulse 1.35s ease-in-out infinite;
  pointer-events: none;
}

.segmented-bar::after {
  content: "";
  position: absolute;
  inset: 7px;
  width: 34%;
  border-radius: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent),
    linear-gradient(135deg, transparent 0 44%, rgba(255, 255, 255, 0.55) 45% 52%, transparent 53%);
  clip-path: polygon(22px 0, 100% 0, calc(100% - 22px) 100%, 0 100%);
  mix-blend-mode: screen;
  animation: meterScan 2.1s ease-in-out infinite;
  pointer-events: none;
}

.segment {
  position: relative;
  height: 26px;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent),
    #efe5df;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  box-shadow: inset 0 -8px 18px rgba(17, 17, 17, 0.06);
  transform-origin: left center;
  animation: segmentWake 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i) * 54ms);
}

.segment.on {
  border-color: rgba(225, 29, 72, 0.64);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 38%),
    radial-gradient(circle at 58% 130%, #fb7185 0 22%, transparent 46%),
    linear-gradient(135deg, #111111 0%, #641313 34%, #e11d48 76%, #ff5a1f 100%);
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.45), 0 0 8px rgba(255, 90, 31, 0.38), inset 0 0 16px rgba(255, 255, 255, 0.1);
}

.segment.on::before {
  content: "";
  position: absolute;
  inset: 2px;
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(255, 255, 255, 0.24) 43% 49%, transparent 50%),
    linear-gradient(45deg, transparent 0 52%, rgba(255, 90, 31, 0.4) 53% 58%, transparent 59%);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  animation: emberJitter 700ms steps(2, end) infinite;
}

.segment.on::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  transform: translateX(-140%);
  animation: segmentGlint 1.45s ease-in-out infinite;
  animation-delay: calc(var(--i) * 88ms);
}

@keyframes segmentWake {
  from {
    opacity: 0.22;
    transform: scaleX(0.2);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes segmentGlint {
  0%,
  45% {
    transform: translateX(-140%);
  }
  100% {
    transform: translateX(140%);
  }
}

@keyframes meterScan {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }
  18%,
  72% {
    opacity: 0.8;
  }
  100% {
    transform: translateX(360%);
    opacity: 0;
  }
}

@keyframes flamePulse {
  0%,
  100% {
    transform: translateY(2px) scaleX(0.92) skewX(-10deg);
    opacity: 0.45;
  }
  50% {
    transform: translateY(-2px) scaleX(1.08) skewX(10deg);
    opacity: 0.9;
  }
}

@keyframes emberJitter {
  0% {
    opacity: 0.35;
    transform: translateX(-1px);
  }
  100% {
    opacity: 0.85;
    transform: translateX(1px);
  }
}

.invoice-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.invoice-control-grid,
.invoice-split,
.invoice-settings-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-control-grid label,
.invoice-split label,
.invoice-settings-grid label,
.invoice-template-card label,
.invoice-form-panel label {
  color: var(--muted);
  display: grid;
  font-size: 0.84rem;
  font-weight: 850;
  gap: 7px;
}

.invoice-control-grid input,
.invoice-control-grid select,
.invoice-split input,
.invoice-split textarea,
.invoice-form-panel textarea,
.invoice-form-panel input,
.invoice-settings-grid input,
.invoice-settings-grid select,
.invoice-settings-grid textarea,
.invoice-template-card textarea {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(55, 14, 14, 0.18);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

.invoice-notes-textarea {
  line-height: 1.45;
  min-height: 138px;
  overflow: hidden;
  resize: vertical;
}

.invoice-draft-status {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  margin: 12px 0 0;
}

.invoice-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.invoice-action-row .primary-button,
.invoice-action-row .secondary-button {
  min-width: 150px;
}

.invoice-tax-toggle {
  align-items: center;
  align-self: end;
  display: flex !important;
  min-height: 42px;
}

.inline-heading {
  margin-top: 18px;
}

.invoice-items-table table {
  min-width: 720px;
  table-layout: fixed;
}

.invoice-items-table th:nth-child(1) {
  width: 42%;
}

.invoice-items-table th:nth-child(2) {
  width: 13%;
}

.invoice-items-table th:nth-child(3) {
  width: 17%;
}

.invoice-items-table th:nth-child(4) {
  width: 20%;
}

.invoice-preview-document {
  background: #fff;
  border: 1px solid rgba(55, 14, 14, 0.16);
  border-radius: 8px;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  padding: 28px;
}

.invoice-preview-top {
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.invoice-preview-document h2,
.invoice-preview-document h3,
.invoice-preview-document p {
  margin: 0 0 8px;
}

.invoice-logo-box {
  align-items: center;
  border: 1px dashed rgba(55, 14, 14, 0.28);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  height: calc(64px * var(--invoice-logo-scale, 1));
  justify-items: center;
  min-width: calc(118px * var(--invoice-logo-scale, 1));
  overflow: visible;
  padding: 8px 26px 8px 8px;
  position: relative;
}

.invoice-logo-box img {
  display: block;
  max-height: calc(48px * var(--invoice-logo-scale, 1));
  max-width: calc(88px * var(--invoice-logo-scale, 1));
  object-fit: contain;
}

.invoice-logo-remove {
  align-items: center;
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.25);
  border-radius: 999px;
  color: var(--danger);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 5px;
  top: 5px;
  width: 22px;
}

.invoice-party-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
  margin: 24px 0;
}

.invoice-business-contact {
  display: grid;
  gap: 2px;
}

.invoice-business-contact p {
  margin-bottom: 0;
}

.invoice-client-company,
.invoice-tax-id {
  color: rgba(17, 17, 17, 0.78);
  font-weight: 850;
}

.invoice-client-address,
.invoice-tax-id {
  margin-top: 8px !important;
}

.invoice-event-row {
  border-bottom: 1px solid rgba(55, 14, 14, 0.18);
  border-top: 1px solid rgba(55, 14, 14, 0.18);
  margin: 0 0 18px;
  padding: 14px 0 16px;
}

.invoice-event-row span {
  color: rgba(17, 17, 17, 0.56);
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.invoice-event-row strong {
  color: #111;
  display: block;
  font-size: 1.24rem;
  font-weight: 900;
  line-height: 1.2;
}

.invoice-preview-items {
  border-collapse: collapse;
  font-size: 0.86rem;
  width: 100%;
}

.invoice-preview-items th,
.invoice-preview-items td {
  border-bottom: 1px solid rgba(55, 14, 14, 0.16);
  padding: 8px;
  text-align: left;
}

.invoice-totals {
  margin: 18px 0 0 auto;
  max-width: 290px;
}

.invoice-totals p {
  border-bottom: 1px solid rgba(55, 14, 14, 0.12);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 7px 0;
}

.balance-due strong {
  color: var(--good);
}

.invoice-message {
  border-top: 1px solid rgba(55, 14, 14, 0.14);
  line-height: 1.5;
  margin-top: 22px;
  padding-top: 16px;
}

.invoice-logo-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.logo-upload-control,
.logo-scale-control {
  align-items: center;
  display: flex;
  gap: 8px;
}

.logo-upload-control input {
  max-width: 170px;
}

.logo-scale-control {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.logo-scale-control input {
  accent-color: var(--accent);
  width: 112px;
}

.logo-scale-control span {
  color: var(--ink);
  min-width: 40px;
  text-align: right;
}

.invoice-template-list {
  display: grid;
  gap: 14px;
}

.invoice-template-card {
  border: 1px solid rgba(55, 14, 14, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.invoice-template-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.invoice-template-summary {
  margin: -2px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.invoice-help-card {
  color: var(--muted);
  line-height: 1.5;
}

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

.invoice-archive-card {
  align-items: center;
  border: 1px solid rgba(55, 14, 14, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.4fr) minmax(170px, 0.8fr) minmax(120px, 0.5fr) auto;
  padding: 14px;
}

.invoice-archive-card.active {
  border-color: rgba(225, 29, 72, 0.42);
  box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.12);
}

.invoice-archive-main,
.invoice-archive-meta,
.invoice-archive-total {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.invoice-archive-main span,
.invoice-archive-meta span,
.invoice-archive-total span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
}

.invoice-archive-main strong,
.invoice-archive-total strong {
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 900;
}

.invoice-archive-main p {
  color: var(--muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.invoice-empty-state {
  display: grid;
  gap: 6px;
  padding: 18px;
}

@media (max-width: 980px) {
  .invoice-grid,
  .invoice-split,
  .invoice-control-grid,
  .invoice-settings-grid,
  .invoice-party-grid {
    grid-template-columns: 1fr;
  }

  .invoice-preview-document {
    padding: 18px;
  }

  .invoice-archive-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .invoice-archive-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .segmented-bar::after,
  .segmented-bar::before,
  .segment,
  .segment.on::before,
  .segment.on::after {
    animation: none;
  }
}

.probability-meter strong {
  font-size: 3rem;
  line-height: 1;
}

.probability-meter p,
.ai-answer {
  color: var(--muted);
  line-height: 1.5;
}

.probability-explainer {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff7f7;
}

.probability-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.probability-summary article {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(225, 29, 72, 0.16);
  border-radius: 8px;
  background: #fff;
}

.probability-summary span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.probability-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
  line-height: 1.1;
}

.micro-info {
  width: 18px;
  height: 18px;
  font-size: 0.68rem;
}

.probability-plain {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.seasonality-explainer,
.decision-explainer {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff7f7;
}

.seasonality-visual {
  display: grid;
  gap: 11px;
  min-height: 320px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.seasonality-now {
  display: grid;
  gap: 14px;
}

.seasonality-current-month {
  min-height: 150px;
  padding: 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #18090a, #8f1d2c 58%, #e11d48);
  color: #fff;
}

.seasonality-current-month span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.seasonality-current-month strong {
  display: block;
  margin-top: 12px;
  font-family: "Syne", "Arial Black", "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 0.96;
}

.seasonality-current-month p {
  max-width: 32ch;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
}

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

.seasonality-signal-grid div {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff7f7;
}

.seasonality-signal-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.seasonality-signal-grid strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-variant-numeric: tabular-nums;
}

.seasonality-signal-grid small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.seasonality-row {
  width: 100%;
  border: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
  padding: 3px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.seasonality-row:hover,
.seasonality-row:focus-visible {
  outline: 0;
  background: #fff7f7;
}

.seasonality-month {
  color: var(--muted);
  font-weight: 850;
}

.seasonality-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2e8df;
}

.seasonality-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #991b1b, #e11d48);
}

.seasonality-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.seasonality-row.active {
  background: #fff1f2;
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.22);
}

.freedom-breakdown {
  display: grid;
  gap: 14px;
}

.freedom-status-card {
  padding: 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #18090a, #7f1d1d 52%, #e11d48);
  color: #fff;
}

.freedom-status-card span,
.freedom-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.freedom-status-card span {
  color: rgba(255, 255, 255, 0.7);
}

.freedom-status-card strong {
  display: block;
  margin-top: 10px;
  font-family: "Syne", "Arial Black", "Space Grotesk", sans-serif;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 0.95;
}

.freedom-status-card p {
  max-width: 36ch;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.35;
}

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

.freedom-detail-grid div {
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff7f7;
}

.freedom-detail-grid strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-variant-numeric: tabular-nums;
}

.freedom-detail-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 750;
}

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

.freedom-milestones div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.freedom-milestones span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-weight: 800;
}

.freedom-milestones strong {
  color: var(--red);
  font-size: 0.9rem;
}

.freedom-milestones .passed strong {
  color: #be123c;
}

.freedom-milestones .blocked {
  background: #fff7f7;
}

.goals-form {
  align-items: end;
}

.label-with-info {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.range-readout {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--ink);
}

.goal-summary-card {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff7f7;
}

.goal-summary-card span,
.goal-progress-list span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.goal-summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-variant-numeric: tabular-nums;
}

.goal-summary-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

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

.goal-progress-list > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf8;
}

.goal-progress-list strong {
  display: block;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.goal-progress-list small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.goal-bar {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2e4df;
}

.goal-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
}

.explainer-line {
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.explainer-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.explainer-line span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.explainer-line strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.ai-answer {
  margin-top: 0;
  padding: 14px 15px;
  border: 1px solid rgba(225, 29, 72, 0.16);
  border-left: 4px solid var(--hot);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(225, 29, 72, 0.06), transparent 58%),
    #fffafa;
  color: var(--ink);
  font-weight: 650;
}

.stacked-table {
  margin-top: 14px;
}

.forecast-path-table {
  margin-top: 18px;
}

.forecast-path-heading {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.forecast-path-heading h4 {
  font-size: 1rem;
  margin: 0;
}

.forecast-path-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.growth-panel {
  margin-top: 18px;
}

.growth-panel canvas {
  height: 180px;
  max-height: 180px;
}

#savingsGrowthTable {
  margin-top: 14px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand-block div:last-child,
  .app-tab-label {
    font-size: 0;
    width: 0;
    opacity: 0;
    overflow: hidden;
  }

  .app-tab {
    justify-content: center;
    padding: 0;
  }

  .app-tab-divider {
    margin: 2px auto;
    width: 38px;
  }

  .app-tab-icon {
    margin: 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .app-tab-icon svg {
    width: 19px;
    height: 19px;
  }

  .sidebar-footer {
    display: grid;
    gap: 7px;
    padding: 8px;
  }

  .sidebar-footer span,
  .sidebar-footer strong {
    display: none;
  }

  .save-status {
    justify-content: center;
    min-height: 30px;
    margin-top: 0;
    padding: 0 8px;
    font-size: 0;
  }

  .save-status .save-status-dot {
    display: block;
  }

  .save-status #saveStatusText {
    display: none;
  }

  .save-status::after {
    content: attr(data-mobile-label);
    font-size: 0.68rem;
    font-weight: 900;
  }

  .sidebar-action {
    display: grid;
    place-items: center;
    min-height: 34px;
    margin-top: 0;
    padding: 0;
    text-align: center;
    font-size: 0;
  }

  .sidebar-action::before {
    content: "CSV";
    font-size: 0.72rem;
    font-weight: 900;
  }

  .sidebar-action.subtle::before {
    content: "JSON";
  }

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

  .overview-grid,
  .dashboard-groups,
  .dashboard-overview-grid,
  .split-layout,
  .intake-grid,
  .data-import-grid,
  .ledger-columns,
  .formula-grid,
  .plaid-grid,
  .networth-strip,
  .income-category-readout,
  .freedom-detail-grid,
  .freedom-milestones,
  .expense-chart-grid,
  .expense-bank-grid {
    grid-template-columns: 1fr;
  }

  .budget-group .dashboard-rows {
    grid-template-columns: 1fr;
  }

  .funds-snapshot,
  .intake-readiness,
  .intake-primary-actions,
  .intake-fields {
    grid-template-columns: 1fr;
  }

  .operating-funds-dashboard-panel .funds-snapshot div.comfort-spend {
    grid-column: 1 / -1;
  }

  .info-popover {
    left: 12px;
    right: 12px;
    width: auto;
  }
}

@media (max-width: 720px) {
  .auth-form input,
  .auth-form select,
  .auth-form textarea {
    font-size: 16px;
  }

  .user-create-form .form-grid,
  .user-admin-card {
    grid-template-columns: 1fr;
  }

  .user-admin-actions {
    justify-content: flex-start;
  }

  .data-import-summary {
    grid-template-columns: 1fr;
  }

  .data-import-review-controls,
  .data-import-apply-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .data-import-history-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .data-import-history-item .ghost-button {
    grid-column: 1 / -1;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background:
      linear-gradient(90deg, rgba(225, 29, 72, 0.2), transparent 42%),
      rgba(7, 7, 7, 0.96);
    backdrop-filter: blur(18px);
  }

  .brand-block,
  .sidebar-footer {
    display: none;
  }

  .app-tabs {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .app-tabs::-webkit-scrollbar {
    display: none;
  }

  .app-tab {
    flex: 1 0 50px;
    justify-content: center;
    min-height: 48px;
    padding: 0;
    border-radius: 12px;
  }

  .app-tab-divider {
    flex: 0 0 1px;
    width: 1px;
    height: 34px;
    margin: auto 2px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  }

  .app-tab-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .main-stage {
    padding: 14px 12px 88px;
  }

  .topbar,
  .confidence-hero,
  .section-header,
  .panel-heading {
    display: grid;
  }

  .hero-number {
    justify-items: start;
  }

  .metric-grid,
  .dashboard-groups,
  .dashboard-overview-grid,
  .compact-metrics {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 14px;
  }

  .demo-workspace-notice {
    align-items: flex-start;
    margin-top: 0;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .top-actions .user-pill,
  .top-actions .year-picker {
    grid-column: 1 / -1;
  }

  .top-actions > button {
    width: 100%;
  }

  .year-picker {
    width: 100%;
  }

  .year-picker select {
    width: 100%;
  }

  #incomeCategoryStackChart {
    height: clamp(680px, 92vh, 920px);
    max-height: none;
  }

  .planned-bookings-panel.compare-mode #incomeCategoryStackChart {
    height: clamp(980px, 138vh, 1320px);
    max-height: none;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 2.7rem);
  }

  h2 {
    font-size: clamp(1.5rem, 8vw, 2rem);
  }

  .panel,
  .metric-card {
    border-radius: 10px;
  }

  .panel {
    padding: 14px;
  }

  .sub-tabs,
  .month-tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 7px;
    scrollbar-width: none;
  }

  .sub-tabs::-webkit-scrollbar,
  .month-tabs::-webkit-scrollbar {
    display: none;
  }

  .sheet-tab,
  .month-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .confidence-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 22px 18px;
    min-height: auto;
  }

  .confidence-hero h2 {
    font-size: clamp(2rem, 11vw, 3.15rem);
    line-height: 1;
  }

  .hero-number > strong {
    font-size: clamp(2.4rem, 18vw, 4rem);
  }

  .dashboard-group,
  .panel,
  .data-table {
    max-width: 100%;
  }

  table {
    min-width: 640px;
    font-size: 0.86rem;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .ledger-columns table {
    min-width: 840px;
  }

  .expense-ledger-table table,
  .expense-category-table table {
    min-width: 860px;
  }

  .opportunity-table table,
  #declinedTable table,
  #accountsTable table,
  #plannedBookingsTable table {
    min-width: 1120px;
  }

  .booking-visibility-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .booking-visibility-table table {
    min-width: 940px;
  }

  .account-summary-grid {
    grid-template-columns: 1fr;
  }

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

  .table-input,
  .ledger-columns input,
  .ledger-columns select,
  .opportunity-table input,
  .opportunity-table select {
    min-height: 34px;
    font-size: 0.82rem;
  }

  canvas {
    max-height: 280px;
  }

  .history-chart-panel canvas,
  .growth-panel canvas,
  #incomeConfidenceChart,
  #netWorthCurveChart,
  #reasonStackChart {
    max-height: 300px;
  }

  #confidenceLineChart {
    height: 340px;
    max-height: 340px;
  }

  .networth-chart-wrap,
  .confidence-chart-wrap,
  .history-chart-panel,
  .growth-panel {
    max-height: 360px;
  }

  .confidence-chart-wrap {
    max-height: none;
  }

}

.advisor-command-panel,
.advisor-chat-panel {
  overflow: hidden;
}

.advisor-snapshot {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 14px;
}

.advisor-snapshot[hidden] {
  display: none;
}

.advisor-snapshot article {
  background: linear-gradient(135deg, rgba(255, 247, 247, 0.95), rgba(255, 255, 255, 0.88));
  border: 1px solid rgba(225, 29, 72, 0.16);
  border-radius: 8px;
  padding: 14px;
}

.advisor-snapshot span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.advisor-snapshot strong {
  color: var(--ink);
  display: block;
  font-size: 1.35rem;
  margin-top: 6px;
}

.advisor-command-panel.is-collapsed {
  padding-bottom: 12px;
}

.advisor-command-panel.is-collapsed .panel-heading {
  margin-bottom: 0;
}

.compact-toggle {
  min-height: 32px;
  padding: 7px 11px;
  white-space: nowrap;
}

.advisor-chat-log {
  display: grid;
  gap: 12px;
  max-height: min(52vh, 520px);
  min-height: 180px;
  overflow-y: auto;
  padding: 14px;
  border: 1px solid rgba(225, 29, 72, 0.14);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 247, 247, 0.72), rgba(255, 255, 255, 0.9));
  -webkit-overflow-scrolling: touch;
}

.advisor-chat-empty {
  display: grid;
  min-height: 130px;
  align-items: center;
  color: var(--ink);
}

.advisor-message {
  max-width: min(78ch, 86%);
  padding: 12px 14px;
  border: 1px solid rgba(55, 14, 14, 0.12);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(64, 24, 24, 0.06);
}

.advisor-message span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.advisor-message p {
  margin: 0;
  line-height: 1.5;
}

.advisor-message.from-user {
  justify-self: end;
  background: linear-gradient(135deg, #1f2937, #be2f67);
  color: #fff;
}

.advisor-message.from-user span {
  color: rgba(255, 255, 255, 0.72);
}

.advisor-message.from-advisor {
  justify-self: start;
}

.advisor-message.is-thinking {
  position: relative;
  overflow: hidden;
  border-color: rgba(225, 29, 72, 0.32);
}

.advisor-message.is-thinking::before {
  animation: aiProgress 1.1s infinite linear;
  background: linear-gradient(90deg, transparent, rgba(225, 29, 72, 0.26), transparent);
  content: "";
  height: 3px;
  left: -45%;
  position: absolute;
  top: 0;
  width: 45%;
}

.advisor-message.is-error {
  border-color: rgba(220, 38, 38, 0.36);
  background: rgba(254, 242, 242, 0.96);
  color: #991b1b;
}

.advisor-ai-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.advisor-ai-form label {
  color: var(--muted);
  display: grid;
  font-size: 0.85rem;
  font-weight: 800;
  gap: 8px;
}

.advisor-ai-form textarea {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(55, 14, 14, 0.18);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  min-height: 120px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

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

.advisor-prompt-row button {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(225, 29, 72, 0.18);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 9px 12px;
}

.advisor-prompt-row button:hover,
.advisor-prompt-row button:focus-visible {
  border-color: rgba(225, 29, 72, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.09);
  outline: none;
}

.ai-answer {
  white-space: pre-wrap;
}

.ai-answer.is-thinking {
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.98), rgba(255, 255, 255, 0.92));
  border-color: rgba(225, 29, 72, 0.35);
  color: var(--ink);
}

.ai-answer.is-error {
  background: rgba(254, 242, 242, 0.96);
  border-color: rgba(220, 38, 38, 0.36);
  color: #991b1b;
}

.primary-button.is-thinking {
  cursor: wait;
  opacity: 1;
  position: relative;
}

.primary-button.is-thinking::before {
  animation: aiSpin 0.8s infinite linear;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  width: 14px;
}

#advisorStatus {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  min-height: 24px;
  padding: 0 9px;
}

#advisorStatus.is-thinking {
  background: rgba(225, 29, 72, 0.1);
  color: #991b1b;
}

#advisorStatus .ai-thinking {
  font-size: 0.78rem;
}

#advisorStatus .ai-thinking span:not(:last-child) {
  height: 6px;
  width: 6px;
}

.ai-thinking {
  align-items: center;
  display: inline-flex;
  font-weight: 850;
  gap: 7px;
}

.ai-thinking span:not(:last-child) {
  animation: aiPulse 0.9s infinite ease-in-out;
  background: linear-gradient(135deg, var(--accent), #e11d48);
  border-radius: 999px;
  height: 7px;
  width: 7px;
}

.ai-thinking span:nth-child(2) {
  animation-delay: 0.12s;
}

.ai-thinking span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes aiPulse {
  0%, 80%, 100% {
    opacity: 0.45;
    transform: scale(0.65);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes aiProgress {
  to {
    left: 100%;
  }
}

@keyframes aiSpin {
  to {
    transform: rotate(360deg);
  }
}

.primary-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.expense-category-manager {
  display: grid;
  gap: 16px;
}

.budget-category-manager {
  display: grid;
  gap: 16px;
}

.budget-category-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.budget-category-section {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.category-section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.category-section-heading h4 {
  font-size: 1rem;
  margin: 0;
}

.category-section-heading span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.category-manager-add {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.category-manager-add input,
.category-manager-row input {
  width: 100%;
  min-width: 0;
}

.category-manager-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0;
}

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

.category-manager-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  padding: 10px;
}

.category-manager-usage {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.category-manager-delete {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.28);
  border-radius: 8px;
  color: var(--red);
  cursor: pointer;
  font-weight: 900;
  height: 38px;
  width: 38px;
}

.category-manager-delete:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.freedom-ama-list {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.freedom-ama-list li {
  align-items: baseline;
  border-top: 1px solid rgba(55, 14, 14, 0.12);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 8px 0 0;
}

.freedom-ama-list span {
  color: var(--muted);
  font-weight: 750;
}

.freedom-ama-list strong {
  color: var(--ink);
  font-weight: 850;
  text-align: right;
}

.settings-heading {
  align-items: end;
}

.settings-coming-soon {
  display: grid;
  gap: 12px;
  margin: 0 auto;
  max-width: 760px;
  min-height: 320px;
  place-content: center;
  text-align: center;
}

.settings-coming-soon h2,
.settings-feature-copy h2,
.settings-feature-copy h3 {
  margin: 0;
}

.settings-coming-soon p,
.settings-feature-copy p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.settings-status-badge {
  background: rgba(51, 92, 255, 0.1);
  border: 1px solid rgba(51, 92, 255, 0.18);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 0.73rem;
  font-weight: 850;
  justify-self: center;
  letter-spacing: 0.08em;
  padding: 7px 11px;
  text-transform: uppercase;
}

.settings-status-badge.admin-only {
  justify-self: start;
}

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

.settings-feature-card {
  align-items: center;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  min-height: 170px;
}

.settings-feature-card-wide {
  margin-bottom: 18px;
}

.settings-feature-copy {
  display: grid;
  gap: 10px;
  max-width: 720px;
}

.settings-switch {
  align-items: center;
  cursor: pointer;
  display: grid;
  flex: 0 0 auto;
  gap: 7px;
  justify-items: center;
}

.settings-switch input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.settings-switch-track {
  background: rgba(26, 34, 49, 0.14);
  border-radius: 999px;
  display: block;
  height: 30px;
  padding: 3px;
  transition: background 160ms ease;
  width: 54px;
}

.settings-switch-track::after {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(7, 9, 13, 0.2);
  content: "";
  display: block;
  height: 24px;
  transition: transform 160ms ease;
  width: 24px;
}

.settings-switch input:checked + .settings-switch-track {
  background: var(--accent);
}

.settings-switch input:checked + .settings-switch-track::after {
  transform: translateX(24px);
}

.settings-switch input:focus-visible + .settings-switch-track {
  outline: 3px solid rgba(51, 92, 255, 0.25);
  outline-offset: 3px;
}

.settings-switch-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

@media (max-width: 720px) {
  #app-intake > .sub-tabs {
    flex-wrap: wrap;
  }

  #app-intake > .sub-tabs .sheet-tab {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding-inline: 6px;
  }

  .settings-feature-grid {
    grid-template-columns: 1fr;
  }

  .settings-feature-card {
    align-items: flex-start;
    min-height: 0;
  }

  .budget-template-save-form,
  .budget-template-list-item {
    grid-template-columns: 1fr;
  }

  .budget-repeat-toolbar > span {
    display: none;
  }

  .budget-repeat-toolbar,
  .budget-repeat-actions {
    width: 100%;
  }

  .budget-repeat-actions button,
  .budget-template-item-actions button {
    flex: 1;
  }

  .budget-template-item-actions,
  .budget-copied-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .charging-rule-strip {
    grid-template-columns: 1fr;
  }

  .charging-rule-strip small {
    grid-column: 1;
  }

  .category-manager-add,
  .category-manager-row {
    grid-template-columns: 1fr;
  }

  .category-manager-delete {
    width: 100%;
  }

  .freedom-ama-list li {
    display: grid;
    gap: 3px;
  }

  .freedom-ama-list strong {
    text-align: left;
  }
}
