/* =========================================================================
   고정비 체크기 — styles.css
   모바일 퍼스트(375~430px) · PC는 좌측 레일 + 카드형 본문
   ========================================================================= */

/* ---------- tokens ---------- */
:root {
  --bg: #f3f6f4;
  --bg-soft: #e9efeb;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --ink: #10211b;
  --ink-2: #2b3f37;
  --muted: #5c6f67;
  --line: #e0e8e3;
  --line-strong: #cbd8d1;

  --brand: #0e6b52;
  --brand-strong: #0a5440;
  --on-brand: #ffffff;
  --brand-soft: #e6f3ee;
  --brand-ring: rgba(14, 107, 82, 0.22);
  --mint: #35c39a;
  --gold: #e0a13c;
  --gold-soft: #fdf3e1;

  --danger: #b8402a;
  --danger-soft: #fbece8;
  --warn: #a8680c;
  --warn-ink: #8a5206;
  --warn-soft: #fdf3e2;
  --info: #2b5fa8;
  --info-soft: #eaf1fb;

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-sm: 0 1px 2px rgba(16, 33, 27, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(16, 33, 27, 0.18), 0 2px 6px rgba(16, 33, 27, 0.04);
  --shadow-brand: 0 18px 40px -18px rgba(14, 107, 82, 0.55);

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;

  --pad: 20px;
  --app-max: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1411;
    --bg-soft: #0f1c17;
    --surface: #121f1a;
    --surface-2: #16251f;
    --ink: #e9f2ed;
    --ink-2: #c6d6ce;
    --muted: #93a79d;
    --line: #23342c;
    --line-strong: #33483e;

    --brand: #4fd1a5;
    --brand-strong: #7be3c1;
    --on-brand: #05231a;
    --brand-soft: #14332a;
    --brand-ring: rgba(79, 209, 165, 0.28);
    --mint: #4fd1a5;
    --gold: #f0b95f;
    --gold-soft: #33270f;

    --danger: #f08a72;
    --danger-soft: #331b15;
    --warn: #f0b95f;
    --warn-ink: #f0b95f;
    --warn-soft: #2e2412;
    --info: #8db6ef;
    --info-soft: #16233a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 14px 34px -14px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-brand: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 12% -10%, rgba(53, 195, 154, 0.14), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(224, 161, 60, 0.10), transparent 55%);
  background-attachment: fixed;
  line-height: 1.55;
  font-size: 16px;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--brand-ring);
  outline-offset: 2px;
  border-radius: 8px;
}

