/* carcalc.manuz.com — 견적서·명세서 느낌의 밝은 계산기. 서체 Pretendard 하나, 숫자는 tabular. */
:root {
  color-scheme: light dark;
  --bg: #fbfbf8;
  --paper: #ffffff;
  --paper-2: #f3f4ef;
  --line: #e4e6df;
  --line-2: #cfd3c9;
  --text: #16191e;
  --text-2: #4b5160;
  --muted: #7a8090;
  --accent: #0f6e56;        /* 깊은 녹색: 돈·확정 */
  --accent-2: #0b5442;
  --accent-soft: #e6f2ed;
  --warn: #b45309;          /* 세금·주의 */
  --warn-soft: #fdf1e3;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --wrap: 960px;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c; --paper: #1b1f26; --paper-2: #222731; --line: #2b313c; --line-2: #3a4150;
    --text: #eceef2; --text-2: #b7bcc8; --muted: #8a909e;
    --accent: #4fc39d; --accent-2: #7ad5b8; --accent-soft: #173229; --warn: #f0a04b; --warn-soft: #3a2a17;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--text); background: var(--bg);
  word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: 16px; }
.skip { position: absolute; left: -9999px; top: 10px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; font-weight: 700; }
.skip:focus { left: 10px; }
.small { font-size: .875rem; color: var(--text-2); }

/* 머리 */
.mast { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.mast-in { display: flex; align-items: center; gap: 14px; min-height: 56px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; flex: none; font-weight: 800; letter-spacing: -.01em; }
.wm-icon { width: 28px; height: 28px; }
.wm-text { font-size: 1.05rem; }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; padding: 6px 10px; border-radius: 999px; font-size: .9rem; color: var(--text-2); }
.nav a:hover { background: var(--paper-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-2); font-weight: 700; }
@media (max-width: 640px) {
  .mast-in { flex-wrap: wrap; padding-block: 8px; gap: 6px; }
  .nav { margin-left: -16px; margin-right: -16px; padding-inline: 16px; width: calc(100% + 32px); }
}

.main { flex: 1; padding-block: 20px 40px; }

/* 소개 */
.hero { padding: 8px 0 18px; }
.eyebrow { margin: 0 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--accent); text-transform: uppercase; }
.h1 { margin: 0; font-size: clamp(1.5rem, 2.2vw + 1rem, 2.1rem); line-height: 1.25; letter-spacing: -.02em; font-weight: 800; }
.lead { margin: 10px 0 0; color: var(--text-2); font-size: 1rem; max-width: 640px; }
.asof { margin: 8px 0 0; font-size: .82rem; color: var(--muted); }
.asof time { font-variant-numeric: tabular-nums; }

