/* 이심픽 — 비교 화면 스타일. 토큰 → 기본 → 레이아웃 → 컴포넌트 → 반응형 → 검수 화면 순. */
:root {
  --ink: #15201a;
  --ink-2: #3b4842;
  --muted: #6b766f;
  --muted-2: #8d968f;
  --line: #e3e8e4;
  --line-2: #eef2ef;
  --paper: #f5f7f4;
  --white: #ffffff;
  --green: #186845;
  --green-2: #0f5236;
  --mint: #e6f4ec;
  --mint-2: #cfe9da;
  --lime: #c9f65b;
  --lime-ink: #2f4d00;
  --amber-bg: #fff6e5;
  --amber: #8a5210;
  --amber-line: #efdcb6;
  --blue-bg: #e9f1f7;
  --blue: #2f4f63;
  --radius-s: 10px;
  --radius: 14px;
  --radius-l: 20px;
  --shadow-s: 0 1px 2px rgba(21, 32, 26, .04), 0 2px 8px rgba(21, 32, 26, .04);
  --shadow: 0 10px 30px rgba(21, 32, 26, .08);
  --content: 1040px;
  --gutter: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: var(--green); }
h1, h2, h3, h4, p { margin: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.container { width: min(var(--content), calc(100% - var(--gutter) * 2)); margin: 0 auto; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 244, .9);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
}
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; font-size: 21px; font-weight: 800; letter-spacing: -.6px; }
.brand span { padding: 2px 7px; color: var(--green); background: var(--mint); border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0; }
.site-header p { color: var(--muted); font-size: 13px; }

/* ---------- 히어로 + 검색 패널 ---------- */
.hero { padding: 40px 0 28px; }
.eyebrow { margin-bottom: 8px; color: var(--green); font-size: 13px; font-weight: 700; }
h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -1.2px; line-height: 1.2; }
.hero-sub { margin: 8px 0 22px; color: var(--muted); font-size: 15px; }

.search-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--white);
  box-shadow: var(--shadow-s);
}
.filter-summary { display: none; }
.search-panel-body { display: block; }
.search-fields {
  padding: 22px 24px 24px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px 28px;
}
.search-field { min-width: 0; }
.field-label { margin-bottom: 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 700; }
.field-label small { color: var(--muted); font-size: 12px; font-weight: 500; }
.data-field { grid-column: 1 / -1; padding-top: 4px; }
.network-field, .price-mode-field { padding-top: 20px; border-top: 1px solid var(--line-2); }
.panel-done { display: none; }
.panel-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }
/* 조건 초기화 버튼: 패널 안(#reset-all)과 빈 결과 안내(#reset-filters)가 같은 모양을 쓴다. */
.reset-button { min-height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 700; }
.reset-button:hover { border-color: var(--green); color: var(--green); }

.country-card {
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--mint-2);
  border-radius: var(--radius);
  background: var(--mint);
  cursor: default;
}
.flag { font-size: 26px; line-height: 1; }
.country-card strong, .country-card small { display: block; }
.country-card strong { font-size: 15px; font-weight: 700; }
.country-card small { margin-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.check { width: 22px; height: 22px; margin-left: auto; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50%; font-size: 12px; font-weight: 800; }

.day-picker { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; }
.day-button {
  min-height: 42px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--white);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: border-color .12s, background .12s;
}
.day-button:hover { border-color: var(--green); }
.day-button.active { color: white; border-color: var(--green); background: var(--green); }

.data-filters { display: grid; gap: 8px; }
.filter-group { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 10px; }
.filter-group.single { grid-template-columns: 52px auto; }
.filter-group-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.filter-group-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .12s, background .12s;
}
.chip:hover { border-color: var(--green); }
.chip.active { color: white; border-color: var(--ink); background: var(--ink); }

.segmented { padding: 4px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--paper); border-radius: 12px; }
.segmented button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background .12s, color .12s;
}
.segmented button.active { color: var(--green-2); background: var(--white); box-shadow: var(--shadow-s); }
.benefit-modes button.active { color: white; background: var(--green); box-shadow: none; }
.segmented button:disabled { color: var(--muted-2); background: transparent; box-shadow: none; cursor: not-allowed; }
.reward-availability { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }

/* ---------- 결과 ---------- */
.comparison { padding: 26px 0 80px; }
.result-heading { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.result-heading > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.result-heading h2 span { color: var(--green); }
#sort-label { padding: 4px 10px; color: var(--ink-2); background: var(--white); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 600; }
.result-heading > a { color: var(--green); font-size: 13px; font-weight: 700; text-decoration: none; }
.result-heading > a:hover { text-decoration: underline; text-underline-offset: 3px; }

.freshness-warning { margin-bottom: 12px; padding: 12px 16px; border: 1px solid var(--amber-line); border-radius: var(--radius); background: var(--amber-bg); color: var(--amber); font-size: 13px; line-height: 1.55; }
.freshness-warning:empty { margin: 0; padding: 0; border: 0; background: none; }

#result-summary[hidden] { display: none; }

/* 비교함이 숨겨져 있어도(선택 0개) 비교 관련 안내는 여기서 계속 보인다. */
#compare-status { margin: -6px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
/* 알림 영역은 항상 접근성 트리에 남기고, 알릴 말이 없을 때만 자리를 차지하지 않는다. */
#compare-status:empty { margin: 0; }

.data-error { margin-bottom: 12px; padding: 20px; display: grid; gap: 8px; justify-items: start; border: 1px solid var(--amber-line); border-radius: var(--radius); background: var(--amber-bg); color: var(--amber); font-size: 13px; line-height: 1.6; }
.data-error[hidden] { display: none; }
.data-error strong { color: var(--ink); font-size: 15px; }
.data-error p { margin: 0; }
.data-error-actions { margin-top: 4px; display: flex; align-items: center; gap: 12px; }
.data-error-actions a { color: var(--amber); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
#retry-load { min-height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 700; }
#retry-load:hover { border-color: var(--green); color: var(--green); }

.plans { display: grid; gap: 10px; }
.plan-card {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 24px 168px minmax(0, 1fr) auto auto;
  grid-template-areas: "rank provider spec price cta" "detail detail detail detail detail";
  align-items: center;
  gap: 8px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-s);
  transition: border-color .15s, box-shadow .15s;
}
.plan-card:hover { border-color: var(--mint-2); box-shadow: var(--shadow); }
.plan-card.is-best { border-color: var(--green); }
.rank { grid-area: rank; color: var(--muted-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.provider { grid-area: provider; min-width: 0; }
.provider strong { display: block; font-size: 15px; font-weight: 700; }
/* 판매처가 주는 이름·문구는 길이 제한이 없다. body의 word-break: keep-all 때문에 끊기지 않는
   긴 한글이 카드와 화면 밖으로 밀려나가므로, 자유 입력 텍스트만 골라 어디서든 접도록 둔다. */
.provider strong, .plan-data strong, .detail-meta dt, .detail-meta dd,
.benefit-group li strong, .benefit-group li small,
.compare-table th[scope="col"] span, .compare-table th[scope="col"] small { overflow-wrap: anywhere; }
.badges { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.best-badge { padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.reward-best { color: var(--lime-ink); background: var(--lime); }
.cash-best { color: var(--blue); background: var(--blue-bg); }

.plan-data { grid-area: spec; min-width: 0; }
.spec-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.plan-data > strong + .spec-tags { margin-top: 8px; }
.spec-tag { max-width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink-2); font-size: 12px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.spec-tag-qos { border-color: var(--amber-line); background: var(--amber-bg); color: var(--amber); white-space: pre-line; }
.spec-tag.is-caution { border-color: var(--amber-line); color: var(--amber); }
.spec-tag-service, .spec-tag-care, .spec-tag-install { border-color: var(--mint-2); background: var(--mint); color: var(--green-2); }
.plan-data strong { display: block; font-size: 15px; font-weight: 700; }
.plan-data small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.plan-data.condensed strong { color: var(--ink-2); font-size: 13px; font-weight: 500; }

.price-action { grid-area: price; text-align: right; }
.price-kicker { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.price { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.6px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.purchase-price { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.price-tags { margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag-reward { color: var(--green-2); background: var(--mint); }
.tag-muted { color: var(--muted); background: var(--paper); }
.tag-warn { color: var(--amber); background: var(--amber-bg); }
.tag-condition { color: var(--ink-2); background: var(--paper); }

.buy-link {
  grid-area: cta;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  color: white;
  background: var(--green);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s;
}
.buy-link:hover { background: var(--green-2); }
.buy-link--blocked {
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
}
.buy-link--blocked:hover { border-color: var(--amber); color: var(--amber); background: var(--white); }

.detail-row { grid-area: detail; margin-top: 4px; }
.detail-row summary { width: fit-content; padding: 4px 0; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; list-style: none; }
.detail-row summary::-webkit-details-marker { display: none; }
.detail-row summary::before { content: "▸"; margin-right: 5px; display: inline-block; transition: transform .12s; }
.detail-row[open] summary::before { transform: rotate(90deg); }
.detail-row summary:hover { color: var(--green); }
.detail-body { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.detail-meta { margin: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 6px 14px; font-size: 12px; }
.detail-meta dt { color: var(--muted); font-weight: 600; }
.detail-meta dd { margin: 0; color: var(--ink-2); line-height: 1.5; }
.plan-benefit-groups { margin-top: 12px; padding: 4px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; background: var(--paper); border-radius: var(--radius-s); }
.plan-benefit-groups .benefit-group { padding: 12px 0; }

/* 혜택 항목 (상품 상세·판매처 카드 공용) */
.benefit-group h4 { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .2px; }
.benefit-group ul { margin: 0; padding: 0; list-style: none; }
.benefit-group li + li { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.benefit-group li strong, .benefit-group li small { display: block; }
.benefit-group li strong { color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.4; }
.benefit-group li strong span { margin-left: 6px; padding: 1px 6px; color: var(--green-2); background: var(--mint); border-radius: 5px; font-size: 11px; white-space: nowrap; vertical-align: 1px; }
.benefit-group li small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.benefit-verification { color: var(--amber) !important; font-weight: 600; }
.benefit-facts { display: flex !important; flex-wrap: wrap; gap: 4px; }
.benefit-facts span { padding: 1px 6px; color: var(--ink-2); background: var(--white); border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.benefit-notes { color: var(--muted-2) !important; }
.benefit-source { display: inline-block; margin-top: 6px; color: var(--green); font-size: 12px; font-weight: 600; text-underline-offset: 2px; }

.more-button {
  width: 100%;
  margin-top: 14px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
}
.more-button:hover { border-color: var(--green); color: var(--green); }
.empty { padding: 44px; text-align: center; color: var(--muted); }
.empty p { margin: 0; }
#reset-filters { margin-top: 14px; }

/* ---------- 판매처 혜택 ---------- */
.merchant-search { margin-top: 44px; }
.merchant-search-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-kicker { margin-bottom: 6px; color: var(--green); font-size: 12px; font-weight: 700; }
.merchant-search-heading > div > p:not(.section-kicker) { margin-top: 6px; color: var(--muted); font-size: 13px; }
.merchant-search-heading > span { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.normalization-note { margin-top: 8px; }
.normalization-note summary { width: fit-content; color: var(--green); cursor: pointer; font-size: 12px; font-weight: 600; }
.normalization-note p { max-width: 640px; margin-top: 8px; padding: 10px 12px; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 12px; line-height: 1.55; }
.merchant-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.merchant-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-s); overflow: hidden; }
.merchant-card[open] { grid-column: 1 / -1; }
.merchant-card summary { padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; cursor: pointer; list-style: none; }
.merchant-card summary::-webkit-details-marker { display: none; }
.merchant-card summary::after { content: "+"; grid-column: 2; grid-row: 1 / 4; align-self: center; width: 26px; height: 26px; display: grid; place-items: center; color: var(--green); background: var(--mint); border-radius: 50%; font-size: 16px; font-weight: 600; }
.merchant-card[open] summary::after { content: "−"; }
.merchant-card summary > strong { font-size: 14px; font-weight: 700; }
.merchant-card summary > span { grid-column: 1; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.merchant-card summary > small { grid-column: 1; color: var(--green); font-size: 12px; font-weight: 600; }
.merchant-card .merchant-body { padding: 0 16px 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.merchant-card .benefit-group { padding: 12px 0; border-top: 1px solid var(--line-2); }

/* ---------- 기준·최신성 ---------- */
.basis { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.price-standard { padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; background: #f0f7f3; }
.standard-icon { width: 32px; height: 32px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 9px; font-weight: 800; }
.price-standard strong { font-size: 13px; }
.price-standard p { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.freshness-strip { padding: 11px 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.freshness-strip strong { color: var(--ink); font-size: 12px; }
.live-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #2da66d; box-shadow: 0 0 0 4px rgba(45, 166, 109, .14); }
.freshness-strip button { margin-left: auto; padding: 2px 0; color: var(--green); border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.freshness-panel { padding: 0 16px 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.freshness-panel p + p { margin-top: 4px; }

footer { padding: 28px var(--gutter) 44px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 12px; line-height: 1.7; }
footer p { max-width: 720px; margin: 0 auto; }

/* ---------- 비교함 ---------- */
/* 카드 안 선택 체크박스. 좁은 화면에서도 손가락으로 누를 수 있게 이름까지 통째로 label로 감싼다. */
.compare-toggle-label { margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; }
.compare-toggle { width: 16px; height: 16px; margin: 0; accent-color: var(--green); cursor: pointer; }
.compare-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.compare-toggle:checked + span { color: var(--green); }
.compare-toggle:disabled { cursor: not-allowed; }
.compare-toggle:disabled + span { color: var(--muted-2); }

/* 비교함이 떠 있는 동안에는 마지막 카드가 가리지 않도록 아래 여백을 준다. */
body.has-compare-bar { padding-bottom: 132px; }

.compare-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; flex-direction: column; padding: 0 var(--gutter) 0; pointer-events: none; }
/* display를 직접 정하는 블록이라 [hidden]의 기본 규칙을 눌러버린다. 다시 세워둔다. */
.compare-dock[hidden], .compare-panel[hidden] { display: none; }
.compare-dock > * { width: 100%; max-width: var(--content); margin: 0 auto; pointer-events: auto; }
.compare-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  padding: 12px 16px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--white); box-shadow: var(--shadow);
}
.compare-bar-text { min-width: 0; flex: 1 1 auto; }
#compare-count { display: block; font-size: 14px; font-weight: 700; }
.compare-bar-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 8px; }
.compare-bar-actions button { min-height: 40px; padding: 0 16px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 700; }
.compare-clear { border: 1px solid var(--line); background: var(--white); color: var(--muted); }
.compare-clear:hover { border-color: var(--green); color: var(--green); }
.compare-open { border: 0; background: var(--green); color: white; }
.compare-open:hover:not(:disabled) { background: var(--green-2); }
.compare-open:disabled { background: var(--line); color: var(--muted-2); cursor: not-allowed; }

.compare-panel {
  max-height: min(58vh, 460px); display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--white); box-shadow: var(--shadow);
}
.compare-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 8px; }
#compare-panel-title { font-size: 14px; font-weight: 700; }
#compare-close { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
#compare-close:hover { border-color: var(--green); color: var(--green); }
/* 가로 스크롤은 표 영역 안에서만 일어난다. 페이지 자체는 절대 넓어지지 않는다. */
.compare-scroll { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.compare-note { padding: 0 16px 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
/* 고정 레이아웃이라야 열 너비가 내용과 무관하게 같아져 값을 눈으로 나란히 견줄 수 있다. */
.compare-table { width: 100%; min-width: 460px; table-layout: fixed; border-collapse: collapse; text-align: left; }
/* 표 이름은 화면에서는 감추고 보조기술에만 남긴다. 보이는 설명은 .compare-note가 맡는다. */
.compare-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.compare-table th, .compare-table td { padding: 9px 12px; border-top: 1px solid var(--line-2); vertical-align: top; font-size: 12px; }
.compare-table tr:first-child th, .compare-table tr:first-child td { border-top: 0; }
/* 라벨 칸은 고정 레이아웃에서 다른 열과 같은 몫을 가져가지 않도록 너비를 못박는다. */
.compare-table th[scope="row"], .compare-table .compare-row-label { width: 96px; }
.compare-table th[scope="row"] { padding-left: 16px; color: var(--muted); font-weight: 600; }
.compare-table th[scope="col"] { font-weight: 700; }
.compare-table th[scope="col"] span { display: block; }
.compare-table th[scope="col"] small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.compare-table td { color: var(--ink-2); overflow-wrap: anywhere; }
.compare-table td span, .compare-table td small { display: block; }
.compare-table td span { font-weight: 600; }
.compare-table td small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.compare-table td small.compare-warn { color: var(--amber); }
.compare-table td .buy-link { min-height: 36px; padding: 0 12px; font-size: 12px; }

/* ---------- 모바일 ---------- */
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .site-header { height: 52px; }
  .site-header p { display: none; }
  .hero { padding: 16px 0 12px; }
  .eyebrow { display: none; }
  h1 { font-size: 20px; letter-spacing: -.6px; }
  .hero-sub { margin: 4px 0 12px; font-size: 13px; }

  .search-panel { position: sticky; top: 56px; z-index: 15; border-radius: var(--radius); }
  .filter-summary {
    width: 100%;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    border: 0;
    background: transparent;
    cursor: pointer;
  }
  .filter-summary-text { flex: 1; min-width: 0; overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
  .filter-summary-text em { font-style: normal; color: var(--green); }
  .filter-summary-action { flex: 0 0 auto; padding: 5px 10px; color: var(--green); background: var(--mint); border-radius: 999px; font-size: 12px; font-weight: 700; }
  .search-panel.is-open .filter-summary-action { color: var(--muted); background: var(--paper); }
  .search-panel-body { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .2s ease, visibility 0s linear .2s; }
  .search-panel.is-open .search-panel-body { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
  .search-fields { min-height: 0; overflow: hidden; padding: 0 14px; grid-template-columns: 1fr; gap: 14px; }
  .search-panel.is-open .search-fields { padding-bottom: 14px; }
  .search-panel.is-open .search-panel-body { max-height: calc(100vh - 90px); overflow-y: auto; }
  .search-field { padding-top: 14px; border-top: 1px solid var(--line-2); }
  .data-field { padding-top: 14px; }
  .network-field, .price-mode-field { padding-top: 14px; }
  .field-label { margin-bottom: 8px; }
  .day-picker { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; scrollbar-width: none; }
  .day-picker::-webkit-scrollbar { display: none; }
  .day-button { flex: 0 0 auto; min-width: 46px; min-height: 40px; scroll-snap-align: center; }
  .filter-group { grid-template-columns: 40px minmax(0, 1fr); }
  .filter-group.single { grid-template-columns: 40px auto; }
  .filter-group-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .filter-group-chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .panel-done { display: block; flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: var(--ink); color: white; cursor: pointer; font-weight: 700; }
  .panel-actions .reset-button { flex: 0 0 auto; min-height: 44px; border-radius: 10px; }

  .comparison { padding-top: 16px; }
  .result-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .plan-card {
    padding: 14px 14px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "provider price" "spec spec" "cta cta" "detail detail";
    gap: 8px 12px;
  }
  .rank { display: none; }
  .price { font-size: 20px; }
  .buy-link { width: 100%; min-height: 44px; }
  /* 1fr의 최소 너비는 min-content라서 긴 한글 한 덩어리가 열을 화면 밖으로 넓힌다. */
  .detail-meta { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .detail-meta dt { margin-top: 4px; }
  .plan-benefit-groups { grid-template-columns: 1fr; padding: 0 14px; }
  /* 비교함은 화면 아래에 붙어 있어 카드 목록이 그 뒤로 숨지 않도록 여백을 더 준다. */
  body.has-compare-bar { padding-bottom: 156px; }
  .compare-dock { padding: 0; }
  .compare-bar, .compare-panel { border-left: 0; border-right: 0; border-radius: var(--radius-s) var(--radius-s) 0 0; }
  .compare-bar { padding: 10px 14px; }
  .compare-bar-actions { flex: 1 1 100%; }
  .compare-bar-actions button { flex: 1; min-height: 44px; }
  .compare-panel { max-height: 52vh; }
  .compare-table th[scope="row"] { padding-left: 14px; }

  .merchant-search-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .merchant-grid { grid-template-columns: 1fr; }
  .merchant-card .merchant-body { grid-template-columns: 1fr; }
  .freshness-strip button { margin-left: 0; }
}

@media (min-width: 761px) and (max-width: 980px) {
  .plan-card { grid-template-columns: 24px 140px minmax(0, 1fr) auto auto; gap: 8px 14px; }
  .merchant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-picker { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .search-panel-body, .plan-card, .chip, .day-button { transition: none; }
}

/* ---------- 검수 화면 ---------- */
.price-freshness { display: block; margin-top: 8px; color: #68716c; font-size: 11px; line-height: 1.5; }
.price-freshness.aging, .price-freshness.stale, .price-freshness.unknown { color: #8a5210; }
.review-main { max-width: 1000px; margin: 32px auto; padding: 20px; }
.review-main h1 { margin: 12px 0; }
.review-main > p { margin: 8px 0; }
.review-card { background: white; padding: 24px; margin-top: 20px; border: 1px solid #dce5df; border-radius: 16px; }
.review-card p, .review-card li { font-size: 14px; line-height: 1.7; }
.review-card p { margin: 6px 0; }
.review-card h2 { font-size: 20px; }
.evidence-path { display: block; overflow-wrap: anywhere; margin: 8px 0; font-size: 12px; }
.review-diff { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; padding: 12px; background: #f3f5f3; font-size: 12px; }
.review-card form { display: grid; gap: 12px; padding: 16px 0; }
.review-card textarea { display: block; width: 100%; min-height: 90px; margin-top: 8px; }
.review-card label, .review-card select { font-size: 14px; }
.review-card details { margin-top: 14px; }
.review-image-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.review-image-grid figure { margin: 0; }
.review-image-grid img { width: 100%; height: auto; }
