:root {
  color-scheme: light;
  font-family:
    "Manrope",
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-subtle: #e9eeea;
  --surface-raised: #ffffff;
  --text: #14211b;
  --text-soft: #37473f;
  --muted: #5f6c65;
  --border: #dce3de;
  --brand: #1f8a62;
  --brand-strong: #136b4a;
  --brand-soft: #ddf5ea;
  --brand-contrast: #ffffff;
  --hero: #143d2e;
  --hero-soft: #275b46;
  --hero-accent: #9ce3bd;
  --danger: #bd4b45;
  --danger-soft: #fae7e5;
  --warning: #965a0d;
  --warning-soft: #fff0d8;
  --info: #456fc4;
  --violet: #7658b6;
  --income: #16724f;
  --popover-backdrop: rgb(4 14 12 / 0.17);
  --shadow-sm: 0 1px 2px rgb(20 33 27 / 0.04), 0 8px 22px rgb(20 33 27 / 0.04);
  --shadow-lg: 0 24px 70px rgb(20 33 27 / 0.13);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --topbar-height: 68px;
  --bottom-nav-height: 76px;
  --page-inline: 16px;
  --ease: 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

body[data-theme="ocean"] {
  --brand: #157f8f;
  --brand-strong: #0c6470;
  --brand-soft: #d9f1f2;
  --hero: #113e47;
  --hero-soft: #245b65;
  --hero-accent: #8fdce3;
  --income: #0b7277;
}

body[data-theme="violet"] {
  --brand: #7158c9;
  --brand-strong: #5840ad;
  --brand-soft: #ebe6fb;
  --hero: #352861;
  --hero-soft: #554482;
  --hero-accent: #cfc2f5;
  --income: #4c7b62;
}

body[data-theme="sunset"] {
  --brand: #c95835;
  --brand-strong: #9e4025;
  --brand-soft: #fbe6df;
  --hero: #512d25;
  --hero-soft: #754237;
  --hero-accent: #f6b39d;
  --income: #397259;
}

body[data-mode="dark"] {
  color-scheme: dark;
  --bg: #0d1015;
  --surface: #151921;
  --surface-subtle: #1d232d;
  --surface-raised: #191e27;
  --text: #f4f6f8;
  --text-soft: #d3d8df;
  --muted: #9ba4b0;
  --border: #2a313d;
  --brand: #4fc893;
  --brand-strong: #75dca9;
  --brand-soft: #17372b;
  --brand-contrast: #0b1116;
  --hero: #15392c;
  --hero-soft: #245844;
  --hero-accent: #8ee4ba;
  --danger: #ef8078;
  --danger-soft: #3d211f;
  --warning: #e2a64f;
  --warning-soft: #382c1b;
  --info: #82a5f2;
  --violet: #b59beb;
  --income: #62dba6;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.2), 0 8px 22px rgb(0 0 0 / 0.12);
  --shadow-lg: 0 24px 70px rgb(0 0 0 / 0.34);
}

@media (prefers-color-scheme: dark) {
  body[data-mode="system"] {
    color-scheme: dark;
    --bg: #0d1015;
    --surface: #151921;
    --surface-subtle: #1d232d;
    --surface-raised: #191e27;
    --text: #f4f6f8;
    --text-soft: #d3d8df;
    --muted: #9ba4b0;
    --border: #2a313d;
    --brand: #4fc893;
    --brand-strong: #75dca9;
    --brand-soft: #17372b;
    --brand-contrast: #0b1116;
    --hero: #15392c;
    --hero-soft: #245844;
    --hero-accent: #8ee4ba;
    --danger: #ef8078;
    --danger-soft: #3d211f;
    --warning: #e2a64f;
    --warning-soft: #382c1b;
    --info: #82a5f2;
    --violet: #b59beb;
    --income: #62dba6;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.2), 0 8px 22px rgb(0 0 0 / 0.12);
    --shadow-lg: 0 24px 70px rgb(0 0 0 / 0.34);
  }

  body[data-mode="system"][data-theme="ocean"] {
    --brand: #5bd0dc;
    --brand-strong: #83e1e8;
    --brand-soft: #14383d;
    --hero: #133941;
    --hero-soft: #22545c;
    --hero-accent: #8fe4ec;
  }

  body[data-mode="system"][data-theme="violet"] {
    --brand: #b7a2f2;
    --brand-strong: #cdbdf8;
    --brand-soft: #2d2647;
    --hero: #30294c;
    --hero-soft: #4d426f;
    --hero-accent: #d1c4fb;
  }

  body[data-mode="system"][data-theme="sunset"] {
    --brand: #ef9476;
    --brand-strong: #f4ae98;
    --brand-soft: #3c261f;
    --hero: #452b23;
    --hero-soft: #634035;
    --hero-accent: #ffc0aa;
  }
}

body[data-mode="dark"][data-theme="ocean"] {
  --brand: #5bd0dc;
  --brand-strong: #83e1e8;
  --brand-soft: #14383d;
  --hero: #133941;
  --hero-soft: #22545c;
  --hero-accent: #8fe4ec;
}

body[data-mode="dark"][data-theme="violet"] {
  --brand: #b7a2f2;
  --brand-strong: #cdbdf8;
  --brand-soft: #2d2647;
  --hero: #30294c;
  --hero-soft: #4d426f;
  --hero-accent: #d1c4fb;
}

body[data-mode="dark"][data-theme="sunset"] {
  --brand: #ef9476;
  --brand-strong: #f4ae98;
  --brand-soft: #3c261f;
  --hero: #452b23;
  --hero-soft: #634035;
  --hero-accent: #ffc0aa;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

img,
svg {
  max-width: 100%;
}

button {
  cursor: pointer;
}

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

h1,
h2,
h3,
strong {
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 7vw, 2.65rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.12rem;
  line-height: 1.25;
}

h3 {
  font-size: 1rem;
}

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

::selection {
  background: var(--brand-soft);
  color: var(--text);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  transition: transform var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.money-value,
.ledger-value,
.hero-value {
  font-variant-numeric: tabular-nums;
}

html.is-private [data-sensitive],
html.is-private [data-chart-sensitive],
body.is-private [data-sensitive],
body.is-private [data-chart-sensitive] {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
}

html.is-private input[data-money],
html.is-private input[data-signed-money],
body.is-private input[data-money],
body.is-private input[data-signed-money] {
  color: transparent !important;
  caret-color: transparent;
  text-shadow: 0 0 9px var(--text);
  -webkit-text-security: disc;
}

.app-shell {
  min-height: 100vh;
}

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

.page {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px var(--page-inline) calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 32px);
}

.sidebar {
  display: none;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 var(--page-inline);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.12rem;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 11px;
  background: var(--hero);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: var(--hero-accent);
}

.brand-mark::before {
  width: 18px;
  height: 8px;
  transform: translate(-3px, -5px) rotate(-28deg);
}

.brand-mark::after {
  width: 12px;
  height: 6px;
  transform: translate(5px, 4px) rotate(-28deg);
  opacity: 0.72;
}

.brand-mark span {
  width: 5px;
  height: 5px;
  transform: translate(-7px, 8px);
  background: #fff;
}

.profile-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  color: var(--brand-strong);
}

.bottom-nav {
  position: fixed;
  z-index: 60;
  right: 10px;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr 64px 1fr 1fr;
  align-items: center;
  min-height: var(--bottom-nav-height);
  padding: 8px 8px 6px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 15px 45px rgb(20 33 27 / 0.18);
  backdrop-filter: blur(20px);
}

.bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 600;
}

.bottom-link i {
  font-size: 1.28rem;
}

.bottom-link.is-active {
  color: var(--brand-strong);
}

.bottom-create {
  position: relative;
  top: -16px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto;
  border: 6px solid var(--surface);
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: 0 10px 25px color-mix(in srgb, var(--brand) 38%, transparent);
}

.bottom-create i {
  font-size: 1.55rem;
}

.page-heading {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 22px;
}

.page-heading p {
  max-width: 640px;
  margin-bottom: 0;
}

.page-heading .eyebrow {
  margin-bottom: 8px;
}

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

.eyebrow,
.section-kicker {
  display: block;
  color: var(--brand-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.back-link:hover {
  color: var(--brand-strong);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1;
  transition:
    transform var(--ease),
    background var(--ease),
    border-color var(--ease),
    color var(--ease);
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background: var(--brand-strong);
  color: var(--brand-contrast);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 22%, transparent);
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-soft);
}

.button-secondary:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  color: var(--brand-strong);
}

.button-ghost {
  background: transparent;
  color: var(--muted);
}

.button-danger {
  background: var(--danger);
  color: #fff;
}

.button-light {
  background: #fff;
  color: var(--hero);
}

.button-hero-ghost {
  border-color: rgb(255 255 255 / 0.2);
  background: rgb(255 255 255 / 0.08);
  color: #fff;
}

.button-small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.78rem;
}

.text-link,
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 750;
}

.text-link:hover,
.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-button.danger {
  color: var(--danger);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-soft);
  transition:
    border-color var(--ease),
    color var(--ease),
    background var(--ease),
    transform var(--ease);
}

