/* ============================================================
   YouTuMap global styles — v5
   디자인 토큰·타이포 유틸·focus-visible·skeleton은 css/tokens.css
   (single source of truth). 이 파일은 var() 참조만 한다.
   ★ raw hex 금지 · font-size는 12/15/22/28px 4값만 허용
     (22 = .text-h1 모바일 단, 서브 타이틀 겸용)
   v5: tokens.css 분리 · 타이포 3단계 · 피드 전폭 그리드 + 무한 스크롤
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: var(--fs-body);
  line-height: 1.55;
  word-break: keep-all;        /* 한글 어절 단위 줄바꿈 */
  line-break: strict;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
::selection { background: var(--brand-tint); }

/* ── SVG 아이콘 유틸 (inc/icons.php 스프라이트) ──
   폰트 크기에 비례(em) — 어디에 넣어도 텍스트와 자동 정렬.
   svg 한정: 기존 이모지 span.ico(plist-item 등)와 충돌 방지 */
svg.ico {
  width: 1.15em; height: 1.15em; flex: none;
  vertical-align: -0.2em;
}
/* 좋아요/저장 on-off 아이콘 스왑 — JS는 .on 클래스만 토글 (기존 로직 유지) */
.ic-sw { display: inline-flex; align-items: center; }
.ic-sw .i-on { display: none; }
.actbtn.on .ic-sw .i-off, .xact.on .ic-sw .i-off, .card .foot button.on .ic-sw .i-off { display: none; }
.actbtn.on .ic-sw .i-on, .xact.on .ic-sw .i-on, .card .foot button.on .ic-sw .i-on { display: inline-block; }

@keyframes ytm-rot { to { transform: rotate(360deg); } }

/* ── 모션 배려 ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---- top nav ---- */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topnav .logo {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px;
  font-weight: 800; font-size: var(--fs-body); color: var(--brand-text); white-space: nowrap;
  letter-spacing: -0.01em;
}
.topnav .logo .logo-mark {
  width: 30px; height: 30px; flex: none;
  filter: drop-shadow(0 1px 2px rgba(28, 28, 30, .18));
}
/* 로고 워드마크: 로고 그라디언트 텍스트 (마크와 동일 톤 — 등록 CTA 레드 계열) */
.topnav .logo .logo-txt {
  background: var(--grad-logo);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* ── topnav 중앙 상시 검색 (cook base.html 스타일 라운드 pill) ── */
.nav-search {
  flex: 1 1 auto; max-width: 480px; margin: 0 auto; min-width: 0;
  display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nav-search:focus-within { border-color: var(--brand); box-shadow: var(--focus-ring); }
.nav-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  padding: 8px 16px; min-height: 38px; font-size: var(--fs-body); color: var(--ink);
}
.nav-search input::placeholder { color: var(--muted); }
.nav-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.nav-search button {
  border: 0; background: var(--bg); color: var(--muted);
  min-width: 52px; align-self: stretch;
  display: inline-flex; align-items: center; justify-content: center;
  border-left: 1px solid var(--line);
  transition: background-color .15s ease, color .15s ease;
}
.nav-search button:hover { background: var(--line); color: var(--ink); }
.nav-search .ico { width: 17px; height: 17px; }
/* 모바일 전용 검색 아이콘 (→ search.php) — 데스크톱은 pill이 담당
   (.nav-right a 규칙보다 특이성 높게 .nav-right 스코프로) */
.nav-right .nav-search-m { display: none; }

.nav-right { display: flex; align-items: center; gap: 10px; font-size: var(--fs-caption); white-space: nowrap; }
.nav-right a { display: inline-flex; align-items: center; min-height: 40px; }
/* 등록 CTA (cook 헤더의 primary 버튼 자리) */
.nav-right .nav-add {
  gap: 5px; padding: 0 16px; min-height: 38px;
  background: var(--brand-cta-bg); color: var(--on-accent);
  border-radius: 999px; font-weight: 700; font-size: var(--fs-caption);
  transition: background-color .15s ease;
}
.nav-right .nav-add:hover { background: var(--brand-cta-hover); }
.nav-right .nav-add .ico { width: 15px; height: 15px; }
/* 우측 아바타 (cook처럼 원형만, 닉네임은 title) */
.nav-right .me { font-weight: 700; border-radius: 50%; }
.nav-right .muted, .lang-toggle { color: var(--muted); }
.lang-toggle {
  border: 1px solid var(--line); padding: 5px 10px; min-height: 30px;
  border-radius: var(--radius-input); font-size: var(--fs-caption); font-weight: 600;
  transition: border-color .15s ease, color .15s ease;
}
.lang-toggle:hover { border-color: var(--line-strong); color: var(--ink); }

main.page { max-width: 720px; margin: 0 auto; padding: calc(var(--nav-h) + 16px) 14px 60px; }
/* 목록(피드) 페이지: 화면 전체 폭 사용 */
main.page.wide { max-width: none; padding-left: 24px; padding-right: 24px; }
main.full { position: fixed; inset: var(--nav-h) 0 0 0; }

/* ---- map ---- */
#map { position: absolute; inset: 0; z-index: 1; }
.map-topbar {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
  transition: right .28s ease;
}
.map-search {
  pointer-events: auto; display: flex; background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--shadow-2); overflow: hidden; max-width: 480px;
}
.map-search input { flex: 1; border: 0; outline: 0; padding: 13px 16px; font-size: var(--fs-body); min-height: var(--btn-h); }
.map-search input::placeholder { color: var(--muted); }
.map-search button {
  border: 0; background: var(--surface); padding: 0 16px; font-size: var(--fs-body); min-width: 48px;
  color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
}
.map-search button:hover { background: var(--bg); color: var(--ink); }
.cat-chips { pointer-events: auto; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cat-chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 8px 14px; font-size: var(--fs-caption); font-weight: 600; white-space: nowrap;
  color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: border-color .15s ease, background-color .15s ease, transform .1s ease;
}
.chip .ico { width: 15px; height: 15px; margin-right: 5px; color: var(--brand-text); }
.chip.on .ico { color: var(--on-accent); }
.chip:hover { border-color: var(--line-strong); }
.chip:active { transform: scale(.97); }
.chip.on { background: var(--ink); color: var(--on-accent); border-color: var(--ink); }
/* 팔로우 필터 칩 — 카테고리와 독립 토글이라 켜짐 색을 브랜드로 구분 */
.chip-follow.on { background: var(--brand-cta-bg); border-color: var(--brand-cta-bg); color: var(--on-accent); }
.chip-follow .ico { width: 14px; height: 14px; }

