/* =========================================================================
   Buen Camino — 디자인 시스템
   토큰 근거: docs/02-design-tokens.md (Dribbble "Travel app concept" 픽셀 실측)
   설계 기준: 390px 모바일 우선, 터치 타깃 44px, 가로 스크롤 0
   ========================================================================= */

:root {
  /* Color — 레퍼런스 exact RGB 상위색을 그대로 채택 */
  --canvas: #c7dbcb;
  --mint: #e7f3e9;
  --warm: #f3f2e7;
  --white: #ffffff;
  --ink: #051909;
  --mint-soft: #d2e9d6;
  --mint-mid: #abcdb2;
  --line: #bdd0c1;
  --lime: #bccb30;
  --yellow: #f2d231;

  --ink-70: rgb(5 25 9 / 70%);
  --ink-55: rgb(5 25 9 / 55%);
  --ink-12: rgb(5 25 9 / 12%);
  --ink-08: rgb(5 25 9 / 8%);
  --overlay: rgb(5 25 9 / 62%);

  /* Type */
  --font-sans: "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  --font-serif: "Noto Serif KR", Georgia, serif;

  --text-display: clamp(2.05rem, 8.2vw, 4rem);
  --text-h1: clamp(1.75rem, 6vw, 3rem);
  --text-h2: clamp(1.4rem, 4.4vw, 2.1rem);
  --text-h3: clamp(1.1rem, 3.4vw, 1.4rem);
  --text-lg: 1.0625rem;
  --text-body: 1rem;
  --text-meta: 0.875rem;
  --text-label: 0.75rem;

  --leading-display: 1.14;
  --leading-body: 1.72;
  --tracking-eyebrow: 0.14em;

  /* Space — docs/02-design-tokens.md §6.3 스케일을 그대로 구현 */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */

  /* 이미지↔글자 관계 전용 파생 토큰 */
  --media-pad-lg: clamp(1.5rem, 5vw, 3rem);      /* 히어로 등 큰 사진 위 텍스트 블록 */
  --media-pad: clamp(1.25rem, 4.4vw, 2.5rem);    /* 일반 사진 패널 위 텍스트 블록 */
  --media-pad-sm: var(--space-4);                /* 프리뷰·스토리 등 작은 카드 */
  --media-block-gap: clamp(1.25rem, 3vw, 2rem);  /* 사진 블록 ↔ 앞뒤 텍스트 블록 */
  --media-caption-gap: var(--space-3);           /* 사진 ↔ 바로 아래 캡션 */
  --media-line-gap: var(--space-2);              /* 사진 위 텍스트 줄 사이 */

  --gutter: clamp(1.125rem, 4.6vw, 3rem);
  --section-gap: clamp(2.5rem, 8vw, 4.5rem);

  /* Radius */
  --r-control: 12px;
  --r-card-sm: 18px;
  --r-card: 24px;
  --r-card-lg: 32px;
  --r-panel: clamp(28px, 6vw, 56px);
  --arch-overlap: 34px;
  --r-pill: 999px;

  /* Elevation — 카드마다 그림자를 두지 않고 패널·부유 요소에만 */
  --shadow-outline: 0 0 0 1px var(--ink-08);
  --shadow-panel: 0 24px 60px rgb(5 25 9 / 14%);
  --shadow-float: 0 16px 36px rgb(5 25 9 / 18%);

  /* Motion */
  --d-fast: 160ms;
  --d-base: 240ms;
  --d-enter: 420ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Chrome heights */
  --topbar-h: 60px;
  --tabbar-h: 62px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-weight: 400;
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.24; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: 50%; top: 8px; transform: translate(-50%, -160%);
  z-index: 200; background: var(--ink); color: var(--mint);
  padding: 12px 20px; border-radius: var(--r-pill); font-weight: 700;
  text-decoration: none; transition: transform var(--d-fast) var(--ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 800px; }

/* 해시로 바로 들어와도 브라우저의 앵커 스크롤이 sticky 상단바 뒤로 숨지 않게 한다. */
.route { display: none; scroll-margin-top: var(--topbar-h); }
.route.is-active { display: block; animation: routeIn var(--d-enter) var(--ease-out) both; }
@keyframes routeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.stack > * + * { margin-top: var(--section-gap); }

.section-head { margin-bottom: var(--media-block-gap); }
.eyebrow {
  font-size: var(--text-label);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-55);
  margin-bottom: var(--media-line-gap);
}
.section-head h2 { font-size: var(--text-h2); }
.section-head p { margin-top: var(--media-line-gap); color: var(--ink-70); }
.subhead { font-size: var(--text-h3); font-weight: 700; margin: 0 0 var(--space-3); }
.note { font-size: var(--text-meta); color: var(--ink-55); line-height: 1.6; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding-inline: var(--gutter);
  background: rgb(199 219 203 / 88%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgb(5 25 9 / 6%);
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 44px; padding: 0 10px 0 4px; margin-left: -4px;
  border-radius: var(--r-pill);
  text-decoration: none; font-weight: 800; letter-spacing: -0.02em;
  font-size: 1.02rem; white-space: nowrap;
}
.brand .shell {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  background: var(--ink); color: var(--mint);
  border-radius: 50%; font-size: 0.82rem;
}

.deck-nav { display: none; margin-inline: auto; }
.deck-nav ul { display: flex; gap: 4px; }
.deck-nav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 14px;
  border-radius: var(--r-pill);
  text-decoration: none; font-size: 0.9rem; font-weight: 600;
  color: var(--ink-70);
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.deck-nav a:hover { background: rgb(255 255 255 / 55%); color: var(--ink); }
.deck-nav a[aria-current="page"] { background: var(--ink); color: var(--mint); }

.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang-select {
  min-height: 44px; min-width: 76px;
  padding: 0 30px 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23051909' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center / 11px;
  font-size: 0.85rem; font-weight: 600;
  appearance: none; cursor: pointer;
}

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--white); cursor: pointer;
  transition: background var(--d-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--mint); }
