/* =========================================================
   우리집 가계부 · styles.css
   warm cream / terracotta · mobile first (375px 기준)
   ========================================================= */

:root {
  --cream: #FAF6F0;
  --cream-2: #F5ECE1;
  --cream-3: #EFE1D2;
  --card: #FFFFFF;
  --ink: #3B2A20;
  --ink-2: #6B5648;
  --muted: #9C8A7B;
  --terra: #C85A32;
  --terra-dark: #A9481F;
  --terra-soft: #F8E3D8;
  --terra-line: #F0CDBB;
  --brown: #7C4A2D;
  --line: #ECE0D3;
  --line-soft: #F3EAE0;
  --ok: #5C8A5E;
  --ok-soft: #E8F0E5;
  --danger: #B23B3B;
  --shadow-sm: 0 2px 8px rgba(124, 74, 45, .05);
  --shadow: 0 10px 26px rgba(124, 74, 45, .08);
  --r-xl: 24px;
  --r-lg: 20px;
  --r-md: 15px;
  --r-sm: 11px;
  --nav-h: 62px;
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
          'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(120% 60% at 50% 0%, #FDF8F1 0%, rgba(250, 246, 240, 0) 60%),
    var(--cream);
  overflow-x: hidden;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:active { transform: scale(.985); }

input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #FFFDFB;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  width: 100%;
  min-width: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder, textarea::placeholder { color: #BCAC9C; }
input:focus, select:focus, textarea:focus {
  border-color: var(--terra-line);
  box-shadow: 0 0 0 3px rgba(200, 90, 50, .08);
}
textarea { resize: vertical; min-height: 92px; line-height: 1.55; font-size: 14px; }

h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 레이아웃 ---------- */
.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 24px);
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 8px;
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark { font-size: 21px; line-height: 1; }
.brand-text { min-width: 0; }
.brand-text h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--brown);
  white-space: nowrap;
}
.brand-text p {
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main { padding: 4px 16px 0; }
.view { animation: fade .18s ease; }
@keyframes fade { from { opacity: .4; } to { opacity: 1; } }

/* ---------- 탭바 ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 252, 248, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 40;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: -.2px;
}
.tab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab[aria-current="page"] { color: var(--terra); }
.tab[aria-current="page"] svg { stroke-width: 2.1; }

/* ---------- 월 이동 ---------- */
.monthbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 12px;
  padding: 5px 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.monthbar-mid { text-align: center; line-height: 1.15; }
.monthbar-mid strong { display: block; font-size: 14.5px; font-weight: 800; letter-spacing: -.3px; }
.monthbar-mid span { display: block; font-size: 10px; color: var(--muted); font-weight: 700; }
.nav-arrow {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--cream);
  border-radius: 50%;
}

/* ---------- 히어로 ---------- */
.hero {
  padding: 17px 17px 14px;
  border-radius: var(--r-xl);
  color: #fff;
  background: linear-gradient(150deg, #D2663C 0%, #C1502B 60%, #AE4523 100%);
  box-shadow: 0 12px 26px rgba(174, 69, 35, .22);
}
.hero.income-hero {
  background: linear-gradient(150deg, #6F9B72 0%, #5C8A5E 60%, #4E7A52 100%);
  box-shadow: 0 12px 26px rgba(78, 122, 82, .2);
}
.hero-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hero-head span { font-size: 12px; font-weight: 700; opacity: .92; }
.hero-head em { font-style: normal; font-size: 10.5px; opacity: .8; text-align: right; }
.hero-amount {
  display: block;
  margin: 4px 0 12px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}
.hero-amount small { font-size: 15px; font-weight: 700; margin-left: 2px; opacity: .9; }
.hero-split {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, .24);
}
.hero-split > div { min-width: 0; }
.hero-split span { display: block; font-size: 10px; opacity: .8; font-weight: 700; }
.hero-split b {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-split b.plus { color: #F2FBF0; }
.plus { color: var(--ok); }

/* ---------- 카드 ---------- */
.card {
  margin-top: 11px;
  padding: 15px 16px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
}
.card-head h2 { font-size: 13.5px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); }
.muted { font-size: 11px; color: var(--muted); font-weight: 700; }
.link-btn {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--terra);
  padding: 4px 9px;
  background: var(--terra-soft);
  border-radius: 999px;
  white-space: nowrap;
}
.empty-line { font-size: 12.5px; color: var(--muted); }

/* 진행 바 */
.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--cream-2);
  overflow: hidden;
}
.bar.tall { height: 11px; }
.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--terra);
  transition: width .3s ease;
}
.bar.over > i { background: var(--danger); }
.budget-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.over-text { color: var(--danger); }

