* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --text: #101828;
  --muted: #667085;
  --border: rgba(148, 163, 184, 0.18);
  --primary: #2BB673;
  --primary-soft: #E6F7F0;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body.app-booting #authGate {
  display: none !important;
}

.app {
  max-width: 640px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 90px;
}

.auth-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-locked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.app-unlocked {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loading-state {
  opacity: 0.72;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(43, 182, 115, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(247, 249, 252, 0.98) 0%, rgba(243, 245, 248, 1) 100%);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.auth-gate.auth-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-gate.auth-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-gate-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(24px, calc(20px + env(safe-area-inset-top)))
    18px
    max(24px, calc(20px + env(safe-area-inset-bottom)));
}

.auth-card {
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.1);
  padding: 24px 20px 20px;
  display: grid;
  gap: 18px;
  backdrop-filter: blur(14px);
}

.auth-subview {
  display: grid;
  gap: 18px;
}

.auth-subview-active {
  opacity: 1;
  visibility: visible;
}

.auth-subview-hidden {
  opacity: 0;
  visibility: hidden;
}

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

.auth-brand {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.auth-logo {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(43, 182, 115, 0.12) 0%, rgba(43, 182, 115, 0.08) 100%);
}

.auth-brand h1 {
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.auth-brand p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  max-width: 28ch;
}

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

.app-version-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.68;
}

.auth-version-note {
  margin-top: 12px;
  text-align: center;
}

.auth-secondary-link {
  justify-self: end;
  margin-top: -4px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.auth-secondary-link:hover {
  color: var(--primary);
}

.auth-secondary-link-left {
  justify-self: start;
}

.auth-helper-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(43, 182, 115, 0.08);
  border: 1px solid rgba(43, 182, 115, 0.12);
}

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

.settings-readonly-input {
  color: var(--muted);
  background: #f8fafc;
}

.settings-status {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.settings-status.is-success {
  background: var(--success-soft);
  color: #166534;
}

.settings-status.is-error {
  background: var(--danger-soft);
  color: var(--danger);
  white-space: pre-line;
}

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

.auth-field span {
  font-size: 14px;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
  padding: 0 16px;
  font-size: 16px;
  color: var(--text);
}

.auth-field input:focus {
  outline: 2px solid rgba(43, 182, 115, 0.2);
  border-color: rgba(43, 182, 115, 0.42);
}

.auth-submit-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-login-btn {
  gap: 10px;
  white-space: nowrap;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.auth-login-button-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-login-button-icon > [hidden] {
  display: none !important;
}

.auth-login-button-label {
  min-width: 13ch;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
}

.auth-status {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.auth-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 2px solid rgba(43, 182, 115, 0.18);
  border-top-color: var(--primary);
  animation: auth-spin 0.8s linear infinite;
}

.auth-button-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.34);
  border-top-color: #ffffff;
}