.icon-btn.is-active { background: var(--ink); color: var(--mint); border-color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------------------------------------------------------------- tabbar (mobile) */

.tabbar {
  position: fixed; z-index: 70;
  left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  width: min(calc(100% - 20px), 460px);
  background: var(--ink);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-float);
  padding: 5px;
}
.tabbar ul { display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 44px; padding: 4px 2px;
  border: 0; background: none; border-radius: var(--r-pill);
  color: rgb(231 243 233 / 70%); text-decoration: none;
  font-size: 0.66rem; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; width: 100%;
  transition: color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.tabbar svg { width: 20px; height: 20px; }
.tabbar a[aria-current="page"] { color: var(--mint); background: rgb(255 255 255 / 12%); }
.tabbar a[aria-current="page"] svg { color: var(--lime); }
.tabbar :focus-visible { outline-color: var(--lime); }

/* 더보기 시트 */
.more-sheet {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: flex-end; justify-content: center;
  background: var(--overlay);
  padding: 16px;
}
.more-sheet.is-open { display: flex; animation: fadeIn var(--d-base) var(--ease-out) both; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.more-sheet-panel {
  width: min(100%, 460px);
  background: var(--mint);
  border-radius: var(--r-card-lg);
  padding: 20px 18px calc(20px + var(--tabbar-h));
  animation: sheetUp var(--d-enter) var(--ease-out) both;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0 } to { transform: none; opacity: 1 } }
.more-sheet h2 { font-size: 1.05rem; margin-bottom: 14px; }
.more-sheet ul { display: grid; gap: 8px; }
.more-sheet a {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 16px;
  background: var(--white); border-radius: var(--r-card-sm);
  text-decoration: none; font-weight: 600;
}
.more-sheet a[aria-current="page"] { background: var(--ink); color: var(--mint); }

/* ---------------------------------------------------------------- hero panel */

.hero-panel {
  position: relative;
  margin: var(--space-3) 0 0;
  border-radius: var(--r-panel);
  overflow: hidden;
  background: var(--ink);
  box-shadow: var(--shadow-panel);
  isolation: isolate;
}
.hero-panel > picture, .hero-panel > img { position: absolute; inset: 0; }
.hero-panel img { width: 100%; height: 100%; object-fit: cover; }
.hero-panel::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgb(5 25 9 / 25%) 0%, rgb(5 25 9 / 15%) 34%, rgb(5 25 9 / 72%) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  min-height: min(74vh, 560px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--media-pad-lg);
  color: var(--mint);
}
.hero-inner .eyebrow { color: rgb(231 243 233 / 78%); }
.hero-title { font-size: var(--text-display); line-height: var(--leading-display); font-weight: 800; letter-spacing: -0.03em; }
.hero-route {
  margin-top: var(--space-4); padding-top: var(--space-4);
  border-top: 1px solid rgb(231 243 233 / 28%);
  font-size: var(--text-meta); color: rgb(231 243 233 / 84%); line-height: 1.62;
}
.hero-meta { margin-top: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hero-meta span {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px;
  background: rgb(231 243 233 / 14%); border: 1px solid rgb(231 243 233 / 22%);
  border-radius: var(--r-pill); font-size: 0.78rem; font-weight: 600;
}

/* 아치형 정보 시트 — 다른 페이지들과 통일: 겹침 없이 사진 바로 아래 이음새 없이 붙임 */
.hero-panel { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.arch-sheet {
  position: relative; z-index: 3;
  margin-top: 0;
  background: var(--mint);
  border-radius: 0 0 var(--r-panel) var(--r-panel);
  padding: var(--media-pad);
}

/* ---------------------------------------------------------------- scroller / pills */

.scroller {
  display: flex; gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  padding-bottom: 4px;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; flex: none; }
/* 흰 카드(.panel) 안에 중첩된 스크롤러는 카드 바깥으로 삐져나가지 않도록 여백 침범을 취소 */
.panel .scroller { padding-inline: 0; margin-inline: 0; }

.stat-card {
  min-width: 132px;
  background: var(--white);
  border-radius: var(--r-card);
  padding: 16px 18px;
  border: 1px solid var(--line);
}
.stat-card strong { display: block; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.03em; }
.stat-card span { display: block; margin-top: 4px; font-size: 0.76rem; color: var(--ink-55); line-height: 1.45; }

.tabs {
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  padding-block: 4px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--white);
  font-size: 0.86rem; font-weight: 600; white-space: nowrap;
  cursor: pointer;
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out);
}
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--mint); border-color: var(--ink); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 13px;
  background: var(--mint-soft); border-radius: var(--r-pill);
  font-size: 0.78rem; font-weight: 600;
}
.chip--ink { background: var(--ink); color: var(--mint); }
.chip--outline { background: transparent; border: 1px solid var(--line); }
.chip--lime { background: transparent; border: 1px solid var(--line); }
.chip--lime::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.chip--star::before { content: "★"; color: var(--yellow); font-size: 0.85rem; }