/* pin */
.pin-marker { display: flex; align-items: center; justify-content: center; }
.pin-marker span {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50% 50% 50% 4px;
  background: var(--surface); border: 2px solid var(--brand);
  font-size: var(--fs-body); transform: rotate(0deg);
  box-shadow: 0 2px 6px rgba(28, 28, 30, .28);
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}
/* 핀 내부 SVG 카테고리 아이콘 (app.js pinIcon — catIcon) */
.pin-marker span .ico {
  width: 16px; height: 16px; vertical-align: 0;
  color: var(--brand-text);
  transition: color .18s ease;
}
.pin-hl span .ico { color: var(--on-accent); }
/* 탭 히트영역 확장: 시각 32px 유지, 실효 타깃 44px (모바일 접근성) */
.pin-marker span::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 44px; height: 44px; transform: translate(-50%, -50%);
  border-radius: 50%;
}
.pin-marker:hover span { transform: scale(1.1); }
/* 패널 장소 칩 hover/focus 시 해당 핀 강조 — 브랜드 배경 반전 + 확대 + 최상위 */
.leaflet-marker-icon.pin-hl { z-index: 100000 !important; }
.pin-hl span {
  transform: scale(1.35);
  background: var(--brand); border-color: var(--surface);
  box-shadow: var(--shadow-2);
}

/* marker cluster — 브랜드 톤 오버라이드 */
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
  background: var(--brand-cluster-bg) !important;
}
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background: var(--brand-cta-bg) !important;
  color: var(--on-accent) !important; font-weight: 700;
}
/* 패널 칩 hover 시 그 장소를 품은 클러스터 강조 (개별 핀이 클러스터에 묶여 안 보일 때) */
.marker-cluster.cluster-hl { z-index: 100000 !important; }
.marker-cluster.cluster-hl div {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px var(--brand), var(--shadow-2);
  transition: transform .15s ease, box-shadow .15s ease;
}

/* 핀 hover 툴팁 (장소명) — 브랜드 톤 */
.leaflet-tooltip.leaflet-tooltip-top {
  background: var(--ink); color: var(--surface);
  border: 0; border-radius: var(--radius-input);
  box-shadow: var(--shadow-2); padding: 5px 10px;
  font-size: var(--fs-caption); font-weight: 700; white-space: nowrap;
}
.leaflet-tooltip-top::before { border-top-color: var(--ink); }

/* Leaflet 줌 컨트롤 — 그림자·라운드만 손질 */
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow-2) !important; border-radius: var(--radius-btn) !important; overflow: hidden; }
.leaflet-right { transition: right .28s ease; }

/* ---- 지도 우측 피드 패널 (데스크톱 전용, .sheet와 동일한 우측 도킹) ----
   z-index 1040: .map-topbar(1000) 위, .sheet(1050) 아래
   상단(topnav 바로 아래)~하단·우측 끝까지 빈틈없이 밀착 (radius 0) */
.feed-panel {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 1040;
  width: var(--panel-w);
  background: var(--surface); border-radius: 0;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  transition: transform .28s ease;
}
.feed-panel.collapsed { transform: translateX(100%); }
.feed-panel.collapsed .panel-resizer { display: none; }