.auth-login-button-success-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-login-button-success-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-login-btn.is-success {
  background: linear-gradient(180deg, #1fa971 0%, #168d5c 100%);
  box-shadow: 0 10px 24px rgba(22, 141, 92, 0.18);
}

.auth-login-btn.is-success:hover,
.auth-login-btn.is-success:active {
  background: linear-gradient(180deg, #1b9765 0%, #12764d 100%);
}

.auth-login-btn.is-success:disabled {
  opacity: 1;
}

.auth-error {
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-line;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.logout-menu-link {
  margin-bottom: 14px;
  background: #fff5f5;
  border-color: rgba(220, 38, 38, 0.14);
  color: #991b1b;
  justify-content: center;
}

.logout-menu-link.is-loading:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.logout-menu-link .menu-link-icon,
.logout-menu-link .menu-link-state-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.logout-button-label {
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
}

.logout-button-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-width: 2px;
  border-color: rgba(153, 27, 27, 0.35);
  border-top-color: #991b1b;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  background: rgba(244, 246, 249, 0.96);
  backdrop-filter: blur(10px);
}

.brand-area,
.menu-area {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  border-radius: 14px;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.logo-mark {
  width: 26px;
  height: 28px;
  display: block;
  color: var(--primary);
}

.logo-mark rect {
  fill: currentColor;
}

.logo:active .logo-mark {
  color: #23965E;
}

.logo:active {
  background: rgba(43, 182, 115, 0.12);
  transform: scale(0.96);
}

.month-switcher {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 6px;
  box-shadow: var(--shadow);
}

.topbar-hint {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(43, 182, 115, 0.08);
  border: 1px solid rgba(43, 182, 115, 0.12);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.topbar-hint-close {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  opacity: 0.8;
}

.topbar-hint-close:active {
  transform: scale(0.96);
}

.month-display {
  text-align: center;
  font-weight: 700;
  font-size: 16px;
}

.month-display-button {
  min-width: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0 8px;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.month-display-button:active {
  transform: scale(0.985);
  opacity: 0.9;
}

.month-display-button.is-year-view {
  color: var(--text);
}

.month-display-chevron {
  font-size: 13px;
  color: var(--muted);
  line-height: 1;
  opacity: 0.8;
  transition: transform 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.month-display-button.is-year-view .month-display-chevron {
  color: var(--muted);
  opacity: 0.8;
  transform: translateX(1px);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 0;
}

.menu-toggle-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 14px;
  transition: background-color 0.16s ease, transform 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle-btn:active {
  background: rgba(43, 182, 115, 0.12);
  transform: scale(0.96);
}

.menu-toggle-btn[aria-expanded="true"] {
  background: transparent;
  transform: none;
}

.menu-toggle-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.side-menu-header .icon-btn,
.menu-link {
  -webkit-tap-highlight-color: transparent;
}

.side-menu-header .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.side-menu-header .icon-btn:active,
.menu-link:active {
  background: rgba(43, 182, 115, 0.12);
  transform: scale(0.96);
}

.icon-btn:active {
  transform: scale(0.98);
}

main {
  flex: 1;
  padding: 10px 16px 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

.section-head p {
  color: var(--muted);
  font-size: 14px;
}

.summary {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(54, 169, 138, 0.06), transparent 24%),
    linear-gradient(180deg, #fdfefe 0%, #f7f9fc 100%);
}

.hero-card-shell {
  padding: 24px;
  min-width: 0;
}

.hero-layout {
  display: grid;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.hero-layout-both {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: start;
  min-height: 220px;
}

.hero-layout--spending {
  align-items: center;
}

.hero-layout--budget {
  align-items: start;
}

.hero-layout-budget .hero-panel-budget {
  padding: 14px;
  min-height: 164px;
}

.hero-layout-breakdown .hero-panel-breakdown {
  padding: 16px;
}

.hero-layout-both .hero-panel-budget {
  padding: 14px 10px 10px 14px;
}

.hero-layout-both .hero-panel-breakdown {
  padding: 14px 14px 10px 10px;
}

.hero-panel {
  position: relative;
  min-height: 100%;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: none;
  min-width: 0;
}

.hero-panel-budget {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px 10px 10px 14px;
  align-content: start;
  justify-content: start;
}

.hero-layout--spending .hero-panel-budget {
  align-content: center;
}

.hero-layout--budget .hero-panel-budget {
  align-content: start;
}

.hero-panel-breakdown {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: center;
  min-width: 0;
  padding: 14px 14px 10px 10px;
}

.hero-panel-empty {
  align-items: end;
  min-height: 132px;
}

.hero-eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hero-panel h3 {
  color: #334155;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.hero-panel-budget h3,
.hero-panel-budget .hero-amount,
.hero-panel-budget .hero-budget-meta,
.hero-panel-budget .hero-budget-percentage,
.hero-panel-budget .hero-footnote,
.hero-panel-budget .hero-empty-copy {
  padding-inline: 4px;
}

.hero-panel-breakdown .hero-breakdown-empty,
.hero-panel-breakdown .hero-legend {
  width: 100%;
  padding-inline: 4px;
}

.hero-layout-breakdown .hero-breakdown-chart,
.hero-layout-breakdown .hero-legend,
.hero-layout-breakdown .hero-breakdown-empty {
  padding-inline: 10px;
}

.hero-amount {
  font-size: clamp(23px, 5.8vw, 34px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.hero-budget-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  min-width: 0;
}

.hero-budget-meta-compact {
  display: grid;
  gap: 3px;
}

.hero-budget-meta-compact span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.hero-summary-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.hero-summary-group {
  display: grid;
  gap: 8px;
}

.hero-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.hero-summary-row strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.hero-summary-row-emphasis {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--text);
  font-weight: 700;
}

.hero-summary-row-emphasis strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-summary-row-emphasis.is-positive strong {
  color: var(--success);
}

.hero-summary-row-emphasis.is-negative strong {
  color: var(--danger);
}

.hero-budget-percentage {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.hero-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.hero-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2BB673 0%, #23965E 100%);
  box-shadow: 0 4px 12px rgba(43, 182, 115, 0.22);
}

.hero-footnote,
.hero-empty-copy {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  opacity: 0.86;
}

.hero-breakdown-chart {
  display: grid;
  gap: 8px;
  width: 100%;
  justify-items: center;
}

.hero-donut-wrap {
  position: relative;
  width: min(116px, 100%);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
  cursor: default;
}

.hero-donut-click-target {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  cursor: default;
}

.touchable {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  -webkit-tap-highlight-color: transparent;
}

.touchable::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}

.touchable:active::after {
  opacity: 1;
}

.touchable--circle {
  border-radius: 50%;
}

.hero-layout-breakdown .hero-donut-wrap {
  width: min(220px, 100%);
}

.hero-layout-both .hero-donut-wrap {
  width: min(154px, 100%);
}

#dashboardHeroCard .hero-card-shell {
  padding: 20px;
}

#dashboardHeroCard .hero-layout-both {
  gap: 10px;
  grid-template-columns: minmax(0, 0.66fr) minmax(0, 1.34fr);
  align-items: start;
}

#dashboardHeroCard .dashboard-hero-row {
  align-items: start;
}

#dashboardHeroCard .dashboard-hero-row .hero-panel-budget,
#dashboardHeroCard .dashboard-hero-row .hero-panel-breakdown {
  align-self: start;
}

#dashboardHeroCard .dashboard-hero-row .hero-panel-budget {
  align-content: start;
}

#dashboardHeroCard .dashboard-hero-row .hero-breakdown-chart {
  justify-items: center;
  align-content: start;
}

#dashboardHeroCard .dashboard-hero-row .hero-donut-wrap {
  margin-top: 0;
}

#dashboardHeroCard .dashboard-hero-row .hero-panel-budget,
#dashboardHeroCard .dashboard-hero-row .hero-panel-breakdown {
  padding: 0;
}

#dashboardHeroCard .dashboard-hero-row .hero-panel-budget {
  padding-top: 24px;
}

#dashboardHeroCard .hero-donut-wrap {
  width: min(236px, 100%);
}

#dashboardHeroCard .hero-donut-center strong {
  max-width: none;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: normal;
  white-space: nowrap;
}

#dashboardHeroCard .hero-donut-center {
  --dashboard-donut-meta-safe-width: clamp(60px, 9vw, 82px);
  gap: 3px;
  padding: 14px;
}

#dashboardHeroCard .hero-donut-center span,
#dashboardHeroCard .hero-donut-center-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  opacity: 0.92;
}

#dashboardHeroCard .hero-donut-center small,
#dashboardHeroCard .hero-donut-center-meta {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.78;
  display: block;
  width: min(var(--dashboard-donut-meta-safe-width), calc(100% - 10px));
  max-width: min(var(--dashboard-donut-meta-safe-width), calc(100% - 10px));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  margin-inline: auto;
}

#dashboardHeroCard .hero-panel-budget h3 {
  font-size: 16px;
  padding-inline: 0;
}

#dashboardHeroCard .hero-panel-budget .hero-amount {
  font-size: clamp(26px, 5vw, 36px);
  padding-inline: 0;
}

#dashboardHeroCard .hero-panel-budget .hero-budget-meta {
  font-size: 12px;
  line-height: 1.35;
  padding-inline: 0;
}

#dashboardHeroCard .hero-panel-budget,
#yearSummaryHeroCard .hero-panel-budget {
  gap: 14px;
}

.hero-summary-stack {
  display: grid;
  gap: 14px;
  width: 100%;
}