.icon-button:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.icon-button:disabled,
.icon-button:disabled:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
}

.icon-button.small {
  width: 36px;
  height: 36px;
  font-size: 0.9rem;
}

.icon-button.tiny {
  width: 30px;
  height: 30px;
  font-size: 0.78rem;
}

.icon-button.danger {
  color: var(--danger);
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 0;
}

.panel-head h2 {
  margin-bottom: 0;
}

.panel-context {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.month-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.month-switcher .icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
}

.month-label {
  min-width: 120px;
  padding: 0 6px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 750;
}

.filter-month-switcher {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  gap: 2px;
  border-radius: 12px;
}

.filter-month-switcher .icon-button {
  width: 30px;
  height: 36px;
  border-radius: 8px;
}

.filter-month-switcher .month-label {
  flex: 1;
  min-width: 0;
  padding-inline: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.hero-balance {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 20px;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--hero), color-mix(in srgb, var(--hero) 76%, #0b0d12));
  color: #fff;
  box-shadow: 0 24px 60px color-mix(in srgb, var(--hero) 30%, transparent);
}

.hero-glow {
  position: absolute;
  z-index: -1;
  right: -80px;
  top: -90px;
  width: 260px;
  height: 260px;
  border: 65px solid rgb(255 255 255 / 0.065);
  border-radius: 50%;
}

.hero-glow::after {
  content: "";
  position: absolute;
  left: -120px;
  bottom: -210px;
  width: 210px;
  height: 210px;
  border: 45px solid color-mix(in srgb, var(--hero-accent) 10%, transparent);
  border-radius: 50%;
}

.hero-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: rgb(255 255 255 / 0.72);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.1);
  color: #fff;
  font-size: 0.68rem;
}

.hero-delta.is-positive {
  color: color-mix(in srgb, var(--income) 34%, #fff);
}

.hero-delta.is-warning {
  color: color-mix(in srgb, var(--warning) 38%, #fff);
}

.hero-value {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(2rem, 10vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.065em;
}

.hero-main p {
  max-width: 500px;
  margin: 0;
  color: rgb(255 255 255 / 0.62);
  font-size: 0.78rem;
}

.hero-breakdown {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.hero-breakdown.is-four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-breakdown div {
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 13px;
  background: rgb(255 255 255 / 0.055);
}

.hero-breakdown span {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
  color: rgb(255 255 255 / 0.66);
  font-size: 0.7rem;
}

.hero-breakdown strong {
  display: block;
  font-size: 0.9rem;
  white-space: nowrap;
}

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

.metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 1.2rem;
}

.metric-icon.violet {
  background: color-mix(in srgb, var(--violet) 14%, transparent);
  color: var(--violet);
}

.metric-icon.amber {
  background: var(--warning-soft);
  color: var(--warning);
}

.metric-card div {
  min-width: 0;
}

.metric-card span:not(.metric-icon),
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 0.69rem;
}

.metric-card strong {
  display: block;
  overflow: hidden;
  margin: 2px 0;
  font-size: 1.04rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card-with-details.is-details-open {
  position: relative;
  z-index: 80;
}

.metric-card-with-details.is-details-open::after {
  position: absolute;
  z-index: 20;
  inset: 0;
  border-radius: inherit;
  background: var(--popover-backdrop);
  content: "";
  pointer-events: none;
}

.metric-card-copy {
  flex: 1 1 auto;
}

.metric-details-trigger {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition:
    background var(--ease),
    color var(--ease);
}

.metric-details-trigger:hover,
.metric-card-with-details.is-details-open .metric-details-trigger {
  background: var(--surface-subtle);
  color: var(--brand-strong);
}

.metric-details-trigger i {
  transition: transform var(--ease);
}

.metric-card-with-details.is-details-open .metric-details-trigger i {
  transform: rotate(180deg);
}

.metric-details-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  left: 0;
  display: none;
  width: max(100%, min(310px, calc(100vw - (var(--page-inline) * 2))));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  visibility: hidden;
}

.metric-details-popover::before {
  position: absolute;
  top: -6px;
  left: 28px;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--surface-raised);
  content: "";
  transform: rotate(45deg);
}

.metric-card-with-details.is-details-open .metric-details-popover {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
  animation: metric-details-popover-in var(--ease);
}

@keyframes metric-details-popover-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.metric-details-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 9px;
}

.metric-card .metric-details-popover-head > span {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 750;
}

.metric-card .metric-details-popover-head small {
  color: var(--muted);
  font-size: 0.65rem;
  white-space: nowrap;
}

.metric-details-list {
  display: grid;
  max-height: 250px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
}

.metric-details-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 10px 2px;
  border-top: 1px solid var(--border);
}

.metric-card span.metric-details-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.metric-card .metric-details-name > span {
  overflow: hidden;
  color: inherit;
  font-size: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card span.account-icon.is-compact,
.metric-card span.mini-card-mark.is-compact {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.metric-details-row > strong {
  overflow: visible;
  margin: 0;
  font-size: 0.8rem;
  text-overflow: clip;
}

.onboarding-card {
  display: grid;
  gap: 22px;
  margin: 16px 0;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--brand-soft), var(--surface));
}

.onboarding-copy h2 {
  margin-top: 8px;
  font-size: 1.45rem;
}

.onboarding-copy p {
  margin-bottom: 0;
}

.onboarding-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-steps li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.onboarding-steps li > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-strong);
  color: var(--brand-contrast);
  font-size: 0.72rem;
  font-weight: 800;
}

.onboarding-steps strong,
.onboarding-steps small {
  display: block;
}

.onboarding-steps small {
  color: var(--muted);
  font-size: 0.68rem;
}

.onboarding-steps a {
  color: var(--brand-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
}

.chart-panel {
  min-height: 330px;
}

.chart {
  min-height: 235px;
  padding: 0 8px;
}

.chart-donut {
  min-height: 210px;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 0.68rem;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--brand);
}

.legend-dot.expense {
  background: var(--danger);
}

.category-summary {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0 18px 18px;
  list-style: none;
}

.category-summary li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--item-color);
}

.category-summary strong {
  font-size: 0.75rem;
}

.progress-list {
  display: grid;
  gap: 18px;
  padding: 20px 18px;
}

.progress-item {
  min-width: 0;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 0.76rem;
}

.progress-copy span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-subtle);
}

.progress-track.large {
  height: 10px;
}

.progress-track span {
  display: block;
  width: var(--progress);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--item-color, var(--brand));
  transition: width 500ms ease;
}

.progress-track span.is-over {
  background: var(--danger);
}

.progress-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.67rem;
}

.timeline-list,
.transaction-list,
.mini-card-list,
.insight-list {
  display: grid;
  padding: 10px 18px 18px;
}

.timeline-item,
.transaction-row,
.mini-card {
  display: grid;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child,
.transaction-row:last-child,
.mini-card:last-child {
  border-bottom: 0;
}

.timeline-item {
  grid-template-columns: 44px 40px minmax(0, 1fr);
}

.timeline-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 46px;
  border-radius: 12px;
  background: var(--surface-subtle);
}

.timeline-date strong {
  font-size: 0.9rem;
}

.timeline-date span {
  max-width: 38px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-item.is-overdue .timeline-date {
  background: var(--warning-soft);
  color: var(--warning);
}

.category-icon,
.account-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--item-color) 13%, var(--surface));
  color: color-mix(in srgb, var(--item-color) 35%, var(--text));
  font-size: 1rem;
}

.category-icon.large,
.account-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.1rem;
}

.category-icon.is-income {
  --item-color: var(--income);
}

.timeline-copy,
.transaction-main {
  min-width: 0;
}

.timeline-copy strong,
.timeline-copy small,
.transaction-main strong,
.transaction-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-copy strong,
.transaction-main strong {
  font-size: 0.78rem;
}

.timeline-copy small,
.transaction-main small {
  color: var(--muted);
  font-size: 0.69rem;
}

.timeline-amount {
  grid-column: 3;
  justify-self: start;
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 750;
}

.mini-card {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.mini-card-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--item-color) 13%, var(--surface));
  color: color-mix(in srgb, var(--item-color) 35%, var(--text));
}

.mini-card div {
  min-width: 0;
}

.mini-card strong,
.mini-card small {
  display: block;
}

.mini-card > div:nth-child(2) strong {
  overflow: hidden;
  font-size: 0.77rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-card small {
  color: var(--muted);
  font-size: 0.64rem;
}

.mini-card-value {
  text-align: right;
}

.mini-card-value strong {
  font-size: 0.75rem;
}

.transaction-row {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.transaction-value {
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.is-income {
  color: var(--income) !important;
}

.is-danger {
  color: var(--danger) !important;
}

.insight-list {
  gap: 8px;
  padding-top: 16px;
}

.insight-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-radius: 13px;
  background: var(--surface-subtle);
}

.insight-item > i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--brand-strong);
}

.insight-item.is-positive > i {
  color: var(--income);
}

.insight-item.is-warning > i {
  color: var(--warning);
}

.insight-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.7rem;
}

.insight-orbit {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 34px 20px;
  text-align: center;
}

.empty-state.compact {
  min-height: 220px;
  padding: 26px 18px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 1.45rem;
}