::selection { background: rgba(53, 195, 154, 0.28); }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- shell ---------- */
.app {
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) var(--pad) 56px;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
}
.brand__name { font-size: 17px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.pill--soft { background: var(--brand-soft); color: var(--brand); }
.pill--good { background: var(--brand-soft); color: var(--brand); }
.pill--normal { background: var(--info-soft); color: var(--info); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--danger { background: var(--danger-soft); color: var(--danger); }
.pill--empty { background: var(--surface-2); color: var(--muted); }

/* ---------- hero ---------- */
.hero { padding: 6px 2px 22px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(53, 195, 154, 0.18);
}
.hero h1 {
  margin: 10px 0 10px;
  font-size: clamp(30px, 8.6vw, 40px);
  line-height: 1.22;
  font-weight: 850;
  letter-spacing: -0.045em;
}
.hl {
  color: var(--brand);
  background: linear-gradient(transparent 62%, rgba(53, 195, 154, 0.24) 62%);
  border-radius: 4px;
}
.hero__lead {
  color: var(--ink-2);
  font-size: 15.5px;
  max-width: 34ch;
}
.hero__meta {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- tabs ---------- */
.tabs-wrap { position: sticky; top: 0; z-index: 30; padding: 6px 0 16px; margin: 0 -4px; background: linear-gradient(to bottom, var(--bg) 62%, transparent); }
.tabs {
  --tab: 0;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}
.tabs__indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(50% - 7px);
  border-radius: 11px;
  background: var(--brand);
  box-shadow: var(--shadow-brand);
  transform: translateX(calc(var(--tab) * (100% + 4px)));
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 8px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 750;
  color: var(--muted);
  transition: color 0.2s;
}
.tab.is-active { color: var(--on-brand); }
.tab__num {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  font-size: 11px;
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: inherit;
}
.tab.is-active .tab__num { background: rgba(255, 255, 255, 0.22); }
@media (prefers-color-scheme: dark) { .tab.is-active .tab__num { background: rgba(0, 0, 0, 0.14); } }

/* ---------- panels / sections ---------- */
.panel { animation: fadeUp 0.35s ease both; }
.panel:focus { outline: none; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.section-head { margin: 6px 2px 16px; }
.section-head h2 {
  font-size: 21px;
  line-height: 1.36;
  letter-spacing: -0.035em;
  font-weight: 820;
}
.section-head p { margin-top: 6px; color: var(--muted); font-size: 14px; }

.stack { display: grid; gap: 14px; }
/* 그리드 항목의 자동 최소 폭 때문에 390px 화면에서 카드가 화면 밖으로 넓어지는 것을 막습니다 */
.stack > * { min-width: 0; }

/* ---------- card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card--flat { background: var(--surface-2); box-shadow: none; }
.card--accent {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 60%, var(--surface)) 0%, var(--surface) 70%);
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
}
.card__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.card__head h3 { font-size: 16.5px; font-weight: 780; letter-spacing: -0.025em; }
.card__head p { margin-top: 2px; font-size: 12.8px; color: var(--muted); }
.card__title { font-size: 16px; font-weight: 780; letter-spacing: -0.02em; margin-bottom: 12px; }

.step {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hint { margin-top: 10px; font-size: 12.3px; color: var(--muted); line-height: 1.55; }

/* ---------- chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chips--wide .chip { flex: 1 1 auto; justify-content: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.25;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.12s;
}
.chip:hover { border-color: var(--brand); }
.chip:active { transform: scale(0.98); }
.chip.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 6px 16px -8px var(--brand);
}
.chip.is-on::before {
  content: "✓";
  font-size: 11px;
  font-weight: 900;
  opacity: 0.9;
}

/* ---------- inputs ---------- */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field-grid > * { min-width: 0; }
.input__box, .input__box input, .input__box select { min-width: 0; }
.field-grid--single { grid-template-columns: 1fr; }
@media (max-width: 359px) { .field-grid { grid-template-columns: 1fr; } }

.input { display: block; }
.input__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 12.8px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.input__label em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.input__box {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 50px;
  padding: 0 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.input__box:focus-within {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--brand-ring);
}
.input__box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 16.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding: 12px 0;
  outline: none;
}
.input__box input::placeholder { color: var(--muted); font-weight: 500; font-size: 14.5px; }
.input__suffix { font-size: 13px; color: var(--muted); font-weight: 600; }
.input__help { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); }

.input--inline { margin: 10px 0 2px; }
.input--inline .input__box { max-width: 240px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}
.check--inline { padding: 8px 0 0; }

/* ---------- subscriptions ---------- */
.sub-list {
  display: grid;
  gap: 2px;
  margin: 0 -6px;
  border-top: 1px solid var(--line);
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
}
.sub__toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  min-height: 40px;
  cursor: pointer;
}
.sub__toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.18s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sub__toggle input:checked + .switch { background: var(--brand); }
.sub__toggle input:checked + .switch::after { transform: translateX(16px); }
.sub__toggle input:focus-visible + .switch { outline: 3px solid var(--brand-ring); outline-offset: 2px; }
.sub__name { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub__tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 2px 6px;
}
.sub__amount {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
}
.sub__amount input {
  width: 104px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.sub__amount input:focus {
  border-color: var(--brand);
  background: var(--surface-2);
}
.sub__amount span { font-size: 11.5px; color: var(--muted); }
.sub.is-off .sub__name,
.sub.is-off .sub__tag,
.sub.is-off .sub__amount { opacity: 0.45; }
.sub__amount input:disabled { color: var(--muted); }
@media (max-width: 359px) {
  .sub__tag { display: none; }
  .sub__amount input { width: 92px; }
}

.sub-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  font-size: 13px;
  color: var(--muted);
}
.sub-total strong {
  font-size: 19px;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 13px;
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -0.015em;
  border: 1px solid transparent;
  transition: transform 0.14s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.995); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 9px 14px; font-size: 13.3px; border-radius: 11px; }