/* ── 좌측 가장자리 리사이즈 핸들 (패널·시트 공용) ── */
.panel-resizer {
  position: absolute; left: 0; top: 0; bottom: 0; width: 7px; z-index: 6;
  cursor: ew-resize; touch-action: none;
  transition: background-color .15s ease;
}
.panel-resizer::after {
  /* 중앙 그립 표시선 — hover 전엔 옅게 */
  content: ""; position: absolute; left: 2px; top: 50%;
  width: 3px; height: 44px; transform: translateY(-50%);
  border-radius: 2px; background: var(--line-strong);
  transition: background-color .15s ease;
}
.panel-resizer:hover, .panel-resizer.dragging { background: var(--brand-tint); }
.panel-resizer:hover::after, .panel-resizer.dragging::after { background: var(--brand); }
/* 리사이즈 중: 텍스트 선택 방지 + iframe 드래그 끊김 방지 + 추종 요소 transition 제거 */
body.ytm-resizing { user-select: none; -webkit-user-select: none; cursor: ew-resize; }
body.ytm-resizing iframe { pointer-events: none; }
body.ytm-resizing .map-topbar, body.ytm-resizing .leaflet-right { transition: none; }
.feed-panel-toggle {
  position: absolute; left: -30px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 72px;
  border: 1px solid var(--line); border-right: 0;
  background: var(--surface); color: var(--muted);
  border-radius: var(--radius-btn) 0 0 var(--radius-btn);
  box-shadow: var(--shadow-2);
  display: flex; align-items: center; justify-content: center;
  transition: color .15s ease, background-color .15s ease;
}
.feed-panel-toggle::before {
  /* 히트 영역 확장 → 실효 터치 타깃 ≥44px */
  content: ""; position: absolute; inset: -8px -14px -8px -8px;
}
.feed-panel-toggle:hover { color: var(--ink); background: var(--bg); }
.feed-panel-toggle .ico { width: 18px; height: 18px; }
.feed-panel.collapsed .feed-panel-toggle .ico { transform: rotate(180deg); }
.feed-panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 11px; border-bottom: 1px solid var(--line);
}
.feed-panel-head h2 {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--fs-body); letter-spacing: -0.01em;
}
.feed-panel-head h2 .ico { color: var(--brand); }
.feed-panel-cnt {
  margin-left: auto; font-size: var(--fs-caption); font-weight: 700; color: var(--muted);
  background: var(--bg); border-radius: 999px; padding: 2px 9px;
}
.feed-panel-list {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 16px 16px;
}
.fp-empty {
  color: var(--muted); font-size: var(--fs-caption); text-align: center; padding: 40px 12px;
}
/* 패널 카드 — 영상 단위 그룹 (16:9 썸네일 + 영상 제목 + 장소 칩 목록) */
.fp-card { display: block; cursor: pointer; margin-bottom: 20px; border-radius: var(--radius-card); }
.fp-thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  transition: box-shadow .25s ease;
}
.fp-thumb:has(img) { animation: none; background: var(--grad-fallback); }
.fp-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .3s ease;
}
.fp-card:hover .fp-thumb { box-shadow: var(--shadow-2); }
.fp-card:hover .fp-thumb img { transform: scale(1.03); }
.fp-badge {
  position: absolute; bottom: 6px; right: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--scrim); color: var(--on-accent);
  font-size: var(--fs-caption); font-weight: 700; padding: 3px 8px; border-radius: 6px;
}
.fp-badge .ico { width: 11px; height: 11px; }
/* 영상 제목 (2줄 클램프) */
.fp-vtitle {
  margin-top: 9px;
  font-size: var(--fs-body); font-weight: 700; line-height: 1.35; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .15s ease;
}
.fp-card:hover .fp-vtitle { color: var(--brand-text); }
/* 썸네일 바로재생 버튼 — 클릭 시 카드 안에서 iframe 재생 (장소 열기와 분리) */
.fp-playbtn {
  position: absolute; inset: 0; margin: auto;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--scrim); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s ease, background-color .15s ease;
}
.fp-playbtn .ico { width: 20px; height: 20px; }
.fp-card:hover .fp-playbtn, .fp-playbtn:focus-visible { opacity: 1; }
.fp-playbtn:hover { background: var(--brand-cta-bg); }
.fp-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ?user= 큐레이터 모드 프로필 카드 (cook _profile_side 스타일 — 박스 없이, 하단 구분선) */
.fp-profile {
  position: relative; text-align: center;
  padding: 14px 16px 16px; border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.fpp-x {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
}
.fpp-x:hover { background: var(--bg); color: var(--ink); }
.fpp-av {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%;
  background: var(--grad-brand); color: var(--on-accent);
  font-size: var(--fs-h1); font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.fpp-nm { font-size: var(--fs-body); font-weight: 800; margin-top: 8px; }
.fpp-bio { font-size: var(--fs-caption); color: var(--muted); margin-top: 4px; line-height: 1.5; word-break: keep-all; }
.fpp-cnts { display: flex; justify-content: center; gap: 16px; margin-top: 10px; font-size: var(--fs-caption); color: var(--muted); }
.fpp-cnts b { color: var(--ink); margin-right: 3px; }
.fp-profile .follow-btn { width: 100%; margin-top: 12px; }

/* 카드 큐레이터 행 (아바타 + 닉네임) */
.fp-cur { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
a.fp-cur:hover .fp-cur-nm { color: var(--brand-text); }
.fp-av {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  background: var(--grad-brand); color: var(--on-accent);
  font-size: var(--fs-caption); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.fp-cur-nm { font-size: var(--fs-caption); color: var(--muted); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-direct .fp-av { margin-left: auto; }
/* 영상 속 장소 칩 목록 */
.fp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fp-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  min-height: 32px; padding: 5px 11px;
  border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
  font-size: var(--fs-caption); font-weight: 600; color: var(--ink); text-align: left;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.fp-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-chip:hover, .fp-chip:focus-visible {
  border-color: var(--brand); background: var(--brand-tint); color: var(--brand-text);
}
/* 직접 등록 장소 (영상 없는 장소) 섹션 */
.fp-sec {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-caption); font-weight: 700; color: var(--muted);
  margin: 18px 0 8px;
}
.fp-sec .ico { color: var(--brand); }
.fp-direct {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px;
  padding: 8px 11px; margin-bottom: 8px; text-align: left;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-card);
  font-size: var(--fs-caption); font-weight: 600; color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease;
}
.fp-direct:hover, .fp-direct:focus-visible { border-color: var(--brand); background: var(--brand-tint); }
.fp-direct .nm { font-weight: 700; font-size: var(--fs-body); }
.fp-direct .sub { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 패널 열림 시 검색바·칩·줌 컨트롤이 패널에 가리지 않게 오른쪽 여백 확보 */
@media (min-width: 641px) {
  main.full:has(.feed-panel:not(.collapsed)) .map-topbar { right: calc(var(--panel-w) + 10px); }
  main.full:has(.feed-panel:not(.collapsed)) .leaflet-right { right: var(--panel-w); }
  /* 데스크톱: topnav 상시 검색이 지도 검색을 대체 — 지도 위 플로팅 검색바 숨김 (중복 금지) */
  .map-search { display: none; }
}

/* ---- detail panel: 데스크톱 = 우측 패널, 모바일 = 바텀시트 ---- */
.sheet {
  position: absolute; top: 0; right: 0; bottom: 0; left: auto; z-index: 1050;
  width: var(--sheet-w); max-width: 92%;
  background: var(--surface); border-radius: 0;
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .25s ease;
}
.sheet.open { transform: translateX(0); }
.sheet-grip { padding: 10px 14px 4px; display: flex; justify-content: flex-end; cursor: pointer; }
.sheet-grip i { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); display: none; }
.sheet-close {
  border: 0; background: var(--bg); color: var(--muted); cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; font-size: var(--fs-body); line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}
.sheet-close:hover { background: var(--line); color: var(--ink); }
.sheet-body { overflow-y: auto; padding: 6px 16px 24px; overscroll-behavior: contain; }
.sheet h2 { font-size: 22px; margin-bottom: 2px; line-height: 1.3; letter-spacing: -0.01em; }
.sheet .addr { color: var(--muted); font-size: var(--fs-caption); margin-bottom: 10px; }
.cat-badge,
.sheet .cat-badge {
  display: inline-block; font-size: var(--fs-caption); font-weight: 700; color: var(--brand-text);
  background: var(--brand-tint); border-radius: 6px; padding: 3px 9px; margin-bottom: 6px;
}
/* 시트 큐레이터 표시 (제목 아래) — 아바타 + 닉네임 + 프로필/큐레이터 지도 링크 */
.sheet-curator {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  margin: 10px 0 2px;
}
.sheet-curator .cu-who {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: var(--fs-body); min-width: 0;
}
.sheet-curator .cu-who:hover .cu-nm { color: var(--brand-text); }
.sheet-curator .cu-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-curator .cu-role { color: var(--muted); font-size: var(--fs-caption); font-weight: 600; flex: none; }
.sheet-curator .ts-btn { margin-left: auto; flex: none; }

.sheet-actions { display: flex; gap: 8px; margin: 10px 0 14px; }
.actbtn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: var(--btn-h);
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-btn);
  padding: 9px 4px; font-size: var(--fs-caption); font-weight: 700; color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .1s ease;
}
.actbtn:hover { border-color: var(--line-strong); background: var(--bg); }
.actbtn:active { transform: scale(.98); }
.actbtn.on { background: var(--brand-cta-bg); border-color: var(--brand-cta-bg); color: var(--on-accent); }
.actbtn.on:hover { background: var(--brand-cta-hover); border-color: var(--brand-cta-hover); }
.sheet h3, .sec-h {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-body); color: var(--muted); margin: 14px 0 8px;
}
.sec-h { margin: 18px 0 10px; font-weight: 700; }