.empty-state strong {
  margin-bottom: 6px;
}

.empty-state p {
  max-width: 380px;
  margin-bottom: 16px;
  font-size: 0.78rem;
}

.filter-panel {
  margin-bottom: 16px;
  padding: 12px;
}

.filter-form {
  display: grid;
  gap: 10px;
}

.search-field {
  position: relative;
}

.search-field i {
  position: absolute;
  z-index: 1;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-field input {
  padding-left: 40px;
}

.filter-clear {
  justify-self: center;
}

.ledger-panel {
  overflow: hidden;
}

.ledger-panel:has(.item-actions.is-open) {
  overflow: visible;
}

.ledger-list {
  padding: 8px 16px 16px;
}

.ledger-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.ledger-row:last-child {
  border-bottom: 0;
}

.ledger-row.is-projected .category-icon,
.ledger-row.is-projected .ledger-main,
.ledger-row.is-projected .ledger-value {
  opacity: 0.72;
}

.ledger-date {
  display: none;
  text-align: center;
}

.ledger-date strong,
.ledger-date small {
  display: block;
}

.ledger-date strong {
  font-size: 0.82rem;
}

.ledger-date small {
  max-width: 38px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.52rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-main {
  grid-column: 2;
  min-width: 0;
}

.ledger-main strong,
.ledger-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-main strong {
  font-size: 0.77rem;
}

.ledger-main span {
  color: var(--muted);
  font-size: 0.69rem;
}

.ledger-status {
  display: none;
}

.ledger-row.is-projected .ledger-status,
.ledger-row.is-overdue .ledger-status {
  display: block;
  grid-column: 2;
  grid-row: 3;
}

.ledger-value {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  font-size: 0.72rem;
  white-space: nowrap;
}

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

.ledger-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  flex-direction: column;
}

.ledger-actions .icon-button.small,
.recurring-row .row-actions .icon-button.small {
  width: 44px;
  height: 44px;
}

.ledger-actions form,
.row-actions form {
  display: flex;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-badge > i {
  flex: 0 0 auto;
  align-self: center;
  line-height: 1;
}

.status-badge.is-cleared,
.status-badge.is-paid,
.status-badge.is-category {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.status-badge.is-pending,
.status-badge.is-closed {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge.is-card {
  background: color-mix(in srgb, var(--violet) 13%, transparent);
  color: var(--violet);
}

.status-badge.is-projected {
  background: color-mix(in srgb, var(--info) 12%, transparent);
  color: var(--info);
}

.status-badge.is-overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge.is-open {
  background: color-mix(in srgb, var(--info) 12%, transparent);
  color: var(--info);
}

.status-badge.is-credit {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.status-badge.is-empty,
.status-badge.is-muted {
  background: var(--surface-subtle);
  color: var(--muted);
}

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

.pagination > span {
  color: var(--muted);
  font-size: 0.7rem;
}

.pagination .is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.trash-row {
  grid-template-columns: 40px minmax(0, 1fr);
}

.trash-row .ledger-main {
  grid-column: 2;
}

.trash-row .ledger-value {
  grid-column: 2;
}

.trash-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.trash-actions form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.trash-actions .icon-button.small {
  width: 44px;
  height: 44px;
}

.form-layout {
  display: grid;
  gap: 18px;
}

.form-card,
.settings-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.form-card {
  display: grid;
  gap: 18px;
}

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

.field,
.money-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field label,
.money-field label,
.segmented-fieldset legend,
.choice-fieldset legend {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 750;
}

.optional {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    background var(--ease);
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--border));
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}

.form-popover-backdrop {
  position: fixed;
  z-index: 75;
  inset: 0;
  background: var(--popover-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
}

body.has-form-popover .form-popover-backdrop,
body.has-dashboard-popover .form-popover-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.item-actions {
  position: relative;
  display: inline-flex;
}

.item-actions.is-open {
  z-index: 80;
}

.item-actions.is-open > .item-actions-trigger {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: var(--brand-soft);
  color: var(--brand-strong);
  transform: none;
}

.item-actions-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 3px;
  width: min(230px, calc(100vw - 24px));
  max-height: min(286px, calc(100dvh - 24px));
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--brand));
  border-radius: 13px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  transform: translateX(var(--item-actions-offset-x, 0px));
  transform-origin: top right;
  animation: item-actions-menu-in var(--ease);
}

.item-actions-menu[hidden] {
  display: none;
}

.item-actions.is-above .item-actions-menu {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom right;
}

.item-actions-menu > form {
  display: block;
  width: 100%;
  margin: 0;
}

.item-actions-option {
  appearance: none;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 620;
  line-height: 1.35;
  text-align: left;
  transition:
    color var(--ease),
    border-color var(--ease),
    background var(--ease);
}

.item-actions-option > i {
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

.item-actions-option > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-actions-option:hover,
.item-actions-option:focus-visible {
  outline: 0;
  border-color: color-mix(in srgb, var(--brand) 28%, transparent);
  background: color-mix(in srgb, var(--brand-soft) 52%, var(--surface));
  color: var(--brand-strong);
}

.item-actions-option:hover > i,
.item-actions-option:focus-visible > i {
  color: inherit;
}

.item-actions-option.is-danger {
  color: var(--danger);
}

.item-actions-option.is-danger > i {
  color: inherit;
}

.item-actions-option.is-danger:hover,
.item-actions-option.is-danger:focus-visible {
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

@keyframes item-actions-menu-in {
  from {
    opacity: 0;
    transform: translate(var(--item-actions-offset-x, 0px), -4px) scale(0.985);
  }
}

.icon-select {
  --icon-select-option-size: 44px;
  --icon-select-gap: 6px;
}

.icon-select,
.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.icon-select.is-open,
.custom-select.is-open,
.color-picker.is-open {
  z-index: 80;
}

.icon-select-native,
.custom-select-native,
.color-picker-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.icon-select-trigger,
.custom-select-trigger,
.color-picker-trigger {
  display: grid;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    background var(--ease);
}

.icon-select-trigger,
.color-picker-trigger {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.custom-select-trigger {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.icon-select-trigger:hover,
.custom-select-trigger:hover,
.color-picker-trigger:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--border));
}

.icon-select-trigger:focus-visible,
.custom-select-trigger:focus-visible,
.color-picker-trigger:focus-visible {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}

.icon-select-trigger[aria-invalid="true"],
.custom-select-trigger[aria-invalid="true"],
.color-picker-trigger[aria-invalid="true"] {
  border-color: var(--danger);
}

.icon-select-trigger > .ph:first-child {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 1.05rem;
}

.icon-select-trigger-label,
.custom-select-trigger-label {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-trigger.is-placeholder .custom-select-trigger-label {
  color: var(--muted);
  font-weight: 550;
}

.custom-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-select-caret,
.custom-select-caret,
.color-picker-caret {
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform var(--ease);
}

.icon-select.is-open .icon-select-caret,
.custom-select.is-open .custom-select-caret,
.color-picker.is-open .color-picker-caret {
  transform: rotate(180deg);
}

.icon-select-menu {
  position: absolute;
  z-index: 80;
  inset-inline: 0;
  top: calc(100% + 6px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--icon-select-option-size), 1fr));
  gap: var(--icon-select-gap);
  width: 100%;
  max-height: 262px;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--brand));
  border-radius: 13px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.icon-select-menu[hidden] {
  display: none;
}

.icon-select.is-above .icon-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.icon-select-option {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  height: var(--icon-select-option-size);
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--text-soft);
  font-size: 1.3rem;
  transition:
    color var(--ease),
    border-color var(--ease),
    background var(--ease),
    transform var(--ease);
}

.icon-select-option:hover,
.icon-select-option:focus-visible {
  outline: 0;
  border-color: color-mix(in srgb, var(--brand) 38%, var(--border));
  background: color-mix(in srgb, var(--brand-soft) 52%, var(--surface));
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.icon-select-option.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent);
}

.custom-select-menu {
  position: absolute;
  z-index: 80;
  inset-inline: 0;
  top: calc(100% + 6px);
  display: grid;
  gap: 3px;
  width: 100%;
  max-height: min(286px, calc(100dvh - 24px));
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--brand));
  border-radius: 13px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select.is-above .custom-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.custom-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 620;
  text-align: left;
  transition:
    color var(--ease),
    border-color var(--ease),
    background var(--ease);
}

.custom-select-option > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-option > i {
  color: var(--brand-strong);
  font-size: 0.9rem;
  opacity: 0;
}

.custom-select-option:hover:not(:disabled),
.custom-select-option:focus-visible {
  outline: 0;
  border-color: color-mix(in srgb, var(--brand) 28%, transparent);
  background: color-mix(in srgb, var(--brand-soft) 52%, var(--surface));
  color: var(--brand-strong);
}

.custom-select-option.is-selected {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.custom-select-option.is-selected > i {
  opacity: 1;
}

.custom-select-option.is-placeholder:not(.is-selected) {
  color: var(--muted);
}

.custom-select-option:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.item-actions-menu,
.icon-select-menu,
.custom-select-menu,
.color-picker-panel {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 38%, transparent) transparent;
}

