/* Material 3 토큰 (seed #0b57d0, 중립 표면) */
:root {
  --bg: #ffffff;
  --surface: #f0f4f9;          /* surface-container */
  --surface-hi: #ffffff;       /* surface-container-lowest */
  --ink: #1f1f1f;              /* on-surface */
  --sub: #444746;              /* on-surface-variant */
  --outline: #747775;
  --line: #c4c7c5;             /* outline-variant */
  --primary: #0b57d0;
  --on-primary: #ffffff;
  --primary-c: #d3e3fd;
  --on-primary-c: #041e49;
  --secondary-c: #c2e7ff;
  --on-secondary-c: #001d35;
  --error-c: #f9dedc;
  --on-error-c: #410e0b;
  --state: rgba(11, 87, 208, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131314;
    --surface: #1e1f20;
    --surface-hi: #282a2c;
    --ink: #e3e3e3;
    --sub: #c4c7c5;
    --outline: #8e918f;
    --line: #444746;
    --primary: #a8c7fa;
    --on-primary: #062e6f;
    --primary-c: #0842a0;
    --on-primary-c: #d3e3fd;
    --secondary-c: #004a77;
    --on-secondary-c: #c2e7ff;
    --error-c: #8c1d18;
    --on-error-c: #f9dedc;
    --state: rgba(168, 199, 250, .1);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", Roboto, sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--primary); text-underline-offset: 2px; }
b, strong { font-weight: 500; }
.wrap { max-width: 840px; margin: 0 auto; padding-inline: 16px; }

/* Top app bar */
.top { background: var(--bg); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; min-height: 64px; padding-block: 6px; }
.brand { font-size: 18px; font-weight: 500; color: var(--ink); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; margin-inline: -12px; }
.top nav a { color: var(--sub); text-decoration: none; font-size: 14px; font-weight: 500; padding: 10px 12px; border-radius: 20px; }
.top nav a:hover { background: var(--state); color: var(--primary); }

/* 머리말 */
.crumb { font-size: 14px; color: var(--sub); padding-top: 20px; }
.crumb a { color: var(--sub); text-decoration: none; }
.crumb a:hover { color: var(--primary); }
.hero { padding-block: 32px 8px; }
.hero h1 { font-size: clamp(28px, 5vw, 36px); line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 12px; }
.hero h1 em { font-style: normal; }
.hero p { color: var(--sub); margin: 0; max-width: 38em; }
.hero .date { font-size: 14px; margin-top: 8px; }

/* 요점 3칸: 구분선만 */
.keys { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.keys li { padding: 14px 16px 14px 0; display: flex; flex-direction: column; gap: 2px; }
.keys li + li { padding-left: 16px; border-left: 1px solid var(--line); }
.keys b { font-size: 16px; }
.keys span { font-size: 14px; color: var(--sub); }
@media (max-width: 520px) {
  .keys { grid-template-columns: 1fr; }
  .keys li, .keys li + li { padding: 12px 0; border-left: 0; }
  .keys li + li { border-top: 1px solid var(--line); }
}

/* Filled card */
.card { background: var(--surface); border-radius: 16px; padding: 24px; margin-block: 16px; }
.card h2 { font-size: 22px; line-height: 28px; font-weight: 500; margin: 0 0 16px; }
@media (max-width: 520px) { .card { padding: 20px 16px; } }

/* 계산기: Outlined text field */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--sub); }
select, input[type="number"] {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-hi);
  border: 1px solid var(--outline); border-radius: 4px; padding: 0 14px; width: 100%; height: 56px;
}
select { appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select:hover, input[type="number"]:hover { border-color: var(--ink); }
select:focus, input:focus { outline: none; border: 2px solid var(--primary); padding-left: 13px; }
.fine input[type="number"] { width: 4.5em; height: 32px; padding: 0 8px; font-size: 14px; display: inline-block; vertical-align: middle; margin: 0 4px; }
.fine input[type="number"]:focus { padding-left: 7px; }

.result { margin-top: 24px; background: var(--surface-hi); border-radius: 12px; padding: 20px; }
.result .big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.result .big span { font-size: 14px; font-weight: 500; color: var(--sub); width: 100%; }
.result .big strong { font-size: clamp(36px, 8vw, 45px); line-height: 1.15; font-weight: 400; color: var(--primary); font-variant-numeric: tabular-nums; }
.result .big em { font-style: normal; color: var(--sub); font-size: 16px; }
.result dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 32px; margin: 16px 0 0; }
.result dl div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-block: 10px; }
.result dt { color: var(--sub); font-size: 14px; }
.result dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.result .op { margin: 8px 0 0; font-size: 14px; color: var(--sub); }

