:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #0a0f1f;
  --ink-sub: #333d4b;
  --muted: #6b7684;
  --line: #eef1f6;
  --blue: #0878f9;
  --blue-dark: #0352c8;
  --red: #f04452;
  --green: #0aa870;
  --shadow: 0 10px 28px rgba(25, 42, 70, 0.06);
  --shadow-hero: 0 18px 40px rgba(8, 120, 249, 0.24);
  --radius: 24px;
}

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

html, body {
  margin: 0;
  background: #dfe5ef;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: linear-gradient(180deg, #f7f9fd 0%, #f1f4fa 100%);
  padding-bottom: calc(98px + env(safe-area-inset-bottom));
  box-shadow: 0 0 50px rgba(15, 23, 42, 0.1);
  position: relative;
}

.page { padding: 18px 20px 28px; }

/* 1. 상단 브랜드바 (image_3.png 동일) */
.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px 18px;
}
.brand {
  font-weight: 900;
  font-size: 27px;
  letter-spacing: -1.1px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0a0f1f;
}
.brand-dot {
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
}
.brand small {
  font-weight: 600;
  font-size: 15px;
  color: #4e5968;
  letter-spacing: -0.3px;
}
.brand-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #191f28;
}
.icon-btn-rel {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.noti-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 50%;
  border: 1.5px solid #f7f9fd;
}

.svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 서브 페이지 상단 헤더 */
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 18px;
}
.detail-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.back-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  margin-left: -6px;
}
.detail-title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.7px;
}

/* 2. 블루 그라데이션 히어로 카드 (6장 시안 공통) */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #3288ff 0%, #0d6de8 48%, #0351c6 100%);
  color: #ffffff;
  border-radius: 30px;
  padding: 24px 24px;
  box-shadow: var(--shadow-hero);
  min-height: 196px;
}
.hero:after {
  content: "";
  position: absolute;
  width: 440px;
  height: 190px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  right: -150px;
  bottom: -85px;
  transform: rotate(-9deg);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.eyebrow {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  gap: 7px;
  padding-right: 54px;
}
.info-circle {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}
.hero-value {
  font-size: 38px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -1.6px;
  margin: 12px 0 22px;
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.hero-stat { min-width: 0; }
.hero-stat + .hero-stat {
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  padding-left: 14px;
}
.hero-stat label {
  display: block;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}
.hero-stat strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: block;
  white-space: nowrap;
}
.hero-stat strong.cyan-highlight {
  color: #a5f3fc;
}
.hero-corner {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  color: #ffffff;
  z-index: 3;
}
.hero-corner:active { transform: scale(0.96); }

/* 히어로 내부 반투명 알약 배지 (소비 화면 image_2.png) */
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.hero-pill .svg { width: 16px; height: 16px; }

/* 차량 히어로 우측 자동차 일러스트 (image_6.png) */
.hero-car-art {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 132px;
  height: 92px;
  z-index: 2;
  opacity: 0.95;
}

/* 주식 히어로 2분할 (image_5.png) */
.hero-split-stock {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
.hero-stock-right {
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  padding-left: 16px;
}
.hero-stock-right label {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
  margin-bottom: 4px;
}
.hero-stock-right strong {
  display: block;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.6px;
}
.hero-rate-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 800;
}

/* 도넛 모드 */
.composition-hero { min-height: 270px; }
.composition-title { font-size: 17px; font-weight: 800; margin: 0 0 14px; }
.donut-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.donut-block { display: flex; flex-direction: column; align-items: center; text-align: center; }
.donut {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.donut:after {
  content: "";
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #0d64d9;
}
.donut-label { position: relative; z-index: 2; font-size: 11px; font-weight: 800; line-height: 1.25; }
.donut-label strong { display: block; font-size: 13px; margin-top: 2px; }
.legend { margin-top: 10px; display: grid; gap: 4px; width: 100%; font-size: 11px; color: rgba(255, 255, 255, 0.9); text-align: left; }
.legend-row { display: flex; justify-content: space-between; gap: 8px; }
.legend-key { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }

/* 3. 홈 & 공통 화이트 카드 리스트 (image_3.png, image_6.png 동일) */
.section { margin-top: 22px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 12px;
}
.section-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 4px 12px;
  color: #191f28;
}
.section-head .section-title { margin: 0; }
.section-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.list { display: grid; gap: 12px; }
.list-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid #edf0f5;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.14s;
  text-align: left;
}
.list-card:active { transform: scale(0.985); }