/* ---------------------------------------------------------------- panels & cards */

.panel {
  background: var(--mint);
  border-radius: var(--r-panel);
  padding: clamp(1.4rem, 4.4vw, 2.6rem);
}
.panel--warm { background: var(--warm); }
.panel--white { background: var(--white); }
.panel--ink { background: var(--ink); color: var(--mint); }
.panel--ink .eyebrow { color: rgb(231 243 233 / 62%); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px;
}
.card--flat { border-color: transparent; background: var(--mint-soft); }

.grid { display: grid; gap: 12px; }
/* 좁은 화면에서 긴 토큰이 그리드 트랙을 밀지 않도록 하는 공통 보정 */
.grid > *, .phrase-grid > *, .kv > div, .checklist li, .missa-refs div { min-width: 0; }
.hotel-card > *, .stay-box > *, .d-field p, .kv dd, .checklist li, .missa-refs span, .phrase .p-foreign { overflow-wrap: anywhere; }
@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* 사진 패널 (구분자) */
.photo-panel {
  position: relative;
  margin-top: var(--space-3);
  border-radius: var(--r-panel);
  overflow: hidden;
  background: var(--ink);
  min-height: 260px;
  display: flex; align-items: flex-end;
  box-shadow: var(--shadow-panel);
}
.photo-panel > picture, .photo-panel > img { position: absolute; inset: 0; }
.photo-panel img { width: 100%; height: 100%; object-fit: cover; }
.photo-panel::after {
  content: none;
}
.photo-panel-inner {
  position: relative; z-index: 2;
  padding: var(--media-pad);
  color: var(--mint);
  word-break: keep-all;
}
.photo-panel-inner h1, .photo-panel-inner h2 { font-size: var(--text-h1); letter-spacing: -0.025em; }
.photo-panel-inner p { margin-top: var(--media-line-gap); color: rgb(231 243 233 / 82%); font-size: var(--text-meta); }
.photo-panel-inner .eyebrow { color: rgb(231 243 233 / 72%); }
.photo-panel-inner h1, .photo-panel-inner h2, .photo-panel-inner p, .photo-panel-inner .eyebrow {
  text-shadow: 0 1px 5px rgb(0 0 0 / 75%), 0 4px 18px rgb(0 0 0 / 60%), 0 0 2px rgb(0 0 0 / 90%);
}