.hero-summary-block {
  display: grid;
  gap: 5px;
  min-width: 0;
  justify-items: start;
}

.hero-summary-heading {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.hero-summary-value {
  display: block;
  color: var(--text);
  font-size: clamp(18px, 3.4vw, 24px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 750;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.hero-summary-block-primary .hero-summary-value {
  font-size: clamp(24px, 4.4vw, 33px);
  font-weight: 800;
}

.hero-summary-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.hero-summary-meta span {
  display: block;
}

.hero-summary-meta-line {
  display: block;
}

.hero-summary-meta-line .hero-summary-meta-label-long {
  display: inline;
}

.hero-summary-meta-line .hero-summary-meta-label-short {
  display: none;
}

#dashboardHeroCard .dashboard-hero-summary-stack {
  gap: 14px;
}

#dashboardHeroCard .dashboard-hero-summary-block {
  gap: 5px;
}

#dashboardHeroCard .dashboard-hero-summary-meta {
  display: grid;
  gap: 4px;
  padding-top: 2px;
}

#dashboardHeroCard .dashboard-hero-summary-heading {
  color: var(--text);
}

#dashboardHeroCard .dashboard-hero-summary-value {
  color: var(--text);
}

#dashboardHeroCard .dashboard-hero-summary-block-primary .dashboard-hero-summary-value {
  font-size: clamp(24px, 4.4vw, 33px);
}

#dashboardHeroCard .dashboard-hero-balance-block:not(.dashboard-hero-summary-block-primary) .dashboard-hero-summary-value {
  font-size: clamp(18px, 3.4vw, 24px);
  font-weight: 750;
}

#dashboardHeroCard .dashboard-hero-balance-block.is-positive .dashboard-hero-summary-value {
  color: var(--text);
}

#dashboardHeroCard .dashboard-hero-balance-block.is-negative .dashboard-hero-summary-value {
  color: var(--text);
}

#dashboardHeroCard .month-budget-hero-block-primary .month-budget-hero-value {
  font-size: clamp(24px, 4.4vw, 33px);
}

#dashboardHeroCard .month-budget-hero-value-positive {
  color: var(--text);
}

#dashboardHeroCard .month-budget-hero-value-negative {
  color: var(--text);
}

#dashboardHeroCard .month-budget-hero-meta {
  display: grid;
  gap: 4px;
  padding-top: 2px;
}

#dashboardHeroCard .hero-breakdown-chart {
  gap: 2px;
}

#dashboardHeroCard .hero-panel-breakdown .hero-legend {
  padding-inline: 0;
}

#dashboardHeroCard .hero-legend {
  gap: 1px;
}

#yearSummaryHeroCard .hero-card-shell {
  display: grid;
  gap: 6px;
  padding: 20px;
}

#yearSummaryHeroCard .year-summary-hero-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 0;
}

#yearSummaryHeroCard .year-summary-scope-control {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: fit-content;
  max-width: fit-content;
  min-width: 0;
  gap: 0;
  padding: 1px;
  margin-bottom: 0;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 9999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

#yearSummaryHeroCard .year-summary-scope-control .segment-btn {
  position: relative;
  min-height: 19px;
  padding: 0 6px;
  font-size: 8.5px;
  line-height: 1;
  border-radius: 0;
  white-space: nowrap;
  letter-spacing: 0;
  flex: 0 0 auto;
}

#yearSummaryHeroCard .year-summary-scope-control .segment-btn:first-child {
  border-radius: 9999px 0 0 9999px;
}

#yearSummaryHeroCard .year-summary-scope-control .segment-btn:last-child {
  border-radius: 0 9999px 9999px 0;
}

#yearSummaryHeroCard .year-summary-scope-control .segment-btn + .segment-btn::before {
  display: none;
}

#yearSummaryHeroCard .year-summary-scope-control .segment-btn.active {
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
}

#yearSummaryHeroCard .hero-layout-both {
  gap: 10px;
  grid-template-columns: minmax(0, 0.66fr) minmax(0, 1.34fr);
  align-items: start;
}

#yearSummaryHeroCard .year-summary-hero-row {
  align-items: start;
}

#yearSummaryHeroCard .year-summary-hero-row .hero-panel-budget,
#yearSummaryHeroCard .year-summary-hero-row .hero-panel-breakdown {
  padding: 0;
  align-self: start;
}

#yearSummaryHeroCard .year-summary-hero-row .hero-panel-budget {
  align-content: start;
  padding-top: 24px;
}

#yearSummaryHeroCard .year-summary-hero-row .hero-breakdown-chart {
  justify-items: center;
  align-content: start;
}

#yearSummaryHeroCard .year-summary-hero-row .hero-donut-wrap {
  margin-top: 0;
}

#yearSummaryHeroCard .hero-donut-wrap {
  width: min(236px, 100%);
}

#yearSummaryHeroCard .hero-donut-center strong {
  max-width: none;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: normal;
  white-space: nowrap;
}

#yearSummaryHeroCard .hero-donut-center {
  --year-summary-donut-meta-safe-width: clamp(60px, 9vw, 82px);
  gap: 3px;
  padding: 14px;
}

#yearSummaryHeroCard .hero-donut-center span,
#yearSummaryHeroCard .hero-donut-center-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  opacity: 0.92;
}

#yearSummaryHeroCard .hero-donut-center small,
#yearSummaryHeroCard .hero-donut-center-meta {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  opacity: 0.78;
  display: block;
  width: min(var(--year-summary-donut-meta-safe-width), calc(100% - 10px));
  max-width: min(var(--year-summary-donut-meta-safe-width), calc(100% - 10px));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  margin-inline: auto;
}

#yearSummaryHeroCard .hero-panel-budget .hero-budget-meta {
  font-size: 12px;
  line-height: 1.35;
  padding-inline: 0;
}

#yearSummaryHeroCard .year-summary-hero-metrics {
  grid-template-columns: 1fr;
  gap: 14px;
}

#yearSummaryHeroCard .year-summary-hero-metric {
  gap: 5px;
}

#yearSummaryHeroCard .year-summary-hero-metric-heading {
  color: var(--text);
}

#yearSummaryHeroCard .year-summary-hero-metric-value {
  color: var(--text);
  font-size: clamp(18px, 3.4vw, 24px);
}

