:root {
  --bg: #f7b98d;
  --bg-soft: #ffd9bd;
  --phone: #fff8ef;
  --surface: #fffdf8;
  --surface-soft: #fff0df;
  --surface-muted: #f7eadf;
  --text: #263650;
  --muted: #857568;
  --muted-strong: #4f5b70;
  --teal: #67b7a6;
  --teal-deep: #358c7a;
  --sky: #91cbd0;
  --yellow: #f4bf55;
  --coral: #eea27f;
  --navy: #263e64;
  --red: #cf5f6f;
  --green: #2d9b76;
  --border: #f0dccb;
  --shadow: 0 18px 48px rgba(94, 62, 42, 0.14);
  --soft-shadow: 0 10px 28px rgba(94, 62, 42, 0.09);
  --radius: 24px;
  --app-width: 430px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 242, 139, 0.5), transparent 8rem),
    radial-gradient(circle at 86% 10%, rgba(145, 203, 208, 0.34), transparent 9rem),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  font-family: "Nunito", "Avenir Next", Arial, sans-serif;
  line-height: 1.42;
}

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

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

button {
  color: inherit;
}

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

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

h1,
h2,
h3,
.button,
.quick-card strong,
.entry-amount,
.bottom-nav button {
  font-family: "Baloo 2", "Nunito", Arial, sans-serif;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-family: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: clamp(1.82rem, 8.2vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.05;
}

h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.1;
}

.phone-shell {
  position: relative;
  width: min(100%, var(--app-width));
  max-width: 100vw;
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(158px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  background:
    radial-gradient(circle at 86% 4%, rgba(255, 229, 113, 0.52), transparent 2rem),
    linear-gradient(180deg, #fffdf8 0%, var(--phone) 100%);
}

.mobile-header,
.section-title,
.header-actions,
.entry-top,
.entry-meta,
.dialog-top,
.dialog-actions,
.loading-card {
  display: flex;
  align-items: center;
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 20;
  justify-content: space-between;
  gap: 12px;
  margin: calc(-18px - env(safe-area-inset-top)) -16px 14px;
  padding: calc(18px + env(safe-area-inset-top)) 16px 14px;
  background: rgba(255, 248, 239, 0.9);
  backdrop-filter: blur(16px);
}

.mobile-header > div:first-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.tiny-label,
.section-title span,
.entry-note,
.entry-meta,
.quick-card small,
.search-panel p,
.profile-panel p,
.balance-card small {
  color: var(--muted);
}

.tiny-label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.08;
}

.header-plant {
  position: relative;
  width: 48px;
  height: 50px;
  flex: 0 0 auto;
  margin-left: auto;
  display: none;
}

.header-plant::after {
  content: "";
  position: absolute;
  left: 16px;
  bottom: 2px;
  width: 22px;
  height: 17px;
  border-radius: 5px 5px 10px 10px;
  background: var(--coral);
}

.header-plant span {
  position: absolute;
  bottom: 14px;
  width: 4px;
  height: 30px;
  border-radius: 999px;
  background: var(--teal-deep);
  transform-origin: bottom;
}

.header-plant span:nth-child(1) {
  left: 22px;
  transform: rotate(-25deg);
}

.header-plant span:nth-child(2) {
  left: 28px;
  height: 36px;
}

.header-plant span:nth-child(3) {
  left: 32px;
  transform: rotate(25deg);
}

.header-actions {
  flex: 0 0 auto;
  gap: 10px;
}

.circle-button {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--navy);
  box-shadow: var(--soft-shadow);
  cursor: pointer;
}

.circle-button.small {
  width: 34px;
  height: 34px;
  box-shadow: none;
}

.dot {
  position: absolute;
  top: 11px;
  right: 12px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--coral);
}

.icon-search,
.icon-bell,
.home-icon,
.wallet-icon,
.chart-icon,
.user-icon {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
}

.icon-search::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 2px;
  top: 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-search::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  right: 1px;
  bottom: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.icon-bell::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 14px;
  left: 4px;
  top: 2px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 6px 6px;
}

.icon-bell::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  left: 6px;
  bottom: 1px;
  border-radius: 999px;
  background: currentColor;
}

.search-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.search-panel p {
  margin: 9px 4px 0;
  font-size: 0.84rem;
  font-weight: 800;
}

.search-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.search-result-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: #fff8ef;
  text-align: left;
  cursor: pointer;
}

