/* 여행 동행 앱 스타일. 색은 전부 토큰으로 쓴다. 여행 내용(도시 이름 등)은 쓰지 않는다. */
:root {
  color-scheme: light dark;
  --bg: #F6F3EC; --surface: #FFFFFF; --sunk: #ECE8DE;
  --text: #1B1D22; --text-2: #4A4F59; --text-3: #62666F;
  --line: #D9D4C7; --line-strong: #8A8577;
  --accent: #1B4DB3; --on-accent: #FFFFFF;
  --ok: #17603A; --ok-bg: #E1F0E5;
  --warn: #7A4300; --warn-bg: #FBEBCB;
  --danger: #A3211B; --danger-bg: #FBE3E0;
  --hero-bg: #14213D; --hero-line: #14213D; --hero-text: #FFFFFF; --hero-text-2: #C9D2E6; --hero-time: #FFD166;
  --stub-bg: #FBF8F0; --stub-text: #111318;
  --city-0: #8A8577; --city-1: #A8552F; --city-2: #7556A8; --city-3: #0F7F9E; --city-4: #4F6475; --city-5: #B03A72;

  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
  --font-code: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Courier New", "Apple SD Gothic Neo", "Malgun Gothic", monospace;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --gutter: 16px; --card-pad: 16px; --card-gap: 12px;
  --r-card: 14px; --r-ctl: 12px; --r-pill: 999px;
  --tap: 48px; --topbar-h: 44px; --tabbar-h: 56px; --testbar-h: 0px; --banner-h: 0px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1217; --surface: #1A1E26; --sunk: #252B36;
    --text: #F1F2F4; --text-2: #B7BCC7; --text-3: #969CA9;
    --line: #343B48; --line-strong: #6B7382;
    --accent: #8DB4FF; --on-accent: #0F1217;
    --ok: #86D9A0; --ok-bg: #14301E;
    --warn: #F5C264; --warn-bg: #382808;
    --danger: #FFA198; --danger-bg: #3E1518;
    --hero-bg: #1C2942; --hero-line: #3A4A6B;
    --city-0: #6B7382; --city-1: #E0916B; --city-2: #B49AE6; --city-3: #5CC3E0; --city-4: #9FB3C4; --city-5: #EE86B4;
  }
}
html.has-testbar { --testbar-h: 28px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.45 var(--font);
  word-break: keep-all; overflow-wrap: anywhere;
  min-height: 100vh; min-height: 100dvh;
  padding-top: calc(var(--safe-t) + var(--testbar-h) + var(--topbar-h));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px + var(--banner-h));
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ul { margin: 0; padding: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; margin: 0; text-align: left; cursor: pointer; border-radius: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }

.wrap { max-width: 480px; margin: 0 auto; padding-left: calc(var(--gutter) + var(--safe-l)); padding-right: calc(var(--gutter) + var(--safe-r)); }

button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.hero button:focus-visible, .hero a:focus-visible { outline-color: var(--hero-time); }