.btn--primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover { background: var(--brand-strong); }
.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-2);
}
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--light { background: #fff; color: #0a5440; }
.btn--outline-light { border-color: rgba(255, 255, 255, 0.45); color: #fff; }

.form-actions { display: grid; gap: 8px; margin-top: 2px; }
.form-actions__sub { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ---------- ad ---------- */
.ad {
  margin: 20px 0 4px;
  text-align: center;
}
.ad--top { margin: 2px 0 12px; }
.ad__label {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 4px;
}
.ad__box { min-height: 0; }
.ad__box:empty { display: none; }

/* ---------- result common ---------- */
.result { display: grid; gap: 14px; margin-top: 20px; }
.result > * { min-width: 0; }
.result:empty { display: none; }

.empty { text-align: center; padding: 30px 20px; }
.empty__icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 10px;
  filter: grayscale(0.1);
}
.empty h3 { font-size: 17px; letter-spacing: -0.02em; }
.empty p { margin: 6px auto 16px; max-width: 34ch; font-size: 13.5px; color: var(--muted); }

.fineprint {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  padding: 0 4px;
}

/* ---------- score ---------- */
.score {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px 18px 18px 14px;
}
.score__gauge { width: 116px; }
.gauge { width: 100%; height: auto; }
.gauge__track { stroke: var(--line); opacity: 0.7; }
.gauge__value {
  stroke: var(--brand);
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dasharray 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gauge__num {
  font-size: 30px;
  font-weight: 850;
  fill: var(--ink);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.gauge__pct { font-size: 13px; font-weight: 700; fill: var(--muted); }
.gauge__cap { font-size: 9.5px; fill: var(--muted); font-weight: 600; }
.score--warn .gauge__value { stroke: var(--warn); }
.score--danger .gauge__value { stroke: var(--danger); }
.score--normal .gauge__value { stroke: var(--info); }
.score__body { min-width: 0; }
.score__body h3 {
  margin: 8px 0 4px;
  font-size: 17.5px;
  line-height: 1.35;
  letter-spacing: -0.03em;
}
.score__body p { font-size: 13px; color: var(--ink-2); }
.score__sub { margin-top: 4px; color: var(--muted) !important; font-size: 12px !important; }

/* ---------- stat strip ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat-strip > div {
  padding: 13px 12px;
  border-left: 1px solid var(--line);
}
.stat-strip > div:first-child { border-left: 0; }
.stat-strip span {
  display: block;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: -0.01em;
  margin-bottom: 3px;
  white-space: nowrap;
}
.stat-strip b {
  display: block;
  font-size: 14.5px;
  font-weight: 820;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-strip b.is-over { color: var(--danger); }
.stat-strip__note {
  grid-column: 1 / -1;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- savings hero ---------- */
.savings-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 24px 22px 22px;
  color: #eafff6;
  background:
    radial-gradient(420px 200px at 88% 8%, rgba(224, 161, 60, 0.32), transparent 60%),
    radial-gradient(500px 260px at 0% 100%, rgba(53, 195, 154, 0.28), transparent 65%),
    linear-gradient(135deg, #0b4f3d 0%, #0e6b52 52%, #0a5a46 100%);
  box-shadow: var(--shadow-brand);
}
.savings-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}
.savings-hero__label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
}
.savings-hero__value {
  margin: 4px 0 2px;
  font-size: clamp(44px, 13vw, 58px);
  line-height: 1.05;
  font-weight: 880;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.savings-hero__value small {
  font-size: 0.42em;
  font-weight: 750;
  margin-left: 4px;
  letter-spacing: -0.02em;
}
.savings-hero__sub { font-size: 12.5px; color: rgba(255, 255, 255, 0.72); }

/* ---------- chart ---------- */
.chart { display: grid; gap: 12px; }
.chart__row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 10px;
}
.chart__label { font-size: 12px; color: var(--muted); font-weight: 650; }
.bar {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 55%, var(--mint)), var(--brand));
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.chart__row--after .bar i { background: color-mix(in srgb, var(--brand) 34%, var(--bg-soft)); }
.chart__row--save .bar i { background: linear-gradient(90deg, var(--gold), #f2c274); }
.chart__value {
  font-size: 13px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.chart__row--save .chart__value { color: var(--warn); }
.bar--thin { height: 9px; }

/* ---------- top3 ---------- */
.top3 { display: grid; gap: 10px; }
.top3__item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 70%, var(--brand-soft));
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line));
}
.top3__rank {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.top3__text { flex: 1; min-width: 0; }
.top3__text h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 780;
  letter-spacing: -0.02em;
}
.top3__text p { margin-top: 3px; font-size: 12.2px; color: var(--muted); line-height: 1.5; }
.top3__amount {
  flex: none;
  font-size: 14.5px;
  font-weight: 820;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-align: right;
}
.top3__amount span {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
}