/* 안내 상자 */
.warn, .ok, .tip { border-radius: 12px; padding: 12px 16px; margin: 12px 0 0; font-size: 15px; }
.warn { background: var(--error-c); color: var(--on-error-c); }
.ok { background: var(--secondary-c); color: var(--on-secondary-c); margin: 0 0 12px; }
.tip { background: var(--secondary-c); color: var(--on-secondary-c); }
.fine { font-size: 14px; color: var(--sub); margin: 16px 0 0; }
.src { font-size: 12px; color: var(--sub); margin: 16px 0 0; }
.src a { color: var(--sub); }

/* 본문 */
.steps, .prose ul, .prose ol { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.prose p { margin: 0 0 10px; }
.prose p:last-child { margin-bottom: 0; }
.prose > :is(.tiles, .tbl) { margin-top: 4px; }

/* Filled button */
.btn { display: inline-flex; align-items: center; height: 40px; margin-top: 20px; padding: 0 24px; border-radius: 20px;
  background: var(--primary); color: var(--on-primary); text-decoration: none; font-size: 14px; font-weight: 500; }
.btn:hover { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15); }

/* 목록 타일: outlined card */
.tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tiles a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--surface-hi); height: 100%; }
.tiles a:hover { background: color-mix(in srgb, var(--surface-hi), var(--primary) 8%); }
.tiles span { font-size: 14px; color: var(--sub); }

/* 목록: list item */
.list { list-style: none; padding: 0; margin: 0 -8px; }
.list a { display: flex; flex-direction: column; padding: 12px 8px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.list a:hover { background: var(--state); }
.list li + li { border-top: 1px solid var(--line); }
.list span { font-size: 14px; color: var(--sub); margin-top: 2px; }

.facts dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 0; }
.facts dt { font-size: 12px; font-weight: 500; color: var(--sub); }
.facts dd { margin: 0; font-size: 18px; }

.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 500; color: var(--sub); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

details { border-top: 1px solid var(--line); }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 500; padding-block: 14px; list-style: none; display: flex; gap: 8px; align-items: baseline; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; color: var(--primary); font-weight: 700; width: 1em; flex: none; }
details[open] > summary::before { content: "−"; }
details p { margin: 0 0 14px; color: var(--sub); }

/* 체크리스트: 체크박스 목록 */
.checks { list-style: none; padding: 0; margin: 0 -8px; }
.checks label { flex-direction: row; align-items: flex-start; gap: 16px; font-size: 16px; line-height: 1.5; color: var(--ink); font-weight: 400; padding: 12px 8px; border-radius: 8px; cursor: pointer; }
.checks label:hover { background: var(--state); }
.checks input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); flex: none; }
.checks label:has(input:checked) { color: var(--sub); }

.foot { color: var(--sub); font-size: 13px; padding-block: 32px 48px; border-top: 1px solid var(--line); margin-top: 32px; }
.foot p { margin: 4px 0; max-width: 48em; }

