/* ─────────────────────────────────────────────
   여행 사이트 공통 디자인 (휴대폰 먼저)
   - 색: 재료\여행사이트_색상가이드.pdf 4쪽 (팬톤 2026 클라우드 댄서 + 2027 아쿠아 스플래시)
   - 밝은 화면: 버튼·링크는 깊은 청록, 선택된 칸·표시는 아쿠아 스플래시 + 진한 글자 (흰 글자 금지)
   - 어두운 화면: 버튼·링크가 아쿠아 스플래시, 버튼 위 글자는 #0F1A1C
   - 경고·주의·완료는 색만으로 구분하지 않고 ⚠ ✔ 같은 기호·글자를 같이 씀
   - 휴대폰 기준으로 만들고, 넓은 화면(900px 이상)은 맨 아래에서 따로 조정
   ───────────────────────────────────────────── */

/* 밝은 화면 색 (가이드 4쪽 :root 그대로) */
:root {
  --bg: #EEF4F4;          /* 연한 물빛 · 페이지 배경 (가이드는 클라우드 댄서 #F0EEE9 → 아쿠아 로고와 어울리게 바꿈, 2026-12-05) */
  --card: #FFFFFF;        /* 화이트 · 카드·표 배경 */
  --text: #1F2A2E;        /* 먹색 · 본문 글자 */
  --text-sub: #55656A;    /* 회청색 · 보조 글자·설명 */
  --line: #D8E2E1;        /* 물안개 · 테두리·구분선 */
  --aqua: #85CED1;        /* 아쿠아 스플래시 · 포인트 면·선택된 칸 (팬톤 2027) */
  --accent: #176E73;      /* 깊은 청록 · 버튼·링크·제목 강조 */
  --aqua-soft: #E3F4F4;   /* 연한 아쿠아 · 정보 상자·표 머리 배경 */
  --danger: #B23A2E;      /* 산호 빨강 · 경고 (1/4 공항 시간 등) */
  --warn: #8A5A00;        /* 호박 노랑 · 주의 글자 (배경 #FFF4DC) */
  --ok: #1D7A52;          /* 숲 초록 · 완료·체크 */

  /* 아래는 사이트 코드가 쓰는 이름 → 위 색으로 연결 */
  --muted: var(--text-sub);
  --accent-text: #FFFFFF;          /* 깊은 청록 버튼 위 글자 */
  --accent-soft: var(--aqua-soft);
  --select-bg: var(--aqua);        /* 선택된 칸 (날짜·탭·식사 시간 등) */
  --select-text: var(--text);      /* 선택된 칸 글자: 진한 글자 */
  --warn-soft: #FFF4DC;            /* 주의 바탕 (가이드 값) */
  --danger-soft: #F9E4E1;          /* 경고 바탕 (가이드에 없음 → 산호 빨강을 아주 연하게) */
  --shadow: 0 1px 2px rgba(31, 42, 46, .05), 0 6px 18px rgba(31, 42, 46, .05);
  --radius: 18px;
  color-scheme: light;
}

/* 어두운 화면 색 (가이드 4쪽 [data-theme="dark"] 그대로) */
:root[data-theme="dark"] {
  --bg: #0F1A1C;          /* 밤바다 · 페이지 배경 */
  --card: #172527;        /* 깊은 물 · 카드·표 배경 */
  --text: #E8EFEF;        /* 물빛 흰색 · 본문 글자 */
  --text-sub: #9FB3B5;    /* 회청색 · 보조 글자·설명 */
  --line: #2A3B3E;        /* 어두운 물결 · 테두리·구분선 */
  --aqua: #85CED1;        /* 아쿠아 스플래시 · 버튼·링크·강조 (팬톤 2027) */
  --on-aqua: #0F1A1C;     /* 버튼 글자 · 아쿠아 버튼 위 글자 */
  --aqua-soft: #1E4A4D;   /* 심해 청록 · 정보 상자·선택된 칸 배경 */
  --danger: #FF8A7A;      /* 산호 · 경고 */
  --warn: #F2C14E;        /* 호박 · 주의 */
  --ok: #5CCB94;          /* 민트 · 완료·체크 */

  --accent: var(--aqua);
  --accent-text: var(--on-aqua);
  --accent-soft: var(--aqua-soft);
  --select-bg: var(--aqua);
  --select-text: var(--on-aqua);
  --warn-soft: #3A3016;            /* 주의 바탕 (가이드에 없음 → 어둡게) */
  --danger-soft: #45201B;          /* 경고 바탕 (가이드에 없음 → 어둡게) */
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  word-break: keep-all;          /* 한국어 단어 중간에서 줄 안 바뀌게 */
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 16px 16px 96px; }