.video-item { margin-bottom: 14px; }
.video-embed {
  position: relative; padding-top: 56.25%; border-radius: var(--radius-card);
  overflow: hidden; background: var(--video-bg);
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: var(--fs-caption); }
.video-meta .ch { font-weight: 700; }
/* 영상에 소개된 장소 칩 (시트) — 클릭 시 해당 타임스탬프로 시간 이동, 현재 장소는 .on */
.vp-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.vp-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  min-height: 30px; padding: 4px 10px;
  border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
  font-size: var(--fs-caption); font-weight: 600; color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.vp-chip .ts { color: var(--brand-text); font-weight: 700; }
.vp-chip:hover, .vp-chip:focus-visible { border-color: var(--brand); background: var(--brand-tint); }
.vp-chip.on { border-color: var(--brand-cta-bg); background: var(--brand-cta-bg); color: var(--on-accent); }
.vp-chip.on .ts { color: var(--on-accent); }
.ts-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px;
  border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-input);
  padding: 4px 10px; font-size: var(--fs-caption); font-weight: 600; white-space: nowrap;
  transition: border-color .15s ease, background-color .15s ease;
}
.ts-btn:hover { border-color: var(--line-strong); background: var(--surface); }

/* ---- v13: cook 포스트 상세 구성의 시트 (임베드→폴백줄→작성자→제목→출처→장소카드→액션바→포스트) ---- */
.sheet-hero { margin-bottom: 4px; }
.sheet-hero .video-embed { margin: 0 -16px; border-radius: 0; } /* 상단 전폭 임베드 */
/* 임베드 폴백 안내줄 */
.embed-note { color: var(--muted); font-size: var(--fs-caption); margin: 8px 0 0; }
.embed-note a { color: var(--brand-text); font-weight: 600; }
.embed-note a:hover { text-decoration: underline; }
/* 작성자(큐레이터) 행 — 아바타 40px + @닉네임 · 상대시간 + 우측 카테고리 배지 */
.sheet-author { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 12px 0 10px; }
.sheet-author .au { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.sheet-author .avatar-sm { width: 40px; height: 40px; }
.sheet-author .nm { font-weight: 700; font-size: var(--fs-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-author .au:hover .nm { color: var(--brand-text); }
.sheet-author .dot, .sheet-author .when { color: var(--muted); font-size: var(--fs-caption); flex: none; }
.sheet-author .cat-badge { margin: 0 0 0 auto; flex: none; }
.sheet h2 .nm-en { color: var(--muted); font-size: var(--fs-caption); font-weight: 400; }
/* 출처 카드 — [유튜브 아이콘] @채널명 채널의 영상 · @큐레이터 큐레이션 ... 원본 보기 ↗ */
.src-card {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-input);
  padding: 9px 12px; margin: 10px 0 0; font-size: var(--fs-caption);
}
.src-card .yt { color: var(--brand); flex: none; }
.src-card .ch { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; max-width: 40%; }
.src-card .sub { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-card .orig { margin-left: auto; flex: none; color: var(--brand-text); font-weight: 700; }
.src-card .orig:hover { text-decoration: underline; }
/* 장소 카드 (cook의 재료 카드 자리) — 라운드 보더 박스 + 칩 랩 목록 */
.place-card { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 12px; margin: 12px 0 0; }
.place-card .pc-h {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-caption); font-weight: 700; color: var(--muted); margin-bottom: 9px;
}
.place-card .pc-h .ico { color: var(--brand); }
.place-card .vp-chips { margin-top: 0; }
/* 액션바 — cook X-스타일 중앙 정렬 아이콘 줄 */
.sheet-xbar {
  display: flex; justify-content: space-around; align-items: center;
  border-top: 1px solid var(--line); padding-top: 6px; margin: 14px 0 2px;
}
.xact {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--btn-h); min-width: 44px; padding: 0 12px;
  border: 0; background: none; border-radius: 999px;
  color: var(--muted); font-size: var(--fs-caption); font-weight: 700;
  transition: color .15s ease, background-color .15s ease, transform .1s ease;
}
.xact:hover { color: var(--brand-text); background: var(--brand-tint); }
.xact:active { transform: scale(.95); }
.xact.on { color: var(--brand-text); }
/* 비로그인 안내줄 */
.login-line { text-align: center; margin: 8px 0 2px; font-size: var(--fs-caption); }
.login-line a { color: var(--muted); font-weight: 700; }
.login-line a:hover { color: var(--brand-text); }

/* ---- cards / feed ---- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 14px; margin-bottom: 12px;
  box-shadow: var(--shadow-1);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--line-strong); }
.card .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: var(--fs-caption); }
.card .head .who { font-weight: 700; }
.card .head .when { color: var(--muted); margin-left: auto; font-size: var(--fs-caption); }
.card .place-line { font-weight: 700; font-size: var(--fs-body); }
.card .place-line small { color: var(--muted); font-weight: 400; }
.card .content { margin: 6px 0; white-space: pre-wrap; }
.card .photos { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.card .photos img {
  height: 120px; border-radius: var(--radius-input);
  background: var(--grad-fallback); object-fit: cover;
}
.card .foot { display: flex; gap: 14px; margin-top: 10px; font-size: var(--fs-caption); color: var(--muted); }
.card .foot button {
  border: 0; background: none; font-size: var(--fs-caption); color: var(--muted); font-weight: 600;
  min-height: 32px; padding: 0 4px;
  transition: color .15s ease;
}
.card .foot button:hover { color: var(--ink); }
.card .foot button.on { color: var(--brand-text); }

/* ---- 피드 그리드 (cook 스타일: 16:9 대형 썸네일 + 아바타 + 2줄 제목) ---- */
.feed-grid {
  display: grid; gap: 24px 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.fcard { display: block; border-radius: var(--radius-card); }
.fcard .fthumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  transition: box-shadow .25s ease;
}
.fcard .fthumb:has(img) { animation: none; background: var(--grad-fallback); }
.fcard .fthumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .3s ease;
}
.fcard:hover .fthumb { box-shadow: var(--shadow-2); }
.fcard:hover .fthumb img { transform: scale(1.03); }
.fcard .fthumb .fkind {
  position: absolute; bottom: 6px; right: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--scrim); color: var(--on-accent);
  font-size: var(--fs-caption); font-weight: 700; padding: 3px 8px; border-radius: 6px;
}
.fcard .fthumb .fkind .ico { width: 11px; height: 11px; }
.fcard .fthumb.fthumb-brand { animation: none; background: var(--grad-brand); }
.fcard .fthumb .fkind-ico {
  /* 썸네일 없는 종류(코스 등) 중앙 아이콘 */
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--on-accent); opacity: .85;
}
.fcard .fthumb .fkind-ico .ico { width: 34px; height: 34px; }
.fcard .frow { display: flex; gap: 10px; margin-top: 10px; align-items: flex-start; }
.favatar {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--grad-brand); color: var(--on-accent);
  font-size: var(--fs-body); font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.fcard .ftxt { min-width: 0; }