/* ---------- category list ---------- */
.cat-list { display: grid; gap: 14px; }
.cat { display: block; }
.cat__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 5px;
}
.cat__head span { font-weight: 700; }
.cat__head b { font-variant-numeric: tabular-nums; font-size: 13.5px; }
.cat__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- tips ---------- */
.tips { display: grid; gap: 9px; }
.tips li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}
.tips li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
}

/* ---------- share ---------- */
.share-card p { margin: 4px 0 14px; font-size: 13px; color: var(--muted); }
.share-card h3 { font-size: 15.5px; letter-spacing: -0.02em; }

/* ---------- next cta ---------- */
.next-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 17px 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface));
  color: var(--brand);
  font-size: 14.5px;
  font-weight: 780;
  letter-spacing: -0.02em;
  text-align: left;
  transition: background 0.18s, border-color 0.18s;
}
.next-cta:hover { border-style: solid; background: var(--brand-soft); }

/* ---------- benefits: progress ---------- */
.progress { display: grid; }
.progress__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.progress__head .btn { flex: none; }
.progress__text { font-size: 14px; color: var(--ink-2); }
.progress__text strong {
  font-size: 22px;
  font-weight: 850;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  margin-right: 2px;
}
.progress__bar {
  height: 8px;
  margin: 8px 0 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}
.progress__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--brand));
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.progress__note { font-size: 11.8px; color: var(--muted); }