.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 위쪽 고정 줄 ---------- */
.head { position: fixed; top: 0; left: 0; right: 0; z-index: 30; background: var(--surface); padding-top: var(--safe-t); }
.testbar {
  height: 28px; line-height: 26px; padding: 0 var(--gutter); text-align: center;
  background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 600;
  border-bottom: 1.5px dashed var(--warn);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar { border-bottom: 1px solid var(--line); }
.topbar .wrap { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar h1 { font-size: 17px; font-weight: 600; white-space: nowrap; }
.data-date { font-size: 13px; color: var(--text-2); white-space: nowrap; }

/* ---------- 아래 탭 ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar .wrap { display: flex; padding-left: var(--safe-l); padding-right: var(--safe-r); }
.tab { flex: 1 1 0; min-width: 0; height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-2); font-size: 12px; line-height: 1.2; font-weight: 600; position: relative; text-align: center; }
.tab[aria-current="page"] { color: var(--accent); font-weight: 700; }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 50%; width: 32px; margin-left: -16px; height: 3px; background: var(--accent); }
.tab:active { background: var(--sunk); }
.tab:disabled { color: var(--text-3); cursor: default; }
.tab:focus-visible { outline-offset: -3px; }

/* ---------- 표시줄 ---------- */
.banners { position: fixed; z-index: 25; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px);
  max-width: 480px; margin: 0 auto; padding: 0 calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.banner { pointer-events: auto; min-height: 48px; border-radius: var(--r-ctl); font-size: 15px; font-weight: 600; width: 100%; }
.banner-update { background: var(--accent); color: var(--on-accent); padding: 12px 16px; text-align: center; }
.banner-fail { background: var(--danger-bg); color: var(--danger); border: 1.5px solid var(--danger);
  display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; }
.banner-text { flex: 1 1 auto; padding: 8px 0; }
.banner-close { flex: none; min-width: 48px; min-height: 48px; padding: 0 8px; text-align: center; font-weight: 700; color: var(--danger); border-radius: 8px; }

/* ---------- 내용 공통 ---------- */
#view { padding-top: 12px; }
#view > * + * { margin-top: var(--card-gap); }
.sec { font-size: 13px; line-height: 1.35; font-weight: 600; color: var(--text-2); margin: 20px 0 8px !important; }
#view > .sec + * { margin-top: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--card-pad); }
.card > * + *, .hero > * + * { margin-top: 8px; }
.card-dashed { border: 1.5px dashed var(--line-strong); }
.list-card { padding: 0; overflow: hidden; }
.list-card > * { margin-top: 0 !important; }
.list-card > * + * { border-top: 1px solid var(--line); }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-title { font-size: 20px; line-height: 1.3; font-weight: 700; flex: 1 1 60%; min-width: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.seg { display: inline-block; max-width: 100%; white-space: pre-wrap; }
.row-btn { display: flex; width: 100%; align-items: center; }
.row-btn:active, .plain-btn:active, .jump-btn:active, .nav-back:active, .nav-arrow:active { background: var(--sunk); }
.chev { color: var(--text-3); flex: none; }
.notice { color: var(--text-2); padding: 8px 0; }
.note { font-size: 15px; line-height: 1.4; color: var(--text-2); }
.detail { font: 600 17px/24px var(--font-code); font-variant-numeric: slashed-zero; }
.addr { font-size: 15px; line-height: 1.4; }
.hint { font-size: 13px; line-height: 1.35; color: var(--text-2); }
.range { font-size: 13px; color: var(--text-2); }
.t-chunk, .rel { white-space: nowrap; }
.t-chunk { font-variant-numeric: tabular-nums; }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.kv { font-size: 15px; line-height: 1.4; }
.kv-k { color: var(--text-2); }
.kv-miss, .kv-miss .kv-k { color: var(--text-3); }

/* 상태 표시 */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 13px; line-height: 1; font-weight: 600; white-space: nowrap; vertical-align: middle; flex: none; }
.pill .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.pill-ok { color: var(--ok); background: var(--ok-bg); border: 1px solid var(--ok); }
.pill-warn { color: var(--warn); background: var(--warn-bg); border: 1.5px solid var(--warn); }
.pill-danger { color: var(--danger); background: var(--danger-bg); border: 1.5px solid var(--danger); }
.pill-dash { color: var(--text); border: 1.5px dashed var(--line-strong); }
.pill-past { color: var(--text-3); border: 1px solid var(--text-3); }
.pill-today { color: var(--on-accent); background: var(--accent); }
.warn-line { display: flex; align-items: flex-start; gap: 4px; color: var(--warn); font-size: 13px; line-height: 1.35; font-weight: 600; }
.warn-line .ic { width: 16px; height: 16px; margin-top: 1px; stroke-width: 2.6; }

/* 도시 표시 */
.city { white-space: nowrap; }
.city-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; background: var(--city-0); }
[data-city-tone="1"] { background: var(--city-1); }
[data-city-tone="2"] { background: var(--city-2); }
[data-city-tone="3"] { background: var(--city-3); }
[data-city-tone="4"] { background: var(--city-4); }
[data-city-tone="5"] { background: var(--city-5); }
[data-city-tone="0"] { background: var(--city-0); }

/* 확인 번호 */
.codes { display: flex; flex-direction: column; gap: 8px; }
.code { display: block; width: 100%; border-radius: var(--r-ctl); padding: 12px 14px; background: var(--sunk); color: var(--text);
  border: 1px solid var(--line-strong); transition: background-color .15s; }
.code-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; line-height: 1.35; }
.code-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.code-hint { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 3px; }
.code-hint .ic { width: 14px; height: 14px; stroke-width: 2.8; }
.code-val { display: block; font-family: var(--font-code); font-weight: 600; font-variant-numeric: slashed-zero;
  overflow-wrap: anywhere; word-break: break-all; -webkit-user-select: text; user-select: text; margin-top: 2px; }