/* ── 맨 위 막대 ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 6px;
  min-height: 60px; padding: 6px 14px;
  background: color-mix(in srgb, var(--card) 86%, transparent);   /* 반투명 흰색 (어두운 화면은 반투명 깊은 물색) */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .home { font-weight: 800; text-decoration: none; color: var(--text); margin-right: auto; padding: 8px 4px; }
.topbar nav { display: flex; gap: 6px; align-items: center; }

/* ── 버튼 (손가락으로 누르기 쉽게 최소 44px) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text);
  font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.big { min-height: 56px; font-size: 1.15rem; font-weight: 700; border-radius: 14px; width: 100%; }
.btn.small { min-height: 40px; padding: 4px 12px; font-size: .93rem; }
/* 위쪽 막대의 "일정 보기"(여행 정보 화면) · "여행 정보"(일정 화면) 버튼: 두 화면에서 똑같이 크고 진하게 */
.btn.nav-switch { min-height: 44px; padding: 4px 16px; font-size: 1.05rem; font-weight: 800; color: var(--accent); border: 2px solid var(--accent); background: var(--card); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.active { background: var(--select-bg); border-color: var(--accent); color: var(--select-text); font-weight: 700; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}

/* 작은 디데이 표시 */
.dday-sm {
  display: inline-block; padding: 1px 10px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent);
  font-size: .85rem; font-weight: 700; line-height: 1.6; vertical-align: 2px; white-space: nowrap;
}

/* 입력 칸 공통 */
input[type="text"], input[type="number"], input[type="time"], select, textarea {
  font: inherit; font-size: 1rem; min-height: 44px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
}
textarea { line-height: 1.5; resize: vertical; }

