/* carsave.kr 공용 스타일 — 모든 페이지(홈·연료별·기능 소개·약관류) */
:root {
  --ink: #16202E;
  --ink-2: #2A3546;
  --muted: #4B5768;
  --paper: #F5F7FA;
  --white: #fff;
  --line: #DCE3EC;
  --line-soft: #EEF2F6;
  --brand: #2F6FCB;      /* 글자·버튼용 — 흰 바탕 대비 4.5:1 이상 */
  --brand-fill: #4A90D9; /* 앱 아이콘 색 — 넓은 면 전용 */
  --leak: #A35D10;       /* '새는 곳' 강조 글자 */
  --leak-bg: #FDF1E2;
  --focus: #E3922F;
  --surface: #fff;        /* 카드·문서 바탕 */
  --tint: #EAF1FB;        /* 선택·강조 옅은 파랑 */
  --line-strong: var(--line-strong); /* 입력칸 테두리 */
  --hl: #FFF3C4;          /* 영수증 형광펜 */
  --leak-ink: #5A3A0E;
  --on-brand: #fff;       /* 파란 면 위 글자 */
  --brand-hover: #1F55A3;
  --band: #16202E;        /* 어두운 띠 */
  color-scheme: light;
}

/* 다크 모드 — 휴대폰·PC 설정을 따른다. 색 토큰만 바꾸고 구조는 그대로 */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E8EDF3; --ink-2: #C9D2DD; --muted: #A7B3C2;
    --paper: #0F1620; --white: #141D29; --surface: #18212D;
    --line: #2A3647; --line-soft: #1F2937; --line-strong: #3A4659;
    --brand: #7FB0EE; --brand-hover: #A9CBF5; --on-brand: #0F1620;
    --leak: #F0B46A; --leak-bg: #3A2A14; --leak-ink: #F6D7AE;
    --tint: #1D2D44; --hl: #5A4A12; --focus: #F0A54A; --band: #0A1018;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