.code-grp { margin-right: .25em; }
.code-grp:last-child { margin-right: 0; }
.code-l { min-height: 64px; }
.code-l .code-val { font-size: 22px; line-height: 30px; }
.code-xl { min-height: 86px; background: var(--stub-bg); color: var(--stub-text); border-color: var(--stub-bg); }
.code-xl .code-label, .code-xl .code-hint { color: #3A3F49; }
.code-xl .code-val { font-size: 32px; line-height: 40px; }
.code-xl.code-long .code-val { font-size: 22px; line-height: 30px; }
.code-m { min-height: 48px; padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; }
.code-m .code-val { font-size: 17px; line-height: 24px; flex: 1 1 auto; margin-top: 0; }
.code-m .code-hint { margin-left: auto; }
/* 좁은 폰(360px 미만): 19자 번호가 한 줄에 들어가도록 한 단계 줄인다 */
@media (max-width: 359px) {
  .code-l.code-long .code-val, .code-xl.code-long .code-val { font-size: 19px; line-height: 28px; }
}
.code:active { background: var(--line); }
.code.copied { background: var(--ok-bg); border-color: var(--ok); color: var(--text); }
.code.copied .code-hint { color: var(--ok); font-weight: 700; }
.code-xl.copied { background: #E1F0E5; border-color: #17603A; color: var(--stub-text); }
.code-xl.copied .code-hint { color: #17603A; }
.code.copy-fail .code-hint { color: var(--danger); font-weight: 700; }
.code-xl.copy-fail .code-hint { color: #A3211B; }

/* 지도 버튼 */
.map-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; width: 100%;
  border: 1.5px solid var(--accent); border-radius: var(--r-ctl); color: var(--accent); font-weight: 600; text-decoration: none; padding: 4px 12px; }
.map-btn .ic { width: 20px; height: 20px; }
.map-btn:active { background: var(--sunk); }
.map-note { font-size: 13px; line-height: 1.35; color: var(--text-3); margin-top: 4px; }

/* ---------- 지금 ---------- */
.today-line { min-height: 48px; }
.today-main { line-height: 1.3; }
.today-date { font-size: 20px; font-weight: 700; margin-right: 6px; white-space: nowrap; }
.today-city { font-size: 17px; font-weight: 600; }
.today-sub { font-size: 13px; color: var(--text-2); }

.hero { background: var(--hero-bg); border: 1px solid var(--hero-line); border-radius: var(--r-card); padding: var(--card-pad); color: var(--hero-text); }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--hero-text-2); }
.hero-kind { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.hero-kind .ic, .next-kind .ic { width: 18px; height: 18px; }
/* 다음 일정이 오늘이 아닐 때의 날짜. 작은 카드의 날짜와 같은 크기로 분명히 보이게 한다. */
.hero-date { font-size: 20px; line-height: 1.3; font-weight: 700; color: var(--hero-text); }
.hero-when { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; row-gap: 2px; }
.hero-time { font-size: 44px; line-height: 1.05; font-weight: 700; }
.hero .t-zone { font-size: 15px; font-weight: 600; color: var(--hero-text-2); }
.hero-rel { font-size: 20px; font-weight: 700; color: var(--hero-time); }
.hero-title { font-size: 20px; line-height: 1.3; font-weight: 700; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.hero-sub { font-size: 15px; color: var(--hero-text-2); }
.hero .note { color: var(--hero-text-2); }
.hero .detail { color: var(--hero-text); }
.hero .kv, .hero .kv .kv-k { color: var(--hero-text-2); }
.hero .warn-line { color: var(--hero-time); font-size: 15px; }
.hero .map-btn { border: 1px solid var(--hero-text-2); color: var(--hero-text); }
.hero .map-btn:active { background: var(--hero-line); }
.hero .map-note { color: var(--hero-text-2); }
.hero-before .dday { line-height: 1; }
.dday-k { font-size: 20px; font-weight: 600; }
.dday-n { font-size: 56px; line-height: 1; font-weight: 700; white-space: nowrap; }

.prog { position: relative; overflow: hidden; min-height: 56px; padding: 12px 16px 12px 20px; flex-direction: column; align-items: flex-start; justify-content: center; }
.prog::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.prog > * + * { margin-top: 2px; }
.prog-label { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; margin-right: 6px; vertical-align: middle; }
.prog-label .ic { width: 12px; height: 12px; fill: currentColor; }
.prog-title { font-weight: 600; }
.prog-sub { font-size: 15px; color: var(--text-2); display: block; }
/* 진행 중 띠 안의 번호 칸·좌석·지도는 다른 카드와 같은 간격 */
.prog > .prog-sub ~ * { margin-top: 8px; }
.prog .code:focus-visible, .prog .map-btn:focus-visible { outline-offset: -3px; }

.next-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.next-kind { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.next-when { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; }
.t-start { font-size: 20px; line-height: 1.3; font-weight: 700; }
.t-zone { font-size: 15px; font-weight: 600; color: var(--text-2); }
.next-rel { font-size: 17px; font-weight: 600; color: var(--accent); }
.next-title { font-weight: 600; }
.next-sub { font-size: 15px; color: var(--text-2); }

.stay-plain { background: var(--sunk); border-radius: var(--r-ctl); min-height: 48px; display: flex; align-items: center; padding: 8px 16px; }

.todo-left { min-height: 64px; padding: 12px 16px; gap: 8px; }
.todo-left-k { font-weight: 600; flex: 1 1 auto; }
.todo-left-n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.todo-left-done { color: var(--ok); display: inline-flex; align-items: center; gap: 4px; }

.after { padding-top: 20px; }
.after > * + * { margin-top: 12px; }
.after-title { font-size: 24px; line-height: 1.25; font-weight: 700; }
.after-sub { color: var(--text-2); margin-bottom: 20px; }
.plain-btn { display: block; width: 100%; min-height: 48px; border: 1.5px solid var(--line-strong); border-radius: var(--r-ctl);
  text-align: center; font-weight: 600; padding: 8px 16px; }

/* 일정 한 줄 */
.item-row, .item-card { display: flex; align-items: flex-start; gap: 8px; }
.item-row { padding: 12px 16px; min-height: 56px; }
.item-card > * + * { margin-top: 0; }
.item-ic { color: var(--text-2); margin-top: 2px; }
.item-body { flex: 1 1 auto; min-width: 0; display: block; }
.item-body > * + * { margin-top: 6px; }
span.item-body > span { display: block; }
.item-when { display: block; line-height: 1.5; }
.t-end { display: inline-block; margin-left: .35em; }
.hero .code-l { background: var(--stub-bg); color: var(--stub-text); border-color: var(--stub-bg); }
.hero .code-l .code-label, .hero .code-l .code-hint { color: #3A3F49; }
.hero .code-l.copied { background: #E1F0E5; border-color: #17603A; }
.hero .code-l.copied .code-hint { color: #17603A; }
.t-end, .item-when .t-chunk + .t-chunk { font-size: 15px; font-weight: 600; color: var(--text-2); }
.item-when .t-chunk + .t-chunk .t-zone { font-size: 15px; }
.item-title { font-weight: 600; display: block; }
.is-check .t-start { text-decoration: underline dotted; text-underline-offset: 4px; }
.item-row.is-past, .item-row.is-past .t-start, .item-row.is-past .item-ic, .item-row.is-past .t-end, .item-row.is-past .t-zone,
.item-card.is-past .item-when, .item-card.is-past .item-when *, .item-card.is-past .item-title, .item-card.is-past .item-ic { color: var(--text-3); }

/* 미정 줄과 후보 */
.open-row, .open-link { display: flex; align-items: flex-start; gap: 8px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-card);
  padding: 12px 16px; background: transparent; }
.open-ic { color: var(--text-2); margin-top: 0; }
.open-body { flex: 1 1 auto; min-width: 0; display: block; }
.open-body > * + * { margin-top: 6px; }
.open-title { font-size: 17px; font-weight: 600; display: block; }
.open-note { font-size: 15px; line-height: 1.4; color: var(--text-3); }
.cand-box { background: var(--sunk); border-radius: var(--r-ctl); padding: 12px; }
.cand-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.cand-line { font-size: 15px; line-height: 1.4; font-weight: 400; color: var(--text-2); }
.cand summary { min-height: 44px; display: flex; align-items: center; font-size: 15px; color: var(--accent); font-weight: 600; cursor: pointer; }
.cand summary::before { content: ""; width: 0; height: 0; border-left: 6px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-right: 8px; }
.cand[open] summary::before { transform: rotate(90deg); }
.cand summary::-webkit-details-marker { display: none; }
.open-list { display: flex; flex-direction: column; gap: 8px; }
.open-link { min-height: 56px; align-items: center; }
.open-link-top { display: block; }
.open-date { font-size: 15px; font-weight: 600; color: var(--text-2); margin-right: 6px; }

/* ---------- 일정 목록 ---------- */
.day-row { position: relative; min-height: 64px; padding: 12px 12px 12px 16px; gap: 8px; align-items: flex-start; }
.day-band { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; display: flex; flex-direction: column; }
.day-band i { flex: 1 1 50%; }
.day-date { flex: none; width: 60px; display: block; }
.day-md { display: block; font-weight: 700; line-height: 1.3; }
.day-wd { display: block; font-size: 13px; color: var(--text-2); }
.day-mid { flex: 1 1 auto; min-width: 0; display: block; }
.day-mid > * + * { margin-top: 2px; }
.day-city { display: block; font-size: 15px; font-weight: 600; line-height: 1.5; }
.day-city .pill { margin-left: 4px; }
.day-sum { display: block; font-size: 15px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-sum-t { font-weight: 600; }
.day-sum .t-zone { font-size: 15px; font-weight: 600; color: inherit; }
.day-none, .day-sum-more { color: var(--text-3); }
.day-none { white-space: normal; }
.day-open-count { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; margin-top: 4px; border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-pill); font-size: 13px; font-weight: 600; }
.day-open-count .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.day-row .chev { align-self: center; }
.day-row.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.day-row.is-today .day-md { color: var(--accent); }
.day-row.is-past, .day-row.is-past .day-wd, .day-row.is-past .day-sum { color: var(--text-3); }
.day-row:focus-visible { outline-offset: -3px; }

/* ---------- 붙박이 줄 (날짜 상세, 바로가기) ---------- */
.subbar { position: sticky; z-index: 20; top: calc(var(--safe-t) + var(--testbar-h) + var(--topbar-h));
  margin: -12px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.day-nav { height: 52px; justify-content: space-between; padding: 0 8px; }
.nav-back { min-width: 72px; height: 48px; display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 600; border-radius: 8px; padding-right: 8px; }
.nav-mid { display: flex; align-items: center; gap: 4px; }
.nav-date { font-weight: 600; white-space: nowrap; min-width: 86px; text-align: center; font-variant-numeric: tabular-nums; }
.nav-arrow { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); color: var(--text); }
.nav-arrow:disabled { color: var(--text-3); border-color: transparent; cursor: default; background: none; }
.jump { height: 48px; gap: 0; padding: 0 8px; }
.jump-btn { flex: 1 1 0; min-width: 0; height: 44px; text-align: center; font-size: 13px; font-weight: 600; color: var(--accent); border-radius: 8px; white-space: nowrap; }
.sec[id] { scroll-margin-top: 140px; }

.day-head-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-h1 { font-size: 24px; line-height: 1.25; font-weight: 700; }
.day-head-city { font-weight: 600; }
.caution { position: relative; overflow: hidden; background: var(--sunk); border-radius: var(--r-ctl); padding: 12px 12px 12px 15px; }
.caution::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--warn); }
.caution-k { display: flex; align-items: center; gap: 4px; color: var(--warn); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.caution-k .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.caution ul { list-style: none; }
.caution li { font-size: 15px; line-height: 1.4; padding-left: 12px; position: relative; }
.caution li::before { content: "·"; position: absolute; left: 2px; font-weight: 700; }
.caution li + li { margin-top: 4px; }
.link-warning li { font-family: var(--font-code); overflow-wrap: anywhere; }

.memo { display: block; width: 100%; min-height: 96px; padding: 12px; font: 400 17px/1.45 var(--font); color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r-ctl); resize: vertical; margin: 0; }
.memo:focus { outline: none; border: 2px solid var(--accent); padding: 11.5px; }
.memo::placeholder { color: var(--text-3); }
.memo-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); margin-top: 6px !important; }
.memo-status { display: inline-flex; align-items: center; gap: 3px; }
.memo-status .ic { width: 14px; height: 14px; stroke-width: 2.8; }
.memo-status.is-ok { color: var(--ok); font-weight: 600; }
.memo-status.is-fail { color: var(--danger); font-weight: 600; }
.memo-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.memo-count.is-near { color: var(--warn); font-weight: 600; }
.memo-count.is-full { color: var(--danger); font-weight: 600; }

/* ---------- 예약 ---------- */
.book-head { display: flex; align-items: flex-start; gap: 8px; }
.book-ic { color: var(--text-2); margin-top: 1px; }
.book-when { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 할 일 ---------- */
.dl { display: flex; gap: 12px; padding: 12px 16px; align-items: flex-start; }
.dl-when { flex: none; width: 76px; }
.dl-date { font-weight: 700; line-height: 1.3; }
.dl-time { font-size: 15px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.dl-rel { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); }
.dl-body { flex: 1 1 auto; min-width: 0; }
.dl-body > * + * { margin-top: 4px; }
.dl-note { font-size: 13px; line-height: 1.35; color: var(--text-2); }
.dl-soon { box-shadow: inset 3px 0 0 var(--danger); }
.dl-soon .dl-rel { color: var(--danger); }
.dl-past, .dl-past .dl-note, .dl-past .warn-line { color: var(--text-3); }
.dl-past .pill { margin-top: 2px; }
.dl-gone-title { padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--text-3); background: var(--bg); border-top: 2px solid var(--line-strong) !important; }

.todo { display: flex; align-items: flex-start; gap: 12px; min-height: 56px; padding: 12px 16px; cursor: pointer; }
.todo:active { background: var(--sunk); }
.todo-box { -webkit-appearance: none; appearance: none; flex: none; width: 28px; height: 28px; margin: 1px 0 0; border: 2px solid var(--line-strong);
  border-radius: 8px; background: var(--surface); cursor: pointer; position: relative; }
.todo-box:checked { background: var(--accent); border-color: var(--accent); }
.todo-box:checked::after { content: ""; position: absolute; left: 8px; top: 3px; width: 7px; height: 13px; border: solid var(--on-accent);
  border-width: 0 3px 3px 0; transform: rotate(45deg); }
.todo-body { flex: 1 1 auto; min-width: 0; }
.todo-text { display: block; }
.todo-note { display: block; font-size: 15px; line-height: 1.4; color: var(--text-2); margin-top: 2px; }
.todo-due { display: block; font-size: 13px; color: var(--text-2); }
.todo.is-done .todo-text { color: var(--text-3); text-decoration: line-through; }
.todo.is-done .todo-note { color: var(--text-3); }

/* ---------- 데이터 오류 ---------- */
.data-error { text-align: center; padding-top: 96px; }
.data-error > * + * { margin-top: 12px; }
.data-error h2 { font-size: 20px; font-weight: 700; }
.data-error p { font-size: 15px; color: var(--text-2); }

@media (prefers-reduced-motion: reduce) { .code { transition: none; } }

/* ---------- 2026-12-02 추가: 잠금 · 상태 · 도시 색 · 도구 ---------- */
html.is-locked .tabbar { display: none; }
.top-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lock-btn { min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 13px; font-weight: 600; white-space: nowrap; }
.lock { padding-top: 48px; text-align: center; }
.lock > * + * { margin-top: 12px; }
.lock-ic .ic { width: 48px; height: 48px; color: var(--accent); }
.lock-title { font-size: 24px; font-weight: 700; }
.lock-sub { color: var(--text-2); font-size: 15px; }
.lock-form { text-align: left; display: flex; flex-direction: column; gap: 12px; margin-top: 24px !important; }
.lock-row { display: flex; gap: 8px; align-items: stretch; }
.lock-row .inp { flex: 1 1 auto; }
.lock-err { color: var(--danger); font-weight: 600; min-height: 1.4em; }

.inp { display: block; width: 100%; min-height: 48px; padding: 10px 12px; font: 400 17px/1.3 var(--font); color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r-ctl); }
.inp:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.inp-big { font-size: 22px; font-weight: 600; }
select.inp { width: auto; min-width: 96px; }
.primary-btn { display: block; width: 100%; min-height: 52px; border-radius: var(--r-ctl); background: var(--accent); color: var(--on-accent);
  font-size: 17px; font-weight: 700; text-align: center; padding: 8px 16px; }
.primary-btn:disabled { opacity: .6; }
.small-btn { flex: none; min-height: 44px; min-width: 44px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r-ctl);
  font-size: 15px; font-weight: 600; text-align: center; }