/* ── 일러스트 ── */
:root { --ok: #146c43; --ok-c: #c4eed0; }
@media (prefers-color-scheme: dark) { :root { --ok: #6dd58c; --ok-c: #0f5223; } }
.ill { width: 72px; height: 72px; flex: none; }
.ill .ia { fill: var(--primary); }
.ill .ib { fill: var(--primary-c); }
.ill .ic { fill: var(--surface-hi); }
.ill .id { fill: var(--on-primary-c); }
.ill .ie { fill: var(--ok); }
.ill .if { fill: var(--ok-c); }
.ill .tx { fill: var(--ok); font: 700 15px sans-serif; }
.ill .ln, .ill .ln2, .ill .ln3, .ill .ln4, .ill .ln5 { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ill .ln { stroke: var(--on-primary-c); stroke-width: 3; }
.ill .ln2 { stroke: var(--line); stroke-width: 2.5; }
.ill .ln3 { stroke: var(--primary-c); stroke-width: 2; opacity: .6; }
.ill .ln4 { stroke: var(--surface-hi); stroke-width: 3; }
.ill .ln5 { stroke: var(--ok); stroke-width: 3; }

/* ── 여행 순서 띠 ── */
.journey { margin-block: 32px 16px; }
.journey h2 { font-size: 22px; font-weight: 500; margin: 0 0 12px; }
.journey ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.journey a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 8px; border-radius: 16px; text-decoration: none; color: var(--ink); height: 100%; }
.journey a:hover { background: var(--state); }
.journey b { font-size: 15px; margin-top: 4px; }
.journey span { font-size: 13px; line-height: 1.4; color: var(--sub); }
@media (max-width: 760px) {
  .journey ol { grid-template-columns: 1fr; gap: 0; }
  .journey li + li { border-top: 1px solid var(--line); }
  .journey a { flex-direction: row; text-align: left; gap: 16px; padding: 10px 4px; border-radius: 0; }
  .journey a .ill { width: 56px; height: 56px; }
  .journey a b { margin: 0; min-width: 5.5em; }
}

.cta { background: var(--primary-c); color: var(--on-primary-c); }
.cta p { margin: 0; max-width: 36em; }

/* ── 상황별 ── */
.chipnav { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; scrollbar-width: none; }
.chipnav a { flex: none; height: 32px; display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid var(--outline); border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--sub); text-decoration: none; }
.chipnav a:hover { background: var(--state); }
.stage { scroll-margin-top: 80px; }
.stage-h { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 8px; }
.stage-h h2 { margin: 2px 0 6px; }
.stage-h p { margin: 0; color: var(--sub); }
.over { font-size: 12px; font-weight: 500; color: var(--primary); letter-spacing: .02em; }
.card h3 { font-size: 16px; font-weight: 500; margin: 24px 0 8px; }
@media (max-width: 520px) { .stage-h { gap: 14px; } .stage-h .ill { width: 56px; height: 56px; } }

/* ── 내 영수증 ── */
input[type="text"], input[type="date"], input[type="time"] {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-hi);
  border: 1px solid var(--outline); border-radius: 4px; padding: 0 14px; width: 100%; height: 56px;
}
input[type="text"]:focus, input[type="date"]:focus, input[type="time"]:focus { padding-left: 13px; }
#w-form .grid2 + .grid2 { margin-top: 16px; }
label.sw { flex-direction: row; align-items: center; gap: 12px; font-size: 15px; font-weight: 400; color: var(--ink); margin-top: 16px; cursor: pointer; }
label.sw input { width: 18px; height: 18px; accent-color: var(--primary); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.actions .btn { margin: 0; border: 0; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.tbtn { font: inherit; font-size: 14px; font-weight: 500; color: var(--primary); background: none; border: 0; height: 40px; padding: 0 12px; border-radius: 20px; cursor: pointer; display: inline-flex; align-items: center; }
.tbtn:hover { background: var(--state); }
.tbtn:disabled { color: var(--sub); opacity: .6; cursor: default; background: none; }
.tbtn.outline { border: 1px solid var(--outline); padding: 0 24px; }
.tbtn.danger { color: var(--on-error-c); background: var(--error-c); }

.sum { background: var(--primary-c); color: var(--on-primary-c); }
.sum > span { font-size: 14px; font-weight: 500; }
.sum div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.sum strong { font-size: clamp(40px, 9vw, 52px); line-height: 1.15; font-weight: 400; font-variant-numeric: tabular-nums; }
.sum em { font-style: normal; font-size: 16px; }
.sum p { margin: 8px 0 0; font-size: 14px; }

.rcs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rc { background: var(--surface-hi); border-radius: 12px; padding: 14px 16px 6px; }
.rc.off { opacity: .75; }
.rc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rc-top div { display: flex; flex-direction: column; }
.rc-top span { font-size: 14px; color: var(--sub); }
.rc-top strong { font-size: 20px; font-weight: 500; color: var(--primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc.off .rc-top strong { color: var(--sub); }
.rc-memo { margin: 6px 0 0; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; font-weight: 500; height: 24px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 6px; background: var(--surface); color: var(--sub); }
.chip.err { background: var(--error-c); color: var(--on-error-c); }
.rc-act { display: flex; flex-wrap: wrap; justify-content: flex-end; margin: 4px -8px 0; }
.rep li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px; }
.rep li div { display: flex; flex-direction: column; }
.rep li span { font-size: 14px; color: var(--sub); }
.rep li.empty { color: var(--sub); font-size: 14px; }
label.file { cursor: pointer; flex-direction: row; align-items: center; gap: 0; font-size: 14px; line-height: normal; color: var(--primary); margin: 0; }

/* ── 출국 시간표 ── */
.timeline { list-style: none; padding: 0; margin: 20px 0 0; }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 16px; position: relative; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; left: 115px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li > div:last-child { padding-left: 20px; position: relative; }
.timeline li > div:last-child::before { content: ""; position: absolute; left: -2px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.timeline .tm { text-align: right; display: flex; flex-direction: column; }
.timeline .tm b { font-size: 18px; font-variant-numeric: tabular-nums; }
.timeline .tm span { font-size: 12px; color: var(--sub); }
.timeline p { margin: 2px 0 0; font-size: 14px; color: var(--sub); }
@media (max-width: 520px) {
  .timeline li { grid-template-columns: 72px 1fr; gap: 10px; }
  .timeline li::before { left: 85px; }
  .timeline .tm b { font-size: 16px; }
}
