:root {
  color-scheme: dark;
  --canvas: #050506;
  --surface: rgba(28, 28, 30, 0.86);
  --surface-solid: #1c1c1e;
  --surface-raised: #242426;
  --surface-inset: #111113;
  --glass: rgba(32, 32, 35, 0.68);
  --glass-strong: rgba(43, 43, 47, 0.78);
  --label: #f5f5f7;
  --secondary: #aeaeb2;
  --tertiary: #77777f;
  --separator: rgba(255, 255, 255, 0.1);
  --separator-strong: rgba(255, 255, 255, 0.16);
  --blue: #0a84ff;
  --green: #30d158;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --red: #ff453a;
  --purple: #bf5af2;
  --cyan: #64d2ff;
  --radius-outer: 30px;
  --radius-card: 24px;
  --radius-control: 16px;
  --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-glass: 0 14px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.9);
  outline-offset: 3px;
}

::selection {
  background: rgba(10, 132, 255, 0.34);
  color: white;
}

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

main {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% -4%, rgba(10, 132, 255, 0.2), transparent 30rem),
    radial-gradient(circle at 8% 34%, rgba(191, 90, 242, 0.13), transparent 30rem),
    radial-gradient(circle at 78% 74%, rgba(48, 209, 88, 0.06), transparent 27rem),
    var(--canvas);
}

main::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.018),
    transparent 38%,
    rgba(255, 255, 255, 0.012)
  );
  content: "";
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 0 32px;
}

/* Dynamic guidance */

.spending-alert {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 60px;
  overflow: hidden;
  border: 1px solid rgba(255, 159, 10, 0.3);
  border-radius: 20px;
  background:
    linear-gradient(105deg, rgba(255, 159, 10, 0.14), rgba(255, 69, 58, 0.05) 58%, transparent),
    var(--glass);
  padding: 12px 16px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.09),
    var(--shadow-glass);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
}

.spending-alert::after {
  position: absolute;
  top: 0;
  right: 8%;
  left: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.26), transparent);
  content: "";
}

.spending-alert-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffb22e, var(--orange));
  color: #211506;
  font-size: 17px;
  font-weight: 800;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    0 0 0 6px rgba(255, 159, 10, 0.08);
}

.spending-alert strong {
  display: block;
  margin-bottom: 3px;
  color: #ffd68a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.spending-alert p {
  margin: 0;
  color: rgba(245, 245, 247, 0.84);
  font-size: 13px;
  line-height: 1.4;
}

/* Floating navigation layer */

.topbar {
  position: sticky;
  z-index: 20;
  top: max(10px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  margin-top: 10px;
  border: 1px solid var(--separator);
  border-radius: 22px;
  background: rgba(20, 20, 22, 0.7);
  padding: 10px 12px 10px 14px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    var(--shadow-glass);
  -webkit-backdrop-filter: blur(34px) saturate(170%);
  backdrop-filter: blur(34px) saturate(170%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--label);
  text-decoration: none;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #2f9cff, #006ee6);
  color: white;
  font-size: 21px;
  font-weight: 600;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.38),
    0 7px 20px rgba(10, 132, 255, 0.28);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}

.updated-label {
  margin-right: 5px;
  color: var(--tertiary);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.language-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 38px;
  border: 1px solid var(--separator);
  border-radius: 13px;
  background: rgba(118, 118, 128, 0.16);
  padding: 3px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.language-switch button {
  min-width: 38px;
  min-height: 30px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.language-switch button.active {
  background: rgba(255, 255, 255, 0.17);
  color: white;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 2px 7px rgba(0, 0, 0, 0.3);
}

.language-switch button:active {
  transform: scale(0.96);
}

.month-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--separator);
  border-radius: 13px;
  background: rgba(118, 118, 128, 0.14);
  padding: 0 13px;
  color: var(--label);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.month-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow:
    0 0 0 4px rgba(48, 209, 88, 0.1),
    0 0 12px rgba(48, 209, 88, 0.42);
}

/* Month navigation and timeline */

.month-history {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 2px 10px;
  scrollbar-width: none;
}

.month-history::-webkit-scrollbar {
  display: none;
}