img { max-width: 100%; height: auto; }
picture { display: block; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.wrap.narrow { max-width: 860px; }
.section { padding: 96px 0; }
.section.white { background: var(--white); }
.section.dark { background: var(--band); color: #fff; }

.h1 { margin: 0; font-size: clamp(36px, 3.2vw + 16px, 56px); line-height: 1.18; font-weight: 700; letter-spacing: -0.02em; }
.h2 { margin: 0; font-size: clamp(26px, 1.6vw + 18px, 36px); line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.lead { margin: 14px 0 0; font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 36em; }
.dark .h2 { color: #fff; }
.dark .lead { color: #C9D3E0; }

/* 내비게이션 */
.top { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 19px; }
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.top-links { display: flex; gap: 28px; align-items: center; font-size: 15px; }
.top-links a { color: var(--ink); text-decoration: none; }
.top-links a:hover { color: var(--brand); }
.menu-btn { display: none; min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--white); border-radius: 10px; font: inherit; color: var(--ink); }
.mobile-menu { display: none; border-top: 1px solid var(--line); background: var(--white); }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 14px 32px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-soft); }

.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 15px; border: 0; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn.dark { background: var(--band); color: #fff; }
.btn.dark:hover { background: #2A3546; color: #fff; }
.btn svg { flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none; font-size: 14px; }

.crumb { padding-top: 20px; font-size: 14px; color: var(--muted); }

/* 히어로 */
.hero { padding: 88px 0 96px; background: var(--white); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero-kicker { margin: 0 0 18px; font-size: 16px; color: var(--muted); font-weight: 500; }
.hero-sub { margin: 22px 0 0; font-size: 22px; line-height: 1.55; color: var(--ink-2); max-width: 30em; }
.checks { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 16px; color: var(--ink-2); }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks svg { flex: none; margin-top: 4px; }
.hero .btn-row { margin-top: 36px; }
.hero-note { margin: 16px 0 0; font-size: 14px; color: var(--muted); }

/* 물어보기 데모 */
.ask { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.ask-q { display: flex; justify-content: flex-end; }
.ask-q span { background: var(--brand); color: var(--on-brand); border-radius: 18px 18px 4px 18px; padding: 14px 18px; font-size: 17px; max-width: 80%; }
.ask-a { margin-top: 18px; background: var(--white); border-radius: 18px; padding: 22px 22px 18px; border: 1px solid var(--line); }
.ask-a-label { margin: 0; font-size: 15px; color: var(--muted); }
.ask-a-total { margin: 6px 0 0; font-size: 40px; font-weight: 700; letter-spacing: -0.01em; }
.ledger { margin-top: 16px; border-top: 1px dashed var(--line-strong); }
.ledger div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 15px; border-bottom: 1px dashed var(--line-strong); }
.ledger div:last-child { border-bottom: 0; }
.ask-tip { margin-top: 12px; background: var(--leak-bg); border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.5; color: var(--leak-ink); }
.ask-foot { margin: 14px 2px 0; font-size: 13px; color: var(--muted); }

/* 카드·그리드 */
.grid-3, .grid-4, .grid-2 { display: grid; gap: 20px; margin-top: 40px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.card h3 { margin: 0; font-size: 19px; line-height: 1.4; }
.card p { margin: 10px 0 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
a.card { display: block; text-decoration: none; color: var(--ink); min-height: 150px; }
a.card:hover { border-color: var(--brand); }
.mini { margin-top: 18px; font-size: 14px; border-top: 1px solid var(--line-soft); }
.mini div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.mini div:last-child { border-bottom: 0; }
.mini span:first-child { color: var(--muted); }
.fine { margin: 20px 0 0; font-size: 14px; color: var(--muted); }

/* 새는 곳 목록 */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: start; }
.leaks { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--white); }
.leak { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.leak b { font-size: 17px; font-weight: 600; }
.leak strong { font-size: 17px; font-weight: 700; text-align: right; }
.leak small { font-size: 14px; color: var(--muted); }
.leak small:last-child { text-align: right; }
.leak .up { color: var(--leak); }
.leak .good { color: var(--brand); }
.leaks-foot { margin: 0; padding: 12px 24px; background: var(--paper); font-size: 13px; color: var(--muted); }

/* 자동차세 계산기 */
.tax-form { background: var(--white); color: var(--ink); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.tax-form fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tax-form legend, .tax-form label.lbl { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.fuel-opt { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; font-size: 15px; }
.fuel-opt input { position: absolute; opacity: 0; pointer-events: none; }
.fuel-opt:has(input:checked) { border-color: var(--brand); background: var(--tint); color: var(--brand); font-weight: 600; }
.fuel-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.tax-form input[type=number] { min-height: 52px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 16px; font: inherit; font-size: 18px; width: 100%; }
.tax-out div { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.tax-out b { font-weight: 700; }
.tax-out .good { color: var(--brand); }
.tax-note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

/* 표 */
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--white); margin-top: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; color: var(--muted); font-size: 14px; }
td.n, th.n { text-align: right; }

/* 후기 */
.reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
.review { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 24px; margin: 0; }
.review h3 { margin: 0; font-size: 17px; }
.review blockquote { margin: 10px 0 0; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.review figcaption { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* FAQ */
details { border-top: 1px solid var(--line); padding: 18px 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; min-height: 28px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; float: right; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: '−'; }
details p { margin: 12px 0 0; font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.faq-h3 { margin: 28px 0 0; font-size: 18px; }
.faq-p { margin: 8px 0 0; font-size: 16px; line-height: 1.7; color: var(--ink-2); }

/* 푸터 — 본문과 구분되는 옅은 바탕, 링크는 조용하게(밑줄은 가리킬 때만) */
.foot { padding: 56px 0 72px; border-top: 1px solid var(--line); background: var(--paper); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr)); gap: 40px; font-size: 13px; color: var(--muted); line-height: 1.8; }
.foot-grid p { margin: 0; }
.foot-name { font-weight: 700; color: var(--ink); font-size: 15px; margin-bottom: 8px !important; }
.foot-links { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.foot-links b { color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--brand); text-decoration: underline; }

@media (max-width: 900px) {
  .hero-grid, .split, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-3, .grid-4, .reviews { grid-template-columns: minmax(0, 1fr); }
  .top-links { display: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .top .btn.primary { display: none; }
  .hero { padding: 56px 0 64px; }
  .section { padding: 64px 0; }
  .wrap { padding: 0 20px; }
  .ask-a-total { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ── 기능 소개 페이지 (home/record/nearby/stats/my) ── */
.page-hero { padding: 36px 0 72px; }
.page-hero .h1 { font-size: clamp(32px, 2.6vw + 14px, 48px); }
.page-hero .hero-sub { max-width: 32em; }
.top-links a[aria-current="page"] { color: var(--brand); font-weight: 600; }

/* 화면 이미지 — 스토어 스크린샷(문구 포함 세로 이미지) */
/* 위 카드 줄과 같은 등분 칸 — 이미지는 칸 가운데, 너비 상한으로 세로 길이를 제한 */
.shots { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.shots figure { margin: 0 auto; width: 100%; max-width: 280px; }
.shots img { display: block; width: 100%; height: auto; border-radius: 22px; border: 1px solid var(--line); background: var(--tint); }
.shots figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }
.with-shot { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }
.with-shot img { width: 100%; border-radius: 22px; border: 1px solid var(--line); }

/* 기록: 영수증 → 채워진 입력칸 */
.scan { display: grid; grid-template-columns: minmax(0, .85fr) auto minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 44px; }
.receipt { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px 22px 26px; font-size: 14px; line-height: 1.9; color: var(--ink-2); transform: rotate(-1.2deg); }
.receipt h3 { margin: 0 0 6px; font-size: 15px; text-align: center; }
.receipt .r { display: flex; justify-content: space-between; gap: 12px; }
.receipt .hl { background: var(--hl); border-radius: 3px; padding: 0 3px; }
.scan-arrow { font-size: 14px; color: var(--muted); text-align: center; line-height: 1.4; }
.scan-arrow svg { display: block; margin: 0 auto 6px; }
.form-mock { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.form-mock .field { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.form-mock .field:last-of-type { border-bottom: 0; }
.form-mock .field span:first-child { color: var(--muted); }
.form-mock .filled { background: var(--tint); color: var(--brand); font-weight: 600; border-radius: 8px; padding: 0 8px; }
.form-mock .save { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.form-mock .save span:last-child { background: var(--brand); color: var(--on-brand); border-radius: 10px; padding: 8px 16px; font-size: 14px; font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pills span { border: 1px solid var(--line); border-radius: 18px; padding: 4px 12px; font-size: 14px; background: var(--surface); }
.pills .on { border-color: var(--brand); color: var(--brand); background: var(--tint); font-weight: 600; }
.h3-lg { font-size: 28px; }
.more-sec { padding: 72px 0; }
.more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.more a { position: relative; display: block; padding: 18px 44px 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); }
.more a span { display: block; font-size: 16px; font-weight: 600; }
.more a small { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.more a svg { position: absolute; right: 16px; top: 50%; margin-top: -9px; color: var(--muted); }
.more a:hover { border-color: var(--brand); }
.more a:hover svg { color: var(--brand); }

@media (max-width: 900px) {
  .scan, .with-shot { grid-template-columns: minmax(0, 1fr); }
  .scan-arrow svg { transform: rotate(90deg); }
  .receipt { transform: none; }
  .shots { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
  .shots figure { margin: 0; width: calc(50% - 7px); }
  .with-shot img { max-width: 260px; }
  .more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
  .h3-lg { font-size: 24px; }
}

/* 공식 스토어 배지 (Apple·Google 제공 SVG — 색·비율 변경 금지) */
.store-badge { display: inline-block; line-height: 0; border-radius: 8px; }
.store-badge img { height: 48px; width: auto; display: block; }
.store-badge:hover { opacity: .85; }
@media (max-width: 900px) { .store-badge img { height: 44px; } }
.nw { white-space: nowrap; }

/* 앱 받기 — PC 는 QR(폰 카메라로), 폰은 하단 바. /app 이 기기에 맞는 스토어로 보낸다 */
.qr-get { display: inline-flex; align-items: center; gap: 12px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 13px; line-height: 1.45; color: var(--muted); }
.qr-get img { width: 72px; height: 72px; image-rendering: pixelated; display: block; }
.btn-row:has(.qr-get) { align-items: center; }
.get-bar { display: none; }
.app-get { max-width: 420px; margin: 0 auto; padding: 72px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.app-get img[width="72"] { border-radius: 16px; }
.app-get .btn-row { justify-content: center; }
@media (max-width: 900px) {
  .qr-get { display: none; }
  .get-bar { display: flex; align-items: center; gap: 12px; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30;
    padding: 10px 10px 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 24px rgba(22, 32, 46, .16);
    transform: translateY(140%); visibility: hidden; transition: transform .25s ease, visibility 0s .25s; }
  .get-bar.show { transform: none; visibility: visible; transition: transform .25s ease; }
  .get-bar img { border-radius: 10px; }
  .get-bar-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
  .get-bar-t b { font-size: 15px; }
  .get-bar-t small { font-size: 13px; color: var(--muted); }
  .get-bar a { background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 15px; text-decoration: none; padding: 0 18px; min-height: 44px; display: flex; align-items: center; border-radius: 12px; }
  .foot { padding-bottom: 120px; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) { .get-bar, .get-bar.show { transition: none; } }

/* 약관·개인정보·환불 — 읽기 폭 720px, 넓은 화면에선 왼쪽 목차 고정 */
.legal-sec { padding-top: 24px; }
.legal-wrap { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 48px; justify-content: center; }
.legal-toc { position: sticky; top: 92px; align-self: start; font-size: 14px; }
.legal-toc p { margin: 0 0 8px; font-weight: 700; color: var(--ink); }
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 140px); overflow: auto; }
.legal-toc a { color: var(--muted); text-decoration: none; }
.legal-toc a:hover { color: var(--brand); text-decoration: underline; }
.legal { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 44px 48px; }
.legal h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.3; letter-spacing: -0.01em; }
.legal .legal-meta { margin: 0 0 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.legal .legal-intro { font-size: 16px; color: var(--ink-2); line-height: 1.8; white-space: pre-line; margin: 0 0 28px; }
.legal .legal-section { margin-bottom: 32px; }
.legal h2 { margin: 0 0 10px; font-size: 18px; scroll-margin-top: 88px; }
.legal .legal-section p { margin: 0; font-size: 16px; color: var(--ink-2); line-height: 1.85; white-space: pre-line; }
.legal-more { grid-column: 2; margin: 20px 0 0; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 18px; }
@media (max-width: 900px) {
  .legal-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .legal-toc { display: none; }
  .legal { padding: 28px 22px; border-radius: 16px; }
  .legal h1 { font-size: 24px; }
  .legal-more { grid-column: 1; }
}

/* 기능 페이지 첫 화면 — 왼쪽 글, 오른쪽 그 기능의 앱 화면 */
.page-hero.has-shot .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 64px; align-items: center; }
.hero-shot { margin: 0; }
.hero-shot img { display: block; width: 100%; height: auto; border-radius: 24px; border: 1px solid var(--line); background: var(--tint); }
.wrap.narrow-l > div { max-width: 760px; }
@media (max-width: 900px) {
  .page-hero.has-shot .wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-shot { justify-self: center; width: min(240px, 70%); }
}

/* 같은 사이트 페이지 이동 시 부드러운 전환 — 머리글은 자리를 지킨다. 움직임 줄이기 설정이면 끈다 */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .top { view-transition-name: site-top; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
}