.fcard .ftxt h3 {
  font-size: var(--fs-body); font-weight: 700; line-height: 1.35; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .15s ease;
}
.fcard:hover .ftxt h3 { color: var(--brand-text); }
.fcard .fmeta {
  font-size: var(--fs-caption); color: var(--muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fcard .fmeta .cat-badge { margin: 0 4px 0 0; padding: 1px 7px; vertical-align: 1px; }
.fcard .fexcerpt {
  font-size: var(--fs-caption); color: var(--muted); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* 무한 스크롤 sentinel — 로딩 중에만 스피너 노출 */
.feed-more { height: 1px; }
.feed-more.loading {
  height: auto; padding: 24px 0; text-align: center; color: var(--muted);
  font-size: var(--fs-caption);
}
.feed-more.loading::before {
  content: ""; display: block; width: 24px; height: 24px; margin: 0 auto 8px;
  border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%;
  animation: ytm-rot .9s linear infinite;
}

/* 검색 결과: 검색어 매칭 강조 (브랜드 반전) */
.q-hit {
  background: var(--brand-cta-bg); color: var(--on-accent);
  border-radius: 4px; padding: 0 3px;
}

/* ---- forms ---- */
.formbox {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-modal);
  padding: 24px; max-width: 420px; margin: 24px auto;
  box-shadow: var(--shadow-1);
}
.formbox h1 { font-size: 22px; margin-bottom: 16px; line-height: 1.3; letter-spacing: -0.01em; }
.formbox label { display: block; font-size: var(--fs-caption); font-weight: 700; margin: 14px 0 5px; }
.formbox input[type=text], .formbox input[type=email], .formbox input[type=password],
.formbox input[type=url], .formbox textarea, .formbox select,
.inp {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-input);
  padding: 11px 12px; font-size: var(--fs-body); font-family: inherit; outline: 0; background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.formbox input::placeholder, .inp::placeholder, .formbox textarea::placeholder { color: var(--muted); }
.formbox input:focus, .formbox textarea:focus, .formbox select:focus, .inp:focus {
  border-color: var(--brand); box-shadow: var(--focus-ring);
}
.formbox input[type=file] { font-size: var(--fs-caption); padding: 10px 0; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: var(--brand-cta-bg); color: var(--on-accent);
  min-height: var(--btn-h);
  border-radius: var(--radius-btn); padding: 12px 20px; font-size: var(--fs-body); font-weight: 700; width: 100%;
  margin-top: 16px; text-align: center;
  transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--brand-cta-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.sub { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.btn.sub:hover { background: var(--line); }
.btn.sm { width: auto; min-height: 40px; padding: 8px 14px; font-size: var(--fs-caption); margin-top: 0; }
.err { color: var(--brand-text); font-size: var(--fs-caption); margin-top: 10px; font-weight: 600; }
.ok-msg { color: var(--ok); font-size: var(--fs-caption); margin-top: 10px; font-weight: 600; }
.form-foot { margin-top: 14px; font-size: var(--fs-caption); color: var(--muted); text-align: center; }
.form-foot a { color: var(--brand-text); font-weight: 700; }
.form-foot a:hover { color: var(--brand-cta-hover); }

/* ---- video_add extraction UI ---- */
.vprev { display: flex; gap: 12px; margin: 14px 0; }
.vprev img {
  width: 160px; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-card); flex-shrink: 0;
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.vprev .t { font-weight: 700; font-size: var(--fs-body); line-height: 1.4; }
.vprev .c { color: var(--muted); font-size: var(--fs-caption); margin-top: 4px; }
.cand-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-1);
}
.cand-item .nm { font-weight: 700; font-size: var(--fs-body); }
.cand-item .pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cand-opt {
  border: 1px solid var(--line); border-radius: var(--radius-input); padding: 8px 12px;
  min-height: var(--btn-h);
  font-size: var(--fs-caption); background: var(--surface); text-align: left; line-height: 1.4; color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.cand-opt small { color: var(--muted); }
.cand-opt:hover { border-color: var(--brand); }
.cand-opt.on {
  border-color: var(--brand); background: var(--brand-tint); color: var(--brand-dark); font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--brand);
}
.cand-opt.on::before { content: "✓ "; font-weight: 800; }
.cand-opt.on small { color: var(--brand-dark); opacity: .75; }
.cand-item .row2 { display: flex; gap: 8px; margin-top: 10px; align-items: center; font-size: var(--fs-caption); flex-wrap: wrap; }
.cand-item select {
  width: auto; padding: 8px 10px; font-size: var(--fs-caption); min-height: 36px;
  border: 1px solid var(--line); border-radius: var(--radius-input); background: var(--surface);
  font-family: inherit; color: var(--ink);
}
.cand-item .rm {
  margin-left: auto; color: var(--muted); border: 0; background: none; font-size: var(--fs-caption);
  min-height: 36px; padding: 0 6px;
  transition: color .15s ease;
}
.cand-item .rm:hover { color: var(--brand-text); }
.spin { text-align: center; color: var(--muted); padding: 30px 0; font-size: var(--fs-caption); }
.spin::before {
  content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 12px;
  border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%;
  animation: ytm-rot .9s linear infinite;
}

/* §G 접수 안내 배너 (큐 비동기 등록) */
.accept-note {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ok);
  border-radius: var(--radius-card); box-shadow: var(--shadow-1);
  padding: 14px 16px; font-size: var(--fs-body); color: var(--ink); line-height: 1.5;
}
.accept-note .ico { color: var(--ok); }

/* §G 내 등록 작업 목록 */
.job-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow-1);
}
.job-thumb {
  width: 96px; aspect-ratio: 16 / 9; flex: none; overflow: hidden;
  border-radius: var(--radius-input);
  background: var(--grad-fallback);
}
.job-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.job-txt { min-width: 0; flex: 1; }
.job-txt .jt {
  font-weight: 700; font-size: var(--fs-caption); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.job-txt .jb { margin-top: 5px; }
.job-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-caption); font-weight: 700; color: var(--muted);
  background: var(--bg); border-radius: 999px; padding: 3px 10px; min-height: 24px;
}
.job-badge.run { color: var(--brand-text); background: var(--brand-tint); }
.job-badge.ok { color: var(--on-accent); background: var(--ok); }
a.job-badge.ok { min-height: 32px; transition: opacity .15s ease; }
a.job-badge.ok:hover { opacity: .88; }
.job-badge.fail { color: var(--brand-text); background: var(--brand-tint); }
.job-spin {
  width: 12px; height: 12px; flex: none; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--brand);
  animation: ytm-rot .9s linear infinite;
}
.job-retry { flex: none; }