/* ---------- benefit questions ---------- */
.qfield { padding: 12px 0; border-top: 1px solid var(--line); }
.qfield:first-of-type { border-top: 0; padding-top: 0; }
.qfield__label {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: baseline;
  font-size: 13px;
  font-weight: 720;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.qfield__label em {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- total card ---------- */
.total-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-xl);
  color: #effff9;
  background:
    radial-gradient(360px 200px at 100% 0%, rgba(224, 161, 60, 0.34), transparent 60%),
    linear-gradient(135deg, #0b4f3d, #0f7359 70%, #0b5b47);
  box-shadow: var(--shadow-brand);
}
.total-card p { font-size: 13px; color: rgba(255, 255, 255, 0.8); font-weight: 650; }
.total-card__value {
  margin: 4px 0 4px;
  font-size: clamp(38px, 11vw, 48px);
  line-height: 1.1;
  font-weight: 880;
  letter-spacing: -0.045em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.total-card__value small { font-size: 0.42em; margin-left: 3px; font-weight: 750; }
.total-card__sub { font-size: 12px !important; color: rgba(255, 255, 255, 0.72) !important; }

/* ---------- filters ---------- */
.filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  max-width: 100%;
  padding: 2px 2px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none;
  padding: 8px 12px;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.filter.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- program cards ---------- */
.prog-list { display: grid; gap: 10px; }
.prog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.prog[open] { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.prog__sum {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.prog__sum::-webkit-details-marker { display: none; }
.prog__sum:hover { background: var(--surface-2); }
.prog__cat {
  flex: none;
  align-self: flex-start;
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  white-space: nowrap;
}
.prog__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.prog__name { font-size: 14.5px; font-weight: 780; letter-spacing: -0.02em; }
.prog__amount {
  font-size: 13px;
  font-weight: 750;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.prog__badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.4;
}
.badge--urgent { background: var(--danger-soft); color: var(--danger); }
.badge--check { background: var(--info-soft); color: var(--info); }
.badge--cost { background: var(--gold-soft); color: var(--warn-ink); }
.badge--muted { background: var(--bg-soft); color: var(--muted); }
.prog__chev {
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.22s;
  margin-right: 2px;
}
.prog[open] .prog__chev { transform: rotate(-135deg); }
.prog__body {
  padding: 0 16px 16px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.prog__reason {
  font-size: 13px;
  line-height: 1.62;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.prog__meta {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  margin-bottom: 10px;
}
.prog__meta > div {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  font-size: 12px;
}
.prog__meta dt { color: var(--muted); font-weight: 700; }
.prog__meta dd { color: var(--ink-2); }
.prog__caution {
  font-size: 11.8px;
  line-height: 1.6;
  color: var(--muted);
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
  margin-bottom: 12px;
}
.prog__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.prog__actions .btn--primary { flex: 1; min-width: 140px; }
.prog.is-closed { opacity: 0.78; }
.prog.is-closed .prog__amount { color: var(--muted); }

/* ---------- aftercare (blog) ---------- */
.aftercare {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 16px;
  margin-top: 28px;
  padding: 24px 22px;
  border-radius: var(--radius-xl);
  color: #f2fff9;
  background: linear-gradient(140deg, #14241e 0%, #0f3b2e 55%, #0b4f3d 100%);
  box-shadow: var(--shadow-md);
}
.aftercare .eyebrow { color: #8fe6c6; }
.aftercare h2 {
  margin: 6px 0 6px;
  font-size: 19px;
  line-height: 1.36;
  letter-spacing: -0.03em;
}
.aftercare p { font-size: 12.8px; color: rgba(255, 255, 255, 0.74); }
.aftercare__body { position: relative; z-index: 1; }
.aftercare__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.aftercare__art {
  position: absolute;
  right: -18px;
  bottom: -26px;
  width: 132px;
  height: 132px;
  opacity: 0.5;
  pointer-events: none;
}
.art-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 22px rgba(53, 195, 154, 0.08);
}
.art-coin {
  position: absolute;
  right: 30px;
  top: 40px;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f6cf8b, #e0a13c);
  color: #4a3208;
  font-size: 30px;
  font-weight: 850;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.45);
}

/* ---------- footer ---------- */
.footer {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 10px;
}
.footer__brand img { border-radius: 7px; }
.footer__note { font-size: 11.3px; line-height: 1.65; margin-bottom: 8px; }
.footer__note strong { color: var(--ink-2); }
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 12px 0 10px;
  font-size: 11.5px;
}
.footer__links a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.footer__copy { font-size: 10.8px; opacity: 0.8; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 90;
  transform: translate(-50%, 16px);
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 13px;
  background: #10211b;
  color: #f2fff9;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  text-align: center;
  z-index: 100;
}

/* ---------- desktop ---------- */
@media (min-width: 960px) {
  :root { --pad: 28px; --app-max: 1100px; }
  .app {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    column-gap: 48px;
    align-items: start;
    padding-top: 28px;
    padding-bottom: 72px;
  }
  .topbar { grid-column: 1 / -1; padding-bottom: 22px; }
  .hero {
    grid-column: 1;
    grid-row: 2;
    position: sticky;
    top: 26px;
    padding-top: 16px;
  }
  .hero h1 { font-size: 40px; }
  .hero__lead { font-size: 14.5px; }
  .hero__meta { margin-top: 18px; }

  .tabs-wrap {
    grid-column: 1;
    grid-row: 3;
    position: sticky;
    top: 272px;
    padding-top: 0;
  }
  .tabs { display: flex; flex-direction: column; padding: 6px; border-radius: 18px; }
  .tabs__indicator {
    left: 6px;
    right: 6px;
    top: 6px;
    bottom: auto;
    width: calc(100% - 12px);
    height: 48px;
    transform: translateY(calc(var(--tab) * (100% + 4px)));
  }
  .tab { justify-content: flex-start; padding-left: 14px; min-height: 48px; font-size: 14.5px; }

  main { grid-column: 2; grid-row: 2 / span 2; min-width: 0; }
  .footer { grid-column: 1 / -1; }

  .section-head h2 { font-size: 24px; }
  .stack { grid-template-columns: 1fr; }
  .result { gap: 16px; }
  .score { grid-template-columns: 126px 1fr; padding: 20px; }
  .score__gauge { width: 126px; }
  .savings-hero { padding: 28px 26px; }
  .aftercare { padding: 28px; }
  .aftercare h2 { font-size: 21px; }
  .aftercare p { max-width: 46ch; }
}

@media (min-width: 1200px) {
  .app { grid-template-columns: 360px minmax(0, 1fr); column-gap: 64px; }
  .hero h1 { font-size: 44px; }
}

/* ---------- motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .tabs-wrap, .ad, .aftercare, .next-cta, .share-card, .form-actions, .toast, .skip-link { display: none !important; }
  body { background: #fff; }
  .app { display: block; max-width: none; padding: 0; }
  .card, .savings-hero, .total-card { box-shadow: none; break-inside: avoid; }
}

/* ── 관련 글 카드 (애드센스 심사용 정보성 링크) ── */
.related-post {
  max-width: 720px;
  margin: 28px auto 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.related-post__label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}
.related-post__link {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--brand);
  text-decoration: none;
}
.related-post__link:hover { text-decoration: underline; }
.related-post__note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- 함께 많이 쓰는 계산기 ---------- */
.related-apps { margin: 18px 0 14px; }
.related-apps h2 { color: var(--ink); font-size: 14px; font-weight: 800; margin: 0 2px 9px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.related-app {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .14s ease, transform .14s ease;
}
.related-app:hover { border-color: var(--brand); transform: translateY(-2px); }
.related-app strong { color: var(--ink); font-size: 13px; font-weight: 800; }
.related-app span { color: var(--muted); font-size: 11px; line-height: 1.5; }
@media (max-width: 360px) { .related-grid { grid-template-columns: 1fr; } }

/* ── 제휴 링크 카드 (쿠팡파트너스 · 네이버 쇼핑커넥트) ─────────── */
.promo-card .card-head, .promo-card .card__head { margin-bottom: 12px; }
.promo-grid { display: grid; gap: 8px; }
.promo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 14px);
  background: var(--field, var(--surface-2, #f7faf8));
}
.promo-thumb {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 46px; width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--brand-soft);
  font-size: 19px; line-height: 1;
}
.promo-body { min-width: 0; flex: 1 1 auto; }
.promo-name { font-size: 13px; font-weight: 800; line-height: 1.3; letter-spacing: -.02em; color: var(--ink); }
.promo-meta { margin-top: 3px; font-size: 10.5px; color: var(--ink-3, var(--muted)); }
.promo-cta {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px; font-weight: 800; white-space: nowrap;
  text-decoration: none;
}
.promo-cta:hover { text-decoration: none; background: color-mix(in srgb, var(--brand) 15%, transparent); }
.ad-disclosure { margin-top: 10px; font-size: 10.5px; line-height: 1.5; color: var(--ink-3, var(--muted)); }

/* 좁은 화면에서 상품명이 단어 중간에서 끊기지 않도록 합니다 */
@media (max-width: 430px) {
  .promo-name, .promo-meta { word-break: keep-all; overflow-wrap: break-word; }
  .promo-cta { padding-left: 8px; padding-right: 8px; }
}