#yearSummaryHeroCard .year-summary-hero-metric-primary .year-summary-hero-metric-value {
  font-size: clamp(24px, 4.4vw, 33px);
}

#yearSummaryHeroCard .year-summary-hero-metric:not(.year-summary-hero-metric-primary) .year-summary-hero-metric-value {
  color: var(--text);
  font-weight: 750;
}

#yearSummaryHeroCard .year-summary-hero-meta {
  display: grid;
  gap: 4px;
  padding-top: 2px;
}

#yearSummaryHeroCard .year-summary-hero-meta-alert {
  color: #b45309;
  font-weight: 700;
}

#yearSummaryHeroCard .hero-breakdown-chart {
  gap: 2px;
}

#yearSummaryHeroCard .hero-panel-breakdown .hero-legend {
  padding-inline: 0;
}

#yearSummaryHeroCard .hero-legend {
  gap: 1px;
}

.year-breakdown-detail-layout {
  display: grid;
  gap: 18px;
}

.year-breakdown-detail-chart .hero-donut-wrap {
  width: min(300px, 100%);
}

.year-breakdown-detail-chart .hero-donut-center {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  padding: 18px;
  border-radius: 0;
  overflow: visible;
  clip-path: none;
  pointer-events: none;
  opacity: 1;
  gap: 6px;
}

.year-breakdown-detail-chart .hero-donut-center-content {
  width: auto;
  height: auto;
  cursor: default;
  pointer-events: none;
  border-radius: 0;
  clip-path: none;
}

.year-breakdown-detail-chart .hero-donut-center-content * {
  cursor: default;
}

.year-breakdown-detail-chart .hero-donut-center strong {
  max-width: none;
  font-size: clamp(24px, 5.5vw, 30px);
  line-height: 1.05;
  white-space: nowrap;
  overflow-wrap: normal;
}

.year-breakdown-detail-chart .hero-donut-center span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.2;
}

.year-breakdown-detail-chart .hero-donut-center small {
  font-size: 12px;
  line-height: 1.1;
}

.year-breakdown-detail-list {
  display: grid;
  gap: 2px;
}

.year-breakdown-detail-item {
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.year-breakdown-detail-item.is-active {
  background: rgba(43, 182, 115, 0.06);
}

.year-breakdown-detail-item.is-dimmed {
  opacity: 0.48;
}

.year-breakdown-detail-marker {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.year-breakdown-detail-name {
  font-size: 14px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-breakdown-detail-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.year-breakdown-detail-budget {
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-breakdown-detail-amount,
.year-breakdown-detail-share {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
}

.hero-donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  display: block;
  cursor: default;
}

.hero-donut circle {
  cursor: pointer;
}

.donut-segment {
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.donut-segment:focus {
  outline: none;
  box-shadow: none;
}

.donut-segment:focus-visible {
  outline: none;
  box-shadow: none;
  opacity: 1;
  stroke-opacity: 1;
  filter: drop-shadow(0 0 0.5px rgba(43, 182, 115, 0.9)) drop-shadow(0 0 3px rgba(43, 182, 115, 0.18));
}

.donut-segment.is-active {
  opacity: 1;
  stroke-opacity: 1;
}

.donut-segment.is-dimmed {
  opacity: 0.28;
  stroke-opacity: 0.22;
}

.hero-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 60%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  pointer-events: auto;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  clip-path: circle(50% at 50% 50%);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.hero-donut-center-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: inherit;
  padding: 9px 8px 10px;
  box-sizing: border-box;
  pointer-events: none;
  cursor: inherit;
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
}

.hero-donut-center-content * {
  pointer-events: none;
  cursor: inherit;
}

.hero-layout.is-ready .hero-donut-center {
  opacity: 1;
}

.hero-donut-center span,
.hero-donut-center-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.85;
}

.hero-donut-center strong {
  display: block;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: 72px;
  text-align: center;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.hero-donut-center small,
.hero-donut-center-meta {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  display: block;
  padding-bottom: 1px;
}

.hero-legend {
  display: grid;
  gap: 3px;
  width: 100%;
}

.hero-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
  text-align: left;
}

.hero-legend-item.is-active {
  transform: translateX(1px);
}

.hero-legend-item.is-dimmed {
  opacity: 0.34;
}

.hero-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  border: none;
  box-shadow: none;
}

.hero-legend-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
}

.hero-legend-name {
  font-size: 12px;
  font-weight: 550;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hero-legend-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.hero-legend-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
  min-width: 28px;
}

.hero-breakdown-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  text-align: center;
  color: var(--muted);
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.08);
}

.insights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.insight-tile {
  display: grid;
  gap: 6px;
  padding: 14px 15px 13px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
}

.insight-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.insight-tile strong {
  font-size: 21px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.insight-tile-primary {
  padding: 16px 16px 14px;
  border-color: rgba(43, 182, 115, 0.18);
  box-shadow: var(--shadow-soft);
}

.insight-tile-primary .insight-label {
  font-size: 12px;
}

.insight-tile-primary strong {
  font-size: 24px;
}

.insight-highlight-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.insight-highlight-stack strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.insight-highlight-value {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

#yearSummaryInsights .insight-highlight-value {
  font-size: 18px;
}

.insight-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.insight-split strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.insight-side-value {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  text-align: right;
}

#dashboardInsights .insight-side-value {
  color: var(--text);
  font-size: 18px;
}

.insight-meta-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.insight-tile p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.insight-tile-light {
  background: rgba(248, 250, 252, 0.72);
}

.insight-tile-light strong {
  font-size: 20px;
}

#yearSummaryInsights .insight-tile-shared strong {
  font-size: 17px;
}

.insight-metrics-card {
  gap: 0;
  padding-block: 12px;
}

.insight-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 0;
}

