:root {
  color-scheme: light;
  --background: #f4fbf5;
  --surface: #ffffff;
  --surface-low: #eef6ef;
  --surface-high: #e2eae4;
  --text: #161d1a;
  --muted: #6c7a73;
  --primary: #006c50;
  --primary-bright: #00c292;
  --primary-soft: #dff8ef;
  --danger: #a53b22;
  --danger-soft: #ffdad2;
  --tertiary: #873da6;
  --tertiary-soft: #f8d8ff;
  --line: rgba(22, 29, 26, 0.08);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

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

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  line-height: 1;
}

.app-shell {
  min-height: 100dvh;
  background:
    radial-gradient(circle at top right, rgba(0, 194, 146, 0.10), transparent 34rem),
    var(--background);
}

.mobile-frame {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 72px;
  padding: 12px 20px;
  padding-top: max(12px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(22, 29, 26, 0.06);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-bright);
  color: #004935;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8a958f;
}

.content {
  padding: 24px 20px 112px;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(22, 29, 26, 0.04);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
}

.label-caps {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.money-display {
  font-size: clamp(34px, 9vw, 48px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
}

.primary-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  background: var(--primary-bright);
  color: #004935;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(0, 194, 146, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

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

.secondary-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-low);
  color: var(--text);
  font-weight: 700;
}

.field {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: #edf4ef;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.field:focus {
  box-shadow: 0 0 0 2px var(--primary-bright);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  width: min(100%, 520px);
  transform: translateX(-50%);
  padding: 12px 20px max(16px, env(safe-area-inset-bottom));
  background: #ffffff;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: 0 -10px 28px rgba(22, 29, 26, 0.12);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.nav-item {
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #9aa3a0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-bright);
}

.fab {
  position: fixed;
  right: max(20px, calc((100vw - 520px) / 2 + 20px));
  bottom: calc(100px + env(safe-area-inset-bottom));
  z-index: 35;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 20px;
  background: var(--primary-bright);
  color: #004935;
  box-shadow: 0 14px 28px rgba(0, 194, 146, 0.28);
}

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

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

.category-tile {
  width: 132px;
  min-width: 132px;
  min-height: 132px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.amount-income {
  color: var(--primary-bright);
}

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

.login-wrap {
  min-height: 100dvh;
  padding: 28px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(100%, 420px);
  padding: 32px 24px;
}

.empty-state {
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
}

.chart-box {
  height: 220px;
  position: relative;
}

@media (min-width: 760px) {
  body {
    background: #eaf3ec;
  }

  .mobile-frame {
    margin-top: 24px;
    margin-bottom: 24px;
    min-height: calc(100dvh - 48px);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(22, 29, 26, 0.14);
  }

  .bottom-nav {
    bottom: 24px;
    border-radius: 24px;
  }
}