.search-result-card strong,
.search-result-card span {
  display: block;
}

.search-result-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.search-result-card strong {
  color: var(--text);
  font-weight: 900;
}

.search-result-type {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--navy);
  color: #fff8ef !important;
  font-size: 0.7rem !important;
  font-weight: 900;
}

.sync-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--soft-shadow);
}

.sync-panel > div:first-child {
  display: grid;
  gap: 2px;
}

.sync-panel span,
.sync-panel small {
  display: block;
}

.sync-panel span {
  color: var(--navy);
  font-family: "Baloo 2", "Nunito", Arial, sans-serif;
  font-size: clamp(0.92rem, 4.8vw, 1.08rem);
  font-weight: 900;
  line-height: 1.12;
}

.sync-panel small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.sync-panel[data-state="success"] {
  border-color: rgba(103, 183, 166, 0.46);
  background: rgba(103, 183, 166, 0.16);
}

.sync-panel[data-state="warning"] {
  border-color: rgba(244, 191, 85, 0.55);
  background: rgba(244, 191, 85, 0.16);
}

.sync-panel[data-state="error"] {
  border-color: rgba(207, 95, 111, 0.42);
  background: rgba(207, 95, 111, 0.12);
}

.sync-panel[data-state="loading"] {
  border-color: rgba(145, 203, 208, 0.62);
  background: rgba(145, 203, 208, 0.16);
}

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sync-actions .text-button {
  min-height: 32px;
  background: rgba(255, 253, 248, 0.8);
}

.sync-actions .text-button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.search-box {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 14px;
  background: #fffaf2;
  color: var(--navy);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.balance-card {
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 18px 18px 18px 20px;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 232, 111, 0.82), transparent 2.6rem),
    linear-gradient(135deg, #ffd2ad 0%, #f2ac86 100%);
  box-shadow: var(--shadow);
}

.balance-card::after {
  content: "";
  position: absolute;
  right: -16px;
  bottom: -24px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.24);
}

.balance-card > div:first-child,
.round-action,
.balance-art {
  position: relative;
  z-index: 1;
}

.balance-card span {
  display: block;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.balance-card strong {
  display: block;
  margin-top: 1px;
  color: var(--text);
  font-family: "Baloo 2", "Nunito", Arial, sans-serif;
  font-size: 1.78rem;
  line-height: 1.02;
}

.balance-card small {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 800;
}

.balance-art {
  width: 58px;
  height: 66px;
  flex: 0 0 auto;
  margin-left: 2px;
  margin-right: 52px;
}

.coin {
  position: absolute;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: inset -4px -5px 0 rgba(214, 146, 44, 0.16);
}

.coin.one {
  width: 28px;
  height: 28px;
  right: 2px;
  top: 5px;
}

.coin.two {
  width: 20px;
  height: 20px;
  left: 9px;
  bottom: 11px;
  background: var(--teal);
}

.leaf {
  position: absolute;
  right: 12px;
  bottom: 8px;
  width: 16px;
  height: 34px;
  border-radius: 999px;
  border-left: 4px solid var(--teal-deep);
  transform: rotate(25deg);
}

.round-action {
  border: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface);
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: var(--soft-shadow);
  cursor: pointer;
}

.app-section,
.summary-panel,
.form-sheet,
.profile-panel {
  margin-bottom: 20px;
}

.app-view {
  display: none;
  min-width: 0;
  max-width: 100%;
}

.app-view.is-active {
  display: block;
}

.section-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.form-title-row {
  align-items: start;
}

.section-title span {
  font-size: 0.8rem;
  font-weight: 900;
}

.text-link {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.sub-title {
  margin-top: 22px;
}

.reminder-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(74px, 0.72fr) minmax(74px, 0.72fr);
  gap: 8px;
  margin-bottom: 12px;
}

.reminder-summary.compact {
  grid-template-columns: minmax(0, 1.25fr) minmax(74px, 0.72fr) minmax(74px, 0.72fr);
}

.reminder-summary article {
  min-width: 0;
  padding: 10px 9px;
  border: 1px solid rgba(103, 183, 166, 0.16);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.78);
}

.reminder-summary span,
.reminder-summary strong {
  display: block;
}

.reminder-summary span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.reminder-summary strong {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: clamp(0.74rem, 3.7vw, 0.86rem);
  line-height: 1.16;
  font-weight: 900;
}

