:root {
  color: #1d1d1f;
  background: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --soft: #8f8f96;
  --line: #e7e7eb;
  --surface: rgba(255, 255, 255, 0.9);
  --glass: rgba(255, 255, 255, 0.72);
  --black: #111111;
  --accent: #d65738;
  --accent-dark: #873421;
  --accent-soft: #fdeee8;
  --warm: #fbfaf8;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.085);
  --soft-shadow: 0 8px 22px rgba(0, 0, 0, 0.055);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  min-height: 100%;
  background: #ffffff;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 20px calc(112px + env(safe-area-inset-bottom));
  position: relative;
}

@supports (min-height: 100dvh) {
  body,
  .app-shell {
    min-height: 100dvh;
  }
}

.topbar {
  min-height: 76px;
  margin-bottom: 12px;
  position: relative;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--soft);
  font-size: 12px;
}

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

h1 {
  max-width: 280px;
  font-size: 28px;
  font-weight: 520;
  line-height: 1.13;
}

h2 {
  font-size: 19px;
  font-weight: 520;
  line-height: 1.25;
}

h3 {
  font-size: 16px;
  font-weight: 520;
  line-height: 1.25;
}

.pill {
  position: absolute;
  right: 0;
  top: 12px;
  min-height: 31px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
}

.panel {
  border: 1px solid rgba(231, 231, 235, 0.92);
  background: #ffffff;
  border-radius: 28px;
  box-shadow: var(--soft-shadow);
  padding: 20px;
  margin: 16px 0;
  overflow: hidden;
}

.panel.slim {
  padding: 18px 20px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

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

.small {
  font-size: 12px;
  line-height: 1.45;
}

.body {
  font-size: 15px;
  line-height: 1.45;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.segmented button {
  min-height: 30px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.segmented button.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: none;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  min-height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.reminder-list {
  margin-top: 18px;
}

.list-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

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

.icon-mark {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--warm);
  color: var(--ink);
  flex: 0 0 auto;
}

.icon-mark.dark {
  background: var(--black);
  color: #fff;
}

.icon-mark.accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.row-title {
  display: block;
  font-size: 16px;
  font-weight: 520;
  line-height: 1.2;
}

.row-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.row-right {
  text-align: right;
  font-size: 13px;
  color: var(--ink);
}

.row-status {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.quick-section {
  margin-top: 26px;
}

.quick-panel {
  margin-top: 14px;
  padding: 18px;
  border-radius: 34px;
  border: 1px solid rgba(240, 238, 236, 0.96);
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.quick-tile {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  padding: 16px 18px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid #ece8e2;
  text-align: left;
}

.quick-tile .row-title {
  font-size: 20px;
  line-height: 1.18;
}

.quick-tile .row-meta {
  margin-top: 8px;
  max-width: 190px;
  line-height: 1.45;
}

.quick-tile + .quick-tile {
  margin-top: 18px;
}

.quick-tile.accent {
  background: var(--accent-soft);
  border-color: #f7dfd5;
}

.quick-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 11px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 8px 0 22px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin-top: 6px;
  font-size: 32px;
  line-height: 1;
  font-weight: 430;
}

.divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.bars {
  display: grid;
  gap: 15px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 54px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e5e5e9;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: #66666b;
  animation: grow 700ms ease both;
}

.bar-fill.accent {
  background: var(--accent);
}

@keyframes grow {
  from {
    width: 0;
  }
}

.form-panel {
  padding: 22px 20px;
}

.field {
  min-height: 58px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.field + .field {
  padding-top: 11px;
}

.field label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.field-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
}

.field-value {
  min-width: 0;
  font-size: 17px;
  line-height: 1.25;
  word-break: break-word;
}

.field-right {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.select-field {
  width: 100%;
  min-height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
  appearance: auto;
}

.category-field {
  min-height: auto;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 2px;
}

.category-chip {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.category-chip.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.category-chip.custom {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: rgba(214, 87, 56, 0.16);
}

.cost-block {
  padding-top: 22px;
}

.big-number {
  margin-top: 8px;
  font-size: 42px;
  line-height: 1;
  font-weight: 420;
}

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn {
  min-height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.btn.primary {
  min-width: 104px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.hero-card {
  position: relative;
  min-height: 156px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
}

.chart {
  height: 160px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  align-items: end;
  padding-top: 18px;
}

.chart-col {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.chart-bar {
  width: 24px;
  height: var(--h);
  min-height: 28px;
  border-radius: 999px;
  background: #b8b8be;
  animation: rise 550ms ease both;
  animation-delay: var(--delay);
}

.chart-bar.active {
  background: var(--accent);
}

@keyframes rise {
  from {
    height: 0;
    opacity: 0.3;
  }
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 402px);
  height: 74px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 7px 8px;
  border-radius: 28px;
  border: 1px solid rgba(231, 231, 235, 0.92);
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 1),
    0 18px 46px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(30px) saturate(190%) contrast(112%) brightness(108%);
  -webkit-backdrop-filter: blur(30px) saturate(190%) contrast(112%) brightness(108%);
  z-index: 20;
}

.nav-btn {
  border-radius: 22px;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  font-size: 11px;
}

.nav-btn.active {
  background: rgba(253, 238, 232, 0.92);
  color: var(--accent);
  border: 1px solid rgba(214, 87, 56, 0.16);
}

.nav-icon {
  width: 20px;
  height: 20px;
}

.empty {
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 360px) {
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .metric-value {
    font-size: 28px;
  }

  .quick-tile {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (min-width: 390px) and (max-width: 430px) {
  .app-shell {
    padding-left: 22px;
    padding-right: 22px;
  }

  .list-row {
    min-height: 68px;
  }

  .bottom-nav {
    width: min(calc(100% - 32px), 410px);
  }
}

@media (display-mode: standalone) {
  .app-shell {
    padding-top: calc(18px + env(safe-area-inset-top));
  }

  .bottom-nav {
    bottom: calc(8px + env(safe-area-inset-bottom));
  }
}