/* 인물 사진 패널 — 얼굴이 잘리지 않도록 초점을 왼쪽 위로 */
.photo-panel--portrait img { object-position: 24% 28%; }
/* 얼굴이 위쪽에 있는 가로 사진 — 초점을 위로 올려 얼굴이 잘리지 않도록 함 */
.photo-panel--facetop img { object-position: 55% 15%; }
/* 헤드라인 사진과 바로 아래 흰 패널 사이 간격 제거 */
.wrap.stack > .photo-panel + .panel { margin-top: 0; }
/* KJS소개 히어로와 바로 아래 소개글 박스가 맞닿는 면은 각지게 처리 */
.photo-panel--portrait { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wrap.stack > .photo-panel--portrait + .panel { border-top-left-radius: 0; border-top-right-radius: 0; }

/* ---------------------------------------------------------------- 통합 히어로 카드 (흰 배경 + 인셋 사진) */
.hero-white { padding-bottom: var(--media-pad); }
.hero-white .hero-head { margin-bottom: var(--section-gap); }
.hero-white .hero-head h1 { font-size: var(--text-h1); letter-spacing: -0.025em; margin: 0 0 var(--media-line-gap); color: var(--ink); }
.hero-white .hero-head p { color: var(--ink-70); margin-top: var(--media-line-gap); word-break: keep-all; }
.hero-white .hero-photo { border-radius: var(--r-card-lg); overflow: hidden; }
.hero-white .hero-photo img { width: 100%; display: block; max-height: 400px; object-fit: cover; }
/* 탭이 있는 통합 히어로 박스: 아래 탭패널과 맞닿으므로 하단 모서리를 각지게 처리 */
.hero-white[data-tabs] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
[role="tabpanel"] { border-top-left-radius: 0; border-top-right-radius: 0; }
.hero-white.hero-white--facetop .hero-photo img { object-position: 55% 15%; }
/* 히어로 카드 바로 다음 패널과의 간격 제거 (사진 아래 폼이 바로 이어지도록) */
.wrap.stack > .hero-white + .panel { margin-top: 0; }
/* 탭패널은 어느 탭이 활성화되든 항상 히어로 박스에 바로 붙도록 처리 */
.wrap.stack > [role="tabpanel"] { margin-top: 0 !important; }
/* 인물이 왼쪽에 있으므로 텍스트는 오른쪽으로 배치해 얼굴을 가리지 않도록 함 */
.photo-panel--portrait { justify-content: flex-end; }
.photo-panel--portrait .photo-panel-inner { text-align: right; max-width: 480px; margin-left: auto; }
@media (max-width: 480px) {
  .photo-panel--portrait .photo-panel-inner { max-width: 92%; }
}

/* 인라인 사진 */
.figure { border-radius: var(--r-card-lg); overflow: hidden; background: var(--mint-soft); }
/* 사진 블록은 앞뒤 텍스트 블록과 같은 간격을 갖는다 — 섹션 간격보다 촘촘하게 */
.panel .prose + .figure,
.stack > * + .figure,
.stack > .figure + * { margin-top: var(--media-block-gap); }
.figure img { width: 100%; height: auto; }
.figure figcaption { padding: var(--media-caption-gap) var(--space-4) var(--space-4); font-size: var(--text-meta); color: var(--ink-55); }

/* 프리뷰 카드 (홈) */
.preview-card {
  position: relative; display: block;
  border-radius: var(--r-card-lg); overflow: hidden;
  text-decoration: none; color: var(--mint);
  background: var(--ink);
  min-height: 190px;
}
.preview-card > picture, .preview-card > img { position: absolute; inset: 0; }
.preview-card img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--d-enter) var(--ease-out); }
.preview-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(5 25 9 / 10%), rgb(5 25 9 / 76%)); }
.preview-card:hover img { transform: scale(1.04); }
.preview-inner { position: relative; z-index: 2; padding: var(--media-pad-sm); display: flex; flex-direction: column; justify-content: flex-end; min-height: 190px; }
.preview-inner strong { font-size: 1.12rem; font-weight: 700; }
.preview-inner span { font-size: var(--text-meta); color: rgb(231 243 233 / 80%); margin-top: var(--space-1); }
.preview-go {
  position: absolute; top: var(--space-3); right: var(--space-3); z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgb(231 243 233 / 22%); backdrop-filter: blur(6px);
  display: grid; place-items: center;
}