.payment-scroll {
  display: grid;
  grid-auto-columns: minmax(100%, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.payment-scroll::-webkit-scrollbar {
  display: none;
}

.payment-card {
  position: relative;
  min-height: 162px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  overflow: hidden;
  border-radius: 22px;
  background: var(--sky);
  color: var(--text);
  box-shadow: var(--soft-shadow);
}

.payment-card::after,
.quick-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.22);
}

.payment-card.featured {
  background: linear-gradient(145deg, #65b6a5 0%, #43a08c 100%);
  color: #fffdf8;
}

.payment-card.tone-1 {
  background: var(--sky);
}

.payment-card.tone-2 {
  background: var(--yellow);
}

.payment-card.tone-3 {
  background: var(--coral);
}

.payment-card.featured .payment-sub,
.payment-card.featured .entry-note {
  color: rgba(255, 253, 248, 0.84);
}

.payment-brand {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(47, 43, 36, 0.09);
}

.payment-card strong,
.payment-card .payment-sub,
.payment-card .entry-note {
  position: relative;
  z-index: 1;
}

.payment-card strong {
  display: block;
  margin-top: 8px;
  font-weight: 900;
}

.payment-sub {
  display: block;
  margin-top: 1px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.status-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--navy);
  font-size: 0.68rem;
  font-weight: 900;
}

.status-pill.upcoming {
  background: rgba(103, 183, 166, 0.18);
  color: #2f786c;
}

.status-pill.overdue {
  background: rgba(238, 162, 127, 0.24);
  color: #a64b36;
}

.status-pill.paid {
  background: rgba(38, 62, 100, 0.12);
  color: var(--muted);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.quick-card {
  position: relative;
  min-width: 0;
  max-width: 100%;
  min-height: 136px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  padding: 14px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
}

.quick-card.tone-teal {
  background: var(--teal);
  color: #fffdf8;
}

.quick-card.tone-sky {
  background: var(--sky);
}

.quick-card.tone-yellow {
  background: var(--yellow);
}

.quick-card.tone-coral {
  background: var(--coral);
  color: #fffdf8;
}

.quick-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(52, 43, 32, 0.08);
}

.quick-graphic {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 1;
  width: 54px;
  height: 54px;
  color: transparent;
  font-size: 0;
}

.quick-graphic::before,
.quick-graphic::after {
  content: "";
  position: absolute;
}

.quick-graphic::before {
  inset: 9px 13px 6px;
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.86);
  transform: rotate(-8deg);
}

.quick-graphic::after {
  left: 20px;
  top: 17px;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--navy);
  box-shadow: 0 9px 0 var(--navy), 0 18px 0 var(--navy);
  opacity: 0.32;
}

.quick-card.tone-sky .quick-graphic::before {
  width: 12px;
  height: 44px;
  inset: 4px auto auto 25px;
  border-radius: 999px;
  background: var(--coral);
  transform: rotate(-28deg);
}

.quick-card.tone-sky .quick-graphic::after {
  left: 20px;
  top: 36px;
  width: 28px;
  height: 10px;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: none;
  transform: rotate(-28deg);
  opacity: 1;
}

.quick-card.tone-yellow .quick-graphic::before {
  inset: 9px;
  border: 5px solid rgba(255, 253, 248, 0.88);
  border-top-color: transparent;
  border-radius: 50%;
  background: transparent;
  transform: rotate(22deg);
}

.quick-card.tone-yellow .quick-graphic::after {
  left: 24px;
  top: 24px;
  width: 10px;
  height: 16px;
  border-radius: 999px;
  background: var(--navy);
  box-shadow: 0 15px 0 -3px var(--navy);
  opacity: 0.28;
}

.quick-card.tone-coral .quick-graphic::before {
  inset: 12px;
  border-radius: 50%;
  background: conic-gradient(var(--navy) 0 35%, rgba(255, 253, 248, 0.9) 35% 100%);
  transform: none;
}

.quick-card.tone-coral .quick-graphic::after {
  left: 14px;
  top: 30px;
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: rgba(38, 62, 100, 0.3);
  box-shadow: none;
}

.quick-card strong,
.quick-card small,
.quick-icon {
  position: relative;
  z-index: 2;
}