.insight-metric-row + .insight-metric-row {
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.insight-metric-label {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.insight-metric-value {
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: right;
  white-space: nowrap;
}

.insight-tile-shared {
  gap: 0;
}

.insight-shared-section {
  display: grid;
  gap: 4px;
}

.insight-shared-section + .insight-shared-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.insight-tile p:empty {
  display: none;
}

.insight-empty {
  grid-column: 1 / -1;
}

.year-series-list {
  display: block;
}

.year-card-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.ghost-inline-btn {
  min-height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.ghost-inline-btn[hidden] {
  display: none;
}

.ghost-inline-btn:active {
  transform: translateY(1px);
}

@media (hover: hover) and (pointer: fine) {
  .logo:hover .logo-mark {
    color: #23965E;
  }

  .logo:hover {
    background: rgba(43, 182, 115, 0.08);
  }

  .topbar-hint-close:hover {
    background: rgba(148, 163, 184, 0.12);
  }

  .month-display-button:hover {
    background: rgba(43, 182, 115, 0.1);
  }

  .month-display-button:hover .month-display-chevron {
    color: #23965E;
    opacity: 1;
  }

  .menu-toggle-btn:hover {
    background: rgba(43, 182, 115, 0.08);
  }

  .side-menu-header .icon-btn:hover,
  .menu-link:hover {
    background: rgba(43, 182, 115, 0.08);
  }

  .month-switcher .icon-btn:hover {
    background: rgba(43, 182, 115, 0.1);
    color: #23965E;
  }

  .ghost-inline-btn:hover {
    background: rgba(241, 245, 249, 0.96);
    border-color: rgba(148, 163, 184, 0.32);
    color: var(--primary);
  }
}

.year-filter-btn {
  background: #f8fafc;
  border: 1px solid var(--border);
}

.year-filter-btn.is-active {
  background: var(--primary-soft);
  border-color: rgba(43, 182, 115, 0.28);
  color: var(--primary);
}

.year-filter-btn.has-category-filter {
  position: relative;
}

.year-filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: min(260px, calc(100vw - 64px));
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

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

.transaction-filter-chip {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #E6F7F0;
  border: 1px solid rgba(43, 182, 115, 0.2);
  color: #2BB673;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.transaction-filter-chip-compact {
  display: none;
}

.transaction-filter-chip-close {
  display: inline-flex;
}

#dashboardCategoryFilterChip .transaction-filter-chip-compact,
#dashboardCategoryFilterChip .transaction-filter-chip-close {
  display: none;
}

.transaction-filter-chip[hidden] {
  display: none;
}

.year-filter-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.year-filter-title {
  font-size: 13px;
  font-weight: 700;
}

.year-filter-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.year-filter-list {
  display: grid;
  gap: 8px;
}

.transaction-filter-section + .transaction-filter-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.year-filter-row-all {
  padding-bottom: 8px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.year-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 14px;
  border-radius: 10px;
  transition: background-color 0.15s ease;
}

.year-filter-row:hover {
  background: #E6F7F0;
}

.year-filter-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #2BB673;
}

.year-filter-empty {
  color: var(--muted);
  font-size: 13px;
}

.year-filter-empty-warning {
  color: var(--danger);
  margin-top: 10px;
}

.year-bars-chart {
  display: grid;
  gap: 12px;
  padding-inline: 2px;
}

.year-bars-empty {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.08);
}

.year-bars-empty p {
  margin: 0;
}

.year-bars-empty-soft {
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 250, 252, 0.9) 100%),
    repeating-linear-gradient(
      to top,
      rgba(148, 163, 184, 0.08) 0,
      rgba(148, 163, 184, 0.08) 1px,
      transparent 1px,
      transparent 44px
    );
  border: 1px solid rgba(148, 163, 184, 0.14);
}

#yearSummaryTrendCard {
  scroll-margin-top: 96px;
  transition: box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