/* CTA */
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  background: var(--ink); color: var(--mint);
  border: 0; border-radius: var(--r-pill);
  font-size: 0.95rem; font-weight: 700; text-decoration: none;
  cursor: pointer;
  transition: transform var(--d-fast) var(--ease-out);
}
.cta:hover { transform: translateY(-2px); }
.cta--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }

/* ---------------------------------------------------------------- data rows (표 대체) */

.rows { display: grid; gap: 10px; }
.row-card {
  display: grid; gap: 4px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-card-sm); padding: 14px 16px;
}
.rows > * { min-width: 0; }
/* 「Avis·Europcar·Hertz·Enterprise·Alamo」처럼 공백 없는 긴 토큰이 그리드 트랙을 밀어
   320px에서 문서 가로 스크롤을 만들었다. 넘칠 때만 끊기도록 anywhere 를 준다. */
.row-card dt, .row-card dd { overflow-wrap: anywhere; }
.row-card dt { font-size: var(--text-label); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-55); font-weight: 700; }
.row-card dd { margin: 0; font-size: 0.94rem; }
.row-card .row-main { font-weight: 700; font-size: 1rem; }
.row-card .row-sub { color: var(--ink-70); font-size: var(--text-meta); }

.kv { display: grid; gap: 8px; }
.kv > div { display: grid; grid-template-columns: minmax(90px, 34%) 1fr; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--ink-12); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { font-size: var(--text-meta); font-weight: 700; color: var(--ink-70); }
.kv dd { margin: 0; font-size: 0.94rem; }
.kv .total { font-weight: 800; }
.kv > div.is-total { background: var(--ink); color: var(--mint); border: 0; border-radius: var(--r-card-sm); padding: 14px 16px; margin-top: 6px; }
.kv > div.is-total dt { color: rgb(231 243 233 / 78%); }