/* ═════════════ 홈 ═════════════ */
.home-list { display: flex; flex-direction: column; gap: 18px; max-width: 560px; margin: 8px auto 0; }
.trip-hero { display: flex; flex-direction: column; gap: 14px; padding: 26px 22px 22px; }
.trip-hero .eyebrow { font-size: .9rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.trip-hero h1 { font-size: 2.6rem; line-height: 1.1; }
.trip-hero .dates { font-size: 1.15rem; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.trip-hero .sub { color: var(--muted); font-size: .98rem; }
.trip-hero .actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; }

/* ═════════════ 여행 정보 (정보지) ═════════════ */
.guide-hero { display: flex; flex-direction: column; gap: 14px; }
.guide-hero .dates { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }

/* 핵심 일정 요약: 날짜 칸을 따로 둬서 1/4 밤과 1/5 새벽이 구분되게 */
.timeline { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.timeline li { display: grid; grid-template-columns: 104px 1fr; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .d { padding: 12px 12px; background: var(--accent-soft); font-weight: 800; line-height: 1.35; }
.timeline .c { padding: 12px 14px; line-height: 1.45; }
.timeline .t { display: block; font-weight: 800; font-size: 1.1rem; }
.timeline li.strong .d { background: var(--select-bg); color: var(--select-text); }

.intro { margin: 0; padding-left: 1.2em; color: var(--muted); font-size: .97rem; }
.intro li + li { margin-top: 2px; }

.sections { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.section > * + * { margin-top: 14px; }
.section h2 { display: flex; gap: 10px; align-items: baseline; }
.section h2 .num { color: var(--accent); font-variant-numeric: tabular-nums; }
.section h3 { margin-top: 20px; }

/* 표: 좁은 화면에서는 표 안에서만 옆으로 밀어서 보기 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .97rem; }
.table-wrap.narrow table { min-width: 0; }
th, td { padding: 11px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--accent-soft); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; }

/* 색깔 상자: 이모지 대신 왼쪽 색 막대 */
.note { padding: 13px 16px; border-radius: 12px; border-left: 5px solid var(--accent); background: var(--accent-soft); }
.note.warn   { background: var(--warn-soft); color: var(--warn); border-left-color: var(--warn); }
.note.danger { background: var(--danger-soft); color: var(--danger); border-left-color: var(--danger); font-weight: 600; }

.detail { background: var(--bg); border-radius: 12px; padding: 14px 16px; }
.detail h3 { margin: 0 0 6px; }
.detail ul, ul.list { margin: 0; padding-left: 1.25em; }
.detail li + li, ul.list li + li { margin-top: 4px; }

/* 체크리스트 */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist label {
  display: flex; gap: 14px; align-items: center; min-height: 52px;
  padding: 10px 14px; border-radius: 12px; background: var(--bg); cursor: pointer;
}
.checklist input { width: 24px; height: 24px; accent-color: var(--ok); flex: none; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.check-count { font-weight: 700; color: var(--accent); }

/* ── 사진 ── */
.photos { display: flex; flex-direction: column; gap: 12px; }
.photo { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
/* 글자 있는 지도·인포그래픽이 잘리지 않게: 본문 너비에 맞춰 줄이기만 함 */
.photo img { display: block; width: 100%; max-width: 100%; height: auto; object-fit: contain; background: #fff; }
.photo figcaption { padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .95rem; color: var(--muted); }
.photo figcaption .cap { flex: 1 1 200px; }
/* 사진 올리기·편집 칸 스타일은 기능과 함께 뺌 (2026-12-05) */

.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.place-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.place-card h4 { font-size: 1.02rem; }
.place-card .meta { font-size: .9rem; color: var(--muted); line-height: 1.45; }

/* ═════════════ 일정 ═════════════ */
.plan-top { display: flex; flex-direction: column; gap: 8px; }
.plan-top h1 { font-size: 1.6rem; }
.plan-top .dates { color: var(--muted); font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 전체 비용 작은 요약 (누르면 비용 상세) */
.cost-summary {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  min-height: 48px; padding: 8px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-size: .95rem; cursor: pointer; text-align: left;
}
.cost-summary b { color: var(--accent); }
.cost-summary .arrow { color: var(--muted); transition: transform .15s; }
.cost-summary[aria-expanded="true"] .arrow { transform: rotate(90deg); }
.cost-detail { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.cost-detail table { min-width: 0; }
.cost-detail td, .cost-detail th { padding: 8px 10px; }
.cost-detail td:not(:first-child), .cost-detail th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.rate-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rate-row input { width: 110px; }
.save-state { font-size: .9rem; color: var(--muted); min-height: 1.4em; }

/* 날짜 선택 줄 */
.date-tabs {
  position: sticky; top: 56px; z-index: 40;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px;
  margin: 12px -16px 0; padding: 8px 12px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.date-tabs button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 56px; padding: 4px 0; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-size: 1rem; font-weight: 500; line-height: 1.2; cursor: pointer;
}
.date-tabs button small { font-size: .78rem; color: var(--muted); }
.date-tabs button .cnt { font-size: .72rem; color: var(--muted); }
.date-tabs button[aria-selected="true"] { background: var(--select-bg); border-color: var(--accent); color: var(--select-text); font-weight: 800; }
.date-tabs button[aria-selected="true"] small,
.date-tabs button[aria-selected="true"] .cnt { color: var(--select-text); }

.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 14px; }
.palette { display: none; }       /* 휴대폰에서는 목록 대신 "장소 추가" 창 사용 */

.days { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.day { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px; }
.day:not(.selected) { display: none; } /* 휴대폰: 고른 날짜만 */
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.day-head h2 { font-size: 1.4rem; }
.day-sum { color: var(--muted); font-size: .92rem; text-align: right; }
.day-sum b { color: var(--text); }
.day-warn { display: flex; flex-direction: column; gap: 6px; }
.day-warn:empty { display: none; }
.day-warn .note { padding: 10px 14px; font-size: .95rem; }

.day-list { display: flex; flex-direction: column; gap: 10px; border-radius: 12px; }
.empty { text-align: center; color: var(--muted); padding: 22px 8px 6px; font-size: 1.02rem; }
.add-btn { width: 100%; }

.item { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); padding: 12px 12px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.item.bad { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }
.item.caution { border-color: var(--warn); }
.item-main { display: flex; gap: 8px; align-items: flex-start; }
.item-main .handle { display: none; cursor: grab; font-size: 1.3rem; color: var(--muted); padding: 2px 4px 0 0; touch-action: none; user-select: none; }
.item-text { flex: 1; min-width: 0; }
.item-title { font-size: 1.12rem; font-weight: 800; line-height: 1.35; }
.item-meta { color: var(--muted); font-size: .94rem; margin-top: 2px; line-height: 1.45; }
.item-meta .time { color: var(--text); font-weight: 700; }
.item-memo { margin-top: 4px; font-size: .95rem; white-space: pre-wrap; }
.item-edit { flex: none; }
.item-form { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.item-form label { font-size: .9rem; color: var(--muted); }
.item-form .full { grid-column: 1 / -1; }
.item-form input[type="time"] { width: 100%; }
.item-form input, .item-form select { width: 100%; min-width: 0; }
.item-form textarea { width: 100%; min-height: 64px; }
.item-form .row-end { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.flags:empty { display: none; }
.flag { font-size: .92rem; font-weight: 600; }
.flag.danger { color: var(--danger); }
.flag.warn { color: var(--warn); }
.flag.info { color: var(--accent); }

.kind { font-size: .82rem; font-weight: 700; color: var(--accent); }

/* ── 장소 추가 창 (아래에서 올라옴) ── */
.sheet { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 26, 28, .5); }
.sheet-panel {
  position: relative; background: var(--card); border-radius: 20px 20px 0 0;
  max-height: 86vh; display: flex; flex-direction: column;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .15);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-head h2 { font-size: 1.2rem; }
.sheet-head .for { color: var(--accent); }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 12px 0 10px; }
.tabs .btn { white-space: nowrap; padding-left: 4px; padding-right: 4px; }   /* 탭 4개(관광지·근교·음식·유흥)가 한 줄에 들어가게 */
.cand-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.cand { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 14px; background: var(--bg); }
.cand .info { flex: 1; min-width: 0; line-height: 1.4; }
.cand .t { font-weight: 800; }
.cand .s { font-size: .88rem; color: var(--muted); }
.cand .btn { flex: none; }
.cand.added .btn { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* 목록 (넓은 화면 전용) */
.pcard {
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  padding: 10px 12px; display: flex; gap: 10px; align-items: center; cursor: grab;
}
.pcard .thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; background: var(--accent-soft); }
.pcard .info { flex: 1; min-width: 0; line-height: 1.4; }
.pcard .t { font-weight: 700; }
.pcard .s { font-size: .86rem; color: var(--muted); }

.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 12px;
  font-weight: 600; z-index: 100; max-width: 90vw; text-align: center;
}

/* ═════════════ 넓은 화면 (컴퓨터) ═════════════ */
@media (min-width: 900px) {
  .wrap { padding: 24px 24px 96px; }
  h1 { font-size: 2rem; }
  .card { padding: 24px; }

  /* 여행 정보: 왼쪽에 전체 목차 항상 보이기 */

  /* 일정: 목록 + 날짜 칸 전부 + 끌어다 놓기 */
  .date-tabs { display: none; }
  .plan-top { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; }
  .cost-summary { width: auto; min-width: 320px; }
  .plan-layout { grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
  .palette { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 76px; max-height: calc(100vh - 96px); padding: 16px; }
  .palette .tabs { margin: 0; }
  .palette-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
  .days { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .day, .day:not(.selected) { display: flex; }
  .day-list { min-height: 72px; }
  .day-list:empty { border: 2px dashed var(--line); }
  .day .empty { display: none; }
  .item-main .handle { display: block; }
}

/* ═════════════ 추가: 공항 고정 일정 · 지우기 확인창 · 음식 단계 · 목적별 묶음 · 장소 상세 ═════════════ */

.sandbox-bar { background: var(--warn-soft); color: var(--warn); text-align: center; font-weight: 700; font-size: .9rem; padding: 6px 12px; }
.local-time { font-size: .88rem; color: var(--muted); margin-top: 2px; }

/* 공항 고정 일정: 일반 일정과 같은 줄에 놓되, 테두리 점선 + 회색 바탕으로 구분 (끌기·수정 불가) */
.fixed-top:empty, .fixed-bottom:empty { display: none; }
.fixed-top, .fixed-bottom { display: flex; flex-direction: column; gap: 10px; }
.fixed {
  display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: start;
  border: 1.5px dashed var(--accent); border-radius: 14px; padding: 9px 12px;
  background: var(--accent-soft);
}
.fixed-time { font-weight: 800; font-size: .98rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.fixed-title { font-weight: 800; line-height: 1.4; }
.fixed-title .tag { margin-right: 2px; vertical-align: 1px; }
.fixed-sub { font-size: .86rem; color: var(--muted); margin-top: 1px; }
/* 항공편 상세 (출발·도착·비행 시간 등, hcm.json 의 fixedEvents[].details) */
.fixed-details { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: .88rem; }
.fixed-details dt { color: var(--muted); font-weight: 700; }
.fixed-details dd { margin: 0; }
/* 항공편 카드 (작게: 한 줄 경로 + 접힌 상세) */
.fixed.flight { display: block; padding: 10px 12px; }
.flight-route { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: .98rem; white-space: nowrap; }
.flight-route .leg b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.flight-arrow { color: var(--accent); font-weight: 800; }
.flight-more { margin-top: 6px; font-size: .88rem; color: var(--muted); }
.flight-more summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; }
.flight-more summary::-webkit-details-marker { display: none; }
.flight-more .more-label { margin-left: auto; color: var(--accent); font-weight: 700; }
.flight-more .more-label::after { content: " ▾"; }
.flight-more[open] .more-label::after { content: " ▴"; }
.flight-more .fixed-details { color: var(--text, inherit); }
.tag { display: inline-block; white-space: nowrap; font-size: .78rem; font-weight: 800; padding: 1px 9px; border-radius: 999px; line-height: 1.6; }
.tag-flight { background: var(--accent); color: var(--accent-text); }
.tag-leave  { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.tag-goal   { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.next-day { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.next-day-label {
  display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--accent); font-size: .98rem;
}
.next-day-label::before, .next-day-label::after { content: ""; flex: 1; border-top: 2px solid var(--accent); opacity: .5; }

/* 일정 카드: 옆으로 밀어 지우기 (위아래 스크롤은 그대로 되고, 옆 움직임만 사이트가 받음) */
.item-main { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; cursor: pointer; touch-action: pan-y; }
.item.swipe-ready { border-color: var(--danger); background: var(--danger-soft); }

/* "되돌리기" 알림 */
.toast.undo { display: flex; align-items: center; gap: 14px; text-align: left; width: max-content; }
.toast.undo button {
  background: none; border: 0; color: var(--aqua); font: inherit; font-weight: 800;
  padding: 4px 2px; cursor: pointer; white-space: nowrap;
}

/* 컴퓨터: 일정을 끄는 동안 목록에 "여기에 놓으면 일정에서 빼기" 표시 */
.palette { position: relative; }
.palette.drop-remove { outline: 2px dashed var(--danger); outline-offset: -6px; }
.palette.drop-remove::after {
  content: "여기에 놓으면 일정에서 빼기"; position: absolute; left: 12px; right: 12px; top: 12px;
  background: var(--danger); color: #fff; font-weight: 800; text-align: center; padding: 10px; border-radius: 10px;
  pointer-events: none;
}
.palette.drop-remove .palette-list > .item { display: none; }
.no-cost { color: var(--warn); font-weight: 600; }

/* 지우기 확인창 (화면 가운데) */
.sheet.confirm { justify-content: center; align-items: center; padding: 20px; z-index: 95; }
.confirm-panel {
  position: relative; background: var(--card); border-radius: 18px; width: 100%; max-width: 380px;
  padding: 22px 20px 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 6px;
}
.confirm-panel h2 { font-size: 1.2rem; }
.confirm-name { font-size: 1.1rem; font-weight: 800; margin-top: 6px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn.danger-fill { color: #2a0d09; }

/* 장소 추가 창: 정보 / 담기 버튼, 음식 단계 */
.cand .btn + .btn { margin-left: -2px; }
.btn.done { background: var(--accent-soft) !important; color: var(--accent) !important; border-color: var(--accent) !important; }
.cat-row { width: 100%; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.cat-row .info { display: flex; flex-direction: column; }
.cat-row .go, .place-links .go { color: var(--muted); font-size: 1.4rem; flex: none; }
.sheet-hint { color: var(--muted); font-size: .93rem; margin-bottom: 2px; }
.sheet-box { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.sheet-box h3 { font-size: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-size: .95rem; cursor: pointer;
}
.chip.on { background: var(--select-bg); border-color: var(--accent); color: var(--select-text); font-weight: 800; }
.add-wide { width: 100%; justify-content: flex-start; }
.back-btn { align-self: flex-start; padding-left: 4px; }
.cat-title { font-size: 1.25rem; }
.ref { font-size: .88rem; color: var(--muted); }
.typed-row { display: flex; gap: 8px; }
.typed-row input { flex: 1; min-width: 0; }
.item-form .ref { grid-column: 1 / -1; margin: 0; }
.item-form input[type="text"] { width: 100%; }

/* 여행 정보: 목적별 묶음 */
.groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.group { padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 120px; }
.group h2 { font-size: 1.2rem; }
.g-links { display: flex; flex-wrap: wrap; gap: 6px; }
.g-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 4px 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .93rem; font-weight: 600;
}
.g-link:hover { border-color: var(--accent); }
.g-food { color: var(--muted); font-size: .95rem; }
.place-links { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.place-links li + li { border-top: 1px solid var(--line); }
.place-links a { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; color: var(--text); text-decoration: none; }
.place-links a:hover { background: var(--accent-soft); }
.pl-t { font-weight: 700; flex: 1; min-width: 0; line-height: 1.35; }
.pl-s { color: var(--muted); font-size: .85rem; text-align: right; max-width: 45%; line-height: 1.35; }
.place-card h4 a { color: var(--text); }

/* 장소 상세 */
.place-wrap { max-width: 760px; }
.place-detail { display: flex; flex-direction: column; gap: 16px; }
.pd-head { display: flex; flex-direction: column; gap: 4px; }
.pd-kind { font-size: .85rem; font-weight: 800; color: var(--accent); }
.pd-head h1 { font-size: 1.9rem; }
.pd-region { color: var(--muted); font-weight: 600; }
.pd-intro { font-size: 1.1rem; font-weight: 600; line-height: 1.6; }
.pd-sec { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.pd-sec h2 { font-size: 1.1rem; }
.pd-big { font-size: 1.15rem; font-weight: 800; }
.pd-sec .btn { align-self: flex-start; }
.pd-foot { font-size: .88rem; }

@media (min-width: 900px) {
  .groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ═════════════ 동선 지도 ═════════════ */
.map-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.map-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.map-head h2 { font-size: 1.15rem; }
.map-days { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; width: 100%; }
.map-days .btn { padding: 6px 0; min-height: 0; font-size: .85rem; }
.map-days button[aria-pressed="true"] { background: var(--select-bg); border-color: var(--accent); color: var(--select-text); font-weight: 800; }
.day-map { height: 280px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); z-index: 0; }
.map-note { font-size: .86rem; color: var(--muted); }
[data-theme="dark"] .day-map .leaflet-tile-pane { filter: brightness(.75) invert(1) contrast(.9) hue-rotate(180deg) saturate(.6); }
.leaflet-container { font-family: inherit; }

/* 번호 핀 */
.map-pin span {
  display: flex; align-items: center; justify-content: center; height: 28px; padding: 0 6px;
  background: var(--accent); color: var(--accent-text); border: 2px solid #fff; border-radius: 14px;
  font-weight: 800; font-size: .85rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); white-space: nowrap;
}
/* 구간 화살표 */
.map-arrow span {
  display: block; width: 22px; height: 22px; line-height: 22px; text-align: center;
  color: var(--accent); font-size: 18px; text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}

@media (min-width: 900px) {
  .add-btn { display: none; }          /* 컴퓨터는 목록에서 끌어다 놓기로 추가 → "장소 추가" 버튼 없음 */
  .day-map { height: 380px; }
}

/* 여행 중 빠르게 확인하는 장소 정보 */
.pd-map { align-self: flex-start; min-height: 44px; }
.pd-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 8px; }
.pd-facts > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pd-facts dt { color: var(--muted); font-size: .85rem; font-weight: 700; }
.pd-facts dd { margin: 2px 0 0; line-height: 1.45; }
.pd-photo img { max-height: 440px; }
.pd-sec .list li + li { margin-top: 10px; }
.guide-place-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.guide-place-list a { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 8px; color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 10px; }
.guide-place-list img { width: 64px; height: 54px; border-radius: 6px; object-fit: cover; flex: none; }
.guide-place-text { display: grid; flex: 1; min-width: 0; line-height: 1.4; }
.guide-place-text small, .guide-place-text > span { color: var(--muted); font-size: .85rem; }
.guide-hero summary, .section summary { cursor: pointer; font-weight: 700; }
.guide-hero details[open] > summary, .section details[open] > summary { margin-bottom: 10px; }
.guide-cell-label { display: none; }
@media (max-width: 600px) {
  .section .table-wrap:not(.narrow) table { display: block; min-width: 0; }
  .section .table-wrap:not(.narrow) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .section .table-wrap:not(.narrow) :is(tbody, tr, td) { display: block; }
  .section .table-wrap:not(.narrow) tr { padding: 8px 10px; }
  .section .table-wrap:not(.narrow) tr + tr { border-top: 1px solid var(--line); }
  .section .table-wrap:not(.narrow) td { padding: 3px 0; border: 0; }
  .section .table-wrap:not(.narrow) .guide-cell-label { display: inline; margin-right: 8px; color: var(--muted); font-weight: 700; }
}

.touch-sort-hint { display: none; }
@media (any-pointer: coarse) {
  .day:has(.day-list > .item + .item) .touch-sort-hint { display: block; margin: 0 0 8px; font-size: .85rem; }
  .item-main .handle { display: grid; place-items: center; flex: 0 0 24px; min-height: 44px; padding: 0; background: transparent; font-size: 1rem; line-height: 1; }
  .item.sortable-chosen .handle { color: var(--accent); }
}

/* 저녁 가이드 */
.night-guide, .night-section, .night-card { display: flex; flex-direction: column; gap: 12px; }
.night-guide { gap: 20px; scroll-margin-top: 76px; }
.night-guide[hidden] { display: none; }
.night-heading h1 { font-size: 1.45rem; }
.night-heading .muted { font-size: .9rem; }
.night-section { scroll-margin-top: 76px; }
.night-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 12px; }
.night-card { padding: 16px; }
.night-card h4 { font-size: 1.15rem; overflow-wrap: anywhere; }
.night-card header .muted, .night-access { font-size: .9rem; }
.night-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.night-card .night-links { margin-top: auto; }
.night-links .btn { min-height: 40px; }
.night-hero img { max-height: 240px; object-fit: cover; }
.night-hero figcaption a { color: inherit; }
.night-facts { display: grid; gap: 6px; margin: 0; }
.night-facts > div { display: grid; grid-template-columns: 2.4rem 1fr; gap: 8px; }
.night-facts dt { font-size: .88rem; color: var(--muted); font-weight: 700; }
.night-facts dd { margin: 0; }

/* 여행 정보 목차 */
.guide-cover { position: relative; isolation: isolate; overflow: hidden; display: flex; justify-content: flex-end; min-height: clamp(235px, 34vw, 385px); padding: clamp(20px, 4vw, 40px); border: 0; border-radius: 22px; background: #10292B; color: #F0EEE9; }
.guide-cover-photo, .guide-cover::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.guide-cover-photo { z-index: -2; object-fit: cover; object-position: center 57%; }
.guide-cover::after { content: ""; z-index: -1; background: linear-gradient(0deg, rgba(10, 30, 32, .94), rgba(12, 36, 38, .53) 50%, rgba(12, 36, 38, .05) 100%); }
.guide-cover-copy h1 { font-size: clamp(1.8rem, 5vw, 3.45rem); line-height: 1.14; letter-spacing: -.055em; text-wrap: balance; }
.guide-cover-copy .dates { margin-top: 7px; font-size: clamp(.86rem, 2vw, 1.05rem); }
.guide-cover-credit { position: absolute; top: 12px; right: 12px; padding: 5px 9px; border-radius: 20px; background: rgba(15, 26, 28, .78); color: #F0EEE9; font-size: .74rem; text-decoration: none; }
.guide-cover-credit:hover { text-decoration: underline; }
.guide-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.guide-toc { margin-top: clamp(20px, 3vw, 32px); }
.guide-toc > h2 { margin-bottom: 12px; font-size: clamp(1.18rem, 2.4vw, 1.55rem); letter-spacing: -.03em; }
.guide-toc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.guide-toc-group { min-width: 0; padding: 12px 14px 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.guide-toc-group header { display: flex; align-items: center; gap: 9px; padding: 0 3px 7px; }
.guide-toc-group h3 { font-size: 1.02rem; letter-spacing: -.015em; }
.guide-toc-icon { display: grid; place-items: center; width: 31px; height: 31px; flex: none; border-radius: 10px; font-size: 1.05rem; font-weight: 750; background: var(--accent-soft); color: var(--accent); }
.guide-toc-icon.tone-blue { background: #e4edef; color: #315665; }
.guide-toc-icon.tone-plum { background: #f1e8ef; color: #71435f; }
.guide-toc-icon.tone-ochre { background: #f5ecd8; color: #725421; }
:root[data-theme="dark"] .guide-toc-icon.tone-blue { background: #23363d; color: #b2d4df; }
:root[data-theme="dark"] .guide-toc-icon.tone-plum { background: #412f3c; color: #e4bed8; }
:root[data-theme="dark"] .guide-toc-icon.tone-ochre { background: #3d3526; color: #e7cd96; }
.guide-toc-group ul { margin: 0; padding: 0; list-style: none; }
.guide-toc-group li { border-top: 1px solid var(--line); }
.guide-toc-group a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 5px 3px; color: inherit; text-decoration: none; font-weight: 620; line-height: 1.35; }
.guide-toc-group a:hover, .guide-toc-group a:focus-visible { color: var(--accent); }
.guide-toc-arrow { color: var(--accent); font-size: 1.18rem; flex: none; }
@media (min-width: 580px) { .guide-toc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 900px) {
  .guide-toc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .guide-toc-group { padding-inline: 17px; }
}

.topbar .travel-home { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
.travel-home img { display: block; width: 96px; height: 49px; object-fit: contain; }
/* 아쿠아 로고는 밝은·어두운 화면 모두 색 그대로 (반전 없음) */
.guide-topbar .guide-back { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 10px 0 4px; font-size: 1.06rem; font-weight: 800; color: var(--accent); text-decoration: none; }
.guide-back span { font-size: 1.45rem; line-height: 1; }
.night-card[id] { scroll-margin-top: 76px; }

/* 일정 보기 "정보"로 유흥 카드에 바로 왔을 때, 위쪽 막대에 가리지 않게 */
.night-card { scroll-margin-top: 72px; }

/* 어두운 화면: 심해 청록(--aqua-soft) 바탕 위에서는 보조 글자(#9FB3B5)가 대비 4.48 : 1 로 모자라서
   그 바탕을 쓰는 상자 안에서만 보조 글자를 본문 글자색으로 (대비 8.4 : 1) */
:root[data-theme="dark"] .fixed,
:root[data-theme="dark"] .note,
:root[data-theme="dark"] th,
:root[data-theme="dark"] .timeline .d { --muted: var(--text); }


/* ═════════════ 첫 화면 (홈) ═════════════
   상자 없이 글자·버튼을 바탕 위에 바로 두고, 지도가 남은 화면을 꽉 채움 → 스크롤 없이 한 화면
   컴퓨터도 휴대폰과 같은 세로 배치 (가운데 760px 폭) */
.home-page { min-height: 100dvh; display: flex; flex-direction: column; }
.home-main { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 16px 16px; }
.home-trip { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 18px; }
.home-intro { display: flex; flex-direction: column; gap: 6px; }
.home-eyebrow { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 700; color: var(--muted); }
.home-dday { padding: 1px 10px; border-radius: 999px; background: var(--aqua); color: #0F1A1C; font-weight: 800; font-size: .82rem; }
.home-intro h1 { font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 850; letter-spacing: -0.04em; line-height: 1.02; }
.home-dates { font-size: 1.05rem; font-weight: 600; color: var(--muted); }
.home-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 12px; }
.home-btn { min-height: 52px; border-radius: 999px; font-size: 1.05rem; font-weight: 800; }
.btn.ghost-line { background: var(--card); border: 1.5px solid var(--line); color: var(--text); box-shadow: 0 1px 3px rgba(15, 26, 28, .08); }
/* 두 버튼 모두 마우스를 올리거나 누르면 색이 바뀜 (휴대폰은 누르는 순간) */
.home-btn { transition: background-color .15s, border-color .15s, color .15s, transform .1s; }
.home-btn:active { transform: scale(.97); }
.btn.primary.home-btn:hover { background: color-mix(in srgb, var(--accent) 85%, #000); border-color: color-mix(in srgb, var(--accent) 85%, #000); }
.btn.primary.home-btn:active { background: var(--aqua); border-color: var(--aqua); color: #0F1A1C; }
.btn.ghost-line:hover { border-color: var(--accent); color: var(--accent); }
.btn.ghost-line:active { background: var(--aqua-soft); border-color: var(--accent); color: var(--accent); }
:root[data-theme="dark"] .btn.primary.home-btn:hover { background: color-mix(in srgb, var(--aqua) 80%, #fff); border-color: color-mix(in srgb, var(--aqua) 80%, #fff); }
:root[data-theme="dark"] .btn.primary.home-btn:active { background: #5FB4B8; border-color: #5FB4B8; }

/* 동선 칸: 위쪽 날짜 버튼 → 아래 지도 → 맨 아래 짧은 설명 (서로 겹치지 않게) */
.home-map { flex: 1; min-height: 340px; display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 24px; background: var(--card); box-shadow: 0 10px 30px rgba(15, 26, 28, .08); }
.home-map .map-head { display: flex; flex-direction: column; gap: 8px; }
.home-map .map-title { font-size: 1rem; font-weight: 800; padding-left: 2px; }
.home-map .map-days .btn { border-radius: 999px; background: transparent; border-color: var(--line); }
.home-map .map-days button[aria-pressed="true"] { background: var(--select-bg); border-color: var(--select-bg); color: var(--select-text); }
.home-map .day-map { flex: 1; min-height: 0; height: auto; border: 0; border-radius: 16px; }
.home-map .map-note { font-size: .8rem; color: var(--muted); padding-left: 2px; }
.home-map .leaflet-control-zoom { display: none; }               /* 휴대폰은 두 손가락으로 확대 */
.home-map .leaflet-control-attribution { border-radius: 8px 0 0 0; font-size: .68rem; }

@media (min-width: 900px) {
  /* 컴퓨터도 휴대폰과 같은 세로 배치 (제목·버튼 위 → 동선 지도 아래), 화면 가운데에 적당한 폭으로 */
  .home-main { max-width: 760px; padding: 28px 24px 24px; }
  .home-actions { max-width: 520px; }
  .home-map .leaflet-control-zoom { display: block; }
}