/* ---- profile (§C 2컬럼 + §D 프로필 카드) ---- */
/* [ 게시물 1fr | 세로 구분선(컬럼 전체 높이) | 우측 280px sticky 카드 ] */
.prof-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px;
  gap: 0 32px; align-items: stretch;
  max-width: 1140px; margin: 0 auto;
}
.prof-main { min-width: 0; padding-top: 4px; }
/* 구분선은 컬럼(aside) 자체에 — 카드 높이가 아니라 컬럼 전체 높이 */
.prof-side { border-left: 1px solid var(--line); padding-left: 28px; }
.prof-side-in { position: sticky; top: calc(var(--nav-h) + 20px); }

/* 프로필 카드 — 박스(배경·테두리) 없음 */
.pcard { position: relative; padding-top: 4px; }
.pcard-avatar { width: 80px; height: 80px; font-size: var(--fs-h1); }
.pcard-nm { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin-top: 12px; }
.pcard-bio {
  font-size: var(--fs-caption); color: var(--muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pcard-stats {
  display: flex; gap: 16px; margin-top: 12px;
  font-size: var(--fs-caption); color: var(--muted);
}
.pcard-stats b { color: var(--ink); margin-right: 3px; font-size: var(--fs-body); }
.pcard-stats button {
  border: 0; background: none; padding: 0; min-height: 44px;
  font-size: var(--fs-caption); color: var(--muted); font-weight: inherit;
  transition: color .15s ease;
}
.pcard-stats button:hover { color: var(--ink); }
/* 본인: 2×2 액션 버튼 그리드 */
.pcard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.pcard-grid a, .pcard-grid button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: var(--btn-h);
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-btn);
  padding: 9px 6px; font-size: var(--fs-caption); font-weight: 700; color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease;
}
.pcard-grid a:hover, .pcard-grid button:hover { border-color: var(--line-strong); background: var(--bg); }
/* 프로필 카드: 이 큐레이터의 지도 링크 */
.pcard-maplink {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  min-height: var(--btn-h); margin-top: 10px;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-btn);
  font-size: var(--fs-caption); font-weight: 700; color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease;
}
.pcard-maplink:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-text); }
.pcard-maplink .ico { color: var(--brand); }