.checklist { display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; font-size: 0.94rem; line-height: 1.62; }
.checklist li::before {
  content: ""; flex: none; margin-top: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 0 3px rgb(188 203 48 / 22%);
}
.checklist--num { counter-reset: c; }
.checklist--num li { counter-increment: c; }
.checklist--num li::before {
  content: counter(c); width: 24px; height: 24px; margin-top: 1px;
  background: var(--ink); color: var(--mint); box-shadow: none;
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 700;
}

.note-box {
  background: var(--warm); border-left: 4px solid var(--yellow);
  border-radius: var(--r-control);
  padding: 14px 16px; font-size: var(--text-meta); line-height: 1.66;
}

/* ---------------------------------------------------------------- day cards */

.day-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden;
  transition: border-color var(--d-fast) var(--ease-out);
}
.day-card[open] { border-color: var(--ink); }
.day-card > summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  min-height: 68px; padding: 14px 16px;
}
.day-card > summary::-webkit-details-marker { display: none; }
.day-badge {
  min-width: 52px; padding: 6px 8px;
  background: var(--ink); color: var(--mint);
  border-radius: 14px; text-align: center;
}
.day-badge b { display: block; font-size: 1.05rem; font-weight: 800; line-height: 1.1; }
.day-badge span { display: block; font-size: 0.6rem; letter-spacing: 0.1em; opacity: 0.7; }
.day-head-main { min-width: 0; }
.day-head-main .d-date { font-size: var(--text-label); color: var(--ink-55); font-weight: 700; }
.day-head-main .d-title { font-weight: 700; font-size: 0.98rem; line-height: 1.4; letter-spacing: -0.01em; }
.day-toggle {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--mint-soft); display: grid; place-items: center;
  transition: transform var(--d-base) var(--ease-out);
}
.day-card[open] .day-toggle { transform: rotate(180deg); background: var(--ink); color: var(--mint); }
.day-body { padding: 0 16px 18px; display: grid; gap: 14px; }
.day-body .d-sub { font-size: var(--text-meta); color: var(--ink-55); }
.d-field { display: grid; gap: 6px; }
.d-field .d-label { font-size: var(--text-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-55); font-weight: 700; }
.d-field p { font-size: 0.93rem; line-height: 1.6; }

.stay-box { background: var(--mint); border-radius: var(--r-card-sm); padding: 14px 16px; }
.stay-box .s-name { font-weight: 700; font-size: 0.95rem; }
.stay-box .s-addr { margin-top: 4px; font-size: var(--text-meta); color: var(--ink-70); line-height: 1.55; }
.tel-link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; margin-top: 10px; padding: 0 16px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 0.85rem; font-weight: 700; text-decoration: none;
}
.tel-link svg { width: 15px; height: 15px; }

/* 숙소 카드 */
.hotel-card { display: grid; gap: 4px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card-sm); padding: 15px 16px; }
.hotel-card .h-name { font-weight: 700; font-size: 0.95rem; }
.hotel-card .h-desc { font-size: var(--text-meta); color: var(--ink-70); }
.hotel-card .h-price { margin-top: 4px; font-size: var(--text-meta); font-weight: 700; }

/* ---------------------------------------------------------------- story */