.quick-card strong {
  max-width: 100%;
  font-size: 1.04rem;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.quick-card small {
  max-width: 100%;
  color: inherit;
  opacity: 0.78;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.entry-list {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.entry-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 13px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.entry-card.tone-teal,
.entry-card.tone-sky,
.entry-card.tone-yellow,
.entry-card.tone-coral {
  border: 0;
}

.entry-card.tone-teal {
  background: rgba(103, 183, 166, 0.22);
}

.entry-card.tone-sky {
  background: rgba(145, 203, 208, 0.26);
}

.entry-card.tone-yellow {
  background: rgba(244, 191, 85, 0.22);
}

.entry-card.tone-coral {
  background: rgba(238, 162, 127, 0.23);
}

.entry-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.entry-left {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.entry-logo {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 15px;
  background: var(--surface);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 7px 16px rgba(77, 55, 37, 0.08);
}

.entry-title {
  min-width: 0;
  max-width: 100%;
}

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

.entry-title strong {
  font-weight: 900;
}

.entry-note {
  font-size: 0.78rem;
  font-weight: 800;
}

.entry-amount {
  max-width: 90px;
  justify-self: end;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 900;
}

.money-out {
  color: var(--red);
}

.money-in {
  color: var(--green);
}

.entry-meta {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  min-width: 0;
  max-width: 100%;
  font-size: 0.72rem;
  font-weight: 900;
}

.entry-meta span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 253, 248, 0.76);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
  margin-top: 10px;
}

.reminder-card .entry-actions {
  justify-content: flex-start;
}

.text-button,
.danger-button {
  max-width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-strong);
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

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

.summary-panel,
.form-sheet,
.profile-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.summary-panel {
  background:
    radial-gradient(circle at 88% 10%, rgba(244, 191, 85, 0.28), transparent 5rem),
    var(--surface);
}

.summary-panel select,
.filter-row select {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffaf2;
  color: var(--muted-strong);
  padding: 0 10px;
  font-weight: 900;
}

.donut-wrap {
  display: grid;
  place-items: center;
  padding: 12px 0 16px;
}

.donut-chart {
  width: min(72vw, 238px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) 0 40%, var(--yellow) 40% 68%, var(--coral) 68% 100%);
  box-shadow: inset 0 0 0 34px #fff8ef, var(--soft-shadow);
}

.donut-chart div {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #fff8ef;
  text-align: center;
}

.donut-chart strong {
  font-family: "Baloo 2", "Nunito", Arial, sans-serif;
  font-size: 1.12rem;
}

.donut-chart span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-stats div {
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.mini-stats div:nth-child(2) {
  background: rgba(145, 203, 208, 0.28);
}

.mini-stats div:nth-child(3) {
  background: rgba(244, 191, 85, 0.26);
}

.mini-stats span,
.mini-stats strong {
  display: block;
}

.mini-stats span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.mini-stats strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 900;
}

.ai-copy {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 18px;
  background: var(--navy);
  color: #fff8ef;
  font-size: 0.92rem;
  font-weight: 800;
}

.upload-card {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 22px;
  border: 1.5px dashed rgba(103, 183, 166, 0.72);
  border-radius: 24px;
  background:
    radial-gradient(circle at 82% 14%, rgba(244, 191, 85, 0.25), transparent 4rem),
    #fff8ef;
  text-align: center;
  cursor: pointer;
}

.upload-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.upload-card.is-dragover {
  border-color: var(--teal-deep);
  background: rgba(103, 183, 166, 0.15);
}

.upload-mark {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--teal);
  color: #fffdf8;
  font-size: 1.5rem;
  font-weight: 900;
}

.upload-card small,
.loading-card small {
  color: var(--muted);
}

.preview-wrap {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-soft);
}

.preview-wrap img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.loading-card {
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.scan-result-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.scan-ai-note {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(103, 183, 166, 0.42);
  border-radius: 20px;
  background: rgba(219, 241, 234, 0.68);
}

.scan-ai-note strong {
  color: var(--navy);
  font-size: 0.98rem;
  font-weight: 900;
}

.scan-ai-note span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.scan-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fffaf2;
}

.scan-choice button {
  min-height: 44px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 900;
  cursor: pointer;
}

.scan-choice button.is-active {
  background: var(--teal);
  color: #fffdf8;
  box-shadow: 0 10px 20px rgba(71, 151, 135, 0.18);
}

.loader {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(103, 183, 166, 0.24);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

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

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

.record-form h3 {
  margin-top: 16px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffaf2;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(103, 183, 166, 0.16);
}

.wide-field {
  grid-column: 1 / -1;
}

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 900;
  cursor: pointer;
}