.item-actions-menu::-webkit-scrollbar,
.icon-select-menu::-webkit-scrollbar,
.custom-select-menu::-webkit-scrollbar,
.color-picker-panel::-webkit-scrollbar {
  width: 8px;
}

.item-actions-menu::-webkit-scrollbar-track,
.icon-select-menu::-webkit-scrollbar-track,
.custom-select-menu::-webkit-scrollbar-track,
.color-picker-panel::-webkit-scrollbar-track {
  background: transparent;
}

.item-actions-menu::-webkit-scrollbar-thumb,
.icon-select-menu::-webkit-scrollbar-thumb,
.custom-select-menu::-webkit-scrollbar-thumb,
.color-picker-panel::-webkit-scrollbar-thumb {
  min-height: 36px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  background-clip: padding-box;
}

.item-actions-menu::-webkit-scrollbar-thumb:hover,
.icon-select-menu::-webkit-scrollbar-thumb:hover,
.custom-select-menu::-webkit-scrollbar-thumb:hover,
.color-picker-panel::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--brand) 58%, var(--muted));
  background-clip: padding-box;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
.money-input-wrap.has-error {
  border-color: var(--danger);
}

.field > small,
.money-field > small {
  color: var(--muted);
  font-size: 0.64rem;
}

.field-error {
  color: var(--danger) !important;
}

.description-input-wrap {
  position: relative;
  width: 100%;
}

.description-input-wrap.is-open {
  z-index: 81;
}

.description-suggestions {
  position: absolute;
  z-index: 82;
  inset-inline: 0;
  top: calc(100% + 6px);
  display: grid;
  gap: 3px;
  max-height: 286px;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--brand));
  border-radius: 13px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.description-suggestions[hidden] {
  display: none;
}

.description-suggestion-option {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 620;
  text-align: left;
}

.description-suggestion-option:hover,
.description-suggestion-option.is-active {
  border-color: color-mix(in srgb, var(--brand) 28%, transparent);
  background: color-mix(in srgb, var(--brand-soft) 52%, var(--surface));
  color: var(--brand-strong);
}

.money-input-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.money-input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}

.money-input-wrap > span {
  padding-left: 13px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
}

.money-input-wrap input {
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  font-size: 1.08rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.segmented-fieldset,
.choice-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented-fieldset legend,
.choice-fieldset legend {
  margin-bottom: 8px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 5px;
  border-radius: 13px;
  background: var(--surface-subtle);
}

.segment-option {
  position: relative;
}

.segment-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segment-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 750;
  cursor: pointer;
}

.segment-option input:checked + span {
  background: var(--surface);
  color: var(--brand-strong);
  box-shadow: 0 2px 9px rgb(20 33 27 / 0.08);
}

.segment-option input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent);
}

.destination-panel[hidden],
[hidden] {
  display: none !important;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.sticky-actions {
  position: sticky;
  z-index: 3;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 8px);
  margin: 0 -10px -10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
}

.inline-note {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 9px;
  padding: 12px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.7rem;
}

.inline-note > i {
  align-self: center;
  line-height: 1;
}

.inline-note {
  background: var(--brand-soft);
  color: var(--text-soft);
}

.inline-note.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.inline-note a {
  justify-self: start;
  color: var(--brand-strong);
  font-weight: 800;
}

.form-aside,
.card-preview-wrap {
  position: relative;
  align-self: start;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--hero);
  color: #fff;
}

.form-aside .section-kicker,
.form-aside .text-link,
.card-preview-wrap .section-kicker {
  color: color-mix(in srgb, var(--hero-accent) 55%, #fff);
}

.form-aside h2 {
  margin-top: 8px;
  font-size: 1.35rem;
}

.form-aside p,
.form-aside li {
  color: rgb(255 255 255 / 0.68);
  font-size: 0.75rem;
}

.aside-orbit {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 34px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: var(--hero-accent);
  font-size: 1.2rem;
}

.check-list {
  display: grid;
  gap: 9px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  gap: 8px;
}

.check-list i {
  color: var(--hero-accent);
  font-size: 1rem;
}

.recurrence-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.72rem;
  font-weight: 700;
}

.toast-region {
  position: fixed;
  z-index: 100;
  display: grid;
  gap: 10px;
  right: 12px;
  top: calc(var(--topbar-height) + 10px);
  left: 12px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  max-width: 440px;
  margin-left: auto;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text-soft);
  font-size: 0.73rem;
  pointer-events: auto;
  animation: toast-in 220ms ease-out;
}

.toast > i {
  color: var(--brand-strong);
  font-size: 1.15rem;
}

.toast-error {
  border-color: color-mix(in srgb, var(--danger) 32%, var(--border));
}

.toast-error > i {
  color: var(--danger);
}

.toast-warning {
  border-color: color-mix(in srgb, var(--warning) 32%, var(--border));
}

.toast-warning > i {
  color: var(--warning);
}

.toast-info > i {
  color: var(--brand-strong);
}

.toast-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.app-dialog {
  width: min(92vw, 450px);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.app-dialog::backdrop {
  background: rgb(7 16 12 / 0.56);
  backdrop-filter: blur(5px);
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 15px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 1.2rem;
}

.app-dialog h2 {
  font-size: 1.2rem;
}

.app-dialog p {
  font-size: 0.78rem;
}

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

.command-dialog {
  padding: 0;
  overflow: hidden;
}

.command-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.command-head input {
  border: 0;
  box-shadow: none !important;
}

kbd {
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--muted);
  font:
    600 0.61rem/1.2 "Manrope",
    sans-serif;
}

.command-list {
  display: grid;
  gap: 3px;
  max-height: 58vh;
  overflow: auto;
  padding: 8px;
}

.command-list a {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 9px;
  border-radius: 10px;
  font-size: 0.75rem;
}

.command-list a:hover,
.command-list a.is-focused {
  background: var(--surface-subtle);
}

.command-list a i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.calculator-panel {
  position: fixed;
  z-index: 90;
  top: calc(var(--topbar-height) + 16px);
  right: 16px;
  display: grid;
  width: min(320px, calc(100vw - 24px));
  max-height: calc(100dvh - 16px);
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

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

.calculator-panel.is-dragging {
  will-change: transform;
}

.calculator-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.calculator-panel.is-dragging .calculator-head {
  cursor: grabbing;
}

.calculator-drag-handle {
  color: var(--muted);
  font-size: 1.1rem;
}

.calculator-title {
  display: grid;
  line-height: 1.25;
}

.calculator-title small {
  color: var(--brand-strong);
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.calculator-title strong {
  font-size: 0.86rem;
}

.calculator-screen {
  display: grid;
  justify-items: end;
  min-height: 92px;
  margin: 14px 14px 10px;
  padding: 15px 17px;
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(145deg, var(--hero), var(--hero-soft));
  color: #fff;
}

.calculator-screen small {
  align-self: start;
  max-width: 100%;
  overflow: hidden;
  color: rgb(255 255 255 / 0.68);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-screen output {
  align-self: end;
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(1.65rem, 9vw, 2.15rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 14px 14px;
}

.calculator-key {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 49px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 750;
  transition:
    transform var(--ease),
    border-color var(--ease),
    background var(--ease),
    color var(--ease);
}

.calculator-key:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  transform: translateY(-1px);
}

.calculator-key:active {
  transform: translateY(0);
}

.calculator-key-action {
  background: var(--surface-subtle);
  color: var(--text-soft);
}

.calculator-key-operator {
  border-color: color-mix(in srgb, var(--brand) 18%, var(--border));
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 1.12rem;
}

.calculator-key-equals {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  color: var(--brand-contrast);
  font-size: 1.12rem;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 20%, transparent);
}

.calculator-footer {
  padding: 13px 14px 14px;
  border-top: 1px solid var(--border);
}

.calculator-create {
  width: 100%;
  font-size: 0.75rem;
}

.calculator-create:disabled {
  opacity: 0.48;
  transform: none;
  cursor: not-allowed;
  box-shadow: none;
}

.recurring-list {
  padding: 8px 16px 16px;
}

.recurring-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.recurring-row:last-child {
  border-bottom: 0;
}

.recurring-row.is-paused > :not(.row-actions) {
  opacity: 0.62;
}

.recurring-date {
  text-align: center;
}

.recurring-date span,
.recurring-date small {
  display: block;
}

.recurring-date span {
  font-weight: 800;
}

.recurring-date small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

.recurring-row > .category-icon {
  display: none;
}

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

.recurring-main > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.recurring-main > span,
.recurring-main > small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-main > small {
  margin-top: 3px;
}

.recurring-value {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.72rem;
}

.recurring-row .row-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  flex-direction: column;
}

.credit-card-grid {
  display: grid;
  gap: 18px;
}

.credit-card-tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.credit-card-tile.is-archived .card-edit-action {
  opacity: 0.58;
}

.credit-card-visual-wrap {
  position: relative;
}

.credit-card-visual {
  --card-color: #14211b;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  aspect-ratio: 1.65 / 1;
  overflow: hidden;
  padding: 20px;
  border-radius: 21px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--card-color) 30%, #101812), color-mix(in srgb, var(--card-color) 38%, #050807));
  color: #fff;
  box-shadow: 0 18px 36px color-mix(in srgb, var(--card-color) 24%, transparent);
}