.small-btn.danger { color: var(--danger); border-color: var(--danger); }

/* 상태 표시 (가이드와 같은 이모지) */
.pill-card { color: var(--accent); background: var(--sunk); border: 1.5px solid var(--accent); }
.pill-walk { color: var(--text); border: 1.5px dashed var(--line-strong); }
.pill-opt { color: var(--text-2); border: 1.5px dashed var(--accent); }
.st-text { font-size: 15px; color: var(--text-2); }
.hero .st-text { color: var(--hero-text-2); }
.hero .pill-ok { background: var(--ok-bg); }
.note b, .wine-card b, .todo-text b, .caution b { font-weight: 700; }
.detail-text { font-size: 15px; line-height: 1.4; }
.t-label .t-start { font-size: 17px; }
.today-label, .day-label { color: var(--text-2); font-weight: 600; }

/* 도시 색 테마: 오늘(또는 보고 있는 날)의 도시 색을 위쪽 줄과 다음 일정 카드에 */
html[data-tone="1"] { --theme: var(--city-1); }
html[data-tone="2"] { --theme: var(--city-2); }
html[data-tone="3"] { --theme: var(--city-3); }
html[data-tone="4"] { --theme: var(--city-4); }
html[data-tone="5"] { --theme: var(--city-5); }
.topbar { border-bottom: 3px solid var(--theme, var(--line)); }
.hero { border-left: 6px solid var(--theme, var(--hero-line)); }
.day-head { border-left: 4px solid var(--theme, var(--line)); padding-left: 10px; }