.month-history button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--separator);
  border-radius: 13px;
  background: rgba(44, 44, 46, 0.55);
  padding: 0 14px;
  color: var(--secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.month-history button:hover {
  border-color: var(--separator-strong);
  background: rgba(58, 58, 60, 0.7);
  color: var(--label);
}

.month-history button.active {
  border-color: rgba(10, 132, 255, 0.56);
  background: rgba(10, 132, 255, 0.16);
  color: #8ecaff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
}

.month-history button:active {
  transform: scale(0.97);
}

.history-count,
.month-history > span {
  margin-left: auto;
  color: var(--tertiary);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.month-timeline {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 17px;
  background: rgba(18, 18, 20, 0.56);
  padding: 13px 15px 15px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.timeline-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--tertiary);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline-copy strong {
  color: #7fc1ff;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.timeline-track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.3);
}

.timeline-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #5ac8fa);
  box-shadow: 0 0 12px rgba(10, 132, 255, 0.28);
}

.timeline-track i {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 3px solid #151517;
  border-radius: 50%;
  background: var(--green);
  box-shadow:
    0 0 0 2px #5ac8fa,
    0 0 16px rgba(48, 209, 88, 0.3);
  transform: translate(-50%, -50%);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(390px, 0.98fr);
  gap: clamp(38px, 6vw, 76px);
  align-items: center;
  padding: 68px 0 48px;
}

.hero-copy {
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 13px;
  color: #70b7ff;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 700px;
  margin-bottom: 22px;
  color: white;
  font-size: clamp(52px, 6.2vw, 82px);
  font-weight: 720;
  line-height: 0.94;
  letter-spacing: -0.065em;
}

h1 em {
  color: #98989f;
  font-style: normal;
  font-weight: 720;
}

.hero-intro {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--secondary);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.55;
  letter-spacing: -0.012em;
}

.balance-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 270px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-outer);
  background:
    radial-gradient(circle at 94% 8%, rgba(10, 132, 255, 0.2), transparent 42%),
    linear-gradient(145deg, rgba(43, 43, 47, 0.95), rgba(20, 20, 22, 0.96));
  padding: 28px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.09),
    var(--shadow-card);
}

.balance-card::after {
  position: absolute;
  z-index: -1;
  top: -90px;
  right: -55px;
  width: 210px;
  height: 210px;
  border: 30px solid rgba(10, 132, 255, 0.07);
  border-radius: 50%;
  content: "";
}

.balance-topline,
.pace-row,
.balance-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.balance-topline {
  color: var(--secondary);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.balance-main {
  gap: 24px;
  padding: 30px 0 27px;
}

.balance-main strong {
  display: block;
  color: white;
  font-size: clamp(42px, 5vw, 62px);
  font-weight: 720;
  letter-spacing: -0.06em;
  line-height: 1;
}

.balance-caption {
  display: block;
  margin-top: 9px;
  color: var(--secondary);
  font-size: 13px;
}

.progress-ring {
  --progress: 0deg;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--progress), rgba(118, 118, 128, 0.28) 0);
  box-shadow: 0 0 30px rgba(48, 209, 88, 0.08);
}

.progress-ring::before {
  position: absolute;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  background: #1d1d20;
  content: "";
}

.progress-ring span {
  position: relative;
  z-index: 1;
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}

.pace-row {
  border-top: 1px solid var(--separator);
  padding-top: 18px;
  color: var(--secondary);
  font-size: 12px;
}