#yearSummaryTrendCard.is-focused {
  background: linear-gradient(180deg, #ffffff 0%, #f0fbf6 100%);
  border-color: rgba(43, 182, 115, 0.22);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.year-bars-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.year-bars-grid {
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 1;
}

.year-bars-scale-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.year-bars-track {
  fill: rgba(148, 163, 184, 0.14);
}

.year-bars-track.is-future {
  fill: rgba(148, 163, 184, 0.08);
}

.year-bars-fill {
  fill: url(#yearBarGradient);
  opacity: 1;
  transform-box: fill-box;
  transform-origin: center bottom;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.year-bars-fill.is-future {
  opacity: 0.64;
}

.year-bars-fill.is-active {
  opacity: 1;
  transform: translateY(-2px);
}

.year-bars-group {
  cursor: pointer;
  outline: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.year-bars-group:focus-visible .year-bars-fill,
.year-bars-group.is-active .year-bars-fill {
  opacity: 1;
}

.year-bars-group.is-dimmed .year-bars-fill,
.year-bars-group.is-dimmed .year-bars-track {
  opacity: 0.44;
}

.year-bars-group.is-dimmed.is-future .year-bars-fill,
.year-bars-group.is-dimmed.is-future .year-bars-track {
  opacity: 0.22;
}

.year-bars-group.is-dimmed .year-bars-track {
  fill: rgba(148, 163, 184, 0.1);
}

.year-bars-tooltip-box {
  fill: rgba(15, 23, 42, 0.92);
}

.year-bars-tooltip-arrow {
  fill: rgba(15, 23, 42, 0.92);
}

.year-bars-tooltip-text {
  fill: #fff;
  font-size: 10px;
  font-weight: 600;
}

.year-bars-tooltip-text.is-amount {
  font-weight: 800;
}

.year-bars-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 700;
  transition: opacity 0.18s ease;
}

.year-bars-label.is-future {
  opacity: 0.46;
}

.year-bars-label.is-dimmed {
  opacity: 0.36;
}

.year-bars-label.is-dimmed.is-future {
  opacity: 0.22;
}

@media (min-width: 521px) {
  .year-bars-chart {
    padding-inline: 6px;
  }
}

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

.card-header h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.card-subtitle {
  color: var(--muted);
  font-size: 13px;
}

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

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.transaction-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.transaction-item.is-past {
  opacity: 0.62;
}

.transaction-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.transaction-title {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.transaction-meta {
  display: block;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.transaction-meta--single-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-amount {
  width: auto;
  max-width: 100%;
  text-align: right;
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-amount.income {
  color: var(--success);
}

.transaction-amount.expense {
  color: var(--danger);
}

.primary-btn,
.secondary-btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 1;
}

.primary-btn {
  border: none;
  background: var(--primary);
  color: white;
}

.primary-btn:hover,
.primary-btn:active {
  background: #23965E;
}

.secondary-btn {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}


.nav-btn {
  min-height: 68px;
  width: 100%;
  padding-top: 7px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
}

.nav-btn.active {
  background: rgba(43, 182, 115, 0.1);
  color: #23965E;
}


.bottom-nav--three {
  grid-template-columns: repeat(3, 1fr);
}

#appSnackbar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 86px);
  z-index: 45;
  max-width: 608px;
  margin: 0 auto;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(30, 35, 50, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 180ms ease-out, opacity 180ms ease-out;
  will-change: transform, opacity;
  pointer-events: none;
}

#appSnackbar.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#appSnackbar[data-variant="light"] {
  top: calc(env(safe-area-inset-top) + 90px);
  bottom: auto;
  min-height: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #ffffff;
  color: #0f766e;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  transform: translateY(-10px);
  transition: transform 240ms ease-out, opacity 240ms ease-out;
  pointer-events: none;
}

#appSnackbar[data-variant="light"].is-visible {
  pointer-events: none;
}

#appSnackbar[hidden] {
  display: none;
}

.app-snackbar-copy {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.app-snackbar-action {
  border: none;
  background: transparent;
  color: #6ee7b7;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  padding: 4px 0;
  cursor: pointer;
}

.nav-icon,
.menu-link-icon {
  display: inline-grid;
  place-items: center;
}

.nav-icon svg,
.menu-link-icon svg,
.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-toggle-btn svg {
  width: 33px;
  height: 33px;
  stroke-width: 2.25;
}

.nav-icon {
  font-size: 18px;
}

.nav-label {
  font-size: 12px;
  font-weight: 600;
}

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(84vw, 320px);
  height: 100vh;
  background: white;
  box-shadow: -8px 0 30px rgba(17, 24, 39, 0.15);
  padding: 18px 16px;
}

.side-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.side-menu-header h2 {
  font-size: 20px;
}

.side-menu-nav {
  display: grid;
  gap: 10px;
}


.menu-link {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f9fafb;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.menu-link-label {
  flex: 1 1 auto;
  min-width: 0;
}

.menu-link-state-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-link-state-icon > [hidden] {
  display: none !important;
}

.side-menu-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.side-menu-version {
  margin-top: 20px;
  text-align: center;
}

.side-menu-user-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
  padding: 6px 2px 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.side-menu-user-row:hover {
  opacity: 0.88;
}

.side-menu-user-row:active {
  transform: translateY(1px);
}

.side-menu-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
}

.side-menu-user-name {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-menu-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(17, 24, 39, 0.35);
}

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

.category-empty-state {
  margin-top: 14px;
  padding: 16px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #fcfdfd 0%, #f8fafb 100%);
  display: grid;
  gap: 8px;
}

.category-empty-state-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.category-empty-state-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  max-width: 32ch;
}

.dashboard-empty-state-card {
  padding: 28px 22px;
}

.dashboard-empty-state {
  min-height: calc(100vh - 320px);
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 12px;
  padding-top: clamp(52px, 14vh, 112px);
  text-align: center;
}

.dashboard-empty-state-title {
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 750;
}

.dashboard-empty-state-copy {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 30ch;
}

.dashboard-empty-state-btn {
  margin-top: 6px;
  min-width: 156px;
  justify-self: center;
}

.category-pill-card,
.category-row {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.category-row {
  position: relative;
  padding-left: 22px;
}

.category-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--category-accent, rgba(148, 163, 184, 0.4));
}

.category-pill-top,
.category-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.category-pill-top > :first-child,
.category-row-top > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.category-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  min-width: 0;
  max-width: 100%;
}

.category-name > :last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.category-meta {
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-amount {
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-pill-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 46%;
}

.category-chevron {
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  font-weight: 500;
  opacity: 0.7;
}

.category-budget-line {
  margin-top: 6px;
}

.category-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.category-progress-fill {
  height: 100%;
  border-radius: 999px;
}

.category-progress-fill.good {
  background: #22c55e;
}

.category-progress-fill.warn {
  background: #f59e0b;
}

.category-progress-fill.over {
  background: #ef4444;
}

.category-form {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.form-row {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.form-section-heading {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.form-row label {
  font-weight: 600;
  font-size: 14px;
}

.form-row input,
.form-row select,
.form-row textarea,
.settings-row select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  padding: 0 14px;
  font-size: 16px;
}

.support-message-input {
  min-height: 140px;
  padding: 14px;
  resize: vertical;
}

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

.category-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.small-btn {
  min-height: 38px;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: #E6F7F0;
  color: #2BB673;
  font-weight: 600;
  cursor: pointer;
}

.small-btn.danger {
  background: #fef2f2;
  color: #b91c1c;
}

.category-row-body {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.transaction-empty {
  color: var(--muted);
  font-size: 14px;
}

.transaction-list-compact .transaction-item {
  padding: 10px 0;
}

.transaction-form-note {
  color: var(--muted);
  font-size: 13px;
}

.transaction-form-note[hidden] {
  display: none;
}

.form-static-value {
  min-height: 46px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f9fafb;
  padding: 0 14px;
  color: var(--text);
  font-size: 16px;
}

.recurring-count-field {
  display: grid;
}

.recurring-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  padding: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.recurring-stepper:focus-within {
  border-color: rgba(91, 141, 239, 0.45);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12);
}

.recurring-stepper-btn {
  min-width: 40px;
  min-height: 40px;
  border: none;
  border-radius: 12px;
  background: #f3f4f6;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.recurring-stepper-btn:focus {
  outline: none;
}

.recurring-stepper-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.recurring-stepper-value {
  flex: 1 1 auto;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  box-sizing: border-box;
  color: #2BB673;
}

#transactionDate {
  width: calc(100% - 2px);
  max-width: calc(100% - 2px);
  inline-size: calc(100% - 2px);
  max-inline-size: calc(100% - 2px);
  text-align: left;
  line-height: 46px;
  padding-top: 0;
  padding-bottom: 0;
}

#transactionDate::-webkit-date-and-time-value {
  text-align: left;
}

#transactionDate::-webkit-datetime-edit {
  text-align: left;
  padding: 0;
}

input[type="date"]:focus {
  outline: none;
  border-color: rgba(43, 182, 115, 0.45);
  box-shadow: 0 0 0 3px rgba(43, 182, 115, 0.12);
}