/* 길찾기 · 동선 · 맛집 지도 */
.route-btn { border-style: solid; background: var(--surface); }
.maplists { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.maplist-btn { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 6px 10px; border: 1.5px solid var(--line-strong);
  border-radius: var(--r-ctl); color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600; background: var(--surface); }
.maplist-btn span { flex: 1 1 auto; }
.maplist-btn .ic { width: 16px; height: 16px; color: var(--text-3); }
.maplist-btn:active { background: var(--sunk); }

/* 날씨 */
.wx-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wx-meta { font-size: 13px; color: var(--text-3); }
.wx-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.wx-day { background: var(--sunk); border-radius: 10px; padding: 8px 4px; }
.wx-date { font-size: 13px; font-weight: 600; color: var(--text-2); }
.wx-emoji { font-size: 28px; line-height: 1.2; }
.wx-temp { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wx-pop { font-size: 13px; color: var(--text-2); }
.wx-hint { font-size: 15px; line-height: 1.4; color: var(--accent); font-weight: 600; }
.hero .wx-hint { color: var(--hero-time); }

/* 도구 */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 104px; padding: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card); }
.tool-btn:active { background: var(--sunk); }
.tool-emoji { font-size: 30px; line-height: 1.1; }
.tool-name { font-size: 18px; font-weight: 700; }
.tool-sub { font-size: 13px; color: var(--text-2); }
.tool-title { flex: 1 1 auto; text-align: center; margin-right: 72px; }