/* 우상단 ⋮ 드롭다운 */
.pcard-menu { position: absolute; top: 0; right: 0; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; background: none; border-radius: 50%;
  color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
}
.iconbtn:hover { background: var(--bg); color: var(--ink); }
.iconbtn .ico { width: 20px; height: 20px; }
.dropdown {
  position: absolute; right: 0; top: 46px; min-width: 140px; z-index: 20;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-2); padding: 6px;
}
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 44px; padding: 8px 12px; border: 0; background: none;
  border-radius: var(--radius-input); font-size: var(--fs-body); font-weight: 600; color: var(--ink);
  transition: background-color .15s ease;
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg); }

/* 팔로우 버튼 — 미팔로우 = 회색 / 팔로잉 상태 = 브랜드 */
.follow-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  min-height: var(--btn-h); margin-top: 16px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: var(--radius-btn); font-size: var(--fs-body); font-weight: 700;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.follow-btn:hover { border-color: var(--line-strong); background: var(--line); }
.follow-btn.on { background: var(--brand-cta-bg); border-color: var(--brand-cta-bg); color: var(--on-accent); }
.follow-btn.on:hover { background: var(--brand-cta-hover); border-color: var(--brand-cta-hover); }
.follow-btn.sm-inline { width: auto; margin-top: 10px; padding: 6px 16px; min-height: 40px; font-size: var(--fs-caption); }

/* 모바일/좁은 화면: 프로필 카드가 위, 가로 구분선 아래 목록 */
@media (max-width: 900px) {
  .prof-layout { display: flex; flex-direction: column; }
  .prof-side {
    order: -1; border-left: 0; padding-left: 0;
    border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 18px;
  }
  .prof-side-in { position: static; }
}

.tabbar a .ico { width: 15px; height: 15px; margin-right: 5px; }

.prof-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--on-accent);
  background: var(--grad-brand);
  box-shadow: var(--shadow-1);
}
.prof-head .nm { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.prof-head .stats { color: var(--muted); font-size: var(--fs-caption); margin-top: 3px; }
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabbar a {
  display: inline-flex; align-items: center; min-height: var(--btn-h);
  padding: 10px 14px; font-weight: 700; font-size: var(--fs-body); color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease;
}
.tabbar a:hover { color: var(--ink); }
.tabbar a.on { color: var(--ink); border-color: var(--brand); }
.mini-map { height: 260px; border-radius: var(--radius-card); margin-bottom: 14px; z-index: 1; box-shadow: var(--shadow-1); }
.plist-item {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 10px 12px; margin-bottom: 8px; min-height: 56px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.plist-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.plist-item .ico { font-size: 22px; }
.plist-item .ico-cell { display: flex; align-items: center; color: var(--muted); font-size: var(--fs-body); }
.plist-item .ico-cell .ico { width: 20px; height: 20px; }
.plist-item .ico-cell.cat { color: var(--brand-text); }  /* 카테고리 아이콘은 브랜드 톤 */
.plist-item .nm { font-weight: 700; font-size: var(--fs-body); }
.plist-item .sub { color: var(--muted); font-size: var(--fs-caption); }
.plist-item .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(28, 28, 30, .92); color: var(--on-accent); padding: 11px 18px; border-radius: 999px;
  font-size: var(--fs-caption); font-weight: 600; z-index: 2000; opacity: 0; transition: opacity .2s;
  pointer-events: none; box-shadow: var(--shadow-2); max-width: 90vw;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; }

/* ---- 공용 모달 (§E — inc/footer.php #modal) ----
   z-index 1500: sheet(1050)·topnav(1100) 위, toast(2000) 아래 */
#modal {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
#modal[hidden] { display: none; }
.modal-scrim { position: absolute; inset: 0; background: var(--scrim); }
.modal-card {
  position: relative; width: 100%; max-width: 420px;
  max-height: min(82vh, 640px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--radius-modal);
  box-shadow: var(--shadow-3); padding: 22px 20px 20px;
}
.modal-x {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--bg); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}
.modal-x:hover { background: var(--line); color: var(--ink); }
body.modal-open { overflow: hidden; }
.modal-title {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--fs-body); font-weight: 800; letter-spacing: -0.01em;
  margin-bottom: 12px; padding-right: 36px;
}
.modal-title .ico { color: var(--brand); }
.confirm-msg { font-size: var(--fs-body); line-height: 1.5; padding: 6px 36px 4px 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.modal-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  min-height: var(--btn-h); padding: 10px 12px;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-input);
  font-size: var(--fs-body); font-weight: 600; text-align: left; color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease;
}
.modal-item:hover { border-color: var(--brand); background: var(--brand-tint); }
.modal-item .ico { color: var(--muted); }
.modal-newrow { display: flex; gap: 8px; margin-top: 12px; }
.modal-empty { color: var(--muted); font-size: var(--fs-caption); padding: 18px 0; text-align: center; }
.modal-form label { display: block; font-size: var(--fs-caption); font-weight: 700; margin: 12px 0 5px; }
.modal-form .chk { display: flex; align-items: center; gap: 7px; font-size: var(--fs-body); font-weight: 600; margin-top: 14px; min-height: 44px; }
.modal-form .chk input { width: 17px; height: 17px; accent-color: var(--brand-cta-bg); }
.avatar-sm {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--grad-brand); color: var(--on-accent);
  font-size: var(--fs-body); font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