.story-card {
  background: var(--white);
  border-radius: var(--r-card-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}
.story-photos { display: grid; gap: 2px; }
.story-photos.is-pair { grid-template-columns: 1fr 1fr; }
.story-photos img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.story-body { padding: var(--media-pad-sm); }
.story-day { font-size: var(--text-label); letter-spacing: 0.06em; font-weight: 700; color: var(--ink-55); }
.story-title { font-size: 1.16rem; font-weight: 700; margin: var(--space-1) 0 var(--space-3); letter-spacing: -0.02em; }
.story-quote { font-family: var(--font-serif); font-size: 0.98rem; line-height: 1.86; color: var(--ink-70); }

.prose p { font-size: 1rem; line-height: var(--leading-body); }
.prose p + p { margin-top: 1em; }
.prose--serif p { font-family: var(--font-serif); }

/* 경력 타임라인 */
.timeline { display: grid; gap: 12px; position: relative; }
.tl-item {
  position: relative;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 18px 18px 18px 20px;
}
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px;
  background: var(--mint-mid); border-radius: 0 4px 4px 0;
}
.tl-item.is-current::before { background: var(--lime); }
.tl-period { font-size: var(--text-label); letter-spacing: 0.08em; font-weight: 800; color: var(--ink-55); }
.tl-org { font-size: 1.05rem; font-weight: 700; margin: 4px 0 8px; letter-spacing: -0.02em; }
.tl-text { font-size: 0.93rem; line-height: 1.68; color: var(--ink-70); }

/* ---------------------------------------------------------------- phrases */

.phrase-toolbar { display: grid; gap: 12px; margin-bottom: 16px; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-55); }
.search-field input {
  width: 100%; min-height: 48px; padding: 0 16px 0 42px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--white);
}
.phrase-grid { display: grid; gap: 10px; }
@media (min-width: 620px) { .phrase-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .phrase-grid { grid-template-columns: repeat(3, 1fr); } }
.phrase {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-card-sm); cursor: pointer; text-align: left;
  width: 100%;
  transition: background var(--d-fast) var(--ease-out), transform var(--d-fast) var(--ease-out);
}
.phrase:hover { background: var(--mint); }
.phrase.is-speaking { background: var(--ink); color: var(--mint); transform: scale(0.985); }
.phrase.is-speaking .p-ko { color: rgb(231 243 233 / 78%); }
.phrase-text { min-width: 0; flex: 1; }
.phrase .p-foreign { font-weight: 700; font-size: 0.95rem; line-height: 1.4; }
.phrase .p-ko { font-size: var(--text-meta); color: var(--ink-70); margin-top: 2px; }
.phrase .p-speak {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--mint-soft); display: grid; place-items: center;
}
.phrase.is-speaking .p-speak { background: var(--lime); color: var(--ink); }
.phrase svg { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- missa */

.missa-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 18px; display: grid; gap: 10px;
  /* 상단바 높이 + 라우트 진입 애니메이션의 16px 오프셋을 함께 보정한다. */
  scroll-margin-top: calc(var(--topbar-h) + 30px);
}
.missa-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.missa-date { font-weight: 800; font-size: 1rem; }
.missa-liturgy { font-weight: 700; font-size: 0.95rem; line-height: 1.5; }
.missa-refs { display: grid; gap: 6px; font-size: var(--text-meta); }
.missa-refs div { display: flex; gap: 8px; }
.missa-refs b { flex: none; font-weight: 700; color: var(--ink-55); min-width: 56px; }
.missa-summary { font-family: var(--font-serif); font-size: 0.92rem; line-height: 1.8; color: var(--ink-70); background: var(--warm); border-radius: var(--r-control); padding: 12px 14px; }
.missa-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; justify-self: start;
  background: var(--mint-soft); border-radius: var(--r-pill);
  font-size: 0.85rem; font-weight: 700; text-decoration: none;
}
.missa-link:hover { background: var(--ink); color: var(--mint); }

/* ---------------------------------------------------------------- forms & dynamic */

.field-set { display: grid; gap: 10px; }
.input, textarea.input, select.input {
  width: 100%; min-height: 48px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--r-card-sm);
  background: var(--white);
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: rgb(5 25 9 / 42%); }

.write-form { display: grid; gap: 10px; background: var(--mint-soft); border-radius: var(--r-card); padding: 16px; }

