:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --positive: #16a34a;
  --negative: #ef4444;
  --accent: #6c5ce7;
  --accent-strong: #5945d8;
  --info: #2563eb;
  --warning: #d97706;
  --panel: var(--surface);
  --danger: var(--negative);
  --shadow: 0 12px 34px rgba(15, 23, 42, .08);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, .06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0;
}
body.login-body {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
}
.login-shell {
  width: min(380px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
}
.login-mark {
  width: 72px;
  height: 72px;
  border-radius: 16px;
}
.login-wordmark {
  width: 150px;
  filter: invert(1);
}
.login-panel {
  width: 100%;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.login-panel .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-panel .check-row input {
  width: auto;
}
.login-error {
  margin: 0;
  color: var(--negative);
  font-size: 13px;
}
a { color: inherit; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 34px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
}
.brand-wordmark {
  width: 102px;
  height: 32px;
  object-fit: contain;
  filter: invert(1);
}
.nav {
  display: grid;
  gap: 8px;
}
.nav-link {
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}
.nav-link.active,
.nav-link:hover {
  background: var(--accent);
  color: #fff;
}
.sidebar-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 18px;
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sidebar-panel-head {
  display: grid;
  gap: 3px;
}
.sidebar-panel-head strong {
  font-size: 13px;
}
.sidebar-panel-head span {
  color: var(--muted);
  font-size: 12px;
}
.sidebar-check-list {
  display: grid;
  gap: 8px;
}
.account-sidebar-filter .sidebar-check-list {
  max-height: calc(100vh - 390px);
  overflow: auto;
  padding-right: 2px;
}
.sidebar-check-group {
  display: grid;
  gap: 7px;
  border: 0;
  margin: 0;
  padding: 0;
}
.sidebar-check-group + .sidebar-check-group {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 2px;
}
.sidebar-check-group legend {
  padding: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sidebar-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.sidebar-check input {
  width: auto;
  margin-top: 2px;
}
.sidebar-account-link {
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  text-decoration: none;
  line-height: 1.22;
}
.sidebar-account-link:hover,
.sidebar-account-link:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sidebar-check b {
  grid-column: 2;
  color: var(--faint);
  font-size: 10px;
  line-height: 1;
  font-weight: 850;
}
.main {
  width: 100%;
  padding: 28px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
}
.calendar-nav {
  display: flex;
  align-items: end;
  gap: 8px;
}
.calendar-head {
  align-items: center;
  margin-bottom: 10px;
}
.calendar-head > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.calendar-head .eyebrow {
  margin: 0;
  font-size: 10px;
}
.calendar-head h1 {
  font-size: 34px;
}
.calendar-head .calendar-nav {
  align-items: center;
  gap: 6px;
}
.calendar-head .calendar-nav label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}
.calendar-head .calendar-nav select {
  min-width: 104px;
  padding: 7px 9px;
}
.calendar-head .today-link {
  height: 34px;
  padding-inline: 11px;
}
.calendar-head .icon-nav {
  width: 34px;
  height: 34px;
  font-size: 24px;
}
.today-mode-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  margin: 0;
  background: var(--surface);
}
.today-mode-switch button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 850;
  padding: 4px 5px;
  white-space: nowrap;
}
.today-mode-switch button.active {
  background: var(--accent);
  color: #fff;
}
.calendar-nav label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.calendar-nav select {
  min-width: 112px;
  padding: 9px 10px;
}
.today-link {
  display: inline-flex;
  align-items: center;
  height: 40px;
}
.icon-nav {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 28px;
  line-height: 1;
  font-weight: 850;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .14em;
}
h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}
h2, h3, p { margin-top: 0; }
.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.button.small {
  padding: 8px 10px;
  font-size: 12px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.budget-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.budget-create-panel,
.budget-list-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}
.budget-create-panel h2,
.budget-list-panel h2 {
  margin: 0;
}
.budget-create-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.budget-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.budget-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px 90px 70px 120px 120px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.budget-row:first-child {
  border-top: 0;
}
.budget-row strong {
  color: var(--text);
}
.budget-row b {
  font-variant-numeric: tabular-nums;
}
.budget-row-head {
  background: var(--surface-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.field-hint {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
}
.metric, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.metric {
  padding: 18px;
  min-height: 158px;
}
.metric p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.metric strong {
  display: block;
  font-size: 32px;
  line-height: 1;
}
.metric span {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.widget-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(210px, 1fr));
  grid-auto-rows: 8px;
  grid-auto-flow: dense;
  gap: 18px;
  align-items: start;
}
.widget-board.masonry-ready {
  position: relative;
  display: block;
}
.widget-board.masonry-ready > .dashboard-widget {
  position: absolute;
  left: var(--masonry-left);
  top: var(--masonry-top);
  width: var(--masonry-width);
}
.widget-board.masonry-ready > .column-add-widget {
  position: absolute;
  left: var(--masonry-left);
  top: var(--masonry-top);
}
.hero-graph-panel {
  min-height: 340px;
  margin-bottom: 16px;
  padding: 22px 24px 18px;
  overflow: hidden;
  text-align: left;
}
.hero-graph-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
}
.hero-graph-panel header p,
.hero-graph-panel header span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero-graph-panel header h1 {
  margin: 4px 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}
