:root {
  color-scheme: light;
  --color-primary: #176b5b;
  --color-primary-soft: #dfece4;
  --color-background: #f7f3e9;
  --color-surface: #fffdf8;
  --color-surface-warm: #f1eadc;
  --color-text-primary: #24312c;
  --color-text-secondary: #7a8178;
  --color-income: #22704b;
  --color-expense: #bd543d;
  --color-danger: #bd543d;
  --bg: var(--color-background);
  --bg-soft: #fbf8f1;
  --panel: var(--color-surface);
  --panel-warm: var(--color-surface-warm);
  --ink: var(--color-text-primary);
  --muted: var(--color-text-secondary);
  --line: rgba(36, 49, 44, 0.1);
  --accent: var(--color-primary);
  --accent-soft: var(--color-primary-soft);
  --gold: #dda657;
  --gold-soft: #f7e7c8;
  --income: var(--color-income);
  --expense: var(--color-expense);
  --investment: #8a641d;
  --shadow: 0 16px 40px rgba(57, 47, 31, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  overscroll-behavior-y: none;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 -16px 4px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(var(--bg) 82%, rgba(247, 243, 234, 0));
}

.date-line,
.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 25px;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 19px;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeUp 160ms ease-out;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero,
.soft-card,
.card,
.metric,
.toolbar,
.empty {
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
}

.hero {
  margin: 10px 0 14px;
  padding: 22px;
  background: #f0e4cf;
  color: var(--ink);
}

.hero-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero .label,
.metric .label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.hero .amount,
.big-amount {
  margin-bottom: 8px;
  font-size: clamp(40px, 12vw, 58px);
  font-weight: 780;
  line-height: 1;
  letter-spacing: 0;
}

.hero-note {
  margin: 0;
  color: #6d6252;
  font-size: 13px;
}

.avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--accent);
  color: #fffaf0;
  font-size: 28px;
  line-height: 1;
}

.summary-grid,
.field-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.metric,
.card,
.toolbar,
.empty {
  border: 0;
}

.metric {
  padding: 14px;
  background: rgba(255, 253, 248, 0.78);
}

.metric .value,
.value {
  margin: 0;
  font-size: 18px;
  font-weight: 760;
  word-break: break-word;
}

.card,
.soft-card {
  margin-top: 14px;
  padding: 16px;
}

.soft-card {
  background: rgba(255, 253, 248, 0.72);
}

.section-head {
  margin-bottom: 12px;
}

.section-head h2,
.section-head h3 {
  margin-bottom: 0;
}

.list,
.timeline {
  display: grid;
  gap: 8px;
}

.row,
.ledger-row,
.setting-row,
.pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

button.row,
button.ledger-row,
button.pick-row {
  width: 100%;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.row:last-child,
.ledger-row:last-child,
.setting-row:last-child,
.pick-row:last-child {
  border-bottom: 0;
}

.row-title {
  margin-bottom: 4px;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.row-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.money {
  font-weight: 780;
  white-space: nowrap;
}

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

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

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

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

.primary,
.secondary,
.ghost,
.danger {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 720;
}

.primary {
  background: var(--accent);
  color: #fffaf0;
}

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

.ghost {
  background: transparent;
  color: var(--accent);
}

.danger {
  background: #f6ded6;
  color: var(--expense);
}

.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

.full {
  width: 100%;
}

.button-row,
.chip-list,
.category-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-panel {
  display: grid;
  gap: 14px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: #f3eee4;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(25, 84, 71, 0.13);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: #eee6d8;
}

.segmented button {
  min-height: 38px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
}

.segmented button.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 4px 14px rgba(50, 42, 28, 0.08);
}

.toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.72);
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 253, 248, 0.6);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(36, 49, 44, 0.06);
}