/* 분류 바 */
.bars > li { margin-bottom: 12px; }
.bars > li:last-child { margin-bottom: 2px; }
.bar-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.bar-name { font-size: 12.5px; font-weight: 700; color: var(--ink); letter-spacing: -.2px; }
.bar-head b { font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.bar-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

/* 키-값 목록 */
.kv-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.kv-list li:first-child { border-top: 0; padding-top: 0; }
.kv-list span { color: var(--ink-2); font-weight: 700; }
.kv-list em { font-style: normal; font-size: 10.5px; color: var(--muted); font-weight: 700; margin-left: auto; }
.kv-list b { font-size: 12.5px; font-weight: 800; min-width: 78px; text-align: right; }
.kv-list em + b { min-width: 0; }

/* 냉장고 카드 */
.card.fridge { background: linear-gradient(180deg, #FFFDFB, #FBF3EA); }
.fridge-top { display: flex; align-items: center; gap: 10px; }
.fridge-ico { font-size: 20px; }
.fridge-top > div { min-width: 0; }
.fridge-top b { display: block; font-size: 13px; font-weight: 800; }
.fridge-top em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.fridge-amt { margin-left: auto; font-size: 15px; font-weight: 800; color: var(--brown); white-space: nowrap; }
.fridge-foot { margin-top: 7px; font-size: 11px; color: var(--muted); }

/* ---------- 내역 ---------- */
.listbar { margin-bottom: 10px; }
.search { position: relative; }
.search input {
  padding-left: 34px;
  padding-right: 34px;
  height: 42px;
  font-size: 14px;
  background: #fff;
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: .55;
}
.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--cream-2);
  border-radius: 50%;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chips.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 3px;
  margin-right: -16px;
  padding-right: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 7px 11px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.chip.on {
  color: #fff;
  background: var(--terra);
  border-color: var(--terra);
  box-shadow: 0 4px 10px rgba(200, 90, 50, .22);
}
.chips.tight { gap: 5px; }
.chips.tight .chip { padding: 7px 9px; font-size: 11px; }

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 3px 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.list-head .sum { color: var(--ink-2); }

.groups { }
.group { margin-bottom: 10px; }
.group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 2px 4px 6px;
}
.group-head b { font-size: 11.5px; font-weight: 800; color: var(--ink-2); }
.group-head span { font-size: 11px; font-weight: 700; color: var(--muted); }

.rows {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
}
.row:first-child { border-top: 0; }
.row:active { background: var(--cream); }
.row-ico {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 15px;
  border-radius: 11px;
}
.row-main { flex: 1 1 auto; min-width: 0; }
.row-main b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-main em {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-amt { flex: 0 0 auto; font-size: 13.5px; font-weight: 800; letter-spacing: -.3px; }
.row-amt .u { font-style: normal; font-size: 10.5px; font-weight: 700; margin-left: 1px; opacity: .75; }
.row-amt.plus { color: var(--ok); }

.more {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 14px;
}

.empty-block {
  padding: 26px 18px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.empty-block.small { padding: 20px 12px; border: 0; box-shadow: none; }
.empty-ico { font-size: 26px; }
.empty-block b { display: block; margin-top: 6px; font-size: 13.5px; font-weight: 800; }
.empty-block p { margin: 4px 0 10px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}
.btn.primary {
  color: #fff;
  background: var(--terra);
  border-color: var(--terra);
  box-shadow: 0 8px 18px rgba(200, 90, 50, .22);
}
.btn.danger { color: var(--danger); border-color: #EFD6D6; background: #FFF7F7; }
.btn.big { width: 100%; padding: 15px; font-size: 14.5px; border-radius: 15px; margin-top: 4px; }

/* ---------- 빠른 입력 ---------- */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 11px;
  background: var(--cream-2);
  border-radius: 14px;
}
.seg-btn {
  padding: 9px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
  border-radius: 11px;
}
.seg-btn.on { background: #fff; color: var(--terra); box-shadow: var(--shadow-sm); }

.edit-banner {
  margin-bottom: 9px;
  padding: 9px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--terra-dark);
  background: var(--terra-soft);
  border-radius: 12px;
}
.edit-banner button { font-weight: 800; text-decoration: underline; margin-left: 4px; }

.amount-box {
  padding: 14px 15px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.amount-label { display: block; font-size: 10.5px; font-weight: 800; color: var(--muted); }
.amount-line { display: flex; align-items: baseline; gap: 4px; margin-top: 1px; }
.amount-input {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  padding: 2px 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink);
  background: transparent;
  text-align: right;
  box-shadow: none;
}
.amount-input:focus { box-shadow: none; border: 0; }
.amount-line .won { font-size: 15px; font-weight: 800; color: var(--ink-2); }
.presets { display: flex; gap: 5px; margin-top: 9px; flex-wrap: wrap; }
.presets button {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 4px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-2);
  background: var(--cream-2);
  border-radius: 10px;
  white-space: nowrap;
}
.presets button.ghost { color: var(--muted); background: #fff; border: 1px solid var(--line); }

.field { margin-top: 11px; }
.field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
  padding: 0 2px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-2);
}
.field-label em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--muted); }

.date-row { display: flex; align-items: center; gap: 6px; }
.date-row input[type="date"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 11px;
  color: var(--ink-2);
}