.icon-action-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.icon-action-btn:hover {
  background: #e5e7eb;
}

.icon-action-btn.delete {
  background: #fee2e2;
}

.icon-action-btn.delete:hover {
  background: #fecaca;
}

.icon-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #374151;
}

.icon-action-btn.delete svg {
  color: #b91c1c;
}

.transaction-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  width: auto;
  max-width: 100%;
  flex-wrap: wrap;
  min-width: 0;
  box-sizing: border-box;
}

.recurring-detail-transactions {
  margin-top: 18px;
}

.recurring-detail-transactions .section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.recurring-detail-transactions-head {
  display: flex;
  align-items: center;
  min-width: 0;
}

.recurring-detail-transactions .section-head h3 {
  margin: 0;
}

.recurring-detail-transactions .section-head > p {
  flex-basis: 100%;
  margin: 0;
}

.recurring-detail-transactions-actions {
  margin-left: auto;
}

.transaction-side {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: end;
  align-content: start;
  gap: 8px;
  flex: 0 1 132px;
  width: min(132px, 100%);
  max-width: 42%;
  min-width: 0;
  box-sizing: border-box;
}

.category-side {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 48%;
  box-sizing: border-box;
}

.view .card + .card {
  margin-top: 16px;
}

#allTransactionsList {
  margin-top: 4px;
}

#transactionsView .card + .card {
  margin-top: 16px;
}

#transactionBrowserFilterControl {
  margin-top: 14px;
}

#transactionRangeFilterControl {
  margin-top: -2px;
}

.field-validation-message {
  margin: 6px 2px 0;
  color: #dc2626;
  font-size: 12px;
  line-height: 1.35;
}

.field-validation-message[hidden] {
  display: none;
}

#transactionsView .card-header {
  position: relative;
}

.transaction-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.transaction-pagination[hidden] {
  display: none;
}

.transaction-pagination .ghost-btn {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}

.transaction-pagination .ghost-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.transaction-pagination-status {
  flex: 0 1 auto;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  min-width: 92px;
}

.transaction-pagination-top-status {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 2px 0 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.transaction-pagination-top-status[hidden] {
  display: none;
}

.transaction-pagination-top-status-arrow {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  flex: 0 0 auto;
}

#categoryFormCard,
#transactionFormCard {
  scroll-margin-top: 96px;
}

#transactionFormCard,
#transactionForm,
#transactionForm .form-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.segment-control {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  background: #f3f4f6;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 14px;
}

.segment-control-dual {
  grid-template-columns: repeat(2, 1fr);
}

.segment-btn {
  position: relative;
  min-height: 38px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.segment-btn + .segment-btn::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 16%;
  width: 1px;
  height: 68%;
  background: #E5E7EB;
  pointer-events: none;
}

.segment-btn.active {
  background: #2BB673;
  color: white;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
}

.back-link-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  padding: 0;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 15px;
}

.category-detail-title-shell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-detail-title-shell h2 {
  margin-bottom: 0;
}

.category-detail-name-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  background: #fff;
}

.category-detail-name-input[hidden] {
  display: none;
}

.category-detail-name-btn {
  flex: 0 0 auto;
}

.category-detail-inline-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  border: none;
  flex: 0 0 auto;
}

.category-detail-inline-btn svg {
  color: var(--primary);
}

.category-detail-inline-btn:hover,
.category-detail-inline-btn:focus-visible {
  background: rgba(43, 182, 115, 0.12);
}

.category-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.category-detail-summary[data-stat-count="1"] {
  grid-template-columns: 1fr;
}

.category-detail-stat {
  display: grid;
  gap: 6px;
}

.category-detail-budget-shell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  width: fit-content;
  max-width: 100%;
}

.category-detail-budget-shell strong {
  flex: 0 1 auto;
}

.category-detail-budget-input {
  flex: 0 1 120px;
  width: 120px;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.category-detail-budget-input[hidden] {
  display: none;
}

.category-detail-budget-btn {
  flex: 0 0 auto;
}

.category-detail-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.category-detail-delete-btn {
  min-height: 42px;
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.18);
}

.detail-label {
  font-size: 13px;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.category-open-btn {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
}

.category-open-btn,
.category-open-btn:hover,
.category-open-btn:focus,
.category-open-btn:active,
.category-open-btn:visited {
  color: inherit;
  text-decoration: none;
}

.category-open-btn .category-pill-card,
.category-open-btn .category-row {
  color: var(--text);
}

.category-open-btn .category-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.category-open-btn .category-pill-card:not(.recurring-card) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.category-open-btn .category-pill-card.recurring-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.category-open-btn:active .category-row {
  transform: scale(0.995);
}

.category-open-btn:active .category-pill-card:not(.recurring-card) {
  transform: scale(0.995);
}

.category-open-btn:active .category-pill-card.recurring-card {
  transform: scale(0.995);
}

.category-open-btn:focus-visible .category-pill-card:not(.recurring-card) {
  border-color: rgba(43, 182, 115, 0.22);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.04);
}

.category-open-btn:focus-visible .category-pill-card.recurring-card {
  border-color: rgba(43, 182, 115, 0.22);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.04);
}

@media (hover: hover) and (pointer: fine) {
  .category-open-btn:hover .category-row {
    border-color: rgba(43, 182, 115, 0.22);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.04);
  }

  .category-open-btn:hover .category-pill-card:not(.recurring-card) {
    border-color: rgba(43, 182, 115, 0.22);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.04);
  }

  .category-open-btn:hover .category-pill-card.recurring-card {
    border-color: rgba(43, 182, 115, 0.22);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.04);
  }
}