.badge-strip-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.badge-strip {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: thin;
}
.dashboard-badge,
.badge-add-button {
  flex: 0 0 auto;
  min-width: 178px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
}
.dashboard-badge span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}
.dashboard-badge strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.05;
}
.dashboard-badge small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-badge.positive strong { color: var(--positive); }
.dashboard-badge.negative strong { color: var(--negative); }
.dashboard-badge:hover {
  background: #f8f5ff;
}
.badge-add-button {
  display: grid;
  place-items: center;
  min-width: 58px;
  color: var(--accent);
  font-size: 24px;
  font-weight: 760;
}
.dashboard-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.widget-column {
  display: contents;
}
.widget-stack {
  display: contents;
}
.dashboard-widget {
  grid-column: var(--widget-column) / span var(--widget-span, 1);
  grid-row: span var(--row-span, 36);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 292px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 36px 12px 18px;
  text-align: center;
}
.dashboard-widget.dragging {
  opacity: .48;
}
.dashboard-widget.transactions {
  min-height: 560px;
  align-content: start;
}
.dashboard-widget.graph {
  min-height: 260px;
  align-content: start;
}
.hero-graph-panel.dashboard-widget.graph {
  min-height: 340px;
}
.dashboard-widget.text {
  justify-items: start;
  min-height: 126px;
  padding: 24px 14px 18px;
  border-color: rgba(60, 52, 28, .12);
  text-align: left;
}
.dashboard-widget.text-lemon { background: #fff19d; }
.dashboard-widget.text-mint { background: #d9f4dc; }
.dashboard-widget.text-sky { background: #d9ecff; }
.dashboard-widget.text-blush { background: #ffdce5; }
.dashboard-widget.text-lavender { background: #eadfff; }
.dashboard-widget.text-peach { background: #ffe1c7; }
.widget-text-content {
  display: grid;
  gap: 8px;
  align-self: end;
  width: 100%;
}
.widget-text-content h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}
.widget-text-content p {
  margin: 0;
  color: rgba(27, 31, 38, .68);
  font-size: 13px;
  line-height: 1.35;
}
.widget-config-button {
  position: absolute;
  top: 9px;
  right: 9px;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}
.widget-drag-handle {
  position: absolute;
  top: 9px;
  left: 9px;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  cursor: grab;
  font-size: 16px;
  line-height: 1;
}
.widget-drag-handle:active {
  cursor: grabbing;
}
.widget-drag-handle:hover {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, .72);
}
.widget-config-button:hover {
  border-color: var(--line);
  color: var(--text);
}
.button.danger {
  color: var(--negative);
}
.button.danger.ghost {
  margin-right: auto;
  border-color: rgba(239, 68, 68, .22);
  background: #fff5f5;
}
.widget-drop-zone {
  min-height: 10px;
  border-radius: 999px;
  transition: min-height .12s ease, background .12s ease, box-shadow .12s ease;
}
.widget-drop-zone.active {
  min-height: 26px;
  background: rgba(108, 92, 231, .12);
  box-shadow: inset 0 0 0 2px rgba(108, 92, 231, .42);
}
.column-add-widget {
  grid-column: var(--widget-column) / span var(--widget-span, 1);
  grid-row: span var(--row-span, 6);
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  justify-self: center;
  margin: 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  font-weight: 760;
}
.column-add-widget:hover {
  transform: translateY(-1px);
  border-color: rgba(108, 92, 231, .42);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
}
.dashboard-widget h2 {
  max-width: 100%;
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
}
.widget-date,
.widget-more {
  margin: 0;
  color: #65007a;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}
.widget-more { color: var(--text); }
.widget-total {
  align-self: end;
  display: grid;
  gap: 18px;
  padding-bottom: 28px;
}
.widget-total span {
  color: var(--positive);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}
.dashboard-widget.negative .widget-total span,
.dashboard-widget.negative .widget-total strong {
  color: var(--negative);
}
.widget-total strong {
  color: var(--positive);
  font-size: 30px;
  font-weight: 450;
  line-height: 1;
}
.widget-math {
  align-self: stretch;
  display: grid;
  gap: 12px;
  width: 100%;
  padding-top: 10px;
}
.widget-math > span {
  color: var(--positive);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}
.widget-math > strong {
  color: var(--positive);
  font-size: 30px;
  font-weight: 450;
  line-height: 1;
}
.dashboard-widget.negative .widget-math > span,
.dashboard-widget.negative .widget-math > strong {
  color: var(--negative);
}
.math-formula-preview {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
}
.math-formula-preview div {
  display: flex;
  gap: 5px;
  align-items: baseline;
}
.math-formula-preview b {
  color: var(--accent);
}
.math-formula-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.math-formula-preview small {
  color: var(--text);
  font-weight: 720;
}
.widget-graph-card {
  width: 100%;
  align-self: stretch;
}
.graph-svg {
  display: block;
  width: 100%;
  height: 210px;
  overflow: visible;
}
.graph-line-wrap {
  display: grid;
  width: 100%;
  gap: 5px;
}
.graph-line-wrap.with-axes {
  grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
  align-items: stretch;
}
.graph-line-wrap.with-axes .graph-svg {
  grid-column: 2;
}
.graph-y-axis {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.graph-x-axis {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}
.graph-area-legend {
  grid-column: 1 / -1;
  margin-top: 2px;
}
.graph-line-wrap.with-axes .graph-area-legend {
  grid-column: 2;
}
.dashboard-widget.graph .graph-svg {
  height: 170px;
}
.graph-hover-point {
  fill: transparent;
  stroke: transparent;
  cursor: crosshair;
  pointer-events: all;
}
.graph-hover-point:hover {
  fill: rgba(37, 99, 235, .22);
  stroke: #2563eb;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.graph-pie-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: 10px;
  width: 100%;
}
.graph-pie {
  width: 100%;
  max-width: 128px;
  transform: rotate(-90deg);
}
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
  font-size: 11px;
}
.graph-legend span {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: min(100%, 168px);
  max-width: 100%;
}
.graph-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}
.graph-legend b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.widget-account-list,
.widget-transaction-list {
  display: grid;
  width: 100%;
  text-align: left;
}
.widget-account-row,
.widget-transaction-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 12px;
}
.widget-account-row strong,
.widget-transaction-row strong {
  display: block;
  overflow: hidden;
  color: #5d087b;
  text-overflow: ellipsis;
}
.widget-account-row small {
  color: var(--positive);
  font-weight: 760;
}
.widget-account-row b,
.widget-transaction-row b {
  color: #00158c;
  font-variant-numeric: tabular-nums;
}
.widget-account-row time {
  grid-column: 3;
  color: var(--muted);
}
.account-dot {
  width: 12px;
  height: 12px;
  margin-top: 2px;
  border-radius: 999px;
  background: #139f78;
}
.widget-account-list footer,
.widget-transaction-list footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  font-size: 12px;
}
.widget-transaction-row {
  grid-template-columns: 56px minmax(0, 1fr) auto;
}
.widget-transaction-row span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}
.widget-transaction-row b.negative {
  color: var(--negative);
}
.widget-dialog {
  width: min(860px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(17, 17, 17, .26);
  padding: 0;
}
.widget-dialog::backdrop {
  background: rgba(17, 17, 17, .36);
}
.widget-form {
  display: grid;
  grid-template-columns: minmax(250px, .8fr) minmax(320px, 1fr);
  gap: 16px 24px;
  padding: 18px;
}
.widget-form header,
.widget-form footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.widget-form label,
.widget-form fieldset {
  display: grid;
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.widget-form [hidden] {
  display: none;
}
.widget-text-fields {
  grid-row: span 3;
}
.widget-colour-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.widget-colour-option {
  border: 1px solid rgba(27, 31, 38, .12);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
}
.widget-colour-option input {
  width: auto;
}
.widget-account-picker {
  grid-row: span 3;
}
.widget-account-dual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.widget-account-dual section {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}
.widget-account-dual h3 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 10px;
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.widget-account-bucket {
  display: grid;
  align-content: start;
  min-height: 260px;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
}
.widget-account-bucket.empty::before {
  content: "Drop accounts here";
  color: var(--faint);
  font-size: 12px;
}
.widget-account-option {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  border-radius: 6px;
  margin-bottom: 6px;
  padding: 8px;
  background: var(--surface-soft);
  cursor: grab;
}
.widget-radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}
.widget-radio-group legend {
  grid-column: 1 / -1;
}
.widget-radio-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
}
.widget-radio-group label:has(input:checked) {
  border-color: var(--accent);
  background: #f4f1ff;
}
.widget-account-option:active {
  cursor: grabbing;
}
.widget-account-option span {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.widget-account-option b {
  color: var(--faint);
  font-size: 11px;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, .8fr);
  gap: 16px;
  margin-bottom: 16px;
}
.panel {
  padding: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-head h2 {
  margin: 0;
  font-size: 18px;
}
.panel-head span, .panel-head a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.source-list, .compact-list {
  display: grid;
  gap: 10px;
}
.sync-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow);
}
.sync-strip strong {
  color: var(--text);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .1em;
}
.sync-strip em {
  color: var(--negative);
  font-style: normal;
}
.selection-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.selection-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.selection-summary strong {
  display: block;
  font-size: 26px;
}
.selection-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.accounts-list {
  display: grid;
  gap: 14px;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.feed-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

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

.feed-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.feed-card p {
  margin: 0;
  color: var(--muted);
}

.feed-error {
  margin: 12px 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.feed-settings-list,
.feed-account-list,
.account-create-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.feed-settings-row,
.feed-account-row,
.account-create-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.feed-settings-row,
.feed-account-row,
.inline-link-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
}

.feed-settings-row span,
.feed-account-row span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.inline-link-form {
  grid-template-columns: minmax(180px, 1fr) 140px auto;
}

.account-settings {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.account-settings summary {
  cursor: pointer;
  font-weight: 700;
}

.account-settings-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.account-settings-form.compact {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.account-settings-form .replicate-notes,
.account-settings-form .replicate-actions {
  grid-column: 1 / -1;
}
.account-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}
.account-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.account-card h2 {
  margin: 0;
  font-size: 18px;
}
.account-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.account-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}
.account-meta div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}
.account-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.account-meta dd {
  margin: 6px 0 0;
  font-weight: 850;
}
.account-decision {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  margin-top: 12px;
}
.replicate-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-soft);
}
.replicate-form[hidden] {
  display: none;
}
.replicate-form-head,
.replicate-notes,
.replicate-actions {
  grid-column: 1 / -1;
}
.replicate-form-head {
  display: grid;
  gap: 4px;
}
.replicate-form-head span {
  color: var(--muted);
  font-size: 13px;
}
.replicate-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.replicate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.input-suffix b {
  color: var(--muted);
  font-size: 13px;
}
.replicate-form select,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
  font: inherit;
}
.transaction-account-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.transaction-account-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.transaction-account-list strong {
  color: var(--text);
}
.source-row, .compact-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.source-row div, .compact-row div {
  display: grid;
  gap: 4px;
}
.source-row span, .compact-row span, .source-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}
.accountant-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.accountant-preview article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
}
.status {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.status.steady { color: var(--positive); border-color: rgba(21,154,122,.25); }
.status.watch { color: #a86d00; border-color: rgba(168,109,0,.25); }
.status.replicated { color: #6f3fb5; border-color: rgba(111,63,181,.28); }
.status.ignored { color: var(--muted); border-color: rgba(112,106,96,.32); }
.calendar-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  height: calc(100vh - 118px);
  min-height: 560px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.weekday-row, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.weekday-row span {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}
.day-cell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
  padding: 8px 9px 7px;
  cursor: pointer;
}
.event-line:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.day-cell:nth-child(7n+1) { border-left: 0; }
.day-cell.muted-day { background: #eeeae3; color: var(--faint); }
.day-cell.today .day-number {
  background: var(--accent);
  color: #fff;
}
.day-cell.today {
  box-shadow: inset 0 0 0 2px var(--accent);
  z-index: 1;
}
.day-cell.actual-day {
  background-image: linear-gradient(180deg, rgba(21, 154, 122, .05), rgba(21, 154, 122, 0));
}
.day-cell.budget-day.today {
  background-image: linear-gradient(180deg, rgba(17, 17, 17, .05), rgba(17, 17, 17, 0));
}
.day-cell.best-guess-day.today {
  background-image: linear-gradient(180deg, rgba(168, 109, 0, .07), rgba(168, 109, 0, 0));
}
.day-number {
  justify-self: end;
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 850;
}
.day-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 6px;
  min-height: 18px;
}
.day-top .day-number {
  margin-left: auto;
  transform: translate(2px, -2px);
}
.day-events {
  display: grid;
  align-content: start;
  gap: 2px;
  margin-top: 1px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}
.event-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 10.5px;
  line-height: 1.18;
  font-weight: 520;
}
.event-line:hover i {
  color: var(--text);
}
.actual-line {
  cursor: default;
  font-size: 10.5px;
  font-weight: 500;
}
.actual-line:hover i {
  color: var(--muted);
}
.actual-line b {
  font-weight: 650;
}
.event-line b {
  font-weight: 650;
}
.remaining-divider {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.remaining-divider::before,
.remaining-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.event-line i {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}
.event-line small {
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
  font-size: 10px;
}
.closing-balance {
  justify-self: center;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.1;
  cursor: help;
  border-radius: 6px;
  padding: 1px 4px;
}
.closing-balance:hover,
.closing-balance:focus-visible {
  color: var(--text);
  outline: 2px solid rgba(17, 17, 17, .14);
}
.balance-tooltip,
.recurrence-tooltip {
  position: fixed;
  z-index: 30;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  color: #fff;
  box-shadow: 0 18px 46px rgba(17, 17, 17, .22);
  padding: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.balance-tooltip[data-visible="true"],
.recurrence-tooltip[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}
.balance-tooltip-head,
.balance-tooltip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}
.balance-tooltip-head {
  align-items: baseline;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}
.balance-tooltip-list {
  display: grid;
  gap: 7px;
  padding-top: 9px;
}
.balance-tooltip-row {
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
}
.balance-tooltip-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.balance-tooltip-row b,
.balance-tooltip-head b {
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.recurrence-tooltip {
  width: min(360px, calc(100vw - 24px));
}
.recurrence-tooltip-head {
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}
.recurrence-tooltip-list {
  display: grid;
  gap: 8px;
  padding-top: 9px;
}
.recurrence-tooltip-row {
  display: grid;
  grid-template-columns: minmax(86px, auto) auto;
  gap: 4px 12px;
  color: rgba(255, 255, 255, .84);
  font-size: 12px;
}
.recurrence-tooltip-row span,
.recurrence-tooltip-row b {
  color: #fff;
  font-weight: 760;
}
.recurrence-tooltip-row small {
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, .66);
  font-size: 11px;
}
.recurrence-tooltip-foot {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 760;
}
.budget-dialog {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.budget-form {
  display: grid;
  gap: 12px;
}
.budget-form header, .budget-form footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.budget-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.budget-form h2 { margin: 0; }
.budget-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.budget-category-field {
  position: relative;
}
.category-suggestions {
  position: absolute;
  z-index: 3;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}
.category-suggestions[hidden],
.category-create-hint[hidden] {
  display: none;
}
.category-suggestions button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  padding: 8px 9px;
  text-align: left;
}
.category-suggestions button:hover {
  background: var(--soft);
}
.category-create-hint {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}
.budget-radio-row,
.repeat-box,
.edit-scope-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.budget-radio-row {
  display: flex;
  gap: 14px;
  align-items: center;
}
.budget-radio-row legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.budget-radio-row label,
.repeat-box .check-row,
.edit-scope-box label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.budget-radio-row input,
.repeat-box input[type="checkbox"],
.repeat-box input[type="radio"],
.edit-scope-box input[type="radio"] {
  width: auto;
}
.repeat-box {
  display: grid;
  gap: 10px;
}
.edit-scope-box {
  display: grid;
  gap: 8px;
  background: var(--surface-soft);
}
.edit-scope-box[hidden] {
  display: none;
}
.edit-scope-box legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.edit-scope-box label {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}
.button.danger {
  border-color: rgba(216, 93, 98, .35);
  color: var(--negative);
}
.button.danger:hover {
  background: rgba(216, 93, 98, .1);
}
.repeat-fields {
  display: grid;
  grid-template-columns: minmax(90px, .7fr) minmax(120px, 1fr) minmax(150px, 1fr);
  gap: 10px;
}
.repeat-fields[hidden] {
  display: none;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}
.icon-button {
  border: 0;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.report-copy {
  color: var(--muted);
  line-height: 1.55;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
}
.report-table th, .report-table td {
  border-top: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  color: var(--muted);
  font-size: 13px;
}
.report-table th {
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
}
@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
  }
  .nav { display: flex; flex-wrap: wrap; }
  .calendar-head {
    align-items: flex-start;
  }
  .calendar-head,
  .calendar-head > div,
  .calendar-head .calendar-nav {
    flex-wrap: wrap;
  }
  .widget-board {
    grid-template-columns: 1fr;
  }
  .widget-board.masonry-ready {
    display: grid;
    height: auto !important;
  }
  .widget-board.masonry-ready > .dashboard-widget,
  .widget-board.masonry-ready > .column-add-widget {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
  }
  .dashboard-widget,
  .widget-drop-zone,
  .column-add-widget {
    grid-column: auto;
  }
  .widget-form {
    grid-template-columns: 1fr;
  }
  .widget-account-dual {
    grid-template-columns: 1fr;
  }
  .metric-grid, .content-grid, .accountant-preview, .report-grid, .budget-layout { grid-template-columns: 1fr; }
  .budget-table {
    overflow-x: auto;
  }
  .budget-row {
    min-width: 760px;
  }
  .account-meta, .selection-summary, .account-decision, .replicate-form { grid-template-columns: 1fr; }
  .calendar-grid, .weekday-row { min-width: 980px; }
  .calendar-shell {
    height: auto;
    min-height: 0;
    overflow-x: auto;
  }
  .day-cell {
    min-height: 142px;
  }
}

/* Minta design system layer. See docs/design-system.md. */
.main {
  padding: 30px 34px;
}
.page-head h1 {
  color: var(--text);
  font-size: 32px;
  font-weight: 850;
  letter-spacing: 0;
}
.eyebrow {
  color: var(--accent);
  letter-spacing: .08em;
}
.button {
  min-height: 40px;
  border-radius: var(--radius-sm);
  border-color: #d8dee8;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.button:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.button.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 22px rgba(108, 92, 231, .22);
}
.button.danger {
  border-color: rgba(239, 68, 68, .25);
  color: var(--negative);
}
.button.danger:hover {
  background: rgba(239, 68, 68, .08);
}
.panel,
.metric,
.dashboard-widget,
.account-card,
.feed-card,
.feed-settings-row,
.feed-account-row,
.account-create-panel,
.budget-create-panel,
.budget-list-panel,
.selection-summary div,
.sync-strip {
  border-radius: var(--radius-md);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.dashboard-widget {
  padding: 28px 16px 18px;
}
.dashboard-widget.text {
  min-height: 112px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.widget-config-button {
  color: var(--muted);
}
.widget-config-button:hover {
  background: #f1f5f9;
  color: var(--text);
}
.dashboard-widget h2,
.account-card h2,
.feed-card h2,
.budget-create-panel h2,
.budget-list-panel h2 {
  color: var(--text);
  font-weight: 820;
}
.widget-more,
.panel-head a {
  color: var(--accent);
}
.widget-account-row strong,
.widget-transaction-row strong {
  color: var(--text);
}
.widget-account-row b,
.widget-transaction-row b {
  color: var(--info);
}
input,
textarea,
select {
  min-height: 44px;
  border-radius: var(--radius-sm);
  border-color: #d8dee8;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 560;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, .02);
}
textarea {
  min-height: 92px;
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(108, 92, 231, .14);
}
label,
.budget-create-panel label,
.account-settings-form label,
.replicate-form label,
.widget-form label,
.widget-form fieldset,
.budget-form label,
.budget-form fieldset {
  color: #475569;
  font-size: 12px;
  font-weight: 780;
}
dialog {
  border: 0;
}
.budget-dialog,
.widget-dialog,
.scope-dialog {
  width: min(860px, calc(100vw - 36px));
  max-height: min(900px, calc(100vh - 36px));
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
  padding: 0;
  overflow: hidden;
}
.scope-dialog {
  width: min(560px, calc(100vw - 36px));
}
.budget-dialog::backdrop,
.widget-dialog::backdrop,
.scope-dialog::backdrop {
  background: rgba(15, 23, 42, .36);
  backdrop-filter: blur(8px);
}
.budget-form,
.widget-form,
.scope-form {
  display: grid;
  gap: 18px 26px;
  max-height: inherit;
  overflow: auto;
  padding: 30px 36px 0;
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.budget-form,
.widget-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.budget-form header,
.widget-form header,
.scope-form header {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.budget-form header h2,
.widget-form header h2,
.scope-form header h2 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.08;
  font-weight: 880;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 26px;
}
.icon-button:hover {
  background: #f1f5f9;
  color: var(--text);
}
.budget-form footer,
.widget-form footer,
.scope-form footer {
  position: sticky;
  bottom: 0;
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin: 8px -36px 0;
  padding: 18px 36px 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
}
.budget-footer-actions {
  display: flex;
  gap: 12px;
}
.budget-category-field,
.replicate-notes,
.widget-text-fields,
.widget-account-picker,
.widget-math-fields {
  grid-column: 1 / -1;
}
.math-step-list {
  display: grid;
  gap: 8px;
}
.math-step-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(120px, 1fr) minmax(92px, .7fr) minmax(88px, .65fr) 34px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.math-step-row label {
  display: grid;
  gap: 5px;
}
.modal-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
}
.modal-chips[hidden] {
  display: none;
}
.modal-chips span {
  border-radius: 999px;
  background: #eef4ff;
  color: #475569;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 650;
}
.segmented-control {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #d8dee8;
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0;
  background: var(--surface);
}
.segmented-control legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}
.segmented-control label {
  display: grid;
  place-items: center;
  min-height: 52px;
  border-left: 1px solid var(--line);
  cursor: pointer;
  color: #334155;
  font-size: 15px;
  font-weight: 680;
}
.segmented-control label:first-of-type {
  border-left: 0;
}
.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented-control label:has(input:checked) {
  background: #f4f1ff;
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.repeat-box {
  grid-column: 1 / -1;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(37, 99, 235, .05), rgba(37, 99, 235, .02));
  padding: 16px 18px;
}
.repeat-fields {
  grid-template-columns: minmax(120px, .7fr) minmax(170px, 1fr) minmax(220px, 1.2fr);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-row input,
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}
.choice-list {
  display: grid;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0;
}
.choice-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  background: var(--surface);
}
.choice-list label:has(input:checked) {
  border-color: var(--accent);
  background: #f4f1ff;
}
.choice-list b {
  display: block;
  color: var(--text);
  font-size: 14px;
}
.choice-list small,
.scope-copy {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.callout,
.feed-error,
.category-create-hint {
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  background: #eff6ff;
  color: #1e40af;
  padding: 12px 14px;
  font-size: 13px;
}
.callout.success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.callout.warning { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }
.callout.danger,
.feed-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.widget-colour-options {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.widget-colour-option {
  position: relative;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
}
.widget-colour-option::before {
  content: "";
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.widget-colour-option.text-lemon::before { background: #fff19d; }
.widget-colour-option.text-mint::before { background: #d9f4dc; }
.widget-colour-option.text-sky::before { background: #d9ecff; }
.widget-colour-option.text-blush::before { background: #ffdce5; }
.widget-colour-option.text-lavender::before { background: #eadfff; }
.widget-colour-option.text-peach::before { background: #ffe1c7; }
.widget-colour-option input {
  position: absolute;
  opacity: 0;
}
.widget-colour-option:has(input:checked) {
  border-color: var(--accent);
  background: #f4f1ff;
}
.widget-account-dual section {
  border-radius: var(--radius-md);
  overflow: hidden;
}
.widget-account-option {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.account-settings {
  border-top: 0;
}
.account-settings summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-top: 14px;
  padding: 8px 12px;
  color: var(--accent);
  font-size: 13px;
}
.account-settings-form,
.account-settings-form.compact,
.replicate-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}
.account-settings-form,
.replicate-form {
  border-radius: var(--radius-md);
  padding: 16px;
  background: #fbfdff;
}
.account-meta div {
  border-radius: var(--radius-md);
  background: #f8fafc;
}
.account-decision {
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
}
.feed-settings-row,
.feed-account-row,
.inline-link-form {
  border-radius: var(--radius-md);
}
.feed-card form,
.feed-settings-row,
.feed-account-row {
  align-items: center;
}
.budget-row {
  background: var(--surface);
}
.budget-row-head {
  background: #f8fafc;
}
@media (max-width: 980px) {
  .budget-form,
  .widget-form,
  .account-settings-form,
  .account-settings-form.compact,
  .replicate-form {
    grid-template-columns: 1fr;
  }
  .widget-colour-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .repeat-fields,
  .segmented-control,
  .math-step-row {
    grid-template-columns: 1fr;
  }
}

/* Petite setup windows: final cascade guard. */
.budget-dialog { width: min(660px, calc(100vw - 28px)); max-height: min(720px, calc(100vh - 28px)); border-radius: 18px; }
.widget-dialog { width: min(700px, calc(100vw - 28px)); max-height: min(700px, calc(100vh - 28px)); border-radius: 18px; }
.scope-dialog { width: min(440px, calc(100vw - 28px)); border-radius: 18px; }
.budget-form, .widget-form, .scope-form { gap: 11px 16px; padding: 22px 26px 0; }
.budget-form header h2, .widget-form header h2, .scope-form header h2 { font-size: 24px; }
.budget-form footer, .widget-form footer, .scope-form footer { margin: 4px -26px 0; padding: 12px 26px 16px; }
.budget-form input, .budget-form textarea, .budget-form select,
.widget-form input, .widget-form textarea, .widget-form select,
.scope-form input, .scope-form textarea, .scope-form select { min-height: 38px; padding: 8px 10px; font-size: 13px; }
.budget-form textarea, .widget-form textarea { min-height: 72px; }
.segmented-control label { min-height: 38px; font-size: 13px; }
.repeat-box { padding: 9px 10px; }
.repeat-fields { grid-template-columns: minmax(70px, .55fr) minmax(120px, .85fr) minmax(160px, 1fr); gap: 8px; }
.widget-account-bucket { min-height: 168px; max-height: 245px; }
.widget-colour-option::before { width: 28px; height: 28px; }

.forecast-choice-grid {
  display: grid;
  gap: 8px;
}
.forecast-choice {
  display: grid;
  grid-template-columns: 18px minmax(74px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.forecast-choice:has(input[type="radio"]:checked) {
  border-color: rgba(108, 92, 231, .55);
  background: #f7f4ff;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, .1);
}
.forecast-choice > input[type="radio"] {
  margin: 0;
}
.forecast-choice > span {
  color: var(--text);
  font-weight: 760;
}
.forecast-choice input[type="date"],
.forecast-choice input[type="number"],
.forecast-choice select {
  min-height: 34px;
  padding: 6px 8px;
}
.forecast-choice input[type="number"] {
  max-width: 88px;
}
.forecast-choice:has([value="relative"]) {
  grid-template-columns: 18px auto 88px minmax(116px, 1fr);
}

/* Dashboard widget rows: compact, readable, and linkable. */
.widget-account-row,
.widget-transaction-row {
  padding: 8px 0;
  gap: 4px 7px;
  font-size: 11px;
  line-height: 1.22;
}
.widget-account-row {
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}
.widget-account-row:hover {
  background: #f8fafc;
}
.widget-account-row strong,
.widget-transaction-row strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}
.widget-account-row small,
.widget-account-row time,
.widget-transaction-row span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 520;
  text-transform: none;
  letter-spacing: 0;
}
.widget-account-row b,
.widget-transaction-row b {
  font-size: 11px;
  font-weight: 620;
}
.widget-transaction-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}
.widget-account-list footer,
.widget-transaction-list footer {
  padding-top: 10px;
  font-size: 11px;
}