.credit-card-tile .credit-card-visual {
  border-radius: 0 0 24px 24px;
}

.credit-card-visual-actions {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.credit-card-visual-actions form {
  display: flex;
}

.credit-card-visual-actions .icon-button {
  border-color: rgb(255 255 255 / 0.76);
  background: #fff;
  color: #37473f;
  box-shadow: 0 7px 18px rgb(0 0 0 / 0.16);
}

.credit-card-visual-actions .icon-button:hover {
  color: color-mix(in srgb, var(--brand) 60%, #101419);
}

.credit-card-visual-actions .icon-button.danger {
  color: var(--danger);
}

.card-shine {
  position: absolute;
  z-index: -1;
  right: -12%;
  top: -50%;
  width: 75%;
  height: 140%;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 50%;
  transform: rotate(24deg);
}

.card-shine::after {
  content: "";
  position: absolute;
  right: 30%;
  bottom: -25%;
  width: 70%;
  height: 70%;
  border: 38px solid rgb(255 255 255 / 0.045);
  border-radius: 50%;
}

.card-top,
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-top {
  justify-content: flex-start;
  gap: 10px;
}

.card-top i {
  font-size: 1.4rem;
  opacity: 0.8;
}

.card-chip {
  display: block;
  width: 34px;
  height: 25px;
  border-radius: 7px;
  background: linear-gradient(135deg, #ead8a1, #a98942);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.3);
}

.card-name strong,
.card-name small {
  display: block;
}

.card-name strong {
  font-size: 1rem;
}

.card-name small,
.card-bottom {
  color: rgb(255 255 255 / 0.88);
  font-size: 0.68rem;
}

.card-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.card-number span {
  opacity: 0.85;
}

.credit-card-info {
  padding: 18px;
}

.credit-card-values,
.limit-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.credit-card-values span,
.credit-card-values strong,
.limit-values span,
.limit-values strong {
  display: block;
}

.credit-card-values span,
.limit-values span {
  color: var(--muted);
  font-size: 0.64rem;
}

.credit-card-values strong,
.limit-values strong {
  margin-top: 3px;
  font-size: 0.86rem;
}

.card-usage {
  margin: 17px 0 0;
}

.card-empty {
  min-height: 440px;
}

.card-form-layout .form-card {
  align-self: start;
}

.color-field > div:not(.color-picker) {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.color-field > div:not(.color-picker) input[type="color"] {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
}

.color-field > div:not(.color-picker) > span {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
}

.color-field > .color-picker {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.color-picker-trigger-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}

.color-picker-value {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-picker-panel {
  position: absolute;
  z-index: 80;
  inset-inline: 0;
  top: calc(100% + 6px);
  display: grid;
  gap: 11px;
  width: 100%;
  max-height: min(460px, calc(100dvh - 24px));
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--brand));
  border-radius: 13px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

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

.color-picker.is-above .color-picker-panel {
  top: auto;
  bottom: calc(100% + 6px);
}

.color-picker-saturation {
  --color-picker-hue: 0;
  position: relative;
  width: calc(100% + 24px);
  height: 142px;
  margin: -12px -12px 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-width: 0 0 1px;
  border-radius: 12px 12px 11px 11px;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(var(--color-picker-hue) 100% 50%));
  cursor: crosshair;
  touch-action: none;
}

.color-picker-saturation:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent);
  outline-offset: 2px;
}

.color-picker-saturation-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.48),
    0 2px 8px rgb(0 0 0 / 0.28);
  pointer-events: none;
}

.color-picker-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
}

.color-picker-hue {
  display: block;
  min-width: 0;
}

.color-picker-hue input[type="range"] {
  appearance: none;
  display: block;
  width: 100%;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.color-picker-hue input[type="range"]:focus {
  box-shadow: none;
}

.color-picker-hue input[type="range"]::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(to right, #f33, #ff3, #3f3, #3ff, #33f, #f3f, #f33);
}

.color-picker-hue input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -3px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.32),
    0 2px 6px rgb(0 0 0 / 0.2);
}

.color-picker-hue input[type="range"]::-moz-range-track {
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(to right, #f33, #ff3, #3f3, #3ff, #33f, #f3f, #f33);
}

.color-picker-hue input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.32),
    0 2px 6px rgb(0 0 0 / 0.2);
}

.color-picker-preview {
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}

.color-picker-hex {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.color-picker-hex:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}

.color-picker-hex.has-error {
  border-color: var(--danger);
}

.color-picker-hex > span {
  padding-left: 11px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.76rem;
}

.color-picker-hex input {
  min-height: 40px;
  padding: 7px 10px 7px 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: ui-monospace, monospace;
  font-size: 0.76rem;
  text-transform: lowercase;
}

.color-picker-hex input:focus,
.color-picker-hex input:hover {
  border: 0;
  box-shadow: none;
}

.color-picker-palette {
  display: grid;
  gap: 7px;
}

.color-picker-palette > small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.color-picker-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  gap: 6px;
}

.color-picker-preset {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0;
  border: 2px solid var(--surface-raised);
  border-radius: 8px;
  background: var(--preset-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 80%, transparent);
  transition:
    transform var(--ease),
    box-shadow var(--ease);
}

.color-picker-preset:hover,
.color-picker-preset:focus-visible {
  outline: 0;
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px var(--brand);
}

.color-picker-preset.is-selected {
  box-shadow:
    0 0 0 2px var(--brand),
    inset 0 0 0 2px rgb(255 255 255 / 0.72);
}

.card-preview-wrap {
  display: grid;
  gap: 16px;
  padding: 14px;
}

.card-preview-wrap .credit-card-visual {
  margin-top: 4px;
}

.card-detail-grid {
  display: grid;
  gap: 18px;
}

.card-detail-aside {
  display: grid;
  align-self: start;
  gap: 16px;
  min-width: 0;
}

.limit-panel {
  padding-bottom: 18px;
}

.limit-panel .progress-track {
  margin: 18px;
}

.limit-values {
  grid-template-columns: repeat(3, 1fr);
  padding: 0 18px;
}

.limit-values.has-credit {
  grid-template-columns: repeat(2, 1fr);
}

.limit-values strong {
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-detail-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.statement-hero {
  padding-bottom: 18px;
}

.cycle-form {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cycle-form .custom-select {
  width: auto;
  min-width: 160px;
}

.cycle-form .custom-select-trigger {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 0.7rem;
}

.statement-value-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 18px 14px;
}

.statement-value-row > div > span,
.statement-value-row > div > strong,
.statement-value-row > div > small {
  display: block;
}

.statement-value-row > div > span,
.statement-value-row small {
  color: var(--muted);
  font-size: 0.66rem;
}

.statement-value-row > div > strong {
  margin: 5px 0;
  font-size: clamp(1.7rem, 7vw, 2.5rem);
  letter-spacing: -0.055em;
}

.statement-breakdown {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 18px 18px;
}

.statement-breakdown div {
  padding: 11px;
  border-radius: 12px;
  background: var(--surface-subtle);
}

.statement-breakdown span,
.statement-breakdown strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statement-breakdown span {
  color: var(--muted);
  font-size: 0.68rem;
}

.statement-breakdown strong {
  margin-top: 3px;
  font-size: 0.78rem;
}

.payment-details {
  margin: 0 18px;
}

.payment-form {
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-subtle);
}

.statement-row {
  grid-template-columns: 40px minmax(0, 1fr) 44px;
  align-items: start;
}

.statement-row > .transaction-value {
  grid-column: 2;
  justify-self: start;
}

.statement-row form {
  display: flex;
  align-items: center;
  gap: 4px;
}

.statement-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.statement-actions .icon-button.small {
  width: 44px;
  height: 44px;
}

.payment-row {
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: start;
}

.payment-row > .transaction-value {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
}

.payment-row > .item-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
}

.form-origin-summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-radius: 13px;
  background: var(--surface-subtle);
}

.form-origin-summary > div {
  min-width: 0;
}

.form-origin-summary > div > span,
.form-origin-summary > div > strong,
.form-origin-summary > div > small,
.form-origin-summary > strong {
  display: block;
}

.form-origin-summary > div > span,
.form-origin-summary small {
  color: var(--muted);
  font-size: 0.65rem;
}

.form-origin-summary > div > strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-origin-summary > strong {
  font-size: 0.75rem;
  white-space: nowrap;
}

.summary-hero {
  display: grid;
  gap: 20px;
  margin-bottom: 16px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--hero);
  color: #fff;
}