.locked-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--warm); border-radius: var(--r-card-sm);
  padding: 14px 16px; font-size: var(--text-meta); line-height: 1.6; color: var(--ink-70);
}
.config-warning { background: var(--yellow); border-radius: var(--r-card-sm); padding: 14px 16px; font-size: var(--text-meta); line-height: 1.6; }
.config-warning code { background: rgb(5 25 9 / 12%); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

.entry-list { display: grid; gap: 12px; }
.entry-card { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; }
.entry-meta { font-size: var(--text-label); letter-spacing: 0.04em; font-weight: 700; color: var(--ink-55); }
.entry-title { font-size: 1.08rem; font-weight: 700; margin: 6px 0 8px; }
.entry-text { font-size: 0.95rem; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.empty-state { text-align: center; padding: 36px 20px; color: var(--ink-55); font-size: var(--text-meta); background: var(--mint-soft); border-radius: var(--r-card); }

.del-btn {
  position: absolute; top: 12px; right: 12px;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--white); font-size: 0.76rem; font-weight: 700; cursor: pointer;
}
body:not(.is-owner) .del-btn { display: none; }

.photo-grid, .video-grid { display: grid; gap: 12px; }
@media (min-width: 620px) { .photo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
.photo-card, .video-card { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.photo-card img { width: 100%; height: auto; }
.video-embed { position: relative; aspect-ratio: 16 / 9; background: var(--ink); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pcap { padding: var(--media-caption-gap) var(--space-4) 0; font-size: 0.92rem; font-weight: 600; }
.pmeta { padding: var(--media-caption-gap) var(--space-4) var(--space-4); font-size: var(--text-label); color: var(--ink-55); }

/* ---------------------------------------------------------------- modal */

.modal-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  width: min(100%, 400px);
  background: var(--mint);
  border-radius: var(--r-card-lg);
  padding: 24px;
  position: relative;
}
.modal h2 { font-size: 1.15rem; margin-bottom: 16px; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.error-text { margin-top: 10px; font-size: var(--text-meta); color: #8f1d1d; min-height: 1.2em; }
.owner-status { font-size: var(--text-meta); color: var(--ink-70); margin-bottom: 14px; word-break: break-all; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  margin-top: var(--section-gap);
  background: var(--ink); color: rgb(231 243 233 / 78%);
  border-radius: var(--r-panel) var(--r-panel) 0 0;
  padding: clamp(2rem, 6vw, 3rem) var(--gutter) clamp(2.5rem, 6vw, 3rem);
  text-align: center;
}
.site-footer .f-brand { color: var(--mint); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }
.site-footer p { font-size: var(--text-meta); margin-top: 8px; line-height: 1.7; }
.site-footer .f-emergency { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.site-footer .f-emergency a, .site-footer .f-emergency span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  background: rgb(231 243 233 / 12%); border-radius: var(--r-pill);
  color: var(--mint); text-decoration: none; font-size: 0.8rem; font-weight: 600;
}

/* ---------------------------------------------------------------- desktop */

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .tabbar, .more-sheet { display: none !important; }
  .deck-nav { display: block; }
  .hero-inner { min-height: 520px; max-width: 780px; }
  #home .wrap { --arch-overlap: 48px; }
  .story-card { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .story-card.is-reverse .story-photos { order: 2; }
  .story-card .story-photos { height: 100%; }
  .story-card .story-photos.is-pair { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .story-card .story-photos img { height: 100%; aspect-ratio: auto; min-height: 240px; }
  .story-body { padding: var(--space-8); align-self: center; }
  .story-card.is-solo { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .kv > div { grid-template-columns: 260px 1fr; }
}

@media (min-width: 1120px) {
  .hero-title { letter-spacing: -0.035em; }
  /* 넓은 화면에서 「스페인·포르투갈 로드 트립」이 한 줄에 들어오도록 폭을 넓힌다. */
  .hero-inner { max-width: 920px; }
}

/* ---------------------------------------------------------------- motion pref */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* 인쇄 시 라우트 전부 노출 */
@media print {
  .topbar, .tabbar, .more-sheet, .site-footer { display: none !important; }
  .route { display: block !important; }
}