.tile-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: #edf5ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}
.tile-icon .svg { width: 25px; height: 25px; }

.tile-copy { min-width: 0; flex: 1; }
.tile-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #191f28;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-right {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.tile-value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #191f28;
  white-space: nowrap;
}
.chev {
  color: #8b95a1;
  font-size: 22px;
  font-weight: 400;
  margin-left: 2px;
}

/* 알약 상태 배지 (교환 예정, 확인 필요, 등락률 등) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.status-pill.blue { background: #e8f3ff; color: #0878f9; }
.status-pill.red { background: #ffebee; color: #e53935; }
.status-pill.green { background: #e6f8f0; color: #0aa870; }
.status-pill.gray { background: #f2f4f6; color: #4e5968; }

/* 통합 화이트 패널 (부동산 상세, 코인 보유 자산, 확인할 것) */
.detail-panel {
  background: #ffffff;
  border: 1px solid #edf0f5;
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.detail-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  text-align: left;
}
.detail-row + .detail-row { border-top: 1px solid var(--line); }
.detail-row .tile-icon { width: 44px; height: 44px; border-radius: 14px; }
.detail-row .tile-title { font-size: 16px; }
.detail-row .tile-sub { font-size: 13px; }
.detail-row .tile-value { font-size: 16px; }

/* 부동산 월 상환 내역 박스 (image.png 하단 동일) */
.repayment-card {
  background: #ffffff;
  border: 1px solid #edf0f5;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.repayment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.repayment-head h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}
.repayment-inner {
  background: #f8fafd;
  border: 1px solid #edf1f7;
  border-radius: 18px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  align-items: center;
  gap: 10px;
}
.repay-col {
  padding: 4px 6px;
}
.repay-col + .repay-col {
  border-left: 1px solid #e2e8f0;
  padding-left: 12px;
}
.repay-col label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.repay-col strong {
  font-size: 17px;
  font-weight: 800;
  color: #191f28;
}
.repay-highlight {
  background: #e8f2ff;
  border-radius: 14px;
  padding: 12px 14px !important;
  border-left: 0 !important;
}
.repay-highlight label { color: #0878f9; }
.repay-highlight strong { font-size: 20px; color: #0a0f1f; font-weight: 900; }

/* 4. 소비 화면 (image_2.png 동일) */
.spend-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 2px 10px;
}
.spend-filter-dropdown {
  font-size: 16px;
  font-weight: 800;
  color: #191f28;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.toolbar-actions { display: flex; gap: 8px; }
.small-square {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: #ffffff;
  border: 1px solid #e5e8eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  display: grid;
  place-items: center;
  color: #333d4b;
}
.small-square .svg { width: 19px; height: 19px; }

.date-group { margin-top: 20px; }
.date-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 4px 10px;
}
.date-heading strong {
  font-size: 17px;
  font-weight: 800;
  color: #191f28;
}
.date-heading strong small {
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  margin-left: 4px;
}
.date-heading span {
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
}

.tx-card {
  background: #ffffff;
  border: 1px solid #edf0f5;
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tx-wrap + .tx-wrap {
  border-top: 1px solid var(--line);
}
.tx-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  text-align: left;
}
.tx-logo-box {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: #f2f6fc;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.tx-main { flex: 1; min-width: 0; }
.tx-merchant {
  font-size: 17px;
  font-weight: 800;
  color: #191f28;
  letter-spacing: -0.3px;
}
.tx-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.tx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.tx-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #e8f3ff;
  color: #0878f9;
}
.tx-tag-pill.warn {
  background: #e8f3ff;
  color: #0878f9;
}
.tx-tag-pill.member {
  background: #f3e8ff;
  color: #7c3aed;
}
.tx-amount {
  font-size: 17px;
  font-weight: 800;
  color: #191f28;
  white-space: nowrap;
}

/* 쿠팡 영수증 분해 박스 (image_2.png 동일: 배/사과 일러스트 아이콘 포함) */
.items-box {
  margin: 0 16px 16px;
  background: #f4f7fc;
  border-radius: 18px;
  padding: 12px 15px;
}
.items-box.hidden { display: none; }
.items-box-title {
  font-size: 13px;
  font-weight: 800;
  color: #333d4b;
  margin-bottom: 6px;
}
.item-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 700;
  color: #191f28;
}
.item-line + .item-line {
  border-top: 1px solid #e4ebf5;
}
.item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.item-illust {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

/* 참고하세요 안내 박스 (image_4.png 하단) */
.info-notice-box {
  margin-top: 18px;
  background: #eef3fb;
  border-radius: 20px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.info-notice-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.8px solid #0878f9;
  color: #0878f9;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.info-notice-box h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: #191f28;
}
.info-notice-box p {
  margin: 0;
  font-size: 12px;
  color: #4e5968;
  line-height: 1.5;
}

/* 5. 하단 4탭 네비게이션 바 (홈 / 소비 / 자산 / 설정 — 6장 시안 100% 동일) */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  /* 아이폰 홈 표시줄 영역만큼 높이를 더해, 아이콘이 위쪽에 붙지 않게 한다 */
  height: calc(76px + env(safe-area-inset-bottom));
  padding-top: 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border-top: 1px solid #e6eaf1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 700;
}
.nav-item.active {
  color: var(--blue);
  font-weight: 800;
}
.nav-item .svg { width: 24px; height: 24px; }

/* 필터 칩 및 세그먼트 */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 2px; }
.chip {
  padding: 7px 13px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-weight: 700;
  font-size: 13px;
  color: #4e5968;
}
.chip.active { background: var(--blue); border-color: var(--blue); color: #ffffff; }

.segmented {
  display: flex;
  background: #e5eaf2;
  border-radius: 14px;
  padding: 4px;
  margin: 0 0 12px;
}
.segmented button {
  flex: 1;
  padding: 9px 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #4e5968;
}
.segmented button.active {
  background: #ffffff;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* 바텀시트 모달 */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 31, 0.48);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: min(480px, 100%);
  background: #ffffff;
  border-radius: 28px 28px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.18);
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sheet h3 { font-size: 19px; font-weight: 800; margin: 0; }
.sheet-close { font-size: 14px; color: var(--muted); font-weight: 800; padding: 4px 8px; }
.sheet-scroll { max-height: 64vh; overflow-y: auto; padding-right: 2px; }
.sheet-label { font-size: 13px; font-weight: 800; color: #333d4b; margin: 16px 2px 8px; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.cat-btn {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f4f6fb;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}
.cat-btn.active { background: #e8f3ff; color: var(--blue); border: 1px solid #90c2ff; }
.sheet-info {
  margin-top: 12px;
  background: #f4f6fb;
  border-radius: 16px;
  padding: 13px;
  display: grid;
  gap: 5px;
  color: #4e5968;
  font-size: 13px;
}
.sheet-info .raw { font-size: 11px; color: #8b95a1; word-break: break-all; margin-top: 4px; }
.field { display: grid; gap: 6px; margin-top: 12px; }
.field label { font-size: 13px; font-weight: 800; color: #333d4b; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid #d1d6db;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  background: #f9fafb;
  outline: none;
}
.save-btn {
  width: 100%;
  margin-top: 16px;
  background: var(--blue);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  border-radius: 16px;
  padding: 14px;
}
.save-btn.ghost { background: #f2f4f6; color: #4e5968; margin-top: 8px; }
.auto-box {
  margin-top: 12px;
  background: #e8f3ff;
  border-radius: 14px;
  padding: 12px 14px;
  color: #0351c6;
  font-size: 12px;
  line-height: 1.5;
}

.blue-text { color: var(--blue); }
.red-text { color: var(--red); }
.green-text { color: var(--green); }
.subtle { font-size: 12px; color: var(--muted); font-weight: 600; }
.empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; font-weight: 700; }

/* 차트 및 랭킹 바 */
.chart-panel { padding: 14px 10px 8px; }
.trend-chart { width: 100%; height: auto; display: block; }
.trend-chart .grid { stroke: #eef2f8; }
.trend-chart .axis-label { font-size: 10px; fill: #6b7684; font-weight: 600; }
.trend-chart .axis-label.strong { fill: #0a0f1f; font-weight: 800; }
.trend-chart .zero { stroke: #f04452; stroke-width: 1.2; }
.trend-chart .limit { stroke: #f04452; stroke-dasharray: 5 5; stroke-width: 1; }
.trend-chart .line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; }
.legend-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
.legend-chip { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #4e5968; }
.legend-chip i { width: 8px; height: 8px; border-radius: 3px; }
.bars { padding: 12px 18px; }
.bar-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 700;
}
.bar { height: 9px; background: #eef2f8; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
/* 소비 화면 카드사별 사용금액: 행을 누르면 해당 카드사 거래만 보기 */
.card-issuer-row { width: 100%; background: none; border: 0; color: inherit; font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; grid-template-columns: 96px 1fr 92px; }
.card-issuer-row strong { text-align: right; }
.card-issuer-row span { display: flex; flex-direction: column; line-height: 1.25; }
.card-issuer-row small { font-size: 12px; font-weight: 600; color: var(--muted); }
.card-issuer-row.active strong, .card-issuer-row.active span { color: var(--blue); }
.coin-trend-head{display:flex;justify-content:space-between;align-items:baseline;padding:4px 12px 6px;font-size:13px;color:var(--muted);font-weight:700}.coin-trend-head strong{font-size:15px}
.tile-sub.small{font-size:12px;margin-top:2px}.coin-row{width:100%;text-align:left}.coin-row .tile-right{text-align:right}
.coin-row .tile-sub{white-space:normal;overflow:visible}

/* 차량 관리 카드: 짧은 모바일 뷰포트에서 내용이 컨테이너 너비를 밀어내지 않도록 한다. */
.vehicle-list {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
.vehicle-list .list-card { min-width: 0; max-width: 100%; }
.vehicle-list .tile-right { min-width: 0; max-width: 48%; flex: 0 1 auto; }
.vehicle-list .tile-right .tile-sub,
.vehicle-list .tile-right .tile-value {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}
.vehicle-list .chev { flex: 0 0 auto; }
.vehicle-switch { min-width: 0; }
.vehicle-switch button {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 460px) {
  .vehicle-list .list-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 14px;
    column-gap: 12px;
    row-gap: 7px;
    padding: 14px;
    align-items: center;
  }
  .vehicle-list .tile-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 46px;
    height: 46px;
  }
  .vehicle-list .tile-copy {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  .vehicle-list .tile-title,
  .vehicle-list .tile-sub {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .vehicle-list .tile-sub {
    overflow: visible;
    text-overflow: clip;
  }
  .vehicle-list .tile-right {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
    gap: 2px;
  }
  .vehicle-list .tile-right .tile-sub {
    text-align: left;
  }
  .vehicle-list .chev {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    margin-left: 0;
  }
  .vehicle-list .status-pill { max-width: 100%; white-space: normal; }
}

/* 모바일 가로 넘침 방지: 카드가 긴 글자 때문에 화면 밖으로 늘어나지 않게 */
.list, .section, .detail-panel { min-width: 0; max-width: 100%; }
.list-card, .detail-row { min-width: 0; max-width: 100%; }
.list-card .tile-copy, .detail-row .tile-copy { overflow: hidden; }
.list-card .tile-right .tile-value { white-space: nowrap; }
.hero-sub { font-size: 13px; font-weight: 700; opacity: .85; margin-bottom: 14px; }
.spend-basis { margin: 14px 0 4px; }
.hero-grid.two { grid-template-columns: 1fr 1fr; row-gap: 14px; }
.hero-grid.two .hero-stat:nth-child(odd) { border-left: 0; padding-left: 0; }
.hero-grid.two + .hero-note { margin-top: 14px; }

/* 보유 종목 가격 차트 (바텀시트) */
.price-chart-head { padding: 2px 8px 8px; }
.price-chart-head .price-now { font-size: 24px; font-weight: 900; color: #0a0f1f; letter-spacing: -0.02em; }
.price-chart-head .price-diff { font-size: 14px; font-weight: 800; margin-top: 2px; }
.price-chart-head .price-when { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.price-chart { touch-action: none; user-select: none; -webkit-user-select: none; }
.chart-mode { display: inline-flex; gap: 4px; background: #eef1f6; border-radius: 10px; padding: 3px; margin-top: 4px; }
.chart-mode button { padding: 5px 14px; border-radius: 8px; font-size: 13px; font-weight: 800; color: #6b7684; }
.chart-mode button.active { background: #fff; color: #0a0f1f; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.candle-info { padding: 0 6px 6px; }
.candle-info-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 700; }
.candle-info-top strong { font-size: 14px; }
.candle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin-top: 4px; font-size: 12px; color: #6b7684; font-weight: 600; }
.candle-grid b { color: #0a0f1f; font-weight: 800; margin-left: 2px; }
.candle-grid b.red-text { color: #f04452; } .candle-grid b.blue-text { color: #3182f6; }
.bb-dot, .candle-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: #8b5cf6; margin-right: 4px; vertical-align: 0; }
.candle-legend { display: flex; gap: 12px; padding: 6px 6px 2px; font-size: 11px; color: var(--muted); font-weight: 700; }
.candle-legend span:last-child { margin-left: auto; }

/* Product-specific illustrations for individually split Coupang/Naver receipt rows. */
.tx-product-art { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #f7faff; border-radius: 15px; font-size: 25px; line-height: 1; }
.tx-product-art svg { width: 29px; height: 29px; }

/* Merchant-matched icons: pharmacy and Baskin Robbins. */
.merchant-icon{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:15px;overflow:hidden}
.merchant-icon svg{max-width:100%;height:auto;flex-shrink:0}


/* ── POM Cute UI 1.0: small joyful details without compromising ledger clarity ── */
.pom-merchant-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 14px;
  line-height: 1.02; text-align: center; overflow: hidden;
}
.pom-merchant-badge strong {
  font-family: Arial, "Apple SD Gothic Neo", sans-serif;
  font-size: 19px; font-weight: 900; letter-spacing: -1.2px;
  max-width: 100%; white-space: nowrap;
}
.pom-merchant-badge strong:first-child:nth-last-child(1) { font-size: 14px; letter-spacing: -0.8px; }
.pom-merchant-badge small {
  font-family: Arial, sans-serif; font-size: 6.5px; font-weight: 900;
  letter-spacing: -0.2px; margin-top: 3px;
}
.pom-product-emoji { font-size: 22px; line-height: 1; }
.cute-sync-status {
  margin: 14px 4px 12px; width: calc(100% - 8px); min-height: 35px;
  display: inline-flex; gap: 8px; align-items: center; justify-content: center;
  border-radius: 12px; padding: 8px 12px;
  color: #42795F; background: #EAF8F1;
  font-size: 11.5px; font-weight: 750; line-height: 1.35;
}
.cute-sync-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: #12A86B; }
.cute-sync-status.is-stale { color: #866123; background: #FFF5DC; }
.cute-sync-status.is-stale .cute-sync-dot { background: #DA9D2B; }
.cute-sync-status.is-error { color: #B42333; background: #FFF0F1; }
.cute-sync-status.is-error .cute-sync-dot { background: #EE4559; }
.cute-receipt-card {
  position: relative; overflow: hidden;
  border-radius: 22px; border: 1px solid #E6ECFA; 
  background: linear-gradient(130deg,#FEFEFF 0%,#F1F7FF 100%);
  padding: 17px 18px 15px; box-shadow: 0 6px 22px rgba(17,66,142,.055);
}
.cute-receipt-card:after {
  content: "✦"; position: absolute; top: 27px; right: 14px;
  color: #BCD7FF; font-size: 30px; pointer-events: none; transform: rotate(13deg);
}
.cute-receipt-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding-right: 2px;
}
.cute-receipt-head span { color: #264D88; font-size: 13px; font-weight: 900; }
.cute-receipt-head small { color: #6E84A8; font-size: 11px; font-weight: 700; }
.cute-receipt-total { margin-top: 7px; color: #0F315E; font-size: 25px; font-weight: 900; letter-spacing: -0.9px; }
.cute-receipt-sub { color: #67809F; font-size: 12px; margin-top: 2px; font-weight: 700; }
.cute-receipt-chips { display:flex; flex-wrap:wrap; gap: 5px; margin-top: 11px; }
.cute-receipt-chips span {
  border-radius: 12px; padding: 6px 9px; color: #4D617B;
  background: #FFFFFF; border: 1px solid #E5EEFA;
  font-size: 11px; font-weight: 800; white-space: nowrap;
}
.cute-receipt-link {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 8px;
  color: #1767B3; font-size: 12px; font-weight: 900;
  min-height: 28px;
}
.cute-merchant-group {
  background: #FAFCFF; border-bottom: 1px solid #E7EEF7;
}
.cute-merchant-group:last-child { border-bottom: 0; }
.tx-wrap + .cute-merchant-group,
.cute-merchant-group + .tx-wrap,
.cute-merchant-group + .cute-merchant-group { border-top: 1px solid var(--line); }
.cute-merchant-toggle {
  width: 100%; display: flex; align-items: center;
  gap: 14px; padding: 15px 17px; text-align: left;
}
.cute-group-copy { flex: 1; min-width: 0; display:flex; flex-direction:column; gap: 4px; }
.cute-group-copy strong { font-size: 16px; font-weight: 900; color: #1E293B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cute-group-copy small { font-size: 11.5px; font-weight: 700; color: #67788E; line-height: 1.4; }
.cute-group-copy em { font-size: 11px; font-style: normal; font-weight: 900; color: #257AD3; }
.cute-group-amount { flex-shrink: 0; display:flex; flex-direction:column; gap: 2px; align-items: flex-end; color:#1B2A3A; font-size: 14px; font-weight:900; }
.cute-group-amount small { color:#7D97B5; font-size:17px; }
.cute-merchant-entries { background:#FFFFFF; border-top:1px solid #EAF0F8; padding: 5px 0; }
.cute-merchant-entries .tx-wrap { border-left: 3px solid #D9EAFF; margin-left:11px; }
.cute-merchant-entries .tx-row { padding:12px 16px 12px 12px; }
.cute-merchant-entries .tx-logo-box { width:38px; height:38px; border-radius:12px; }
.cute-merchant-entries .tx-merchant { font-size:14px; }
.cute-merchant-entries .tx-amount { font-size:14px; }
.cute-merchant-entries .tx-meta { font-size:11px; }
@media (max-width:360px) {
  .cute-merchant-toggle { gap:10px; padding:13px 12px; }
  .cute-group-copy strong { font-size:14px; }
  .cute-group-amount { font-size:12px; }
  .cute-receipt-total { font-size:22px; }
}
@media (prefers-reduced-motion: reduce) {
  .cute-merchant-toggle, .cute-receipt-link, .cute-sync-status { scroll-behavior: auto; transition:none; animation:none; }
}

/* 쿠팡 원주문 한 건 → 구매 품목 상세. 원장은 품목별로 유지하고 화면만 계층화. */
.coupang-order-group {
  border-top: 1px solid #edf1f7;
  background: #fff;
}
.coupang-order-header {
  width:100%; padding:15px 16px; display:flex; align-items:center;
  gap:12px; text-align:left; background:#f8fbff; min-height:78px;
}
.coupang-order-shop-logo {
  width:46px; height:46px; border-radius:14px; flex-shrink:0;
  overflow:hidden; display:grid;place-items:center;background:#fff;
  box-shadow:0 2px 7px rgba(25,56,95,.07);
}
.coupang-order-shop-logo > * {width:100%;height:100%}
.coupang-order-head-copy {display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
.coupang-order-head-copy strong {
  font-size:15px; font-weight:900; color:#172538;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.coupang-order-head-copy small {font-size:11.5px; color:#70839a; font-weight:700;line-height:1.3}
.coupang-order-head-copy em {font-size:11px; color:#2a78c7; font-weight:800; font-style:normal}
.coupang-order-head-total {
  display:flex; flex-direction:column; align-items:flex-end;gap:2px;
  font-size:15px;font-weight:900;color:#132d50; white-space:nowrap; flex-shrink:0;
}
.coupang-order-head-total small {font-size:15px;color:#8ba3c1}
.coupang-order-item-list {
  background:#fff; padding:3px 0 5px 13px;
  border-top:1px dashed #dbe7f5;
}
.coupang-order-item {margin-left:8px;border-left:2px solid #d8e9fb;position:relative}
.coupang-order-item+.coupang-order-item{border-top:1px solid #edf1f5}
.coupang-order-item:before {
  content:"";position:absolute;top:27px;left:0;width:12px;height:2px;background:#d8e9fb
}
.coupang-order-item-button{
  width:100%;display:flex;align-items:center;gap:11px;min-height:69px;
  padding:12px 13px 12px 17px;text-align:left;
}
.coupang-order-item-icon {
  width:38px;height:38px;border-radius:12px;flex-shrink:0;
  display:grid;place-items:center;overflow:hidden;background:#f4f8ff
}
.coupang-order-item-icon svg {max-width:27px;max-height:27px}
.coupang-order-item-text {flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.coupang-order-item-text strong {
  font-size:12.5px; font-weight:800;line-height:1.4;color:#202d3b;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden
}
.coupang-order-item-text small {
  color:#788a9e; font-size:11px;font-weight:700;
}
.coupang-order-item-price {
  font-size:12.5px;font-weight:900;color:#263748;
  display:flex;flex-direction:column;align-items:flex-end;gap:4px;white-space:nowrap;flex-shrink:0
}
.coupang-order-item-price small {color:#3380ce;font-size:10px}
@media(max-width:365px) {
  .coupang-order-header {padding:13px 11px;gap:9px}
  .coupang-order-shop-logo {width:40px;height:40px}
  .coupang-order-head-total {font-size:13px}
  .coupang-order-item-button {gap:8px;padding:11px 8px 11px 15px}
  .coupang-order-item-icon {width:34px;height:34px}
}