.summary-hero .section-kicker {
  color: color-mix(in srgb, var(--hero-accent) 55%, #fff);
}

.summary-hero h2 {
  margin-top: 7px;
  font-size: 1.5rem;
}

.summary-hero p {
  max-width: 520px;
  margin-bottom: 0;
  color: rgb(255 255 255 / 0.65);
  font-size: 0.75rem;
}

.summary-hero-values {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.summary-hero-values div {
  min-width: 0;
  padding: 11px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.07);
}

.summary-hero-values span,
.summary-hero-values strong,
.summary-hero-values small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-hero-values span,
.summary-hero-values small {
  color: rgb(255 255 255 / 0.68);
  font-size: 0.68rem;
}

.summary-hero-values strong {
  margin-top: 3px;
  color: #fff;
  font-size: 0.82rem;
}

.summary-hero-values small {
  margin-top: 4px;
  font-size: 0.62rem;
}

.budget-grid {
  display: grid;
  gap: 14px;
}

.budget-filter-empty {
  grid-column: 1 / -1;
}

.budget-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.budget-card.is-over {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

.budget-card-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.budget-card-head strong,
.budget-card-head small {
  display: block;
}

.budget-card-head small {
  color: var(--muted);
  font-size: 0.65rem;
}

.budget-percent {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.budget-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.budget-values div {
  padding: 9px;
  border-radius: 10px;
  background: var(--surface-subtle);
}

.budget-values span,
.budget-values strong {
  display: block;
}

.budget-values span {
  color: var(--muted);
  font-size: 0.59rem;
}

.budget-values strong {
  margin-top: 2px;
  font-size: 0.75rem;
}

.budget-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.budget-form .money-input-wrap,
.budget-form > .button {
  height: 48px;
}

.budget-form .money-input-wrap input {
  height: 100%;
  min-height: 0;
}

.budget-delete {
  margin-top: 8px;
  text-align: right;
}

.data-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 1.1rem;
}

.settings-nav {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-bottom: 20px;
  padding: 4px 0 8px;
  scrollbar-width: none;
}

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

.settings-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.settings-section {
  display: grid;
  gap: 14px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--topbar-height) + 16px);
}

.settings-section-copy h2 {
  margin-top: 8px;
  font-size: 1.35rem;
}

.settings-section-copy p {
  max-width: 430px;
  font-size: 0.75rem;
}

.settings-card {
  display: grid;
  gap: 16px;
}

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

.theme-choice {
  position: relative;
}

.theme-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.theme-choice > span {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}

.theme-choice input:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 12%, transparent);
}

.preference-toggle {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-subtle);
  cursor: pointer;
}

.preference-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.preference-toggle-control {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--muted);
  transition: background 160ms ease;
}

.preference-toggle-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgb(20 33 27 / 0.18);
  transition: transform 160ms ease;
}

.preference-toggle input:checked + .preference-toggle-control {
  background: var(--brand);
}

.preference-toggle input:checked + .preference-toggle-control::after {
  transform: translateX(18px);
}

.preference-toggle input:focus-visible + .preference-toggle-control {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 3px;
}

.preference-toggle-copy {
  display: grid;
  gap: 4px;
}

.preference-toggle-copy strong {
  color: var(--text);
  font-size: 0.76rem;
}

.preference-toggle-copy small {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

.theme-choice input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent);
  outline-offset: 3px;
}

.theme-choice i {
  grid-row: 1 / span 2;
  width: 24px;
  height: 24px;
  border: 6px solid color-mix(in srgb, var(--swatch) 22%, var(--surface));
  border-radius: 50%;
  background: var(--swatch);
}

.theme-choice strong,
.theme-choice small {
  display: block;
}

.theme-choice strong {
  font-size: 0.72rem;
}

.theme-choice small {
  color: var(--muted);
  font-size: 0.58rem;
}

.list-card {
  padding-block: 6px;
}

@media (max-width: 767px) {
  .list-card {
    padding-bottom: 18px;
  }
}

.settings-list {
  display: grid;
  gap: 0;
}

.settings-list-action .button {
  width: 100%;
}

.settings-list-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}

.settings-list-row:last-child {
  border-bottom: 0;
}

.category-chip.is-muted > span,
.category-chip.is-muted > strong {
  opacity: 0.56;
}

.settings-list-row.is-muted > :not(.row-actions) {
  opacity: 0.56;
}

.settings-list-row strong,
.settings-list-row small {
  display: block;
}

.settings-list-row small {
  color: var(--muted);
  font-size: 0.63rem;
}

.settings-row-value {
  grid-column: 2;
  font-size: 0.72rem;
}

.settings-list-row .row-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.category-group h3 {
  margin-bottom: 0;
}

.category-list {
  gap: 20px;
}

.category-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 3px 4px 3px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.category-chip > span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--item-color) 13%, var(--surface));
  color: color-mix(in srgb, var(--item-color) 35%, var(--text));
}

.category-chip strong {
  font-size: 0.65rem;
}

.category-chip .category-protected {
  color: var(--muted);
  cursor: default;
}

.category-chip .category-protected:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted);
  transform: none;
}

.data-actions > div {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.data-actions > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.data-actions p {
  margin: 2px 0 8px;
  font-size: 0.67rem;
}

.data-action-buttons {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  gap: 8px;
}

.reassign-page {
  display: grid;
  gap: 16px;
}

.reassign-page .page-heading {
  margin-bottom: 0;
}

.reassign-summary,
.reassign-batch,
.reassign-delete {
  display: grid;
  gap: 16px;
}

.reassign-summary h2,
.reassign-summary h3,
.reassign-batch h2,
.reassign-batch h3,
.reassign-delete h2,
.reassign-delete h3 {
  margin-bottom: 0;
}

.reassign-summary-source {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.reassign-summary-source > div {
  min-width: 0;
}

.reassign-summary-source h2 {
  overflow-wrap: anywhere;
}

.reassign-summary-source p {
  margin: 3px 0 0;
  font-size: 0.7rem;
}

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

.reassign-summary-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-subtle);
}

.reassign-summary-item > i {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.reassign-summary-item span,
.reassign-summary-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reassign-summary-item strong {
  overflow: hidden;
  justify-self: end;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reassign-notice {
  margin: 0;
}

.reassign-batch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.reassign-batch-head label,
.reassign-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
}

[data-reassignment-select-all],
[data-reassignment-item] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 5px;
  accent-color: var(--brand-strong);
}

[data-reassignment-select-all]:disabled,
[data-reassignment-item]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

[data-reassignment-selected-count] {
  justify-self: start;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.reassign-batch-controls {
  display: grid;
  gap: 10px;
}

.reassign-batch-controls .button {
  width: 100%;
}

[data-reassignment-batch-submit]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

.settings-card.reassign-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 18px;
}

.reassign-list > header,
.reassign-list > .panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border);
}

.reassign-list > header h2,
.reassign-list > header h3,
.reassign-list > header p,
.reassign-list > .panel-head h2,
.reassign-list > .panel-head h3,
.reassign-list > .panel-head p {
  margin-bottom: 0;
}

.reassign-list > header p,
.reassign-list > .panel-head p {
  margin-top: 4px;
  font-size: 0.7rem;
}

.reassign-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-width: 0;
  padding: 16px 4px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  transition:
    background var(--ease),
    box-shadow var(--ease);
}

.reassign-row:last-of-type {
  border-bottom: 0;
}

.reassign-row:focus-within {
  background: color-mix(in srgb, var(--surface-subtle) 38%, transparent);
  box-shadow: inset 3px 0 color-mix(in srgb, var(--brand) 55%, transparent);
}

.reassign-row:has([data-reassignment-item]:checked) {
  background: color-mix(in srgb, var(--brand-soft) 42%, transparent);
  box-shadow: inset 3px 0 var(--brand);
}

.reassign-check {
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.reassign-check:has([data-reassignment-item]:checked) {
  border-color: transparent;
  background: transparent;
}

.reassign-row.is-blocked .reassign-check {
  cursor: not-allowed;
}

@media (hover: hover) {
  .reassign-row:not(.is-blocked):hover {
    background: color-mix(in srgb, var(--surface-subtle) 28%, transparent);
  }
}

.reassign-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.reassign-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.reassign-heading > strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.35;
}

.reassign-main > p {
  margin: 0;
  font-size: 0.67rem;
}

.reassign-badges,
.reassign-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.reassign-badges > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  white-space: nowrap;
}

.reassign-badges > span + span {
  background: var(--danger-soft);
  color: var(--danger);
}

.reassign-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.reassign-meta > *:not(:last-child)::after {
  margin-left: 6px;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  content: "·";
}

.reassign-individual {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.reassign-individual,
.reassign-individual form {
  display: grid;
  gap: 10px;
}

.reassign-individual:empty {
  display: none;
}

.reassign-individual .button {
  width: 100%;
  min-height: 46px;
}

.reassign-blocked {
  grid-column: 1 / -1;
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.45;
}

.reassign-blocked a {
  color: var(--brand-strong);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.reassign-pagination {
  grid-column: 1 / -1;
  margin-top: 0;
  padding: 14px 0 0;
}

.reassign-delete {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface));
}

.reassign-delete p {
  max-width: 680px;
  margin-bottom: 0;
}

.reassign-delete form,
.reassign-delete .button {
  justify-self: start;
}

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-height) - var(--bottom-nav-height) - 60px);
  text-align: center;
}

.error-code {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  height: 110px;
  margin-bottom: 18px;
}

.error-code span {
  color: var(--surface-subtle);
  font-size: 5.5rem;
  font-weight: 800;
  line-height: 1;
}