.button.primary {
  background: var(--navy);
  color: #fff8ef;
  box-shadow: 0 12px 24px rgba(38, 62, 100, 0.2);
}

.button.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted-strong);
}

.button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.form-message {
  min-height: 20px;
  margin: -4px 2px 0;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.inline-search {
  margin-bottom: 12px;
}

.empty-state {
  padding: 22px;
  border: 1px dashed rgba(103, 183, 166, 0.7);
  border-radius: 22px;
  background: #fff8ef;
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.profile-panel {
  margin-bottom: 0;
  background:
    radial-gradient(circle at 84% 12%, rgba(238, 162, 127, 0.28), transparent 5rem),
    var(--surface);
}

.profile-panel p {
  margin-bottom: 0;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 30;
  width: min(calc(100% - 28px), 398px);
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr 1fr 70px 1fr 1fr;
  align-items: center;
  transform: translateX(-50%);
  border: 1px solid rgba(240, 220, 203, 0.9);
  border-radius: 30px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 18px 46px rgba(94, 62, 42, 0.2);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  border: 0;
  background: transparent;
  min-height: 54px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
  opacity: 0.56;
}

.bottom-nav small {
  font-size: 0.68rem;
}

.bottom-nav button.is-active {
  color: var(--teal-deep);
  opacity: 1;
}

.bottom-nav button.scan-tab {
  width: 58px;
  height: 58px;
  margin: -25px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--yellow) 0%, var(--coral) 100%);
  color: var(--navy) !important;
  box-shadow: 0 13px 24px rgba(238, 162, 127, 0.36);
  opacity: 1 !important;
}

.bottom-nav button.scan-tab span {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  border-radius: 7px;
  font-size: 0;
}

.bottom-nav button.scan-tab span::before,
.bottom-nav button.scan-tab span::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.bottom-nav button.scan-tab span::after {
  transform: rotate(90deg);
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}

.home-icon::before {
  width: 13px;
  height: 11px;
  left: 2px;
  bottom: 2px;
  border-radius: 3px;
}

.home-icon::after {
  width: 11px;
  height: 11px;
  left: 3px;
  top: 2px;
  border-right: 0;
  border-bottom: 0;
  transform: rotate(45deg);
}

.wallet-icon::before {
  width: 16px;
  height: 12px;
  left: 1px;
  top: 5px;
  border-radius: 4px;
}

.wallet-icon::after {
  width: 5px;
  height: 5px;
  right: 1px;
  top: 8px;
  border-radius: 50%;
  background: currentColor;
}

.chart-icon::before {
  width: 15px;
  height: 15px;
  left: 2px;
  top: 2px;
  border-radius: 4px;
}

.chart-icon::after {
  width: 2px;
  height: 9px;
  left: 8px;
  bottom: 4px;
  border: 0;
  background: currentColor;
  box-shadow: 5px -4px 0 currentColor, -5px 3px 0 currentColor;
}

.user-icon::before {
  width: 8px;
  height: 8px;
  left: 5px;
  top: 2px;
  border-radius: 50%;
}

.user-icon::after {
  width: 14px;
  height: 8px;
  left: 2px;
  bottom: 2px;
  border-radius: 12px 12px 4px 4px;
}

.edit-dialog {
  width: min(100% - 28px, 390px);
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: transparent;
}

.edit-dialog::backdrop {
  background: rgba(38, 54, 80, 0.34);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
}

.dialog-top,
.dialog-actions {
  justify-content: space-between;
  gap: 12px;
}

.dialog-top span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

@media (min-width: 560px) {
  .header-plant {
    display: block;
  }
}

@media (min-width: 820px) {
  body {
    padding: 28px 0;
  }

  .phone-shell {
    min-height: calc(100vh - 56px);
    border: 10px solid #fffdf8;
    border-radius: 46px;
    box-shadow: 0 28px 80px rgba(94, 62, 42, 0.22);
  }
}

@media (max-width: 380px) {
  .phone-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .mobile-header {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .balance-art {
    display: none;
  }

  .form-grid,
  .mini-stats {
    grid-template-columns: 1fr;
  }

  .quick-grid {
    gap: 10px;
  }

  .quick-card {
    min-height: 128px;
  }

  .quick-card strong,
  .quick-card small {
    max-width: 88px;
  }
}
