:root {
  --bg: #f4f6f8; --card: #ffffff; --ink: #111827; --muted: #6b7280; --line: #e5e7eb;
  --accent: #0f766e; --accent-soft: #e6f4f2;
  --kr: #2563eb; --loc: #16a34a; --atm: #ea580c;
  --good: #16a34a; --bad: #dc2626; --mid: #ca8a04;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14; --card: #151b22; --ink: #e5e7eb; --muted: #9ca3af; --line: #263040;
    --accent: #2dd4bf; --accent-soft: #10302d;
    --kr: #60a5fa; --loc: #4ade80; --atm: #fb923c;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }
header h1 { margin: 8px 0 2px; font-size: 26px; letter-spacing: -0.02em; }
.lead { margin: 0 0 16px; color: var(--muted); }
.card { background: var(--card); border-radius: 18px; padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h2 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
h3 { font-size: 17px; margin: 6px 0 10px; }
h4 { font-size: 14px; margin: 18px 0 8px; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--ink); }

/* 계산기 */
.conv { position: relative; display: grid; gap: 8px; }
.io { display: block; background: var(--bg); border-radius: 12px; padding: 10px 14px; }
.io-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-right: 40px; }
.io-top span { font-size: 12px; color: var(--muted); }
.io-top select { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 10px; font-size: 14px; font-weight: 600; max-width: 70%; }
.trip { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.trip label { flex: 1; min-width: 0; }
.trip label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.trip select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 14px; }
.trip .arrow { color: var(--muted); padding-bottom: 8px; }
.io input { width: 100%; border: 0; background: transparent; font-size: 26px; font-weight: 700; padding: 2px 0; outline: none; letter-spacing: -0.01em; }
.swap {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted);
}
.quick { display: flex; gap: 6px; margin-top: 10px; }
.quick button { flex: 1; padding: 8px 0; border: 1px solid var(--line); background: transparent; border-radius: 10px; color: var(--ink); }
.quick button:hover { border-color: var(--accent); color: var(--accent); }
.rate { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.rate .muted { font-size: 13px; }
.icon { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 18px; }
.icon.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 비싼 편/싼 편 */
.level:empty { display: none; }
.level { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.lv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.lv { font-weight: 700; font-size: 14px; }
.lv.cheap { color: var(--good); } .lv.mid { color: var(--mid); } .lv.high { color: var(--bad); }
.lv-bar { position: relative; height: 6px; border-radius: 3px; margin: 10px 0 4px;
  background: linear-gradient(90deg, var(--good), var(--mid), var(--bad)); opacity: .85; }
.lv-bar span { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--card);
  border: 3px solid var(--ink); transform: translate(-50%, -50%); }
.lv-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* 경로 */
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.tabs { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.tabs button.on { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.verdict:empty { display: none; }
.verdict { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.best { margin-top: 14px; border: 2px solid var(--accent); border-radius: 14px; padding: 14px; }
.best-top, .o-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.badge { background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
@media (prefers-color-scheme: dark) { .badge { color: #04201d; } }
.got { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-top: 10px; }
.best .muted { margin: 2px 0 0; font-size: 13px; }
.hassle { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.hassle i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.hassle i.on { background: var(--muted); }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.o-top > span, .best-top > span:last-child { white-space: nowrap; }

/* 노선도 */
.line { display: flex; align-items: flex-start; margin: 4px 0; }
.st { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; min-width: 44px; }
.st i { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--ink); background: var(--card); margin-top: 7px; position: relative; z-index: 1; }
.st em { font-style: normal; font-size: 12px; font-weight: 600; margin-top: 4px; white-space: nowrap; }
.seg { flex: 1; position: relative; text-align: center; min-width: 0; padding-top: 0; }
.seg::before { content: ""; position: absolute; left: -16px; right: -16px; top: 12px; height: 4px; border-radius: 2px; background: currentColor; }
.seg.kr { color: var(--kr); } .seg.loc { color: var(--loc); } .seg.atm { color: var(--atm); }
.seg-l { display: block; font-size: 11px; font-weight: 600; margin-top: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.seg-f { display: block; font-size: 11px; color: var(--muted); }

.others { list-style: none; margin: 12px 0 0; padding: 0; }
.others li { padding: 12px 2px; border-top: 1px solid var(--line); }
.others b { font-size: 14px; font-weight: 600; }
.o-num { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.neg { color: var(--bad); } .pos { color: var(--good); }
.more { width: 100%; margin-top: 6px; padding: 10px; border: 0; border-radius: 10px; background: var(--bg); color: var(--ink); }
.tip { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); margin: 16px 0 0; }

/* 알림 */
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.switch-row small { display: block; font-size: 13px; }
.switch { position: relative; width: 46px; height: 28px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 14px; background: var(--line); transition: .2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
#alertBox { margin-top: 14px; }
.target { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.target input { width: 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.banner { background: var(--accent); color: #fff; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .banner { color: #04201d; } }

/* 옵션 */
.opts summary { cursor: pointer; font-weight: 700; list-style: none; }
.opts summary::-webkit-details-marker { display: none; }
.opts summary::after { content: "＋"; float: right; color: var(--muted); }
.opts[open] summary::after { content: "－"; }
.opts summary small { font-weight: 400; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip input { display: none; }
.chip span { display: inline-block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); cursor: pointer; }
.chip input:checked + span { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid label { font-size: 12px; color: var(--muted); }
.grid input, .bank input { width: 100%; margin-top: 3px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.bank .bh, .bank .br { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 6px; align-items: center; }
.bank .bh { font-size: 11px; color: var(--muted); }
.bank .br { margin-top: 4px; font-size: 13px; }
.note { font-size: 12px; color: var(--muted); margin-top: 14px; }
.reset { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 6px 10px; color: var(--muted); font-size: 13px; }

footer { text-align: center; margin-top: 18px; }
footer a { color: inherit; }
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } .got { font-size: 24px; } }

/* 언어 선택 */
.langs { font-size: 13px; color: var(--muted); text-align: right; }
.langs a { color: var(--muted); text-decoration: none; }
.langs a:hover { color: var(--accent); }
.langs b { color: var(--ink); font-weight: 600; }

/* 가성비 여행지 */
.deals h2 { margin-bottom: 2px; }
.deals p { margin: 0 0 10px; }
#dealList { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#dealList button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); }
#dealList button:hover, #dealList button.on { border-color: var(--accent); background: var(--accent-soft); }
#dealList .rk { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
#dealList .nm { flex: 1; font-weight: 600; }
#dealList .nm small { color: var(--muted); font-weight: 400; margin-left: 4px; }
#dealList .pc { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* 광고 · 개인정보처리방침 */
.ad-slot { margin: 0 0 14px; min-height: 100px; text-align: center; }
.privacy ul { padding-left: 18px; margin: 0 0 12px; }
.privacy li { margin-bottom: 10px; }
.privacy a, .back, footer a { color: var(--accent); word-break: break-all; }
.back { text-decoration: none; font-size: 14px; }

/* 계산 원리 · 가이드 · 글 */
.how p { margin: 8px 0 0; color: var(--ink); font-size: 14px; line-height: 1.7; }
.guide-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.guide-list a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.guide-list a:hover { border-color: var(--accent); background: var(--accent-soft); }
.guide-list b { display: block; font-size: 15px; font-weight: 600; }
.guide-list span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.art-h1 { font-size: 24px; line-height: 1.35; }
.article { font-size: 15.5px; line-height: 1.75; }
.article h2 { font-size: 18px; margin: 22px 0 6px; }
.article h2:first-child { margin-top: 0; }
.article p { margin: 8px 0; }
.article ul { padding-left: 20px; margin: 6px 0; }
.article li { margin: 4px 0; }
.article a { color: var(--accent); }
.cta-wrap { text-align: center; margin: 4px 0 18px; }
.cta { display: inline-block; background: var(--accent); color: #fff; padding: 12px 20px; border-radius: 12px; text-decoration: none; font-weight: 700; }
@media (prefers-color-scheme: dark) { .cta { color: #04201d; } }

/* 문의함 */
.cform { display: grid; gap: 12px; }
.cform label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.cform input, .cform select, .cform textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.cform textarea { resize: vertical; }
.cform input:focus, .cform select:focus, .cform textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cform button { background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 12px; font-weight: 700; font-size: 15px; }
.cform button:disabled { opacity: .5; cursor: default; }
@media (prefers-color-scheme: dark) { .cform button { color: #04201d; } }
.cform .hp { display: none; }
.cf-msg { margin: 0; font-size: 14px; min-height: 1.2em; }
.cf-msg.ok { color: var(--good); font-weight: 600; } .cf-msg.bad { color: var(--bad); font-weight: 600; }

/* 안전 안내 */
.warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--muted); line-height: 1.6; }
.warn a { color: var(--accent); }
#dealList .none { padding: 12px; color: var(--muted); font-size: 14px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