.year-summary-category-focus-btn .category-pill-card {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.year-summary-category-focus-btn:active .category-pill-card {
  transform: scale(0.985);
}

.year-summary-category-focus-btn .category-pill-card.is-focused {
  background: linear-gradient(180deg, #ffffff 0%, #f0fbf6 100%);
  border-color: rgba(43, 182, 115, 0.32);
  box-shadow: 0 12px 22px rgba(43, 182, 115, 0.14);
}

.year-summary-category-focus-btn .category-pill-card.is-dimmed {
  opacity: 0.5;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 6px 0;
}

.settings-row--stacked {
  align-items: end;
}

.settings-row label {
  font-weight: 600;
}

.settings-copy {
  display: grid;
  gap: 3px;
}

.settings-link-btn {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.recurring-card {
  display: grid;
  gap: 10px;
}

.recurring-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.recurring-card-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.recurring-card-note {
  font-weight: 700;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.recurring-card-note.is-muted {
  color: var(--muted);
  font-weight: 600;
}

.recurring-card-grid,
.recurring-detail-grid {
  display: grid;
  gap: 10px;
}

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

.recurring-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 4px;
}

.recurring-detail-summary {
  margin-bottom: 18px;
}

.recurring-meta-item {
  display: grid;
  gap: 3px;
}

.recurring-meta-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.recurring-meta-item strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.recurring-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.recurring-detail-actions .secondary-btn,
.recurring-detail-actions .primary-btn {
  flex: 1 1 180px;
}

body.keyboard-open .bottom-nav {
  display: none;
}

.category-detail-toggle-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  width: 100%;
  line-height: 1.35;
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 1px;
  padding: 0;
  border-radius: 6px;
  flex: 0 0 auto;
  accent-color: #2BB673;
}

input[type="checkbox"] {
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: #2BB673;
}

input[type="radio"] {
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: #2BB673;
}

.checkbox-row span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.transaction-recurring-options[hidden] {
  display: none;
}

@media (max-width: 520px) {
  .auth-card {
    border-radius: 24px;
    padding: 22px 18px 18px;
  }

  .auth-brand h1 {
    font-size: 28px;
  }

  .insights-grid,
  .category-detail-summary {
    grid-template-columns: 1fr;
  }

  .recurring-card-grid,
  .recurring-detail-grid {
    grid-template-columns: 1fr;
  }

  .hero-card-shell {
    padding: 20px;
  }

  .hero-panel {
    padding: 0;
  }

  .hero-donut-wrap {
    width: min(102px, 100%);
  }

  #dashboardHeroCard .hero-donut-wrap {
    width: min(156px, 100%);
  }

  #dashboardHeroCard .hero-layout-both {
    grid-template-columns: minmax(0, 0.74fr) minmax(0, 1.26fr);
    gap: 10px;
  }

  #dashboardHeroCard .hero-card-shell,
  #yearSummaryHeroCard .hero-card-shell {
    padding: 18px;
  }

  #yearSummaryHeroCard .hero-donut-wrap {
    width: min(156px, 100%);
  }

  #yearSummaryHeroCard .hero-layout-both {
    grid-template-columns: minmax(0, 0.74fr) minmax(0, 1.26fr);
    gap: 10px;
  }

  #dashboardHeroCard .hero-donut-center strong {
    font-size: 18px;
  }

  #transactionCategoryFilterChip {
    display: none;
  }

  #recurringGroupsFilterChip {
    display: none;
  }

  #transactionCategoryFilterButton.has-category-filter::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #2BB673;
    box-shadow: 0 0 0 2px #f8fafc;
    pointer-events: none;
  }

  #recurringGroupsFilterButton.has-category-filter::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #2BB673;
    box-shadow: 0 0 0 2px #f8fafc;
    pointer-events: none;
  }

  .transaction-item {
    gap: 10px;
    align-items: flex-start;
  }

  .transaction-side {
    gap: 6px;
    max-width: 38%;
    min-width: 72px;
  }

  .transaction-actions {
    gap: 4px;
  }

  .category-pill-end,
  .category-side {
    gap: 4px;
    max-width: 42%;
  }

  .category-amount {
    font-size: 13px;
  }

  .category-meta {
    font-size: 12px;
  }

  .hero-summary-meta-line .hero-summary-meta-label-long {
    display: none !important;
  }

  .hero-summary-meta-line .hero-summary-meta-label-short {
    display: inline !important;
  }

  #dashboardHeroCard .hero-donut-center {
    --dashboard-donut-meta-safe-width: 52px;
  }

  #dashboardHeroCard .hero-donut-center small,
  #dashboardHeroCard .hero-donut-center-meta {
    width: min(var(--dashboard-donut-meta-safe-width), calc(100% - 12px));
    max-width: min(var(--dashboard-donut-meta-safe-width), calc(100% - 12px));
  }

  #dashboardHeroCard .dashboard-hero-row .hero-panel-budget {
    padding-top: 16px;
  }

  #yearSummaryHeroCard .year-summary-hero-metrics {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #yearSummaryHeroCard .hero-layout-both .hero-panel-budget {
    padding-top: 16px;
  }

  #yearSummaryHeroCard .hero-donut-center strong {
    font-size: 18px;
  }

  .year-filter-popover {
    width: min(240px, calc(100vw - 48px));
    right: -4px;
  }

  .hero-legend-copy {
    gap: 6px;
  }

  .hero-legend-meta {
    gap: 4px;
  }

  .hero-layout-both {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 10px;
    min-height: 204px;
  }

  .hero-layout-both .hero-donut-wrap {
    width: min(136px, 100%);
  }

  .hero-layout-breakdown .hero-donut-wrap {
    width: min(190px, 100%);
  }

  .hero-layout-budget .hero-panel-budget {
    min-height: 148px;
    padding: 12px;
  }

  .hero-layout-breakdown .hero-panel-breakdown {
    padding: 14px;
  }

  .hero-layout-both .hero-panel-budget {
    padding: 12px 8px 8px 12px;
  }

  .hero-layout-both .hero-panel-breakdown {
    padding: 12px 12px 8px 8px;
  }

  .transaction-side {
    width: auto;
    min-width: 112px;
    flex-basis: 112px;
  }
}

@media (max-width: 380px) {
  .category-pill-top,
  .category-row-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    row-gap: 8px;
  }

  .category-pill-top > :first-child,
  .category-row-top > :first-child {
    width: 100%;
    max-width: 100%;
  }

  .category-pill-end,
  .category-side {
    display: grid;
    grid-template-columns: minmax(0, auto) auto;
    align-items: start;
    justify-content: end;
    justify-self: end;
    width: auto;
    max-width: 100%;
  }

  .category-amount {
    max-width: min(100%, 20ch);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    text-align: right;
    line-height: 1.25;
  }
}