/* 입력 */
.calc { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.field label { display: block; font-size: .82rem; font-weight: 700; color: var(--text-2); margin-bottom: 5px; }
.field select, .field input { width: 100%; height: 46px; padding: 0 12px; font: inherit; font-size: 1.05rem; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; appearance: none; -webkit-appearance: none; }
.field select { padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%237a8090'%3E%3Cpath d='M5.5 7.5l4.5 4.5 4.5-4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[type=number] { font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-wrap { position: relative; }
.unit-wrap input { padding-right: 64px; }
.unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: .85rem; color: var(--muted); pointer-events: none; }
.help { margin: 5px 0 0; font-size: .78rem; color: var(--muted); line-height: 1.45; }
.btn { height: 46px; padding: 0 18px; font: inherit; font-weight: 700; color: #fff; background: var(--accent); border: 0; border-radius: 10px; cursor: pointer; align-self: end; }

/* 결과 */
.result { margin-top: 14px; transition: opacity .15s; }
.result[aria-busy="true"] { opacity: .55; }
.res { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.res-card { padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.res-card--main { grid-column: 1 / -1; background: var(--accent); border-color: var(--accent); color: #fff; }
.res-label { font-size: .8rem; font-weight: 700; color: var(--text-2); }
.res-card--main .res-label { color: rgba(255,255,255,.85); }
.res-value { margin-top: 4px; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.res-card--main .res-value { font-size: clamp(1.9rem, 4vw + .5rem, 2.6rem); }
.res-sub { margin-top: 4px; font-size: .8rem; color: var(--muted); }
.res-card:nth-child(4):last-child { grid-column: 1 / -1; } /* 폰에서 홀로 남는 네 번째 카드는 한 줄 다 쓴다 */
.res-card--main .res-sub { color: rgba(255,255,255,.85); }
@media (min-width: 720px) { .res { grid-template-columns: repeat(3, 1fr); } .res-card:nth-child(4):last-child { grid-column: auto; } .res-card--main { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; } .res-card--main .res-value { flex-basis: 100%; } }
.res-lines { margin: 12px 0 0; padding: 12px 16px 12px 36px; background: var(--paper-2); border-radius: 10px; font-size: .9rem; color: var(--text-2); }
.res-lines li + li { margin-top: 3px; }
.res-notes { margin: 10px 0 0; padding: 0 0 0 18px; font-size: .85rem; color: var(--text-2); }
.res-notes li + li { margin-top: 4px; }

/* 광고: 자리 고정으로 밀림 방지, 계산 영역과 간격 */
.ad { min-height: 280px; margin: 28px 0; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }

/* 본문 해설·표·FAQ */
.prose { max-width: 720px; margin-top: 24px; }
.prose h2 { font-size: 1.25rem; letter-spacing: -.015em; margin: 32px 0 10px; }
.prose h3 { font-size: 1.05rem; margin: 22px 0 6px; }
.prose p, .prose li { color: var(--text-2); }
.prose p { margin: 8px 0; }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose b { color: var(--text); }
.prose .src { font-size: .82rem; color: var(--muted); }
.prose .src a { text-decoration: underline; text-underline-offset: 2px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; background: var(--paper); }
th, td { padding: 9px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--paper-2); color: var(--text-2); font-weight: 700; font-size: .8rem; }
tbody tr:last-child td { border-bottom: 0; }
td a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 10px 0; font-weight: 700; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 0 12px; color: var(--text-2); }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--text); border-left: 4px solid var(--warn); font-size: .92rem; }

/* 홈 카드 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card-kicker { font-size: .78rem; font-weight: 700; color: var(--accent); }
.card-title { font-size: 1.1rem; font-weight: 800; letter-spacing: -.015em; }
.card-desc { font-size: .88rem; color: var(--text-2); flex: 1; }
.card-cta { font-size: .85rem; font-weight: 700; color: var(--accent-2); margin-top: 4px; }

/* 관련 계산기 */
.related { margin-top: 36px; }
.related h2 { font-size: 1.05rem; margin: 0 0 10px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.related a { display: block; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.related a:hover { border-color: var(--accent); }
.related a b { display: block; font-size: .95rem; }
.related a span { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 발 */
.foot { border-top: 1px solid var(--line); background: var(--paper); padding: 24px 0 32px; font-size: .82rem; color: var(--muted); }
.foot-brand { margin: 0 0 8px; font-weight: 800; color: var(--text); }
.foot-note { margin: 4px 0; max-width: 720px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 8px; }
.foot-links a { text-decoration: underline; text-underline-offset: 2px; }
.foot-copy { margin: 0; }

/* ── 유지비 상세: 단계 입력 ── */
.calc--steps { display: block; padding: 0; background: none; border: 0; }
.step { margin: 0 0 12px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; min-width: 0; }
.step legend { float: left; width: 100%; margin: 0 0 4px; padding: 0; font-weight: 800; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.step legend small, .field label small, .label small { font-weight: 500; color: var(--muted); }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8rem; }
.field--wide { grid-column: 1 / -1; }
.field--check label { display: flex; gap: 8px; align-items: center; font-size: .92rem; font-weight: 500; color: var(--text); }
.field--check input { width: 18px; height: 18px; accent-color: var(--accent); }
.field .label { display: block; font-size: .82rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.field label output { float: right; font-weight: 800; color: var(--accent-2); }
.field input[type=range] { height: 32px; padding: 0; border: 0; background: none; accent-color: var(--accent); appearance: auto; -webkit-appearance: auto; }
.field input[type=range]:focus { box-shadow: none; }
.help a { text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: .9rem; background: var(--bg); }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); font-weight: 700; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.res-card--wide { grid-column: 1 / -1; }

/* ── 비중 막대 (분류 색 4개, 검증 통과 팔레트) ── */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; }
@media (prefers-color-scheme: dark) { :root { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; } }
.viz, .tl-wrap, .cmp { margin-top: 20px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.viz-title { margin: 0 0 12px; font-size: 1rem; font-weight: 800; }
.viz-title small { font-weight: 500; color: var(--muted); font-size: .8rem; margin-left: 6px; }
.stack { display: flex; gap: 2px; height: 34px; border-radius: 6px; overflow: hidden; }
.seg { display: flex; align-items: center; justify-content: center; min-width: 2px; }
.seg b { font-size: .78rem; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.35); }
.seg-1, .sw-1 { background: var(--s1); } .seg-2, .sw-2 { background: var(--s2); } .seg-3, .sw-3 { background: var(--s3); } .seg-4, .sw-4 { background: var(--s4); }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; font-size: .88rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend span { flex: 1; color: var(--text-2); }
.legend small { color: var(--muted); width: 36px; text-align: right; }

/* ── 정비 타임라인 ── */
.tl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line-2); }
.tl-year { position: relative; padding: 0 0 14px 14px; }
.tl-year::before { content: ""; position: absolute; left: -21px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.tl-head { display: flex; align-items: baseline; gap: 10px; font-size: .95rem; }
.tl-head span { color: var(--muted); font-size: .82rem; }
.tl-sum { margin-left: auto; }
.tl-items { list-style: none; margin: 6px 0 0; padding: 0; }
.tl-items li { display: grid; grid-template-columns: 78px 1fr auto; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.tl-items li:last-child { border-bottom: 0; }
.tl-items li.big { background: var(--warn-soft); margin: 0 -8px; padding: 6px 8px; border-radius: 6px; border-bottom: 0; }
.tl-odo { color: var(--muted); font-size: .8rem; }
.tl-name { color: var(--text); }
.tl-none { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }
.tag { display: inline-block; font-style: normal; font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-2); vertical-align: 1px; }
.tag--muted { background: var(--paper-2); color: var(--muted); }
.tag--big { background: var(--warn); color: #fff; }

/* ── 연도별 막대 ── */
.bars { width: 100%; background: none; font-size: .88rem; }
.bars th { width: 64px; text-align: left; font-weight: 600; color: var(--text-2); background: none; border: 0; padding: 4px 0; }
.bars td { text-align: left; border: 0; padding: 4px 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.bars .bar { display: inline-block; height: 18px; background: var(--s1); border-radius: 0 4px 4px 0; }
.bars b { font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.cmp table td:first-child { white-space: normal; }
.assume { margin-top: 16px; padding: 12px 16px; background: var(--paper-2); border-radius: 10px; font-size: .88rem; }
.assume summary { cursor: pointer; font-weight: 700; }
.assume ul { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); }
.assume li + li { margin-top: 5px; }
.assume a { text-decoration: underline; }

/* ── 홈·차종 페이지 ── */
.card--hero { margin: 8px 0 12px; border: 2px solid var(--accent); background: var(--accent-soft); }
.model-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.model-list a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font-size: .92rem; }
.model-list a:hover { border-color: var(--accent); }
.model-list span { color: var(--accent-2); font-weight: 700; white-space: nowrap; }
.cta-row { margin: 14px 0 0; }
.cta-row .btn { display: inline-flex; align-items: center; }
.res-sub a { text-decoration: underline; }
table.spec th { text-align: left; width: 34%; background: var(--paper-2); color: var(--text-2); font-weight: 700; font-size: .85rem; }
table.spec td { text-align: left; white-space: normal; }
td.text { text-align: left; white-space: normal; }
/* 보정: 떠 있는 legend 가 그리드 칸을 차지하지 않게, 체크박스는 기본 모양, 표 첫 열 최소 폭 */
.step legend { grid-column: 1 / -1; }
.field--check input { appearance: auto; -webkit-appearance: auto; height: 18px; padding: 0; border: 0; background: none; }
td.text { min-width: 9.5em; }

.field--wide2 { grid-column: span 2; }
@media (max-width: 640px) { .field--wide2 { grid-column: 1 / -1; } }

/* 주행 특성: 설명 붙은 선택 카드 */
.traits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.trait { position: relative; display: block; cursor: pointer; }
.trait input { position: absolute; top: 14px; left: 12px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.trait-body { display: block; height: 100%; padding: 11px 12px 11px 40px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); }
.trait-body b { display: block; font-size: .92rem; }
.trait-body small { display: block; margin-top: 3px; font-size: .78rem; line-height: 1.45; color: var(--text-2); }
.trait input:checked + .trait-body { border-color: var(--accent); background: var(--accent-soft); }
.trait input:focus-visible + .trait-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.field .trait input { appearance: auto; -webkit-appearance: auto; width: 18px; height: 18px; padding: 0; border: 0; background: none; box-shadow: none; }

/* 빵부스러기·차종별 목록·계열 페이지 */
.crumbs ol { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: .8rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { text-decoration: underline; text-underline-offset: 2px; }
.maker-block h2 small, .related h2 small { font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.prose--wide { max-width: none; }
.prose table td small { margin-left: 4px; font-size: .7rem; color: var(--warn); }
.pop-list { display: flex !important; flex-wrap: wrap; gap: 8px; }
.pop-list a { padding: 8px 14px !important; border-radius: 999px !important; font-size: .9rem; }
.btn--ghost { background: var(--paper); color: var(--accent-2); border: 1px solid var(--accent); margin-left: 6px; }
.cta-row .btn { text-decoration: none; }