.nav-item {
  min-height: 48px;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.add {
  transform: translateY(-16px);
  min-height: 56px;
  border-radius: 999px;
  background: var(--accent);
  color: #fffaf0;
  box-shadow: 0 12px 24px rgba(25, 84, 71, 0.22);
}

.sheet {
  width: min(92vw, 430px);
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.bottom-sheet {
  width: min(100vw, 480px);
  max-height: 82vh;
  margin: auto auto 0;
  border-radius: 28px 28px 0 0;
}

.sheet::backdrop {
  background: rgba(22, 31, 26, 0.32);
}

.sheet form,
.sheet-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head h2 {
  margin-bottom: 0;
}

.icon-btn {
  width: 42px;
  padding: 0;
  font-size: 24px;
}

.chip-list {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 36px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--muted);
  padding: 0 13px;
  line-height: 1;
  text-align: center;
}

.chip.active {
  background: var(--accent);
  color: #fffaf0;
  font-weight: 760;
}

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

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 14px;
}

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

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.chart-wrap {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.donut {
  width: min(190px, 50vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#dfe5dc 0 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: var(--panel);
}

.legend {
  display: grid;
  gap: 8px;
  width: 100%;
}

.legend-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.trend {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 132px;
  overflow-x: auto;
}

.trend-month {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  min-width: 38px;
  height: 124px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.trend-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 3px;
  height: 100px;
}

.trend-bar {
  min-height: 3px;
  border-radius: 999px 999px 0 0;
}

.trend-bar.in {
  background: var(--income);
}

.trend-bar.out {
  background: var(--expense);
}

.link-button {
  min-height: auto;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 760;
  text-align: left;
}

.check-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  color: var(--ink);
}

.check-row input {
  width: auto;
}

.entry-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  padding: 18px 0 10px;
}

.entry-amount span {
  color: var(--muted);
  font-size: 30px;
}

.entry-amount input {
  width: min(260px, 74vw);
  background: transparent;
  padding: 0;
  text-align: center;
  font-size: clamp(48px, 15vw, 72px);
  font-weight: 780;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.category-pill {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 62px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.76);
  color: var(--ink);
  padding: 7px 4px;
  font-size: 11px;
  font-weight: 720;
}

.category-pill .icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 12px;
  background: var(--gold-soft);
  color: var(--accent);
  font-size: 17px;
}

.category-pill.active {
  background: var(--accent);
  color: #fffaf0;
}

.category-pill.active .icon {
  background: rgba(255, 250, 240, 0.18);
  color: #fffaf0;
}

.entry-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

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

.entry-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #efe6d6;
}

.compact-head {
  margin-bottom: 8px;
}

.compact-head h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.emoji-palette {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.emoji-choice {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 14px;
  background: #f3eee4;
  font-size: 18px;
}

.sheet-search {
  margin-top: -2px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.choice-grid .pick-row {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 5px;
  min-height: 76px;
  border: 0;
  border-radius: 18px;
  background: #f3eee4;
  padding: 8px 4px;
  text-align: center;
}

.choice-grid .pick-row .row-sub,
.choice-grid .pick-row .choice-check {
  display: none;
}

.choice-grid .tx-icon {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.search-result-row[hidden],
.pick-row[hidden] {
  display: none;
}

.ledger-filter-sheet {
  position: fixed;
  right: max(0px, calc((100vw - 480px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 480px) / 2));
  z-index: 12;
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--panel);
  box-shadow: 0 -18px 48px rgba(57, 47, 31, 0.16);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 11;
  background: rgba(22, 31, 26, 0.32);
}

.sheet-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  padding-top: 8px;
  background: var(--panel);
}

.warning-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(189, 84, 61, 0.14);
}

