:root {
  color-scheme: light;
  --ink: #17253d;
  --muted: #8794aa;
  --muted-strong: #687794;
  --line: #e8edf5;
  --canvas: #f4f7fc;
  --surface: #ffffff;
  --blue: #3977ff;
  --blue-soft: #edf3ff;
  --coral: #ff6b6b;
  --coral-soft: #fff0ef;
  --mint: #18aa80;
  --mint-soft: #e9fbf5;
  --yellow: #bd8617;
  --yellow-soft: #fff6dc;
  --shadow: 0 16px 42px rgba(41, 75, 132, 0.07);
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 7% 3%, rgba(87, 145, 255, 0.1), transparent 24rem),
    var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(57, 119, 255, 0.32);
  outline-offset: 2px;
}

button:active {
  transform: translateY(1px);
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 32px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 10px 22px rgba(57, 119, 255, 0.25);
}

.brand-eyebrow,
.eyebrow,
.section-kicker {
  display: block;
  margin: 0;
  color: #8ba9e9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 1.2;
}

.brand-name {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-button {
  padding: 7px 11px;
  border: 1px solid rgba(57, 119, 255, 0.16);
  border-radius: 99px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 7px 16px rgba(57, 119, 255, 0.2);
}

.install-button:hover {
  background: #2f6dea;
}

.local-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted-strong);
  font-size: 12px;
  white-space: nowrap;
}

.local-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(24, 170, 128, 0.11);
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #ffe9c9;
  font-size: 22px;
  box-shadow: 0 5px 15px rgba(61, 79, 111, 0.12);
}

.main-content {
  padding-bottom: 50px;
}

.view {
  animation: view-in 0.22s ease-out;
}