.pace-row strong {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

/* Summary and category cards */

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

.stat-card {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 24px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.05),
    0 16px 44px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.stat-card p {
  max-width: calc(100% - 42px);
  margin-bottom: 28px;
  color: var(--secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-card > strong,
.editable-value {
  display: flex;
  align-items: baseline;
  color: white;
  font-size: clamp(31px, 3.5vw, 42px);
  font-weight: 720;
  letter-spacing: -0.05em;
}

.editable-value input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.stat-card small {
  display: block;
  margin-top: 8px;
  color: var(--tertiary);
  font-size: 11px;
  line-height: 1.35;
}

.stat-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--separator);
  border-radius: 11px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--blue);
  font-size: 16px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.stat-card.savings .stat-icon {
  color: var(--purple);
}

.stat-card.expenses .stat-icon {
  color: var(--cyan);
}

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

.category-strip article {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 19px;
  background: rgba(28, 28, 30, 0.72);
  padding: 15px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.category-symbol,
.expense-monogram {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
}

.category-strip article > span:last-child {
  min-width: 0;
}

.category-strip small {
  display: block;
  overflow: hidden;
  margin-bottom: 4px;
  color: var(--tertiary);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-strip strong {
  display: block;
  color: var(--label);
  font-size: 14px;
  font-weight: 690;
}

.food,
.category-f {
  background: rgba(48, 209, 88, 0.13);
  color: var(--green);
}

.services,
.category-s {
  background: rgba(100, 210, 255, 0.13);
  color: var(--cyan);
}

.luxury,
.category-l {
  background: rgba(255, 69, 58, 0.13);
  color: #ff6961;
}

.debt,
.category-d {
  background: rgba(191, 90, 242, 0.13);
  color: var(--purple);
}

.devices,
.category-i {
  background: rgba(255, 214, 10, 0.13);
  color: var(--yellow);
}

/* Breakdown */

.breakdown-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-outer);
  background: rgba(28, 28, 30, 0.78);
  padding: clamp(24px, 4vw, 36px);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.05),
    var(--shadow-card);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.breakdown-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.breakdown-heading {
  margin-bottom: 25px;
}

.breakdown-heading h2,
.section-heading h2,
.add-panel h2,
.empty-state h3 {
  margin-bottom: 0;
  color: var(--label);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.045em;
}

.breakdown-heading > strong,
.section-heading > span {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.breakdown-bar {
  display: flex;
  height: 30px;
  overflow: hidden;
  border: 4px solid #111113;
  border-radius: 13px;
  background: var(--surface-inset);
  box-shadow:
    inset 0 2px 7px rgba(0, 0, 0, 0.55),
    0 1px rgba(255, 255, 255, 0.04);
}

.breakdown-segment {
  min-width: 2px;
  height: 100%;
  border-right: 2px solid #111113;
  transition: filter 180ms ease;
}

.breakdown-segment:hover {
  filter: brightness(1.18);
}

.breakdown-segment.food,
.breakdown-dot.food {
  background: var(--green);
}

.breakdown-segment.services,
.breakdown-dot.services {
  background: var(--cyan);
}

.breakdown-segment.luxury,
.breakdown-dot.luxury {
  background: var(--red);
}

.breakdown-segment.debt,
.breakdown-dot.debt {
  background: var(--purple);
}

.breakdown-segment.devices,
.breakdown-dot.devices {
  background: var(--yellow);
}

.breakdown-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 19px;
}

.breakdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 15px;
  background: rgba(44, 44, 46, 0.48);
  padding: 11px 12px;
}

.breakdown-dot {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.breakdown-item span:last-child {
  min-width: 0;
}

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

.breakdown-item strong {
  margin-bottom: 3px;
  color: var(--label);
  font-size: 11px;
}

.breakdown-item small {
  color: var(--tertiary);
  font-size: 10px;
}

/* Ledger and entry */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(310px, 0.72fr);
  gap: 12px;
  margin-top: 12px;
}

.activity-panel,
.add-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-outer);
  background: rgba(28, 28, 30, 0.8);
  padding: clamp(24px, 4vw, 34px);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.05),
    var(--shadow-card);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.section-heading {
  margin-bottom: 18px;
}

.expense-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.expense-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 68px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 11px 0;
}

.expense-list li:first-child {
  border-top: 0;
}

.expense-monogram {
  background: rgba(118, 118, 128, 0.14);
  color: var(--secondary);
}

.expense-info {
  min-width: 0;
}