/* 붙여넣기 파서 */
.parse-box { margin-top: 14px; }
.parse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--brown);
  background: #FFFDFB;
  border: 1px dashed var(--terra-line);
  border-radius: 13px;
}
.parse-toggle span { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.parse-hint { margin: 8px 2px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.parse-box textarea { margin-bottom: 7px; }
.parse-box .btn { width: 100%; }

.parse-result {
  margin-top: 9px;
  padding: 12px;
  background: var(--ok-soft);
  border: 1px solid #D6E4D2;
  border-radius: 14px;
}
.parse-result.bad { background: #FFF4F2; border-color: #F2D3CC; }
.parse-error { font-size: 12px; font-weight: 700; color: var(--danger); }
.parse-head { font-size: 11.5px; font-weight: 800; color: #4C6B4E; margin-bottom: 7px; }
.parse-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid rgba(92, 138, 94, .16);
}
.parse-list li:first-child { border-top: 0; padding-top: 0; }
.parse-list li > div { flex: 1 1 auto; min-width: 0; }
.parse-list b { display: block; font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parse-list em { display: block; font-style: normal; font-size: 10px; color: #6C8064; font-weight: 700; }
.parse-list > li > span { font-size: 12px; font-weight: 800; white-space: nowrap; }
.mini {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--ok);
  border-radius: 9px;
}
.parse-warn { margin-top: 7px; font-size: 10.5px; color: #8A7A5C; line-height: 1.5; }
.parse-result .btn { width: 100%; margin-top: 9px; }

/* ---------- 수입 탭 ---------- */
.export-row { display: flex; gap: 7px; margin-top: 13px; }
.export-row .btn { flex: 1 1 0; font-size: 12px; padding: 11px 8px; }
.hint { margin: 8px 4px 0; font-size: 10.5px; color: var(--muted); text-align: center; }

/* ---------- 잠금 화면 ---------- */
.lock {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(120% 60% at 50% 0%, #FDF8F1 0%, rgba(250, 246, 240, 0) 60%),
    var(--cream);
}
.lock[hidden] { display: none; }
.lock-inner { width: 100%; max-width: 320px; margin: auto; text-align: center; }
.lock-mark { font-size: 34px; line-height: 1; }
.lock-title {
  margin: 10px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--brown);
}
.lock-msg { min-height: 19px; margin: 7px 0 0; font-size: 12.5px; color: var(--muted); }
.lock-msg.is-error { color: var(--terra-dark); font-weight: 700; }
.lock-dots { display: flex; justify-content: center; gap: 13px; margin: 20px 0 22px; }
.lock-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--terra-line);
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.lock-dot.on { background: var(--terra); border-color: var(--terra); transform: scale(1.08); }
.lock-dots.shake { animation: lockShake .44s ease-in-out; }
@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  45% { transform: translateX(7px); }
  70% { transform: translateX(-4px); }
  88% { transform: translateX(2px); }
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key {
  display: grid;
  place-items: center;
  height: 54px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow-sm);
  touch-action: manipulation;
}
.key:active { background: var(--cream-2); }
.key-del { font-size: 18px; color: var(--ink-2); }
.keypad.busy { opacity: .5; pointer-events: none; }

.lock-btn {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 2px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.lock-btn[hidden] { display: none; }

/* ---------- 모달 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(59, 42, 32, .34);
  z-index: 50;
  animation: fade .16s ease;
}
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  z-index: 51;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--cream);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 34px rgba(59, 42, 32, .16);
  animation: slideUp .2s ease;
  max-height: 86vh;
  overflow-y: auto;
}
@keyframes slideUp { from { transform: translate(-50%, 22px); opacity: .6; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet-grab {
  width: 38px;
  height: 4px;
  margin: 0 auto 12px;
  background: var(--cream-3);
  border-radius: 999px;
}
.sheet-title { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }
.sheet-sub { margin: 3px 0 11px; font-size: 11.5px; color: var(--muted); }
.sheet-actions { display: flex; gap: 8px; margin-top: 13px; }
.sheet-actions .btn { flex: 1 1 0; padding: 13px; }

.detail { text-align: center; }
.detail-ico {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 21px;
  border-radius: 15px;
}
.detail-amount { display: block; margin-top: 7px; font-size: 26px; font-weight: 800; letter-spacing: -.8px; }
.detail-amount.plus { color: var(--ok); }
.detail-name { margin: 2px 0 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); word-break: break-all; }
.detail .kv-list { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; }
.detail .kv-list li { padding: 9px 0; }
.detail .kv-list b { text-align: right; min-width: 0; word-break: break-all; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  transform: translate(-50%, 10px);
  max-width: 88vw;
  padding: 11px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(59, 42, 32, .93);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(59, 42, 32, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 70;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 작은 화면 ---------- */
@media (max-width: 359px) {
  .hero-amount { font-size: 27px; }
  .hero-split { grid-template-columns: 1fr 1fr; }
  .brand-text h1 { font-size: 15.5px; }
}

/* ---------- 넓은 화면 ---------- */
@media (min-width: 600px) {
  body { background: #F3EBE1; }
  .app {
    background: var(--cream);
    box-shadow: 0 0 60px rgba(124, 74, 45, .10);
    min-height: 100vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