.error-code i {
  position: absolute;
  color: var(--brand-strong);
  font-size: 2.2rem;
}

.error-page h1 {
  margin-top: 8px;
}

.error-page p {
  max-width: 470px;
}

.error-page .heading-actions {
  justify-content: center;
}

@media (min-width: 540px) {
  :root {
    --page-inline: 24px;
  }

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

  .hero-breakdown div {
    padding: 13px;
  }

  .hero-breakdown strong {
    font-size: 0.86rem;
  }

  .hero-breakdown,
  .summary-hero-values,
  .statement-breakdown {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-hero-values.is-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-item {
    grid-template-columns: 44px 40px minmax(0, 1fr) auto;
  }

  .timeline-amount {
    grid-column: auto;
    justify-self: end;
  }

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

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

  .filter-form {
    grid-template-columns: minmax(160px, 1fr) auto auto;
  }

  .filter-form.budget-filter-form {
    grid-template-columns: minmax(160px, 1fr) auto;
  }

  .filter-form .search-field {
    grid-column: 1 / -1;
  }

  .filter-form .button {
    align-self: end;
  }

  .filter-clear {
    align-self: center;
    justify-self: start;
  }

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

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

  .theme-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .settings-list-row {
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
  }

  .settings-row-value {
    grid-column: auto;
  }

  .settings-list-row .row-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .reassign-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  }

  .reassign-batch-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .reassign-batch-controls .field {
    grid-column: 1 / -1;
  }

  .reassign-batch-controls [data-reassignment-selected-count] {
    grid-column: 1;
    align-self: center;
  }

  .reassign-batch-controls .button {
    grid-column: 2;
    width: auto;
    min-width: 180px;
  }

  form.reassign-individual {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  form.reassign-individual .button {
    width: auto;
  }

  .reassign-delete {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .reassign-delete > .empty-icon {
    grid-row: 1 / span 2;
  }

  .reassign-delete form {
    grid-column: 2;
  }
}

@media (min-width: 768px) {
  :root {
    --page-inline: 28px;
    --topbar-height: 74px;
  }

  .sidebar {
    position: fixed;
    z-index: 70;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: 72px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 10px;
    border-right: 1px solid var(--border);
    background: var(--surface);
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
  }

  .app-stage {
    margin-left: 72px;
  }

  .bottom-nav {
    display: none;
  }

  .page {
    padding-bottom: 42px;
  }

  .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
  }

  .brand-copy {
    display: none;
  }

  .sidebar-create {
    width: 48px;
    height: 48px;
    margin: 0 auto 18px;
    padding: 0;
    border-radius: 15px;
  }

  .sidebar-create span {
    display: none;
  }

  .sidebar-nav {
    display: grid;
    gap: 6px;
  }

  .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
  }

  .nav-link i {
    font-size: 1.18rem;
  }

  .nav-link span,
  .nav-link kbd {
    display: none;
  }

  .nav-link.is-active {
    background: var(--brand-soft);
    color: var(--brand-strong);
  }

  .sidebar-foot {
    display: grid;
    gap: 5px;
    margin-top: auto;
  }

  .mobile-brand {
    display: none;
  }

  .topbar {
    padding-inline: var(--page-inline);
  }

  .desktop-command {
    display: inline-grid;
  }

  .page-heading {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .page-heading h1 {
    margin-bottom: 7px;
  }

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

  .hero-balance {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    padding: 30px;
  }

  .hero-breakdown {
    align-self: center;
  }

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

  .chart-panel-wide {
    grid-column: 1 / -1;
  }

  .onboarding-card {
    grid-template-columns: 0.8fr 1.2fr;
    align-items: center;
  }

  .filter-form {
    grid-template-columns: minmax(190px, 1fr) auto auto auto auto;
  }

  .filter-form.budget-filter-form {
    grid-template-columns: minmax(190px, 1fr) auto auto;
  }

  .filter-form .search-field {
    grid-column: auto;
  }

  .ledger-row {
    grid-template-columns: 52px 42px minmax(180px, 1fr) auto auto auto;
  }

  .ledger-date {
    display: block;
  }

  .ledger-main {
    grid-column: auto;
  }

  .ledger-value {
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
    font-size: 0.76rem;
  }

  .ledger-status {
    display: block;
  }

  .ledger-row.is-projected .ledger-status,
  .ledger-row.is-overdue .ledger-status {
    grid-column: auto;
    grid-row: auto;
  }

  .ledger-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .ledger-actions,
  .recurring-row .row-actions {
    flex-direction: row;
  }

  .ledger-actions .icon-button.small,
  .recurring-row .row-actions .icon-button.small,
  .statement-actions .icon-button.small {
    width: 36px;
    height: 36px;
  }

  .trash-row {
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
  }

  .trash-row .ledger-main,
  .trash-row .ledger-value,
  .trash-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .recurring-row {
    grid-template-columns: 52px 44px minmax(200px, 1fr) auto auto;
  }

  .recurring-row > .category-icon {
    display: grid;
  }

  .recurring-value {
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
  }

  .recurring-row .row-actions {
    grid-column: auto;
    grid-row: auto;
  }

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

  .form-card,
  .settings-card {
    padding: 24px;
  }

  .settings-card.reassign-list {
    gap: 0;
    padding: 24px;
  }

  .sticky-actions {
    position: static;
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .toast-region {
    right: 24px;
    left: auto;
    width: 440px;
  }

  .card-detail-aside {
    grid-template-columns: minmax(300px, 1fr) minmax(280px, 0.8fr);
  }

  .statement-row {
    grid-template-columns: 40px minmax(0, 1fr) auto auto;
    align-items: center;
  }

  .statement-row > .transaction-value,
  .statement-row > .statement-actions {
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
  }

  .payment-row {
    grid-template-columns: 40px minmax(0, 1fr) auto minmax(76px, auto);
    align-items: center;
  }

  .payment-row > .transaction-value,
  .payment-row > .item-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .summary-hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
    align-items: center;
  }

  .summary-hero.is-four {
    grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1.45fr);
  }

  .summary-hero-values.is-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .settings-section {
    grid-template-columns: minmax(200px, 0.55fr) minmax(0, 1.45fr);
    gap: 28px;
  }
}

@media (min-width: 1120px) {
  :root {
    --page-inline: 36px;
  }

  .sidebar {
    width: 248px;
    padding: 24px 18px;
  }

  .filter-form.transaction-filter-form {
    grid-template-columns: minmax(160px, 1fr) repeat(3, clamp(160px, 11vw, 200px)) auto;
  }

  .app-stage {
    margin-left: 248px;
  }

  .brand {
    justify-content: flex-start;
    gap: 11px;
    padding-inline: 7px;
  }

  .brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
  }

  .brand-copy strong {
    font-size: 1.08rem;
  }

  .brand-copy small {
    color: var(--muted);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .sidebar-create {
    width: 100%;
    height: auto;
    margin: 0 0 22px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
  }

  .sidebar-create span {
    display: inline;
  }

  .nav-link {
    justify-content: flex-start;
    gap: 12px;
    padding: 0 13px;
    font-size: 0.78rem;
    font-weight: 700;
  }

  .nav-link span {
    display: inline;
  }

  .nav-link kbd {
    display: inline;
    margin-left: auto;
  }

  .hero-balance {
    grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
  }

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

  .chart-panel-wide {
    grid-column: span 8;
  }

  .chart-panel:not(.chart-panel-wide) {
    grid-column: span 4;
  }

  .budget-panel {
    grid-column: span 4;
  }

  .upcoming-panel {
    grid-column: span 8;
  }

  .cards-overview-panel {
    grid-column: span 5;
  }

  .activity-panel {
    grid-column: span 7;
  }

  .insight-panel {
    grid-column: span 12;
  }

  .insight-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
    align-items: start;
  }

  .compact-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  }

  .form-aside,
  .card-preview-wrap {
    position: sticky;
    top: calc(var(--topbar-height) + 22px);
  }

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

  .card-detail-grid {
    grid-template-columns: minmax(310px, 0.65fr) minmax(0, 1.35fr);
    align-items: start;
  }

  .card-detail-aside {
    position: sticky;
    top: calc(var(--topbar-height) + 22px);
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .settings-section {
    grid-template-columns: minmax(240px, 0.5fr) minmax(0, 1.5fr);
    gap: 44px;
  }

  .reassign-row {
    grid-template-columns: 24px minmax(260px, 1fr) minmax(360px, 0.82fr);
    align-items: center;
    gap: 16px;
  }

  .reassign-check {
    align-self: center;
  }

  .reassign-individual {
    grid-column: auto;
    padding-top: 0;
    border-top: 0;
  }

  .reassign-row.is-blocked .reassign-main {
    grid-column: 2 / -1;
  }

  .reassign-blocked {
    grid-column: auto;
  }
}

.attachment-picker {
  position: relative;
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-subtle);
}

.attachment-picker.has-error,
.attachment-picker.has-client-error {
  border-color: var(--danger);
}

.attachment-picker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 14px;
}

.attachment-picker-head > div {
  min-width: 0;
}

.attachment-picker-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 750;
}