.expense-info strong,
.expense-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-info strong {
  margin-bottom: 5px;
  color: var(--label);
  font-size: 14px;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.expense-info small {
  color: var(--tertiary);
  font-size: 10px;
}

.expense-amount {
  color: var(--label);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.empty-state {
  padding: 50px 20px;
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(118, 118, 128, 0.14);
  color: var(--secondary);
}

.empty-state p {
  margin: 9px 0 0;
  color: var(--tertiary);
  font-size: 13px;
}

.add-panel {
  background:
    linear-gradient(160deg, rgba(10, 132, 255, 0.06), transparent 46%),
    rgba(28, 28, 30, 0.84);
}

.add-panel h2 {
  margin-bottom: 9px;
}

.form-intro {
  margin-bottom: 23px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.45;
}

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

.add-panel label {
  margin: 7px 0 -4px;
  color: var(--secondary);
  font-size: 11px;
  font-weight: 620;
}

.add-panel input,
.add-panel select,
.amount-field {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  background: rgba(58, 58, 60, 0.58);
  color: var(--label);
  outline: 0;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.add-panel > form > input,
.add-panel select {
  padding: 0 14px;
}

.add-panel input::placeholder {
  color: #6b6b72;
}

.add-panel input:focus,
.add-panel select:focus,
.amount-field:focus-within {
  border-color: rgba(10, 132, 255, 0.7);
  box-shadow:
    0 0 0 3px rgba(10, 132, 255, 0.15),
    inset 0 1px rgba(255, 255, 255, 0.05);
}

.amount-field {
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.amount-field > span {
  color: var(--secondary);
  font-size: 18px;
  font-weight: 650;
}

.amount-field input {
  min-height: 48px;
  border: 0;
  background: transparent;
  padding: 0 0 0 8px;
  box-shadow: none;
  font-size: 18px;
  font-weight: 650;
}

.amount-field input:focus {
  box-shadow: none;
}

.add-panel button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 52px;
  margin-top: 10px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(#1690ff, #087af0);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 680;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.3),
    0 10px 25px rgba(10, 132, 255, 0.22);
  transition:
    filter 160ms ease,
    transform 160ms ease;
}

.add-panel button[type="submit"]:hover {
  filter: brightness(1.08);
}

.add-panel button[type="submit"]:active {
  transform: scale(0.985);
}

.chat-hint {
  display: flex;
  gap: 9px;
  margin: 22px 0 0;
  border-top: 1px solid var(--separator);
  padding-top: 17px;
  color: var(--tertiary);
  font-size: 11px;
  line-height: 1.45;
}

.chat-hint > span:first-child {
  color: #70b7ff;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 4px 10px;
  color: var(--tertiary);
  font-size: 10px;
  letter-spacing: 0.08em;
}

footer p {
  margin: 0;
  letter-spacing: 0;
}

@media (hover: hover) {
  .stat-card,
  .category-strip article,
  .breakdown-item {
    transition:
      border-color 180ms ease,
      background 180ms ease,
      transform 180ms ease;
  }

  .stat-card:hover,
  .category-strip article:hover {
    border-color: rgba(255, 255, 255, 0.13);
    background-color: rgba(36, 36, 38, 0.9);
    transform: translateY(-2px);
  }
}

@media (max-width: 960px) {
  .updated-label {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 56px 0 40px;
  }

  .hero-copy {
    max-width: 720px;
  }

  .balance-card {
    min-height: auto;
  }

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

  .stat-card:last-child {
    grid-column: 1 / -1;
  }

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

  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --radius-outer: 26px;
    --radius-card: 21px;
  }

  .shell {
    width: min(100% - 24px, 1180px);
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .spending-alert {
    align-items: flex-start;
    min-height: 0;
    border-radius: 18px;
    padding: 12px 13px;
  }

  .spending-alert-icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .spending-alert p {
    font-size: 12px;
  }

  .topbar {
    top: max(7px, env(safe-area-inset-top));
    min-height: 58px;
    border-radius: 19px;
    padding: 8px 9px 8px 11px;
  }

  .brand > span:last-child {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .header-meta {
    gap: 6px;
  }

  .language-switch {
    min-height: 36px;
  }

  .language-switch button {
    min-width: 34px;
    min-height: 28px;
  }

  .month-pill {
    min-height: 36px;
    padding: 0 10px;
    font-size: 10px;
  }

  .history-count,
  .month-history > span {
    display: none;
  }

  .month-history {
    margin-right: -12px;
    padding-top: 14px;
    padding-right: 12px;
  }

  .month-timeline {
    padding: 12px 13px 14px;
  }

  .timeline-copy {
    font-size: 9px;
  }

  .timeline-copy strong {
    font-size: 10px;
  }

  .hero {
    gap: 26px;
    padding: 44px 0 34px;
  }

  h1 {
    max-width: 520px;
    margin-bottom: 18px;
    font-size: clamp(47px, 15vw, 64px);
  }

  .hero-intro {
    font-size: 15px;
  }

  .balance-card {
    border-radius: 26px;
    padding: 22px;
  }

  .balance-main {
    padding: 26px 0 23px;
  }

  .balance-main strong {
    font-size: clamp(39px, 12vw, 50px);
  }

  .progress-ring {
    width: 76px;
    height: 76px;
  }

  .progress-ring::before {
    width: 60px;
    height: 60px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card,
  .stat-card:last-child {
    grid-column: auto;
    min-height: 156px;
    padding: 21px;
  }

  .category-strip {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    margin-right: -12px;
    padding-right: 12px;
    scrollbar-width: none;
  }

  .category-strip::-webkit-scrollbar {
    display: none;
  }

  .category-strip article {
    flex: 0 0 190px;
  }

  .breakdown-panel,
  .activity-panel,
  .add-panel {
    padding: 22px;
  }

  .breakdown-heading,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .breakdown-legend {
    grid-template-columns: 1fr 1fr;
  }

  .expense-list li {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
  }

  .expense-info small {
    max-width: 46vw;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .month-pill {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .breakdown-legend {
    grid-template-columns: 1fr;
  }

  .balance-main {
    align-items: flex-end;
  }

  .progress-ring {
    width: 68px;
    height: 68px;
  }

  .progress-ring::before {
    width: 54px;
    height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --separator: rgba(255, 255, 255, 0.24);
    --secondary: #d1d1d6;
    --tertiary: #aeaeb2;
  }

  .topbar,
  .spending-alert,
  .stat-card,
  .breakdown-panel,
  .activity-panel,
  .add-panel {
    background-color: #1c1c1e;
  }
}