@keyframes view-in {
  from { opacity: 0.35; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0 26px;
}

.home-heading {
  align-items: flex-start;
  margin-top: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 9px;
  color: var(--ink);
  font-size: clamp(31px, 4vw, 45px);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 1.13;
}

h1 span {
  color: var(--blue);
}

.view-heading h1 span[aria-hidden="true"] {
  color: inherit;
  font-size: 0.78em;
  letter-spacing: 0;
}

.month-chip,
.section-caption {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.month-chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 99px;
  background: var(--blue-soft);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 34px 36px 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, #3977ff 0%, #5d9aff 100%);
  color: #fff;
  box-shadow: 0 22px 46px rgba(57, 119, 255, 0.22);
}

.hero-card::before {
  position: absolute;
  top: -52px;
  right: 13%;
  width: 135px;
  height: 135px;
  border: 18px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  content: "";
}

.hero-card-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-one {
  right: -75px;
  bottom: -90px;
  width: 255px;
  height: 255px;
}

.orbit-two {
  right: 27px;
  bottom: -36px;
  width: 130px;
  height: 130px;
}

.hero-card-topline,
.hero-metrics {
  position: relative;
  z-index: 1;
  display: flex;
}

.hero-card-topline {
  align-items: flex-start;
  justify-content: space-between;
}

.hero-label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.hero-balance {
  display: block;
  margin-top: 7px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}

.hero-face {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 25px;
}

.hero-metrics {
  gap: clamp(24px, 7vw, 92px);
  margin-top: 35px;
}

.hero-metric {
  display: flex;
  flex-direction: column;
  min-width: 105px;
}

.hero-metric span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.hero-metric strong {
  margin-top: 5px;
  color: #fff;
  font-size: 18px;
}

.hero-metric-note strong {
  color: #ffe58e;
  font-size: 13px;
  font-weight: 700;
}

.section-block {
  margin-top: 36px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading-inline {
  align-items: center;
}

.section-heading h2,
.card-heading h2 {
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.section-caption {
  color: var(--muted);
  font-weight: 600;
}

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

.quick-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 112px;
  padding: 20px;
  border-radius: var(--radius-lg);
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.quick-expense {
  background: var(--coral-soft);
}

.quick-income {
  background: var(--mint-soft);
}

.quick-icon {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: #fff;
  color: var(--coral);
  font-size: 28px;
  font-weight: 800;
}

.quick-income .quick-icon {
  color: var(--mint);
}

.quick-title,
.quick-caption {
  display: block;
}

.quick-title {
  color: #293a57;
  font-size: 16px;
  font-weight: 800;
}

.quick-caption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.fake-shortcut {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  margin-top: 12px;
  padding: 15px 18px;
  border: 1px solid #f7df99;
  border-radius: var(--radius-md);
  background: linear-gradient(105deg, #fffdf6, #fff8e8);
  color: var(--ink);
  text-align: left;
}

.fake-shortcut:hover {
  border-color: #efc95d;
}

.fake-shortcut-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: #ffe6a3;
  color: #9d6e0b;
  font-size: 19px;
}

.fake-shortcut strong,
.fake-shortcut small {
  display: block;
}

.fake-shortcut strong {
  font-size: 15px;
}

.fake-shortcut small {
  margin-top: 2px;
  color: #a7884d;
  font-size: 12px;
}

.fake-shortcut-arrow {
  margin-left: auto;
  color: #b88317;
  font-size: 20px;
}

.text-button {
  padding: 7px 0;
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.text-button span {
  margin-left: 3px;
  font-size: 17px;
}

.recent-list,
.category-stat-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.record-row {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 87px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

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

.record-icon {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: var(--coral-soft);
  font-size: 23px;
}

.record-icon.income {
  background: var(--mint-soft);
}

.record-info {
  min-width: 0;
  flex: 1;
}

.record-name-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.record-name {
  overflow: hidden;
  color: #2b3b58;
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-note,
.record-time {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-amount-box {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
}

.record-amount {
  color: var(--coral);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.record-amount.income {
  color: var(--mint);
}

.record-time {
  margin: 0;
  font-size: 12px;
}

.fake-tag,
.type-tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 3px 7px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.fake-tag {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.empty-state {
  display: grid;
  min-height: 166px;
  place-items: center;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  box-shadow: var(--shadow);
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: #40506d;
  font-size: 17px;
}

.empty-emoji {
  display: block;
  margin-bottom: 4px;
  font-size: 30px;
}

.small-primary,
.primary-submit {
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(57, 119, 255, 0.19);
}

.small-primary {
  padding: 11px 14px;
  border-radius: 13px;
  font-size: 13px;
  white-space: nowrap;
}

.small-primary span {
  margin-right: 3px;
  font-size: 17px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border-radius: 15px;
  background: #eaf0fb;
}

.filter-item {
  padding: 10px 4px;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.filter-item.active {
  background: #fff;
  color: var(--blue);
  font-weight: 800;
  box-shadow: 0 4px 13px rgba(87, 111, 153, 0.09);
}

.filter-item[data-filter="expense"].active {
  color: var(--coral);
}

.filter-item[data-filter="income"].active {
  color: var(--mint);
}

.filter-item[data-filter="fake"].active {
  color: var(--yellow);
}

.month-filter-row {
  display: flex;
  align-items: center;
  min-height: 54px;
  gap: 16px;
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(49, 91, 160, 0.04);
}

.month-filter-row label {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
}

.month-filter-row input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.clear-button {
  margin-left: auto;
  padding: 4px 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.records-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 4px 10px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.toolbar-hint {
  color: var(--muted);
  font-weight: 500;
}

.date-group {
  margin-top: 24px;
}

.date-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 9px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 800;
}

.date-total {
  color: var(--blue);
  font-size: 13px;
}

.date-total.outside {
  color: var(--yellow);
}

.detail-list {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-record {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 13px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.detail-record:last-child {
  border-bottom: 0;
}

.detail-record .record-info {
  padding-top: 1px;
}

.detail-record .record-amount-box {
  min-width: 84px;
  margin-left: auto;
}

.record-actions {
  display: flex;
  flex: 1 0 100%;
  justify-content: flex-end;
  gap: 8px;
  padding-left: 59px;
}

.record-action {
  padding: 6px 11px;
  border-radius: 9px;
  background: #f2f5fa;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.record-action.delete {
  background: var(--coral-soft);
  color: var(--coral);
}

.stats-total-card {
  padding: 27px 30px 25px;
  border-radius: 25px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stats-total-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-strong);
  font-size: 14px;
}

.stats-total-top span:last-child {
  font-size: 25px;
}

.stats-total-card > strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: clamp(35px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.06em;
}

.stats-income-expense {
  display: flex;
  gap: 60px;
  margin-top: 24px;
}

.stats-income-expense span {
  display: flex;
  flex-direction: column;
}

.stats-income-expense small {
  color: var(--muted);
  font-size: 13px;
}

.stats-income-expense strong {
  margin-top: 4px;
  font-size: 16px;
}

.income-text {
  color: var(--mint);
}

.expense-text {
  color: var(--coral);
}

.stats-note {
  margin-top: 21px;
  color: var(--yellow);
  font-size: 13px;
}

.surface-card {
  margin-top: 18px;
  padding: 24px 26px;
  border-radius: 23px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.card-heading h2 {
  margin-top: 0;
  font-size: 18px;
}

.card-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  padding: 6px 10px;
  border-radius: 99px;
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.over {
  background: var(--coral-soft);
  color: var(--coral);
}

.budget-form {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.currency-symbol {
  color: var(--blue);
  font-size: 25px;
  font-weight: 800;
}

.budget-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.budget-form input::placeholder {
  color: #a8b3c5;
  font-size: 15px;
  font-weight: 500;
}

.budget-form button {
  padding: 9px 14px;
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.budget-progress-wrap {
  margin-top: 17px;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #eef2f8;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6acaa7, var(--mint));
  transition: width 0.2s ease;
}

.progress-track span.over {
  background: linear-gradient(90deg, #ff9a91, var(--coral));
}

.budget-progress-wrap p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.trend-card {
  padding-bottom: 20px;
}

.trend-heading {
  align-items: flex-start;
}

.segmented-control {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: #f0f3f8;
}

.segmented-control button {
  min-width: 35px;
  padding: 5px 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented-control button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 3px 9px rgba(87, 111, 153, 0.09);
}

.trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 190px;
  gap: 10px;
  margin-top: 19px;
  padding: 16px 4px 0;
}

.trend-chart.month-mode {
  min-width: 820px;
  justify-content: flex-start;
  gap: 12px;
}

.trend-scroll-wrap {
  overflow-x: auto;
  margin: 0 -5px;
  scrollbar-width: thin;
}

.trend-column {
  display: flex;
  align-items: center;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 34px;
  height: 174px;
}

.month-mode .trend-column {
  flex: 0 0 18px;
  min-width: 18px;
}

.trend-value {
  min-height: 17px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.trend-bar-track {
  display: flex;
  align-items: flex-end;
  width: 25px;
  height: 120px;
  margin-top: 3px;
  border-radius: 99px;
  background: #f0f3f8;
}

.month-mode .trend-bar-track {
  width: 18px;
}

.trend-bar {
  width: 100%;
  min-height: 0;
  border-radius: 99px;
  background: #9bbaff;
  transition: height 0.2s ease;
}

.trend-bar.today {
  background: var(--blue);
}

.trend-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.category-section {
  margin-top: 33px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

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

.stat-category-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--coral-soft);
  font-size: 21px;
}

.stat-category-main {
  min-width: 0;
  flex: 1;
}

.stat-category-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #42516b;
  font-size: 14px;
  font-weight: 700;
}

.progress-track.category-progress {
  height: 7px;
  margin-top: 10px;
}

.category-progress span {
  background: linear-gradient(90deg, #7ba5ff, var(--blue));
}

.stat-percent {
  flex: 0 0 42px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.floating-add {
  position: fixed;
  right: max(25px, calc((100vw - 1180px) / 2 + 18px));
  bottom: 24px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 18px 13px 14px;
  border-radius: 99px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 15px 29px rgba(57, 119, 255, 0.3);
}

.floating-add span:first-child {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 34, 54, 0.38);
  backdrop-filter: blur(4px);
}

.record-modal {
  width: min(100%, 560px);
  max-height: min(92vh, 820px);
  overflow-y: auto;
  padding: 12px 24px 28px;
  border-radius: 28px 28px 20px 20px;
  background: var(--canvas);
  box-shadow: 0 -20px 58px rgba(20, 34, 54, 0.18);
}

.modal-grabber {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 99px;
  background: #d6deea;
}

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

.modal-header h2 {
  margin-top: 6px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.modal-header h2 span {
  color: var(--blue);
  font-size: 22px;
}

.close-button {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 12px;
  background: #eaf0fb;
  color: var(--muted-strong);
  font-size: 25px;
  line-height: 1;
}

.type-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border-radius: 15px;
  background: #eaf0fb;
}

.type-switch button {
  padding: 12px;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.type-switch button.active-expense {
  background: #fff;
  color: var(--coral);
  box-shadow: 0 4px 13px rgba(87, 111, 153, 0.1);
}

.type-switch button.active-income {
  background: #fff;
  color: var(--mint);
  box-shadow: 0 4px 13px rgba(87, 111, 153, 0.1);
}

.amount-card,
.form-card,
.fake-account-card {
  margin-top: 15px;
  padding: 21px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(49, 91, 160, 0.05);
}

.amount-card {
  display: block;
  width: 100%;
}

.amount-card > span:first-child,
.form-label-row span:first-child,
.compact-form .form-row > span:first-child,
.common-notes-row > span:first-child {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
}

.amount-input-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  margin-top: 9px;
}

.amount-input-row b {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 34px;
  line-height: 1;
}

.amount-input-row input {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  height: 1.2em;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1.2;
}

.amount-input-row input::-webkit-outer-spin-button,
.amount-input-row input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.amount-input-row input[type="number"] {
  appearance: textfield;
}

.amount-input-row input::placeholder {
  color: #aeb9ca;
}

.form-label-row,
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.form-label-row em {
  color: #ff8b82;
  font-size: 12px;
  font-style: normal;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.category-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
}

.category-option.selected {
  border-color: #8eb1ff;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.category-icon {
  font-size: 19px;
}

.compact-form {
  padding: 0 21px;
}

.compact-form .form-row {
  min-height: 62px;
  border-bottom: 1px solid var(--line);
}

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

.field-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.field-control input,
.note-input {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.field-control input {
  max-width: 155px;
}

.field-control span {
  color: #a8b3c5;
  font-size: 23px;
}

.note-input {
  min-width: 0;
  flex: 1;
}

.note-input::placeholder {
  color: #a8b3c5;
  font-weight: 400;
}

.common-notes-row {
  padding: 15px 0 17px;
}

.note-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 2px;
}

.note-chip {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 99px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.fake-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 21px;
  border-color: var(--line);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.fake-account-card:has(input:checked) {
  border-color: #f7d57b;
  background: #fffaf0;
}

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

.fake-account-card strong {
  color: #42516b;
  font-size: 15px;
}

.fake-account-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.fake-switch {
  position: relative;
  display: block;
  flex: 0 0 45px;
  width: 45px;
  height: 26px;
  border-radius: 99px;
  background: #dfe6f0;
}

.fake-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.fake-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(64, 76, 101, 0.16);
  transition: transform 0.18s ease;
}

.fake-switch input:checked + i {
  transform: translateX(19px);
}

.fake-switch:has(input:checked) {
  background: #f5bd3f;
}

.primary-submit {
  width: 100%;
  margin-top: 17px;
  padding: 15px;
  border-radius: 15px;
  font-size: 16px;
}

.toast {
  position: fixed;
  bottom: 85px;
  left: 50%;
  z-index: 30;
  max-width: calc(100vw - 40px);
  padding: 11px 17px;
  border-radius: 99px;
  background: rgba(23, 37, 61, 0.9);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 820px) {
  .main-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .home-heading {
    margin-top: 25px;
  }

  .hero-card {
    max-width: 900px;
  }

  .record-modal {
    align-self: center;
    border-radius: 28px;
  }

  .modal-backdrop {
    align-items: center;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0 18px calc(94px + env(safe-area-inset-bottom));
  }

  .topbar {
    height: 75px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 19px;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-eyebrow {
    font-size: 9px;
  }

  .local-pill {
    padding: 6px 9px;
    font-size: 11px;
  }

  .install-button {
    padding: 6px 9px;
    font-size: 11px;
  }

  .avatar {
    width: 36px;
    height: 36px;
    font-size: 19px;
  }

  .view-heading {
    margin-top: 16px;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 32px;
  }

  .hero-card {
    padding: 25px 23px 22px;
    border-radius: 24px;
  }

  .hero-metrics {
    gap: 16px;
    margin-top: 27px;
  }

  .hero-metric {
    min-width: 0;
    flex: 1;
  }

  .hero-metric strong {
    font-size: 15px;
  }

  .hero-metric-note strong {
    font-size: 11px;
  }

  .section-block {
    margin-top: 29px;
  }

  .quick-card {
    min-height: 100px;
    padding: 15px 13px;
  }

  .quick-icon {
    flex-basis: 39px;
    width: 39px;
    height: 39px;
    border-radius: 13px;
    font-size: 24px;
  }

  .quick-title {
    font-size: 14px;
  }

  .quick-caption {
    font-size: 11px;
  }

  .recent-list {
    margin-right: -2px;
    margin-left: -2px;
  }

  .record-row {
    gap: 10px;
    padding: 14px 15px;
  }

  .record-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 20px;
  }

  .record-name,
  .record-amount {
    font-size: 14px;
  }

  .record-note,
  .record-time {
    font-size: 12px;
  }

  .floating-add {
    right: 18px;
    bottom: calc(75px + env(safe-area-inset-bottom));
    padding: 12px 16px 12px 12px;
  }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 4;
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 7px 24px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(226, 232, 242, 0.96);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(15px);
  }

  .nav-item {
    display: flex;
    align-items: center;
    flex: 1;
    flex-direction: column;
    gap: 1px;
    max-width: 100px;
    padding: 5px 12px;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
  }

  .nav-item > span {
    font-size: 21px;
    line-height: 1.1;
  }

  .nav-item small {
    font-size: 11px;
  }

  .nav-item.active {
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 800;
  }

  .records-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    margin-top: 19px;
  }

  .surface-card {
    padding: 20px 18px;
  }

  .stats-total-card {
    padding: 23px 20px;
  }

  .stats-income-expense {
    gap: 34px;
  }

  .record-modal {
    padding-right: 17px;
    padding-left: 17px;
  }

  .modal-backdrop {
    padding: 0;
  }

  .record-modal {
    width: 100%;
    max-height: 95vh;
    border-radius: 25px 25px 0 0;
  }

  .category-option {
    min-height: 58px;
    font-size: 12px;
  }

  .category-icon {
    font-size: 17px;
  }
}

@media (max-width: 380px) {
  .topbar-meta {
    gap: 6px;
  }

  .install-button {
    padding: 6px 8px;
    font-size: 10px;
  }

  .local-pill {
    display: none;
  }

  .quick-grid {
    gap: 10px;
  }

  .quick-card {
    gap: 8px;
    padding: 13px 10px;
  }

  .quick-caption {
    font-size: 10px;
  }
}