.attachment-picker-head p,
.attachment-upload-card > div:first-child p {
  margin: 3px 0 0;
  font-size: 0.68rem;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--border));
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.attachment-chip {
  min-height: 44px;
  margin-top: 5px;
  padding: 8px 11px;
}

.attachment-chip:hover {
  border-color: color-mix(in srgb, var(--brand) 44%, var(--border));
  color: var(--brand-strong);
}

.attachment-chip.is-readonly {
  min-height: 28px;
  margin-top: 5px;
  padding: 5px 9px;
  background: var(--surface-subtle);
  color: var(--muted);
}

.attachment-dropzone {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 92px;
  padding: 14px;
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--border));
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  cursor: pointer;
  transition:
    border-color var(--ease),
    background var(--ease),
    box-shadow var(--ease);
}

.attachment-dropzone:hover,
.attachment-dropzone:focus-visible,
.attachment-dropzone.is-dragging {
  outline: 0;
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 48%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}

.attachment-dropzone.is-disabled {
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
}

.attachment-dropzone-icon,
.attachment-selection-preview,
.attachment-preview {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--brand-strong);
}

.attachment-dropzone-icon {
  width: 42px;
  height: 42px;
  font-size: 1.15rem;
}

.attachment-dropzone strong,
.attachment-dropzone small {
  display: block;
}

.attachment-dropzone strong {
  color: var(--text-soft);
  font-size: 0.73rem;
}

.attachment-dropzone small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.64rem;
}

.attachment-picker-actions {
  display: grid;
  gap: 8px;
}

.attachment-picker-button {
  width: 100%;
  cursor: pointer;
}

.attachment-picker-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
  pointer-events: none;
}

.attachment-input-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0;
}

.attachment-selection,
.attachment-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attachment-selection:empty {
  display: none;
}

.attachment-selection-item,
.attachment-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.attachment-selection-preview {
  width: 44px;
  height: 44px;
  font-size: 1.15rem;
}

.attachment-selection-item > .icon-button.small {
  width: 44px;
  height: 44px;
}

.attachment-selection-preview img,
.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-selection-main,
.attachment-row-main {
  display: block;
  min-width: 0;
}

.attachment-selection-main strong,
.attachment-selection-main small,
.attachment-row-main strong,
.attachment-row-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-selection-main strong,
.attachment-row-main strong {
  font-size: 0.72rem;
}

.attachment-selection-main small,
.attachment-row-main small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.63rem;
}

.attachment-picker-status {
  min-height: 1em;
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 0.65rem;
}

.attachment-picker-status:empty {
  display: none;
}

.attachment-picker-status.is-error {
  color: var(--danger);
  font-weight: 700;
}

.attachment-entry-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.attachment-entry-summary > div {
  min-width: 0;
}

.attachment-entry-summary > div > span,
.attachment-entry-summary > div > strong,
.attachment-entry-summary > div > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-entry-summary > div > span,
.attachment-entry-summary > div > small {
  color: var(--muted);
  font-size: 0.65rem;
}

.attachment-entry-summary > div > strong {
  font-size: 0.79rem;
}

.attachment-entry-summary .attachment-chip {
  margin-top: 0;
}

.attachment-manager-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.attachment-upload-card > div:first-child h2 {
  margin: 6px 0 0;
  font-size: 1.15rem;
}

.attachment-upload-card [data-attachment-submit]:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
  transform: none;
}

.attachment-list-panel {
  min-width: 0;
  overflow: hidden;
}

.attachment-list-panel:has(.item-actions.is-open) {
  overflow: visible;
}

.attachment-list {
  padding: 12px 16px 16px;
}

.attachment-row {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 10px;
}

.attachment-preview {
  width: 48px;
  height: 48px;
  color: var(--danger);
  font-size: 1.25rem;
}

.attachment-row-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.attachment-row-actions .icon-button.small {
  width: 44px;
  height: 44px;
}

@media (min-width: 540px) {
  .attachment-picker-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attachment-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .attachment-preview {
    width: 52px;
    height: 52px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .attachment-picker-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachment-camera-button {
    display: none;
  }
}

@media (min-width: 768px) {
  .attachment-picker {
    padding: 17px;
  }

  .attachment-row-actions .icon-button.small {
    width: 36px;
    height: 36px;
  }

  .attachment-upload-card .sticky-actions {
    justify-content: space-between;
  }
}

@media (min-width: 1120px) {
  .attachment-manager-layout {
    grid-template-columns: minmax(330px, 0.8fr) minmax(0, 1.2fr);
    gap: 20px;
  }
}

@media (min-width: 1380px) {
  .hero-balance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-breakdown.is-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .credit-card-grid {
    grid-template-columns: repeat(3, minmax(320px, 1fr));
  }
}

.simulator-nav {
  margin-bottom: 6px;
}

.simulator-form {
  align-content: start;
}

.simulator-grid-contents {
  display: contents;
}

.simulator-form-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.simulator-form-head h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.simulator-form-head p {
  max-width: 600px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.simulator-form-divider {
  height: 1px;
  margin-block: 2px;
  background: var(--border);
}

.unit-input-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  transition:
    border-color var(--ease),
    box-shadow var(--ease);
}

.unit-input-wrap:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--border));
}

.unit-input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}

.unit-input-wrap:has(input[aria-invalid="true"]) {
  border-color: var(--danger);
}

.unit-input-wrap input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
}

.unit-prefix,
.unit-suffix {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.unit-prefix {
  padding-left: 12px;
}

.unit-suffix {
  padding-right: 12px;
}

.simulator-form-error {
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 700;
}

.simulator-actions {
  padding-top: 2px;
}

.simulator-output {
  display: grid;
  gap: 16px;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius);
  outline: 0;
  background: var(--hero);
  color: #fff;
  box-shadow: 0 18px 42px color-mix(in srgb, var(--hero) 22%, transparent);
}

.simulator-output:focus-visible {
  box-shadow:
    0 0 0 3px var(--hero-accent),
    0 18px 42px color-mix(in srgb, var(--hero) 22%, transparent);
}

.simulator-output-summary {
  display: grid;
  gap: 4px;
}

.simulator-output-summary > span,
.simulator-output-summary > small {
  color: rgb(255 255 255 / 0.68);
  font-size: 0.67rem;
}

.simulator-output-summary output {
  display: block;
  margin-block: 2px;
  color: #fff;
  font-size: clamp(1.75rem, 5vw, 2.55rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.simulator-output-list {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid rgb(255 255 255 / 0.13);
}

.simulator-output-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-block: 10px;
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
}

.simulator-output-list dt,
.simulator-output-list dd {
  margin: 0;
  font-size: 0.68rem;
}

.simulator-output-list dt {
  color: rgb(255 255 255 / 0.62);
}

.simulator-output-list dd {
  max-width: 58%;
  color: #fff;
  font-weight: 750;
  text-align: right;
}

.simulator-output-actions {
  display: flex;
  justify-content: flex-end;
}

.simulator-tier-grid {
  display: grid;
  gap: 8px;
}

.simulator-tier-head {
  display: none;
}

.simulator-tier-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-subtle) 46%, var(--surface));
}

.simulator-tier-row > strong {
  align-self: center;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.simulator-tier-open {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding-inline: 12px;
  border: 1px dashed var(--border);
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.68rem;
}

@media (min-width: 540px) {
  .simulator-tier-head,
  .simulator-tier-row {
    grid-template-columns: minmax(76px, 0.42fr) minmax(140px, 1fr) minmax(160px, 1fr);
    align-items: center;
  }

  .simulator-tier-head {
    display: grid;
    gap: 8px;
    padding-inline: 12px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 750;
  }
}

@media (min-width: 768px) {
  .simulator-trip-energy-grid,
  #energy-simulator:has(input[name="energy_mode"][value="appliance"]:checked) .simulator-energy-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #energy-simulator:has(input[name="energy_mode"][value="bill"]:checked) .simulator-energy-fields,
  .simulator-vehicle-use-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simulator-trip-electric-price {
    grid-column: span 2;
  }

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

  .simulator-adaptive-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (min-width: 1120px) {
  .simulator-section {
    grid-template-columns: minmax(210px, 0.42fr) minmax(0, 1.58fr);
  }
}

@media (min-width: 1600px) {
  .simulator-vehicle-use-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .simulator-vehicle-electric-wide,
  .simulator-vehicle-plugin-wide {
    grid-column: span 2;
  }
}

@media (min-width: 768px) and (max-height: 680px) {
  .sidebar {
    padding: 10px 6px;
  }

  .brand {
    margin-bottom: 10px;
  }

  .sidebar-create {
    height: 44px;
    margin-bottom: 10px;
  }

  .sidebar-nav,
  .sidebar-foot {
    gap: 2px;
  }

  .nav-link {
    min-height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: color-mix(in srgb, var(--text) 35%, transparent);
  }

  .button,
  input,
  select,
  textarea,
  .panel,
  .unit-input-wrap,
  .simulator-tier-row,
  .attachment-picker,
  .attachment-dropzone,
  .attachment-selection-item,
  .attachment-row,
  .attachment-entry-summary,
  .attachment-preview {
    border-width: 2px;
  }
}