/* 아바타 이미지 (avatar_html 공통) — 이미지가 이니셜을 덮고, onerror로 img 제거 시 이니셜 폴백 노출 */
.avatar-img { position: relative; overflow: hidden; }
.avatar-img img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%; display: block;
}
/* topnav 아바타 (원형만 — 닉네임은 title 툴팁) */
.nav-av { width: 32px; height: 32px; font-size: var(--fs-caption); }

/* ---- place 상세 3컬럼 (§B) ----
   xl(≥1200): [본문 ≤760 | 관련 그리드 | 우측 280 sticky] / md~xl: [본문 | 우측 280] / ≤900: 본문만 → 우측 카드는 아래로 */
.place-layout {
  display: grid; grid-template-columns: minmax(0, 760px) minmax(0, 1fr) 280px;
  gap: 0 36px; align-items: start;
}
.place-main { min-width: 0; }
.place-related { min-width: 0; }
.place-related .sec-h { margin-top: 4px; }
.rel-grid {
  display: grid; gap: 20px 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.rel-grid .ftxt h3 { font-size: var(--fs-body); }
.place-side { min-width: 0; }
.place-side-in {
  position: sticky; top: calc(var(--nav-h) + 20px);
  display: flex; flex-direction: column; gap: 12px;
}
.side-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 16px; box-shadow: var(--shadow-1);
}
.side-card .sc-head {
  display: flex; align-items: center; gap: 9px;
  font-size: var(--fs-body); font-weight: 700; min-width: 0;
}
.side-card .sc-head .ico { color: var(--brand); flex: none; }
.side-card .sc-head .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-card .sc-sub { font-size: var(--fs-caption); color: var(--muted); margin-top: 4px; }
.side-card .sc-bio { font-size: var(--fs-caption); color: var(--muted); margin-top: 8px; line-height: 1.5; }
.side-card .btn.sm { width: 100%; margin-top: 12px; }
@media (max-width: 1199px) {
  .place-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .place-related { display: none; }  /* md~xl: 가운데 관련 그리드 생략 */
}
@media (max-width: 900px) {
  .place-layout { display: block; }
  .place-side-in { position: static; margin-top: 28px; }
}

@media (max-width: 640px) {
  .topnav { gap: 8px; padding: 0 10px; }
  .topnav .logo .logo-mark { width: 26px; height: 26px; }
  .topnav .logo { flex: 1; }
  /* 모바일: 중앙 pill 대신 검색 아이콘만 (→ search.php). 지도는 기존 .map-search 유지 */
  .nav-search { display: none; }
  /* 등록 CTA: 모바일은 아이콘만 */
  .nav-right .nav-add { padding: 0; width: 40px; min-height: 40px; justify-content: center; }
  .nav-right .nav-add .lbl { display: none; }
  .nav-right .nav-add .ico { width: 18px; height: 18px; }
  .nav-right .nav-search-m {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; min-height: 40px; border-radius: 50%; color: var(--muted);
    transition: background-color .15s ease, color .15s ease;
  }
  .nav-search-m:hover { background: var(--bg); color: var(--ink); }
  .nav-search-m .ico { width: 19px; height: 19px; }
  /* 모바일: 피드 패널 미표시 (바텀시트 UX 유지) */
  .feed-panel { display: none; }
  /* 피드 그리드 좌우 여백 축소 */
  main.page.wide { padding-left: 14px; padding-right: 14px; }
  /* 터치 타깃 ≥44px */
  .chip { min-height: 44px; padding: 10px 15px; }
  .btn.sm { min-height: 44px; }
  .ts-btn { min-height: 36px; }
  .formbox { padding: 18px 16px; }
  /* 모바일: 리사이즈 미적용 (바텀시트 유지) */
  .panel-resizer { display: none; }
  /* 모바일: 바텀시트로 복귀 */
  .sheet {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none;
    max-height: 78%; border-radius: var(--radius-modal) var(--radius-modal) 0 0;
    box-shadow: 0 -12px 36px rgba(28, 28, 30, .20);
    transform: translateY(105%);
  }
  .sheet.open { transform: translateY(0); }
  .sheet-grip { justify-content: center; padding: 10px 0 4px; }
  .sheet-grip i { display: block; }
  .sheet-close { display: none; }
  .sheet-body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