.date-inline-shortcuts {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.date-inline-shortcuts .chip {
  min-height: 30px;
  padding: 0 12px;
  background: rgba(255, 253, 248, 0.72);
  font-size: 13px;
  font-weight: 680;
}

.home-quick-grid {
  margin-top: 6px;
}

.mini-stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.mini-stat-row span,
.account-month-grid > div {
  display: grid;
  gap: 4px;
}

.mini-stat-row small,
.account-month-grid small {
  color: var(--muted);
  font-size: 12px;
}

.mini-stat-row strong {
  font-size: 24px;
}

.asset-total {
  margin: 4px 0 12px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.account-list,
.compact-account-list {
  display: grid;
}

.account-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

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

.account-list-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.start-assets-card {
  display: grid;
  gap: 10px;
}

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

.active-filter-list {
  margin-top: 8px;
}

.swipe-row {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
}

.ledger-row-card {
  position: relative;
  z-index: 1;
  width: 100%;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.86);
  padding: 12px;
  transition: transform 160ms ease;
}

.swipe-action {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: 78px;
  border-radius: 0 20px 20px 0;
  color: #fffaf0;
  font-weight: 760;
}

.danger-swipe {
  background: var(--danger);
}

.swipe-row.swiped .ledger-row-card {
  transform: translateX(-78px);
}

.subtle-delete {
  margin-top: 18px;
  background: #f6ded6;
  color: var(--danger);
}

.add-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 0;
  border-radius: 18px;
  padding: 10px;
  background: var(--accent-soft);
}

.add-row > span:nth-child(2) {
  min-width: 0;
}

.day-group {
  margin-top: 14px;
}

.day-head {
  display: flex;
  justify-content: space-between;
  margin: 0 2px 6px;
  color: var(--muted);
  font-size: 13px;
}

.tx-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 15px;
  background: #f1e6d3;
  font-size: 18px;
}

.ledger-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  background: rgba(255, 253, 248, 0.7);
  border-bottom: 0;
  border-radius: 20px;
  padding: 12px;
}

.setting-row {
  min-height: 56px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
}

.setting-row::after {
  content: "›";
  color: var(--muted);
  font-size: 26px;
}

.category-admin-list {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.category-admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 22px;
  background: rgba(247, 243, 234, 0.74);
}

.category-admin-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0;
}

.wrap-text {
  white-space: normal;
  overflow-wrap: anywhere;
}

.icon-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.icon-action {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.82);
  color: var(--muted);
  font-weight: 760;
}

.icon-action.subtle-danger {
  color: #9d7a70;
}

.subcat-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

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

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

.avatar-preview {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 20px;
  background: var(--accent);
  color: #fffaf0;
  font-size: 22px;
  font-weight: 780;
}

.user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--panel);
}

.user-info {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.settings-list {
  margin-top: 14px;
  padding: 6px 16px;
  border-radius: var(--radius);
  background: var(--panel);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}

.month-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
  text-align: center;
}

.month-chip.active {
  background: var(--accent);
  color: #fffaf0;
}

.year-switch {
  display: flex;
  gap: 6px;
  align-items: center;
}

.year-switch h2 {
  margin: 0;
}

.ledger-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ledger-summary span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.72);
}

.ledger-summary small {
  color: var(--muted);
  font-size: 11px;
}

.insight-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

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

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

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

.theme-swatch {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 112px;
  border: 2px solid transparent;
  border-radius: 22px;
  background: rgba(247, 243, 234, 0.74);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.theme-swatch.active {
  border-color: var(--accent);
}

.theme-dot,
.theme-bg {
  display: block;
  border-radius: 999px;
}

.theme-dot {
  width: 42px;
  height: 42px;
}

.theme-bg {
  position: absolute;
  right: 12px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
}

.choice-list {
  display: grid;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
}

.choice-check {
  color: var(--accent);
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 40;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--accent);
  color: #fffaf0;
  padding: 11px 16px;
  font-weight: 720;
  box-shadow: 0 12px 24px rgba(25, 84, 71, 0.22);
}

.lock-screen,
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: var(--bg);
}

.lock-panel,
.auth-card {
  width: min(420px, 100%);
  border-radius: 28px;
  background: var(--panel);
  padding: 20px;
  box-shadow: var(--shadow);
}

.auth-card form + form {
  margin-top: 14px;
}

@media (min-width: 760px) {
  .app-shell,
  .bottom-nav {
    max-width: 520px;
  }
}

@media (max-width: 380px) {
  .summary-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

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