/* 표: 폰에서 옆으로 밀어서 보기 */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-left: -4px; margin-right: -4px; }
.tbl { border-collapse: collapse; min-width: 100%; font-size: 16px; line-height: 1.45; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); min-width: 96px; }
.tbl th { font-size: 14px; color: var(--text-2); background: var(--sunk); white-space: nowrap; }
.tbl td:first-child { font-weight: 600; }
.tbl-num td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wine-title { font-size: 22px; font-weight: 700; }
.wine-card { font-size: 17px; line-height: 1.55; }
.wine-list { padding-left: 1.1em; }
.wine-list li + li { margin-top: 8px; }
.wine-foot { font-size: 15px; color: var(--text-2); }
.wine-p { font-size: 16px; }

/* 경비 · 변환 */
.exp-form > * + * { margin-top: 10px; }
.exp-row2 { display: flex; gap: 8px; }
.exp-row2 > .inp { flex: 1 1 50%; min-width: 0; }
.exp-row2 > .primary-btn { width: auto; flex: none; }
.seg-row { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn { min-height: 44px; min-width: 56px; padding: 0 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); font-weight: 600; text-align: center; }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.exp-total { display: flex; justify-content: space-between; align-items: baseline; }
.exp-total b { font-size: 28px; font-variant-numeric: tabular-nums; }
.exp-settle b { font-size: 18px; color: var(--accent); }
.exp-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 16px; }
.exp-item-sub { font-size: 14px; color: var(--text-2); }
.exp-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rate-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.rate-status { font-weight: 600; }
.conv-in { display: flex; gap: 8px; }
.conv-in .inp-big { flex: 1 1 auto; }
.conv-row { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.conv-cur { color: var(--text-2); font-weight: 600; }
.conv-val { font-size: 26px; font-variant-numeric: tabular-nums; }

/* 짐 · 비상 */
.pack-row { display: flex; align-items: center; gap: 4px; padding-right: 8px; }
.pack-row .todo { flex: 1 1 auto; }
.sos-row { gap: 8px; padding: 12px 16px; text-decoration: none; color: var(--text); min-height: 64px; }
.sos-body { flex: 1 1 auto; display: block; }
.sos-label { display: block; font-size: 14px; color: var(--text-2); font-weight: 600; }
.sos-tel { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.sos-note { display: block; font-size: 13px; color: var(--text-3); }
.sos-call { font-size: 24px; }
.sos-own { text-decoration: none; color: var(--text); }
.card > .inp + .inp, .card > .inp + .primary-btn { margin-top: 8px; }

/* ---------- 2026-12-02 2차: 디자인 리뷰 반영 ---------- */
:root { --cardtone: #554F6E; --cardtone-bg: #EEEBF4; --cardtone-line: #8E87A6; }
@media (prefers-color-scheme: dark) { :root { --cardtone: #CFC8E6; --cardtone-bg: #2A2738; --cardtone-line: #7D7698; } }

/* 위쪽 줄: 도시 점 + 이름 */
.city-now { display: inline-flex; align-items: center; font-size: 15px; font-weight: 700; white-space: nowrap; }
.city-now .city-dot { width: 10px; height: 10px; border-radius: 50%; }
.top-right { gap: 10px; }

/* 아래 탭: 지금 도시 색 */
.tab[aria-current="page"]::before { background: var(--theme, var(--accent)); }

/* 오늘: 날짜 줄 + ＋경비 */
.today-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.quick-exp { min-height: 44px; padding: 0 14px; border: 1.5px solid var(--accent); border-radius: var(--r-pill); color: var(--accent);
  font-size: 15px; font-weight: 700; white-space: nowrap; }
.quick-exp:active { background: var(--sunk); }

/* 다음 일정 카드: 첫 화면에 번호·길찾기까지 */
.hero-time { font-size: 40px; line-height: 1.05; }
.hero-title { -webkit-line-clamp: 3; }
.hero-title .pill { margin-left: 4px; position: relative; top: -2px; }
.hero > * + * { margin-top: 8px; }
.hero-st { font-size: 15px; }

/* 진행 중: 짧은 목록 */
.prog-list { overflow: hidden; }
.prog-head { display: flex; align-items: center; gap: 4px; padding: 8px 16px 4px 20px; font-size: 13px; font-weight: 700; color: var(--theme, var(--accent)); }
.prog-head .ic { width: 12px; height: 12px; fill: currentColor; }
.list-card > .prog-head + .prog { border-top: 0; }
.prog { position: relative; display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 56px; padding: 6px 12px 6px 20px; text-align: left; }
.prog::before { background: var(--theme, var(--accent)); }
.prog-time { flex: none; font-size: 15px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.prog-title { flex: 1 1 auto; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 지난 일정 · 지난 예약 접기 */
.past-group { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.past-sum { min-height: 48px; display: flex; align-items: center; padding: 0 16px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.past-group[open] { padding-bottom: 8px; }
.past-group > .card { margin: 8px 8px 0; }

/* 상태 표시 맞추기: 카드 보증은 회보라, 점선은 "예약 없음·옵션"에만 */
.pill-card { color: var(--cardtone); background: var(--cardtone-bg); border: 1.5px solid var(--cardtone-line); }
.hero .pill-card { background: var(--cardtone-bg); }
.day-open-count.pill-warn { border: 1.5px solid var(--warn); color: var(--warn); background: var(--warn-bg); height: 24px; }

/* 잠금 화면 */
.inp::placeholder { font-weight: 400; color: var(--text-3); opacity: 1; }
.lock-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 48px; margin-top: 20px !important;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-ctl); font-size: 17px; font-weight: 600; }

/* 경비 입력: 금액 + 저장 한 줄 */
.exp-amt-row { display: flex; gap: 8px; }
.exp-amt-row .inp { flex: 1 1 auto; min-width: 0; }
.exp-amt-row .primary-btn { width: auto; flex: none; min-height: 48px; padding: 0 18px; }

/* 표: 첫 칸 고정 · 넘칠 때만 흐림 + "옆으로 밀기 →" */
.tablebox { position: relative; }
.tbl-hint { display: none; text-align: right; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }
.tablebox.is-overflow .tbl-hint { display: block; }
.tablebox.is-overflow::after { content: ""; position: absolute; top: 24px; right: -4px; bottom: 0; width: 32px; pointer-events: none;
  background: linear-gradient(to right, rgba(0, 0, 0, 0), var(--surface)); }
.tablebox.is-overflow.at-end::after { display: none; }
.tbl-sticky th, .tbl-sticky td { min-width: 0; }
.tbl-sticky th { white-space: normal; }
.tbl-sticky th:first-child, .tbl-sticky td:first-child { position: sticky; left: 0; z-index: 1; min-width: 120px; max-width: 140px;
  background: var(--surface); box-shadow: inset -1px 0 0 var(--line); }
.tbl-sticky th:first-child { background: var(--sunk); }