/* =============================================================
   G.Spec — Design System
   Pretendard · Modern editorial · light, restrained, intentional
   (no purple/blue gradients, no neon glow — single warm accent)
   ============================================================= */

/* 동적 서브셋 가변폰트 — 사용 글자만 내려받아 용량↓, jsdelivr 장기 캐시 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css");

:root {
  --paper: #FBFAF9;
  --surface: #FFFFFF;
  --surface-2: #F3F2EF;
  --ink: #17171C;
  --ink-2: #5B5B63;
  --ink-3: #73737B;           /* 대비 강화: 종이 위 ~4.4:1 (WCAG AA). 이전 #9A9AA2는 2.6:1 미달이었음 */
  --line: #E8E6E1;
  --line-strong: #D8D5CE;

  --accent: #FF4D2E;          /* persimmon — the only brand color */
  --accent-press: #E33C1F;
  --accent-soft: #FFEDE7;

  /* 의미색(상태) 토큰 — 강조색과 명확히 구분. 하드코딩 #e5484d/#1B8A4B 대체 */
  --danger: #E5484D;  --danger-soft: #FDECEC;
  --ok: #1B8A4B;      --ok-soft: #E7F6EC;
  --like: #e8466e;    --like-soft: #fdeef3;   /* 좋아요·하트 핑크 — 전 페이지 통일 */
  --live: #28C46F;                          /* '진행중' 맥동 닷 — ok(짙은 초록)와 구분되는 밝은 라이브 그린 */

  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-card: 14px; --r-pill: 999px;
  --sh-sm: 0 1px 2px rgba(20,20,25,0.05), 0 2px 6px rgba(20,20,25,0.06);
  --sh-md: 0 6px 16px rgba(20,20,25,0.08), 0 16px 36px rgba(20,20,25,0.09);
  --sh-lg: 0 18px 50px rgba(20,20,25,0.12);

  /* 타입 스케일 — 임의 0.5px 남발 대신 단계 토큰 */
  --fs-3xs: 11px; --fs-2xs: 12px; --fs-xs: 13px; --fs-sm: 14px; --fs-base: 15px; --fs-lg: 16px;
  --fs-h3: 18px; --fs-h2: 24px; --fs-h1: 28px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --t-fast: 160ms; --t: 280ms; --t-slow: 460ms;
  --maxw: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* 모바일에서 링크·이미지·버튼 탭 시 나타나는 파란 하이라이트 제거 */
a, button, img, [role="button"], input, textarea, label, .post, .card { -webkit-tap-highlight-color: transparent; }
/* 세로 스크롤바를 항상 표시 → 추천순/실시간순처럼 글 양에 따라 스크롤바가 생겼다 사라지며
   페이지 폭이 출렁이는 문제 방지(클래식 스크롤바 OS). 오버레이 스크롤바(macOS/모바일)에선 레이아웃 영향 없음. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-y: scroll; }
body {
  font-family: "Pretendard Variable", "Pretendard", -apple-system, system-ui, sans-serif;
  background: var(--paper); color: var(--ink);
  line-height: 1.55; letter-spacing: -0.011em; min-height: 100vh;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
/* HDR(게인맵) 이미지를 표준 밝기(SDR)로 강제 — 피드 등에서 '눈뽕' 방지. 기존 이미지에도 즉시 적용 */
img, video, canvas { dynamic-range-limit: standard; }
img { max-width: 100%; display: block; }

/* 키보드 포커스 가시화 — 마우스 클릭엔 안 뜨고 Tab 이동 시에만(focus-visible) */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, label:focus-visible,
.nav-icon:focus-visible, .topbar-bell:focus-visible, .pf-icon-btn:focus-visible,
.tabbar a:focus-visible, .chip:focus-visible, .cat:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm);
}
.input:focus-visible { outline: none; }   /* 입력칸은 자체 포커스 링(accent-soft) 사용 */

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.accent { color: var(--accent); }
.muted { color: var(--ink-2); }
/* 페이지 상단 뒤로가기 링크 — 전 페이지 통일 (아이콘 arrow-left 고정) */
.back-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2);
  font-weight: 650; margin-bottom: 14px; text-decoration: none; transition: color var(--t-fast); }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 16px; height: 16px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 0; font-weight: 800; font-size: 20px;
  letter-spacing: -0.04em; color: var(--ink); }
/* 마크: 워드마크의 'G'를 반복하지 않고, 브랜드 점(persimmon dot) 모티프를 칩으로 */
.brand .mark { width: 28px; height: 28px; border-radius: var(--r-md); background: var(--accent);
  display: grid; place-items: center; margin-right: 9px; flex: none; }
.brand .mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.brand b { color: var(--accent); }   /* the dot in G.Spec */

/* ── 헤더 3구역: [전체메뉴·검색] — 로고 — [알림·우측메뉴] (PC·모바일 동일) ── */
.tb-side { display: flex; align-items: center; gap: 2px; }
.tb-right { position: relative; }
.hdr-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; position: relative;
  border-radius: var(--r-md); color: var(--ink-2); cursor: pointer; background: transparent; border: 0; padding: 0;
  text-decoration: none; transition: color var(--t-fast), background var(--t-fast); }
.hdr-icon:hover, .hdr-icon.on { color: var(--ink); background: var(--surface-2); }
.hdr-icon svg { width: 22px; height: 22px; }

/* 우측 메뉴 드롭다운 (햄버거) */
.nav-backdrop { display: none; position: fixed; inset: 0; z-index: 190; }
.nav-toggle-cb:checked ~ .nav-backdrop { display: block; }
.nav-links { display: none; position: absolute; top: 48px; right: 0; z-index: 200; flex-direction: column;
  min-width: 196px; padding: 6px; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-md);
  animation: agPop .16s ease; }
.nav-toggle-cb:checked ~ .nav-links { display: flex; }
.nav-links a { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 650; color: var(--ink-2); text-decoration: none;
  transition: color var(--t-fast), background var(--t-fast); }
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.on { color: var(--accent); }
.nav-links a svg { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.nav-links a.on svg { color: var(--accent); }
.nav-cnt { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px;
  padding: 1px 7px; font-size: 11px; font-weight: 800; }

.appgrid-backdrop { display: none; position: fixed; inset: 0; z-index: 140; background: rgba(0,0,0,.18); }
.appgrid { display: none; position: fixed; top: 60px; left: 12px; z-index: 150;
  width: min(320px, calc(100vw - 24px)); padding: 12px;
  grid-template-columns: repeat(3, 1fr); gap: 8px; }
.appgrid-cb:checked ~ .appgrid-backdrop { display: block; }
.appgrid-cb:checked ~ .appgrid { display: grid; animation: agPop .16s ease; }
@keyframes agPop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
/* 데스크톱: 그리드 좌측을 메뉴 버튼(본문 칼럼 좌측 경계)에 정렬 → 안쪽으로 펼쳐지게 */
@media (min-width: 761px) {
  .appgrid { left: calc((100vw - 680px) / 2 + 22px); }
}

/* 피드 상단 투게더택시 배너 (1시간 내 생성된 팟) */
.taxi-feed { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.taxi-feed-item { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: var(--r-md);
  background: rgba(232,70,110,.06); border: 1px solid var(--line); text-decoration: none;
  font-size: 13.5px; color: var(--ink); transition: background var(--t-fast); }
.taxi-feed-item:hover { background: rgba(232,70,110,.12); }
.taxi-feed-item > svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.taxi-feed-item .tx-line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taxi-feed-item .tx-line b { font-weight: 800; }
.taxi-feed-item .tx-ago { font-size: 11.5px; color: var(--ink-3); flex: none; }

.ag-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  aspect-ratio: 1 / 1; border-radius: var(--r-md); background: var(--surface-2);
  color: var(--ink-2); font-size: 12.5px; font-weight: 700; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; position: relative;
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.ag-item:hover { background: var(--surface); color: var(--ink); border-color: var(--line);
  transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.ag-item.on { background: var(--accent); color: #fff; }
.ag-item .ag-ic { position: relative; display: grid; place-items: center; }
.ag-item .ag-ic svg { width: 25px; height: 25px; }
.ag-item .ag-tx { line-height: 1; white-space: nowrap; }
.ag-item .ico-badge { position: absolute; top: -7px; right: -11px; }

/* ---------- Buttons ---------- */
/* 표준 버튼 — 전 페이지 공통 높이/정렬 (디자인 시스템) */
.btn { font-family: inherit; cursor: pointer; border: 1px solid transparent; font-weight: 650;
  font-size: 15px; height: 44px; padding: 0 22px; border-radius: var(--r-md); background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box; white-space: nowrap;
  transition: transform var(--t-fast) var(--spring), box-shadow var(--t) var(--ease), background var(--t-fast); }
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-press); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Inputs ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 7px; }
.input { width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  padding: 13px 15px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast); outline: none; }
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 52px; }

.notice { font-size: 14px; padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 14px; }
.notice.err { background: var(--accent-soft); color: var(--accent-press); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Frosted header (subtle glass — the only glass) ---------- */
.topbar { position: sticky; top: 0; z-index: 100; height: 64px; display: flex; align-items: center;
  justify-content: space-between; padding: 0;
  /* 헤더 내용(로고·메뉴)을 본문 콘텐츠(680px 칼럼, 좌우 22px)와 동일하게 정렬 → 좌/우 여백 일치 */
  padding-inline: calc(max(0px, (100% - 680px) / 2) + 22px);
  background: rgba(251,250,249,0.72); backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%); border-bottom: 1px solid var(--line); }
/* 헤더 우측 그룹 (알림 종 + 메뉴) */
.topbar-right { display: flex; align-items: center; gap: 2px; }
/* 별도 알림 종: 데스크톱은 메뉴 안(.nav-bell)에 두고 이건 숨김. 모바일은 햄버거 좌측에 표시 */
.topbar-bell { display: none; position: relative; place-items: center; width: 40px; height: 40px;
  border-radius: var(--r-md); color: var(--ink-2); flex: none; transition: color var(--t-fast), background var(--t-fast);
  background: transparent; border: none; padding: 0; cursor: pointer; }
.topbar-bell:hover, .topbar-bell.on { color: var(--ink); background: var(--surface-2); }
.topbar-bell svg { width: 22px; height: 22px; }
/* 알림·계정 아이콘 메뉴: 데스크톱은 아이콘만, 모바일 드롭다운은 아이콘+텍스트 */
.topbar .nav-links .nav-icon { display: inline-flex; align-items: center; gap: 8px; position: relative;
  font: inherit; color: var(--ink-2); background: transparent; border: none; padding: 8px 11px;
  border-radius: var(--r-sm); cursor: pointer; transition: color var(--t-fast), background var(--t-fast); }
.topbar .nav-links .nav-icon:hover, .topbar .nav-links .nav-icon.on { color: var(--ink); background: var(--surface-2); }
.nav-icon svg { width: 19px; height: 19px; }
.nav-icon .nav-ico-txt { display: none; }
@media (max-width: 760px) { .nav-icon .nav-ico-txt { display: inline; } }
/* 데스크톱 전용 아이콘 스트립 / 모바일 전용 텍스트 항목 */
.nav-mobile-item { display: none; }
/* 계정 드롭다운 (사람 아이콘) */
.nav-acct { position: relative; display: inline-flex; }
.acct-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 168px; z-index: 210;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-md);
  padding: 6px; display: flex; flex-direction: column; gap: 2px; animation: modal-pop .18s var(--spring); }
.acct-menu[hidden] { display: none; }
.acct-menu a { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 650; color: var(--ink-2); transition: color var(--t-fast), background var(--t-fast); }
.acct-menu a:hover { color: var(--ink); background: var(--surface-2); }
.acct-menu a svg { width: 17px; height: 17px; color: var(--ink-3); }
/* 설정 그룹 (프로필 편집 — 알림 / 공개 범위) */
.set-group { margin: 4px 0 18px; padding: 2px 16px; background: var(--surface, #fff);
  border: 1px solid var(--line); border-radius: var(--r-lg, 16px); }
.set-glabel { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); padding: 13px 0 5px; }
/* 설정 토글 행 */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: none; }
.switch-row .sw-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-row .sw-title { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.switch-row .sw-desc { font-size: 12px; font-weight: 500; color: var(--ink-3); line-height: 1.45; }
/* iOS풍 토글 스위치 */
.toggle { position: relative; flex: none; width: 50px; height: 30px; }
.toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.toggle-track { position: absolute; inset: 0; border-radius: 999px; background: #D9D5CE;
  transition: background .26s cubic-bezier(.4,0,.2,1); }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22);
  transition: transform .26s cubic-bezier(.4,0,.2,1); }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }
/* 알림 목록 */
.noti-list { display: flex; flex-direction: column; }
.noti-item { display: flex; align-items: center; gap: 12px; padding: 13px 10px; border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease); }
.noti-item:hover { background: var(--surface-2); }
.noti-item.unread { background: var(--accent-soft); }
.noti-item .avatar { width: 42px; height: 42px; font-size: 16px; flex: none; }
.noti-main { min-width: 0; flex: 1; }
.noti-body { font-size: 14px; color: var(--ink); line-height: 1.45; }
.noti-item:not(.unread) .noti-body { color: var(--ink-2); }
.noti-time { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.noti-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
/* 알림 개별 삭제 X (행 우측, 항목과 겹치지 않게 여백 확보) */
.noti-row { position: relative; }
.noti-row .noti-item { padding-right: 38px; }
.noti-del { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); z-index: 1;
  width: 26px; height: 26px; border-radius: var(--r-sm); border: none; background: transparent;
  color: var(--ink-3); cursor: pointer; display: grid; place-items: center;
  transition: color var(--t-fast), background var(--t-fast); }
.noti-del:hover { color: var(--danger); background: var(--danger-soft); }
.noti-del svg { width: 15px; height: 15px; }
/* 전체 삭제 — 페이지 헤더의 작은 보조 버튼 */
.noti-clear-all { display: inline-flex; align-items: center; gap: 5px; flex: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 650; color: var(--ink-2);
  background: none; border: 1px solid var(--line); padding: 7px 12px; border-radius: var(--r-md);
  transition: all var(--t-fast) var(--ease); }
.noti-clear-all svg { width: 15px; height: 15px; }
.noti-clear-all:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.noti-clear-all:disabled { opacity: .5; cursor: default; }

/* ---------- Segmented control with sliding indicator ---------- */
.segment { position: relative; display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-2);
  border-radius: var(--r-md); border: 1px solid var(--line); }
.segment button { position: relative; z-index: 1; font-family: inherit; cursor: pointer; border: none;
  background: transparent; color: var(--ink-2); font-weight: 700; font-size: 14px; padding: 8px 20px;
  border-radius: var(--r-xs); transition: color var(--t) var(--ease); }
.segment button.on { color: #fff; }
.segment .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: var(--r-xs);
  background: var(--ink); transition: left var(--t) var(--spring), width var(--t) var(--spring); }

/* ---------- Cards / surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--sh-sm); transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease); }

/* ---------- Chips / tags ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 7px 13px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line-strong); transition: all var(--t-fast) var(--ease); cursor: pointer; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Category filter bar (메뉴를 하나의 상자로) ---------- */
.catbar { display: flex; gap: 2px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.catbar::-webkit-scrollbar { height: 0; }
.catbar .cat { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
  font-size: 14px; font-weight: 650; color: var(--ink-2); padding: 8px 13px; border-radius: var(--r-xs);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.catbar .cat:hover { color: var(--ink); background: rgba(20,20,25,0.05); }
.catbar .cat.on { background: var(--ink); color: #fff; }
.catbar .cat svg { width: 15px; height: 15px; }

/* =================== AUTH (login gate) =================== */
/* 로그인 페이지: 실제 보이는 화면 높이(dvh)에 딱 맞춰 중앙 정렬 + 페이지 스크롤 고정 */
body.login { overflow: hidden; }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login .auth { height: 100dvh; }
.login .auth-panel { overflow-y: auto; }   /* 폼이 화면보다 길면 패널 안에서만 스크롤 */
.auth-brand { position: relative; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--ink); color: #fff; overflow: hidden; }
.auth-brand .big { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.08; }
.auth-brand .big b { color: var(--accent); }
.auth-brand .lead { color: rgba(255,255,255,0.66); font-size: 16px; max-width: 380px; margin-top: 16px; }
.auth-brand .feat { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.auth-brand .feat div { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,0.8); font-size: 15px; }
.auth-brand .feat .ic { width: 34px; height: 34px; border-radius: var(--r-lg); background: rgba(255,255,255,0.08);
  display: grid; place-items: center; font-size: 16px; flex: none; }
.auth-brand .mesh { position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px;
  border-radius: 50%; background: var(--accent); opacity: 0.16; filter: blur(8px); }
.auth-brand .ring { position: absolute; right: -60px; top: 40px; width: 220px; height: 220px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12); }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--paper); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-2); font-size: var(--fs-sm); margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--ink-2); }
.auth-switch a { color: var(--accent); font-weight: 700; cursor: pointer; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 22px; background: var(--surface-2); padding: 4px;
  border-radius: var(--r-md); border: 1px solid var(--line); }
.auth-tabs button { flex: 1; font-family: inherit; cursor: pointer; border: none; background: transparent;
  color: var(--ink-2); font-weight: 700; font-size: 14px; padding: 9px; border-radius: var(--r-xs); transition: all var(--t) var(--ease); }
.auth-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }

/* =================== APP SHELL (feed/profile) =================== */
.shell { max-width: 680px; margin: 0 auto; padding: 22px; }
.rail { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 14px; }
.menu { padding: 10px; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 650; font-size: 15px; transition: all var(--t-fast) var(--ease); }
.menu a:hover { background: var(--surface-2); color: var(--ink); }
.menu a.on { background: var(--ink); color: #fff; }
.menu a .ico { width: 20px; text-align: center; font-size: 18px; }

.panel { padding: 18px; }
.panel h4 { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 12px; }
.trend a { display: block; padding: 8px 4px; transition: opacity var(--t-fast); }
.trend a:hover { opacity: .65; }
.trend .t { display: block; color: var(--ink); font-weight: 700; font-size: var(--fs-sm); }
.trend .t em { color: var(--accent); font-style: normal; }
.trend .c { color: var(--ink-3); font-size: var(--fs-2xs); }

.feed-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.feed-head { display: flex; align-items: center; justify-content: flex-start; gap: 16px; flex-wrap: wrap; }
/* 상단 글쓰기 버튼이 FAB로 빠진 뒤, 제목과 정렬탭을 좌측에 붙여 넓은 화면에서도 벌어지지 않게 */
/* 새 글 알림 플로팅 알약 (헤더 아래 중앙 고정) */
.feed-newpill { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 17px; border-radius: var(--r-pill);
  box-shadow: var(--sh-md); font-size: 14px; animation: modal-pop .22s var(--spring); white-space: nowrap; }
.feed-newpill svg { width: 15px; height: 15px; }
@media (max-width: 600px) { .feed-newpill { top: 70px; } }
/* 모든 페이지 제목 공통 스타일 (피드/탐색/모임/이쪽맵/검색/태그) */
.page-title, .feed-head h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.03em; }

.compose { padding: 16px 18px; display: flex; gap: 12px; }
.compose .body { flex: 1; min-width: 0; }
.compose-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.compose-tools { display: flex; gap: 12px; color: var(--ink-3); font-size: 18px; }
.compose-tools span { cursor: pointer; transition: color var(--t-fast); }
.compose-tools span:hover { color: var(--accent); }
.compose-tools .tool-loc.active { color: var(--accent); }

/* ---------- Post ---------- */
.post { padding: 16px 18px; }
.post + .post { margin-top: 0; }
.post-head { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; background: var(--surface-2);
  color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 16px;
  border: 1px solid var(--line); overflow: hidden; }
.post-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.post-meta .name { font-weight: 700; font-size: 15px; }
.post-meta .handle { color: var(--ink-3); font-size: 13px; }
.post-body { font-size: var(--fs-base); color: var(--ink); white-space: pre-wrap; word-break: break-word; margin-bottom: 12px; }
.post-body .tag { color: var(--accent); font-weight: 600; }
.post-actions { display: flex; gap: 20px; color: var(--ink-3); font-size: var(--fs-xs); }
.post-actions button { font-family: inherit; background: none; border: none; cursor: pointer; color: inherit;
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); transition: color var(--t-fast); padding: 0; }
.post-actions button:hover { color: var(--accent); }
.post-actions button.on { color: var(--accent); font-weight: 700; }

.empty { text-align: center; color: var(--ink-3); padding: 48px 20px; font-size: 15px; }
.empty svg { width: 30px; height: 30px; }

/* 게시글 첨부 이미지 / 위치 */
.post-img { width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--r-sm);
  border: 1px solid var(--line); margin-bottom: 12px; }
.post-loc { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.post-loc svg { width: 14px; height: 14px; }
.post-loc .post-dist { color: var(--accent); font-weight: 700; }
.post-loc a.post-hotname { color: var(--accent); font-weight: 800; text-decoration: none; cursor: pointer; }
.post-loc a.post-hotname:hover { text-decoration: underline; }
.post-loc .post-hotname + .post-dist { color: var(--ink-3); font-weight: 600; }

/* 피드 카드 우측 팔로우/팔로잉 버튼 — 작게·덜 둥글게, 두 상태에 약간의 구분감 */
.post-head .post-follow { flex: none; align-self: center; margin-left: auto; height: 28px; padding: 0 12px; font-size: 12px; font-weight: 600;
  border-radius: 8px; white-space: nowrap; box-shadow: none; border: 1px solid var(--line); }
/* 팔로우(아직 안 함) — 살짝 강조: 연한 주황 배경 + 주황 글씨 */
.post-head .post-follow.btn-accent { background: var(--accent-soft); color: var(--accent-press); border-color: transparent; }
.post-head .post-follow.btn-accent:hover { background: #FFE0D4; color: var(--accent-press); transform: none; box-shadow: none; }
/* 팔로잉(함) — 차분한 회색 */
.post-head .post-follow.btn-ghost { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }
.post-head .post-follow.btn-ghost:hover { background: var(--line); color: var(--ink-2); transform: none; box-shadow: none; }

/* 프로필 아바타 — 클릭 시 크게 보기 */
.pf-avatar img { cursor: zoom-in; }

/* 게시글 이미지 — 피드·상세 동일: 한 줄에 균등 배치 (그리드 1행, 이미지 수만큼 칸) */
.post-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px;
  margin-bottom: 12px; border-radius: var(--r-sm); overflow: hidden; }
.post-gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--surface-2); }
/* 유튜브 임베드 (본문 링크 자동 인식) — 반응형 16:9 */
.post-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin-bottom: 12px;
  border-radius: var(--r-sm); overflow: hidden; background: #000; border: 1px solid var(--line); }
.post-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-gallery[data-n="1"] img { aspect-ratio: 16 / 10; max-height: 460px; }
/* 상세(.post-detail): 이미지 클릭 시 전체화면 */
.post-detail .post-gallery img { cursor: zoom-in; transition: transform var(--t-fast) var(--ease); }
.post-detail .post-gallery img:hover { transform: scale(1.02); }

/* 이미지 전체화면 라이트박스 */
.lightbox { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center;
  background: rgba(10,10,12,0.93); animation: ov-fade .18s var(--ease); }
.lightbox.on { display: flex; }
.lightbox .lb-img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: var(--r-sm); user-select: none; -webkit-user-drag: none; }
.lb-close, .lb-prev, .lb-next { position: absolute; background: rgba(255,255,255,0.13); color: #fff; border: none;
  cursor: pointer; display: grid; place-items: center; border-radius: 50%; transition: background var(--t-fast); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.28); }
.lb-close { top: calc(16px + env(safe-area-inset-top)); right: 16px; width: 44px; height: 44px; z-index: 1; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
.lb-close svg, .lb-prev svg, .lb-next svg { width: 24px; height: 24px; }
.lb-count { position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; font-weight: 600; background: rgba(0,0,0,0.45); padding: 5px 12px; border-radius: 999px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next, .lightbox.single .lb-count { display: none; }

/* 글쓰기 모달 — 첨부 미리보기 그리드 */
.compose-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; margin-top: 12px; }
/* 수정 모드: 이미지/위치/설문 도구는 숨기고 본문(텍스트)만 편집 (edit_post는 본문만 변경) */
#composeModal.editing .tool-image,
#composeModal.editing .tool-loc,
#composeModal.editing .tool-poll,
#composeModal.editing .compose-gallery,
#composeModal.editing .compose-poll,
#composeModal.editing .compose-loc { display: none !important; }
.cg-cell { position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.cg-cell img { width: 100%; height: 100%; object-fit: cover; }
.cg-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(20,20,25,0.6); color: #fff; display: grid; place-items: center; transition: background var(--t-fast); }
.cg-x:hover { background: rgba(20,20,25,0.88); }
.cg-x svg { width: 13px; height: 13px; }

/* ---------- Delete + Edit + Comments ---------- */
.post-own { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.post-del, .post-edit, .post-report { background: none; border: none; color: var(--ink-3); cursor: pointer;
  font-size: 15px; padding: 4px 7px; border-radius: var(--r-md); transition: all var(--t-fast) var(--ease); flex: none; }
.post-del:hover { color: var(--accent); background: var(--accent-soft); }
.post-edit:hover { color: var(--ink); background: var(--surface-2); }
.post-report svg { width: 15px; height: 15px; }
.post-report:hover { color: var(--danger); background: var(--danger-soft); }
/* 관리자가 타인 글을 삭제하는 버튼 — danger 토큰으로 구분 */
.post-del.admin { color: var(--danger); }
.post-del.admin:hover { color: #fff; background: var(--danger); }
.post-del svg, .post-edit svg { width: 15px; height: 15px; }
/* '수정됨' — 아주 작게 */
.edited { font-size: inherit; color: var(--ink-3); }
/* 게시글 인라인 수정 박스 */
.post-edit-box { margin-bottom: 12px; }
.post-edit-box textarea { width: 100%; font-family: inherit; font-size: var(--fs-base); min-height: 70px; resize: vertical; }
.post-edit-box .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.post-edit-box .btn { height: auto; padding: 8px 16px; font-size: 14px; }

.comments { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cmt-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.cmt-list:empty { margin-bottom: 0; }
.cmt { display: flex; gap: 10px; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; border-radius: 50%; border: 1px solid var(--line); }
.cmt-main { min-width: 0; flex: 1; }
.cmt-name { font-weight: 700; font-size: 14px; }
.cmt-handle { color: var(--ink-3); font-size: var(--fs-2xs); margin-left: 4px; }
.cmt-body { font-size: var(--fs-sm); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.cmt-body .tag { color: var(--accent); font-weight: 600; }
.cmt-input { font-size: 14px; padding: 10px 14px; width: 100%; }

/* 댓글 액션(답글/수정/삭제) · 답글 중첩 · 인라인 수정 */
.cmt-actions { display: flex; gap: 10px; margin-top: 2px; margin-left: -6px; }
/* 탭 타깃 확대: 패딩으로 히트 영역을 키우되 시각 정렬은 음수 마진으로 유지 */
.cmt-actions button { font-family: inherit; background: none; border: none; padding: 6px 6px; cursor: pointer;
  font-size: 13px; font-weight: 650; color: var(--ink-3); transition: color var(--t-fast);
  display: inline-flex; align-items: center; justify-content: center; }
.cmt-actions button svg { width: 15px; height: 15px; }
.cmt-actions button:hover { color: var(--ink); }
.cmt-actions .cmt-del:hover, .cmt-actions .cmt-del.admin { color: var(--accent); }
.cmt-replies { display: flex; flex-direction: column; gap: 12px; margin-top: 12px;
  padding-left: 14px; border-left: 2px solid var(--line); }
.cmt-replies:empty { display: none; }
.cmt-reply-form { margin-top: 10px; }
.cmt-reply-form[hidden] { display: none; }
.cmt-edit-box { margin-top: 6px; }
.cmt-edit-box .row { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.cmt-edit-box .row button { font-family: inherit; background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; transition: color var(--t-fast); }
.cmt-edit-box .ce-cancel { color: var(--ink-3); }
.cmt-edit-box .ce-cancel:hover { color: var(--ink); }
.cmt-edit-box .ce-save { color: var(--accent); }
.cmt-edit-box .ce-save:hover { color: var(--accent-press); }

/* 댓글을 '게시글처럼': 카운트 배지·좋아요/리포스트 상태·클릭 가능 카드 (게시글 댓글 .cmt-post 한정) */
.cmt-post { cursor: pointer; }
.cmt-post.focal { cursor: default; }
/* 카드의 navigate 포인터가 입력창으로 상속되지 않게 텍스트 필드만 되돌림 (버튼/링크는 pointer 유지) */
.cmt-post .cmt-reply-form, .cmt-post .cmt-input, .cmt-post .cmt-edit-box, .cmt-post .cmt-edit-box * { cursor: auto; }
.cmt-post .cmt-name { color: inherit; font-weight: 700; }
.cmt-post a.cmt-name:hover { text-decoration: underline; }
/* 댓글 액션 행을 게시글 카드(.post-actions + .post-own)와 동일한 디자인 언어로 통일 */
.cmt-post .cmt-actions { gap: 20px; margin-top: 6px; margin-left: 0; align-items: center;
  color: var(--ink-3); font-size: var(--fs-xs); }
.cmt-post .cmt-actions > button { padding: 0; gap: 6px; font-size: var(--fs-xs); font-weight: 500; color: inherit; }
.cmt-post .cmt-actions > button:hover { color: var(--accent); }
.cmt-post .cmt-actions > button svg { width: 15px; height: 15px; }
.cmt-post .cmt-actions button .n, .cmt-post .cmt-actions button .rn, .cmt-post .cmt-actions button .rc { font-size: var(--fs-xs); font-weight: 600; }
.cmt-post .cmt-actions button .n:empty, .cmt-post .cmt-actions button .rc:empty, .cmt-post .cmt-actions button .rn:empty { display: none; }
.cmt-post .cmt-actions .cmt-like.on { color: var(--accent); font-weight: 700; }
.cmt-post .cmt-actions .cmt-like.on svg { fill: currentColor; }
.cmt-post .cmt-actions .cmt-repost.on, .cmt-post .cmt-actions .cmt-repost.on svg { color: var(--ok); font-weight: 700; }
/* 수정/삭제 — 우측 정렬 + 게시글 .post-own/.post-del와 동일 처리 */
.cmt-post .cmt-manage { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.cmt-post .cmt-manage button { padding: 4px 7px; border-radius: var(--r-md); color: var(--ink-3); transition: all var(--t-fast) var(--ease); }
.cmt-post .cmt-manage button svg { width: 16px; height: 16px; }
.cmt-post .cmt-edit:hover { color: var(--ink); background: var(--surface-2); }
.cmt-post .cmt-del:hover { color: var(--accent); background: var(--accent-soft); }
.cmt-post .cmt-del.admin { color: var(--danger); }
.cmt-post .cmt-del.admin:hover { color: #fff; background: var(--danger); }
/* 답글 신고 — 저장(북마크) 버튼 바로 우측에 배치 (우측 끝으로 밀지 않음) */
.cmt-post .cmt-report { padding: 0; border-radius: var(--r-md); color: var(--ink-3); transition: all var(--t-fast) var(--ease); flex: none; }
.cmt-post .cmt-report svg { width: 15px; height: 15px; }
.cmt-post .cmt-report:hover { color: var(--danger); }
/* 0이면 숫자 숨겨서 군더더기 줄임 */
.cmt-context { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; display: flex; align-items: center; gap: 4px; }
.cmt-context a { color: var(--ink-2); font-weight: 650; }
.cmt-context svg { width: 13px; height: 13px; }

/* 포커스(상세) 댓글 강조 */
.thread-focal .cmt.focal > .cmt-main > .cmt-body { font-size: 16px; line-height: 1.55; }
.cmt.focal > .cmt-main > .cmt-line .cmt-name { font-size: 15px; }

/* 무한 중첩 — 시각 들여쓰기는 깊어질수록 줄이고 5단계부터는 평탄화(모바일 가독성) */
.cmt-replies .cmt-replies { padding-left: 11px; }
.cmt-replies .cmt-replies .cmt-replies { padding-left: 8px; }
.cmt-replies .cmt-replies .cmt-replies .cmt-replies .cmt-replies { padding-left: 0; border-left: none; }

/* 프로필 글/답글 탭 + 답글 카드 (댓글을 게시글처럼 노출) */
.pf-tabs { margin-top: 10px; }
.pf-reply-card { padding: 16px 18px; }

/* ---------- Profile ---------- */
.cover { height: 200px; border-radius: var(--r-lg); background: var(--surface-2); position: relative;
  overflow: hidden; border: 1px solid var(--line); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
/* 아바타는 커버에 겹치고, 이름·핸들은 오른쪽에 나란히 (겹침 방지: 줄높이 고정) */
/* 이름의 위 여백 == 좌측(아바타와의) 여백 == 18px 로 동일하게 */
.pf-head { display: flex; align-items: flex-start; gap: 18px; padding: 0 10px; margin-top: 0; position: relative; z-index: 2; }
.pf-avatar { width: 102px; height: 102px; border-radius: 16px; flex: none; background: var(--surface-2);
  display: grid; place-items: center; font-size: 38px; font-weight: 800; color: var(--ink);
  border: 4px solid var(--paper); box-shadow: var(--sh-sm); overflow: hidden; margin-top: -28px; margin-left: 4px; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-id { margin-top: 18px; min-width: 0; }
.pf-id h1 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.03em; line-height: 1.3; margin-bottom: 2px; }
.pf-id .muted { font-size: 14px; }
@media (max-width: 600px) {
  /* 모바일: 아바타를 커버와 겹치지 않게 아래로 분리 */
  .pf-head { gap: 14px; align-items: center; margin-top: 14px; }
  .pf-avatar { width: 76px; height: 76px; border-radius: 14px; font-size: 30px; margin-top: 0; }
  .pf-id { margin-top: 0; }
  .pf-id h1 { font-size: 22px; }
}
/* 프로필 액션: 우측 배치 + 좌측 이름/핸들 텍스트 라인과 같은 높이로 정렬 */
.pf-actions { margin-left: auto; align-self: flex-start; margin-top: 18px; display: flex; align-items: center; gap: 8px; flex: none; }
.pf-icon-btn { width: 38px; height: 38px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast), transform var(--t-fast) var(--spring); }
.pf-icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.pf-icon-btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.pf-icon-btn.primary:hover { background: var(--accent-press); }
.pf-icon-btn svg { width: 16px; height: 16px; }
/* 팔로우/팔로잉 버튼 높이를 메시지 아이콘 버튼과 동일하게 (38px) — @media 앞에 둬서 모바일 33px가 덮어쓰게 */
.pf-actions .follow-btn { height: 38px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 600px) {
  .pf-icon-btn { width: 33px; height: 33px; }
  .pf-icon-btn svg { width: 15px; height: 15px; }
  .pf-actions { gap: 6px; align-self: center; margin-top: 0; }
  .pf-actions .follow-btn { height: 33px; padding: 0 14px; }
}

/* ---------- Icons (Lucide) ---------- */
.lucide, [data-lucide] { width: 18px; height: 18px; stroke-width: 2; vertical-align: middle; display: inline-block; flex: none; }
.menu a svg { width: 19px; height: 19px; }
.menu a .ico { width: 22px; display: inline-flex; align-items: center; justify-content: center; }
.compose-tools svg { width: 19px; height: 19px; }
.compose-tools span { display: inline-flex; }
.post-actions svg { width: 15px; height: 15px; }
.post-actions .like.on svg { fill: currentColor; }
/* 게시글 저장 버튼 — 액션 행 리포스트 우측(답글과 동일 위치) */
.post-actions .bookmark.on { color: var(--accent); }
.post-actions .bookmark.on svg { fill: currentColor; }
/* 답글(댓글) 저장 버튼 — 답글 액션 행에서 좋아요/리포스트와 동일 톤 */
.cmt-post .cmt-actions .cmt-bookmark.on { color: var(--accent); }
.cmt-post .cmt-actions .cmt-bookmark.on svg { fill: currentColor; }
.post-del svg { width: 15px; height: 15px; }
.tabbar svg { width: 22px; height: 22px; }
.auth-brand .feat .ic svg { width: 17px; height: 17px; }
.chip svg { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }
.map-empty svg { width: 30px; height: 30px; }

/* ---------- Feed actions + Compose modal ---------- */
.feed-actions { display: flex; align-items: center; gap: 10px; }
/* 피드 헤더: 세그먼트(추천/실시간) ↔ 글쓰기 버튼 높이 통일 (둘 다 40px) */
.feed-actions .segment.sm, .feed-actions > .btn { height: 44px; box-sizing: border-box; }
.feed-actions > .btn { padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; }
.modal-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center;
  padding: 72px 20px; background: rgba(20,20,25,0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: ov-fade .2s var(--ease); }
.modal-overlay[hidden] { display: none; }
/* 모달이 하나라도 열려 있으면 배경(body) 스크롤 잠금 — 페이지별 JS 없이 모든 모달에 일괄 적용 */
body:has(.modal-overlay:not([hidden])) { overflow: hidden; }
/* 오버레이 자체도 넘치면 스크롤 가능(긴 모달이 화면을 벗어나도 위/아래로 접근) */
.modal-overlay { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal { width: 100%; max-width: 560px; padding: 22px; animation: modal-pop .28s var(--spring);
  max-height: calc(100vh - 144px); max-height: calc(100dvh - 144px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.02em; }

/* 위치 등록 모달 — 주소·장소 검색 결과 드롭다운 (투게더택시 출발지와 동일 스타일) */
.loc-results { margin-top: 8px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.loc-results:empty { display: none; }
.loc-item { padding: 11px 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.loc-item:last-child { border-bottom: none; }
.loc-item:hover { background: var(--surface-2); }
.loc-item b { font-size: 14px; color: var(--ink); font-weight: 700; }
.loc-item span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.loc-item b .loc-hot-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.loc-pick { margin-top: 8px; padding: 10px 13px; background: rgba(255,77,46,.08); border-radius: var(--r-sm); font-size: 13px; font-weight: 700; color: var(--ink); }
.modal-close { background: var(--surface-2); border: none; width: 34px; height: 34px; border-radius: var(--r-md); cursor: pointer;
  display: grid; place-items: center; color: var(--ink-2); transition: background var(--t-fast); }
.modal-close:hover { background: var(--line); color: var(--ink); }

/* ---------- 통합 검색 모달 ---------- */
.search-overlay { padding-top: 56px; }
.search-modal { max-width: 600px; padding: 16px 18px 18px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); }
.search-modal .search-bar { position: relative; margin-bottom: 14px; display: flex; align-items: center; }
.search-modal .search-bar .si { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: grid; pointer-events: none; }
.search-modal .search-bar .si svg { width: 19px; height: 19px; }
.search-modal .search-bar input { padding-left: 44px; padding-right: 46px; font-size: 16px; }
.search-modal .search-close { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); }
.search-results { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.search-results:empty { display: none; }
/* 검색 결과 카드 (search.php 와 공용) */
.search-results .sec, .sec { margin-bottom: 22px; }
.search-results .sec:last-child { margin-bottom: 2px; }
.sec-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.sec-h h2 { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.sec-h .cnt { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.sec-stack { display: flex; flex-direction: column; gap: 12px; }
.ucard { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.ucard .avatar { width: 46px; height: 46px; font-size: 17px; }
.ucard .u-main { min-width: 0; flex: 1; }
.ucard .u-name { font-weight: 700; font-size: 15px; }
.ucard .u-handle { color: var(--ink-3); font-size: 13px; }
.ucard .u-bio { color: var(--ink-2); font-size: var(--fs-xs); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ucard .u-go { margin-left: auto; color: var(--ink-3); flex: none; }
/* ---------- 모임(술벙) 카드 — 전 페이지 공용 (render_meetup_card 단일 렌더) ---------- */
.meet-card { display: block; padding: 18px; }
.meet-card.is-ended { opacity: .72; }
.meet-card .when { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs);
  font-weight: 700; color: var(--ink-3); margin-bottom: 8px; }
.meet-card .when svg { width: 14px; height: 14px; }
.meet-card .when.live { color: var(--ok); }
.meet-card h3 { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.meet-card .m-place { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-2xs);
  color: var(--ink-2); margin-bottom: 8px; }
.meet-card .m-place svg { width: 13px; height: 13px; }
.meet-card .meta { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: var(--fs-xs); }
.meet-card .who { display: inline-flex; align-items: center; gap: 7px; }
.meet-card .who .avatar.sm { width: 26px; height: 26px; font-size: var(--fs-3xs); }
.meet-badge { margin-left: auto; font-size: var(--fs-2xs); font-weight: 700; padding: 4px 11px; border-radius: var(--r-pill); }
.meet-badge.open { background: var(--accent-soft); color: var(--accent-press); }
.meet-badge.full, .meet-badge.off { background: var(--surface-2); color: var(--ink-3); }
.meet-badge.live { background: var(--ok-soft); color: var(--ok); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 0 3px rgba(40,196,111,0.2); display: inline-block; }
.modal-close svg { width: 18px; height: 18px; }
.modal-compose { display: flex; gap: 12px; }
.modal-compose textarea { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 17px;
  min-height: 130px; max-height: 52vh; max-height: 52dvh; padding: 8px 0; resize: none;
  field-sizing: content; overflow-y: auto; }   /* 내용 길이에 따라 높이 자동 증가(지원 브라우저), 넘치면 스크롤 */
.modal-compose textarea:focus { box-shadow: none; }
/* 글쓰기 도구: 이미지 미리보기 / 위치 칩 */
.compose-tools span { cursor: pointer; }
.compose-tools span:hover { color: var(--accent); }
.compose-preview-wrap { position: relative; margin-top: 12px; }
.compose-preview { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.compose-x { background: rgba(20,20,25,0.6); border: none; color: #fff; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; transition: background var(--t-fast); }
.compose-x svg { width: 14px; height: 14px; }
.compose-preview-wrap .compose-x { position: absolute; top: 8px; right: 8px; }
.compose-preview-wrap .compose-x:hover { background: rgba(20,20,25,0.85); }
.compose-loc { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--ink-2);
  background: var(--surface-2); padding: 7px 10px; border-radius: var(--r-sm); }
.compose-loc svg { width: 14px; height: 14px; }
.compose-loc .compose-x { width: 18px; height: 18px; background: transparent; color: var(--ink-3); }
.compose-loc .compose-x:hover { background: transparent; color: var(--ink); }
@keyframes ov-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ===== 공통 UI: 토스트 / 모달 (시스템 alert·confirm 대체) ===== */
.g-toast-wrap { position: fixed; left: 50%; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 9000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.g-toast { background: rgba(28,28,30,0.92); color: #fff; font-size: 14px; font-weight: 600; line-height: 1.4;
  padding: 11px 18px; border-radius: 999px; box-shadow: 0 8px 28px rgba(0,0,0,0.28); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(10px); transition: opacity .25s var(--ease), transform .25s var(--ease); text-align: center; }
.g-toast.show { opacity: 1; transform: none; }
.g-toast.ok { background: rgba(27,138,75,0.95); }
.g-modal-ov { position: fixed; inset: 0; z-index: 9100; display: grid; place-items: center; padding: 24px;
  background: rgba(10,10,12,0.42); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s var(--ease); }
.g-modal-ov.show { opacity: 1; }
.g-modal { width: 100%; max-width: 340px; padding: 22px; transform: translateY(12px) scale(.98); transition: transform .22s var(--spring);
  display: flex; flex-direction: column; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.g-modal-ov.show .g-modal { transform: none; }
.g-modal-title { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.g-modal-msg { font-size: var(--fs-sm); line-height: 1.55; color: var(--ink-2); margin-bottom: 16px; white-space: normal; }
.g-modal-input { margin-bottom: 16px; }
.g-modal-actions { display: flex; gap: 10px; }
.g-modal-actions .btn { flex: 1; }
/* 좌우 스와이프 정렬 전환 — 새 목록 슬라이드 인 */
@keyframes swipe-in-l { from { opacity: .35; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes swipe-in-r { from { opacity: .35; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
#feedList.swipe-in-l { animation: swipe-in-l .28s var(--ease); }
#feedList.swipe-in-r { animation: swipe-in-r .28s var(--ease); }
@media (max-width: 600px) {
  .feed-head h1 { display: none; }
  .feed-actions { width: 100%; justify-content: space-between; }
  /* 모바일에서도 하단 시트가 아닌 중앙 모달로 표시 */
  /* 모바일: 모든 입력 모달을 화면 상단부터 표시 (중앙 정렬 대신) */
  .modal-overlay { padding: 40px 18px calc(24px + env(safe-area-inset-bottom)); align-items: flex-start; }
  .modal { max-width: 100%; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  /* 단, 검색 모달은 상단 기준으로 표시 (중앙 정렬 예외) */
  .search-overlay { align-items: flex-start; padding-top: 56px; }
  /* 글쓰기 모달 — 모바일에서 상단 기준으로 표시, 본문 입력칸이 남는 공간을 채움 */
  #composeModal { align-items: flex-start; padding-top: 48px; }
  #composeModal .modal { max-height: calc(100vh - 68px); max-height: calc(100dvh - 68px); display: flex; flex-direction: column; }
  #composeModal #composeForm { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #composeModal .modal-compose { min-height: 0; }
  #composeModal .modal-compose textarea { min-height: 90px; }   /* 내용 길이에 따라 자동 증가 */
}

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.post.enter { animation: postIn var(--t-slow) var(--ease) both; }
@keyframes postIn { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- Mobile ---------- */
/* 데스크톱: 상단 네비 / 모바일: 하단 탭바 (Instagram·X 표준 패턴) */
.tabbar { display: none; }
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  /* 모바일: 100dvh 고정 대신 자연 스크롤 — 키보드/주소창 변화에도 모든 입력칸이 잘리지 않게 */
  body.login { overflow: auto; }
  .login .auth { height: auto; min-height: 100dvh; }
  .login .auth-panel { overflow-y: visible; align-items: flex-start;
    padding: 28px 22px calc(32px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  /* 콘텐츠가 하단 탭바에 가리지 않도록 여백 확보 */
  .shell, .container { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    justify-content: space-around; align-items: stretch;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: rgba(251,250,249,0.88); backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--ink-3); padding: 4px 0; border-radius: var(--r-sm);
    transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--spring); }
  .tabbar a span { font-size: var(--fs-3xs); font-weight: 650; letter-spacing: -0.02em; line-height: 1; }
  .tabbar a:active { transform: scale(0.94); }
  .tabbar a.on { color: var(--ink); }
  .tabbar svg { width: 23px; height: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 리포스트 ---------- */
.repost-by { display:flex; align-items:center; gap:6px; font-size: var(--fs-2xs); color:var(--ink-3); font-weight:650; margin-bottom:8px; }
.repost-by svg { width:14px; height:14px; }
.repost-by a { color:var(--ink-2); font-weight:700; }
.post-actions .repost-btn.on, .post-actions .repost-btn.on svg { color:var(--ok); font-weight:700; }

/* ---------- 게시글 카드 클릭(상세 이동) affordance ---------- */
.post { cursor: pointer; }
.post .comments, .post .cmt-input { cursor: auto; }
.post-detail .post { cursor: default; }

/* 안 읽은 메시지 수 배지 (아이콘 우상단) */
.pf-icon-btn { position: relative; }
.tabbar a { position: relative; }
.tab-ico { position: relative; display: inline-flex; }
.ico-badge { position: absolute; top: -7px; right: -8px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: var(--fs-3xs); font-weight: 800; line-height: 1; letter-spacing: -0.02em;
  border: 2px solid var(--paper); pointer-events: none; z-index: 4; }
/* 알림/메시지 뱃지가 우측 계정(사람) 아이콘에 가려지지 않도록 스택을 위로
   (계정엔 z-index 미부여 → 계정 드롭다운 stacking 영향 없음) */
.topbar .nav-links .nav-msg  { z-index: 3; }
.topbar .nav-links .nav-bell { z-index: 2; }

/* =================== DM (다이렉트 메시지 · 인스타 스타일) =================== */
.dm-list { display: flex; flex-direction: column; }
.dm-item { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease); }
.dm-item:hover { background: var(--surface-2); }
.dm-item .avatar { width: 52px; height: 52px; font-size: 18px; flex: none; }
.dm-item-main { min-width: 0; flex: 1; }
.dm-item-top { display: flex; align-items: baseline; gap: 8px; }
.dm-item-name { font-weight: 700; font-size: 15px; }
.dm-item-time { margin-left: auto; color: var(--ink-3); font-size: 12px; flex: none; }
.dm-item-last { color: var(--ink-2); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-item.unread .dm-item-last { color: var(--ink); font-weight: 650; }
.dm-unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }

.dm-head { position: fixed; top: 64px; left: 0; right: 0; z-index: 50; height: 56px; box-sizing: border-box;
  display: flex; align-items: center; gap: 12px;
  /* 본문(680px 컬럼)·상단바와 좌우 시작선 일치 */
  padding: 8px 0; padding-inline: calc(max(0px, (100% - 680px) / 2) + 22px);
  background: var(--paper); border-bottom: 1px solid var(--line); }
.dm-head .back { color: var(--ink-2); display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); flex: none; }
.dm-head .back:hover { background: var(--surface-2); color: var(--ink); }
.dm-head .nm { font-weight: 700; font-size: 15px; line-height: 1.2; }
.dm-head .hd { color: var(--ink-3); font-size: var(--fs-2xs); line-height: 1.2; }

/* 메시지 영역만 독립 스크롤 — 상단바(64)+헤더(56) 아래 ~ 입력창 위. 메시지가 헤더 뒤로 가려지지 않음 */
.dm-thread { position: fixed; left: 0; right: 0; top: 120px; bottom: calc(70px + env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  max-width: 680px; margin: 0 auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 4px; }
.dm-row { display: flex; flex-direction: column; max-width: 76%; }
.dm-row.me { align-self: flex-end; align-items: flex-end; }
.dm-row.them { align-self: flex-start; align-items: flex-start; }
.dm-bubble { padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; word-break: break-word; }
.dm-row.me .dm-bubble { background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.dm-row.them .dm-bubble { background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 5px; }
.dm-time { font-size: var(--fs-3xs); color: var(--ink-3); margin: 2px 6px 0; }
/* 낙관적 전송 상태: 보내는 중(반투명) / 실패(빨강 시간) */
.dm-row.pending .dm-bubble { opacity: .58; }
.dm-row.failed  .dm-bubble { opacity: .58; }
.dm-row.failed  .dm-time { color: var(--danger); }

.dm-compose { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(251,250,249,0.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  /* 본문 컬럼과 좌우 시작선 일치 */
  padding-block: 10px calc(10px + env(safe-area-inset-bottom));
  padding-inline: calc(max(0px, (100% - 680px) / 2) + 22px); }
.dm-compose form { width: 100%; display: flex; gap: 10px; align-items: flex-end; }
.dm-compose textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; border-radius: 22px; padding: 11px 16px; }
.dm-compose .send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--accent);
  color: #fff; cursor: pointer; display: grid; place-items: center; transition: background var(--t-fast); }
.dm-compose .send:hover { background: var(--accent-press); }
.dm-compose .send svg { width: 18px; height: 18px; }
.dm-empty-thread { text-align: center; color: var(--ink-3); padding: 40px 20px; font-size: 14px; }

/* 글쓰기 플로팅 버튼 (전 화면 · 우측 하단). 앱이 데스크톱에서도 모바일 폭 컬럼이라 항상 FAB로 통일. */
.feed-head #composeOpen { display: none; }   /* 상단 헤더 글쓰기 버튼 숨김 → FAB로 대체 */
/* 하단 탭바(약 74px) 위로 띄워 '프로필' 탭과 겹치지 않게. 넓은 화면에선 가운데 컬럼 우측에 붙임 */
.fab-compose { display: grid; place-items: center; position: fixed;
  right: max(18px, calc((100vw - var(--mobile-w, 600px)) / 2 + 8px));
  bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 95;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(255,77,46,0.4), var(--sh-md);
  transition: transform var(--t-fast) var(--spring), background var(--t-fast); }
.fab-compose:hover { background: var(--accent-press); }
.fab-compose:active { transform: scale(0.92); }
.fab-compose svg { width: 24px; height: 24px; }

/* 핫플 등록 신청 플로팅 버튼 (피드 FAB와 동일 스타일 · 전 화면 노출) */
/* 핫플 FAB도 피드 FAB와 동일: 하단 탭바 위 + 가운데 컬럼 우측에 붙임(전 화면) */
.fab-action { position: fixed; z-index: 95;
  right: max(18px, calc((100vw - var(--mobile-w, 600px)) / 2 + 8px));
  bottom: calc(86px + env(safe-area-inset-bottom));
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  border: none; cursor: pointer; background: var(--accent); color: #fff;
  box-shadow: 0 6px 18px rgba(255,77,46,0.4), var(--sh-md);
  transition: transform var(--t-fast) var(--spring), background var(--t-fast); }
.fab-action:hover { background: var(--accent-press); transform: translateY(-2px); }
.fab-action:active { transform: scale(0.92); }
.fab-action svg { width: 24px; height: 24px; }
.fab-action:disabled { opacity: .45; cursor: default; box-shadow: var(--sh-sm); }
.fab-action:disabled:hover { background: var(--accent); transform: none; }

/* hidden 속성은 항상 숨김 — .compose-loc 등 display 지정 요소가 hidden을 덮어쓰지 않도록 */
[hidden] { display: none !important; }

/* 피드/목록: 긴 본문은 6줄까지만 보이고 … 요약. 상세 페이지(post-detail)는 전체 표시 */
.post-body { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.post-detail .post-body { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }

/* ---------- 피드 정렬: 세그먼트 축소 + 거리 반경 설정 ---------- */
.segment.sm button { padding: 7px 12px; font-size: 13px; }
.km-wrap { position: relative; display: inline-flex; }
.seg-gear { width: 34px; height: 34px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
  transition: background var(--t-fast), color var(--t-fast); }
.seg-gear:hover { background: var(--surface-2); color: var(--ink); }
.seg-gear svg { width: 17px; height: 17px; }
.km-menu { position: absolute; top: 42px; right: 0; z-index: 60; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-md); padding: 4px;
  display: flex; flex-direction: column; min-width: 116px; }
.km-menu button { font-family: inherit; cursor: pointer; border: none; background: transparent; text-align: left;
  padding: 8px 12px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.km-menu button:hover { background: var(--surface-2); color: var(--ink); }
.km-menu button.on { color: var(--accent); }
/* 프로필 더보기(…) 드롭다운: 아이콘+라벨, 신고는 위험색 */
.pf-more-menu { min-width: 132px; }
.pf-more-menu button { display: flex; align-items: center; gap: 9px; }
.pf-more-menu button svg { width: 16px; height: 16px; flex: none; }
.pf-more-menu .danger { color: var(--danger); }
.pf-more-menu .danger:hover { color: var(--danger); background: var(--danger-soft); }

/* 거리순 버튼 안쪽 설정 기어 (거리순 활성 시에만 표시) */
.seg-wrap { position: relative; display: inline-flex; }
/* 거리순 정렬은 모바일에서만 노출 (데스크톱 숨김) */
@media (min-width: 761px) { .segment .seg-distance { display: none; } }
/* 글쓰기 위치등록의 '자동 위치'(GPS) 버튼도 모바일에서만 노출 (데스크톱 숨김) */
@media (min-width: 761px) { #locAuto { display: none; } }
.km-gear { display: inline-flex; align-items: center; justify-content: center; margin-left: 6px;
  padding: 2px; border-radius: 5px; cursor: pointer; opacity: .9; vertical-align: middle; }
.km-gear:hover { opacity: 1; background: rgba(255,255,255,0.22); }
.km-gear svg { width: 14px; height: 14px; }
.seg-wrap .km-menu { top: calc(100% + 6px); right: 0; }
#feedList { transition: opacity .12s ease; }

/* 커버(배경사진) 미등록: 배너 없이 깔끔하게 — 아바타 겹침/액션 절대배치 해제 */
.pf-head.no-cover { margin-top: -3px; }
.pf-head.no-cover .pf-avatar { margin-top: 0; }
.pf-head.no-cover .pf-actions { position: static; margin-left: auto; align-self: flex-start; top: auto; right: auto; }

/* 팔로워/팔로잉: 클릭 가능한 통계 + 목록 모달 행 */
.stat-link { cursor: pointer; border-radius: var(--r-sm); transition: opacity var(--t-fast); }
.stat-link:hover { opacity: .65; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: var(--r-md); }
.user-row:hover { background: var(--surface-2); }
.user-row .avatar.sm { width: 42px; height: 42px; font-size: 16px; flex: none; }
.user-row .ur-main { min-width: 0; }
.user-row .ur-name { font-weight: 700; font-size: var(--fs-sm); color: var(--ink); }
.user-row .ur-handle { color: var(--ink-3); font-size: 13px; }
.user-row .ur-bio { color: var(--ink-2); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 멤버 추천(people.php) ── user-row에 팔로우 버튼 결합 + 섹션 헤더 */
.btn.sm { height: 34px; padding: 0 16px; font-size: 13px; }
.suggest-row { justify-content: space-between; }
.suggest-row .ur-link { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; color: inherit; }
.suggest-row .ur-link:hover .ur-name { text-decoration: underline; }
.suggest-row .follow-btn { flex: none; }
.suggest-row .ur-meta { color: var(--accent); font-weight: 600; }
.suggest-sec { margin-top: 26px; }
.suggest-sec:first-of-type { margin-top: 8px; }
.suggest-sec-h { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: var(--fs-base); margin: 0 4px 4px; }
.suggest-sec-h svg { width: 18px; height: 18px; color: var(--accent); }
.suggest-sec-sub { color: var(--ink-3); font-size: 13px; margin: 0 4px 10px; }

/* ---------- 피드 레이아웃: 본문은 항상 화면 중앙(헤더와 정렬), 태그 레일은 우측 여백에 ----------
   기본은 단일 680 중앙 칼럼. 좌우 여백이 레일을 담을 만큼 넓을 때만(≥1300px) 3단(1fr·680·1fr)으로
   전환해 본문은 그대로 중앙 유지하고, 우측 여백(3번째 트랙)에 레일을 얹는다. */
.feed-wrap { max-width: 680px; margin: 0 auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.feed-aside { display: none; }
@media (min-width: 1300px) {
  .feed-wrap { max-width: none; display: grid; column-gap: 24px; align-items: start;
    grid-template-columns: 1fr 630px 1fr; }   /* 가운데 본문 고정 630px → 정렬 전환·해상도 무관 폭 불변 */
  .feed-col   { grid-column: 2; }
  .feed-aside { display: block; grid-column: 3; justify-self: start; width: 260px;
    position: sticky; top: 86px; }                       /* 우측 여백에 sticky 레일 */
}
@media (max-width: 600px) {
  .feed-wrap { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }  /* 하단 탭바 가림 방지 */
}
/* 빈 상태 — 아이콘 + 안내 + 행동유도(CTA) */
.empty .empty-ic { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; margin: 0 auto 14px; color: var(--ink-3); }
.empty .empty-ic svg { width: 22px; height: 22px; }
.empty .empty-title { font-weight: 800; color: var(--ink-2); font-size: var(--fs-lg); }
.empty .empty-sub { font-size: var(--fs-xs); margin-top: 4px; }
.empty .empty-cta { margin-top: 16px; }

/* ===== 설문조사 (compose 작성 + 카드 표시) ===== */
.compose-poll { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.cp-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; margin-bottom: 10px; }
.cp-head svg { width: 15px; height: 15px; vertical-align: -2px; }
.cp-remove { background: none; border: none; cursor: pointer; color: var(--ink-3); padding: 2px; display: inline-flex; }
.cp-remove svg { width: 16px; height: 16px; }
.cp-opts { display: flex; flex-direction: column; gap: 8px; }
.cp-opt { font-size: 14px; }
.cp-add { margin-top: 8px; background: none; border: none; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 2px; }
.cp-add svg { width: 14px; height: 14px; }
.cp-days { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.cp-days select { width: auto; height: auto; padding: 7px 10px; font-size: 13px; }
.tool-poll { cursor: pointer; }

.poll { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.poll-opt { text-align: left; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; transition: all var(--t-fast); }
.poll-opt:hover { border-color: var(--accent); background: var(--surface-2); }
.poll-opt:disabled { opacity: .6; cursor: default; }
.poll-res { position: relative; padding: 11px 14px; border-radius: var(--r-md); background: var(--surface-2);
  overflow: hidden; display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.poll-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); opacity: .15; z-index: 0;
  transition: width var(--t) var(--ease); border-radius: var(--r-md) 0 0 var(--r-md); }
.poll-res.mine .poll-fill { opacity: .30; }
.poll-lbl { position: relative; z-index: 1; font-weight: 600; display: flex; align-items: center; gap: 4px; min-width: 0; }
.poll-lbl svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.poll-res.mine .poll-lbl { font-weight: 800; }
.poll-pct { position: relative; z-index: 1; font-weight: 800; color: var(--ink-2); flex: none; margin-left: 8px; }
.poll-foot { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 모임 > 단톡 게시판 (gtalk) ---------- */
.chips a.chip { text-decoration: none; }
.gt-card .gt-title { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin: 2px 0 8px; line-height: 1.35; }
.gt-card .post-body { margin-bottom: 2px; }
.gt-join { display: inline-flex; align-items: center; gap: 7px; margin: 12px 0 2px; padding: 10px 16px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; border-radius: var(--r-sm);
  text-decoration: none; transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.gt-join:hover { background: #000; }
.gt-join:active { transform: scale(0.97); }
.gt-join svg { width: 16px; height: 16px; }
.gt-card .post-actions { margin-top: 12px; }
.post-actions .gt-like.on svg { fill: currentColor; }

/* =========================================================================
   [데스크톱 모바일뷰] 컴퓨터/태블릿 접속 시에도 '모바일 화면 방식'으로 표시
   요청: 너비를 모바일 폭으로 제한해 PC에서도 모바일과 동일하게 보이도록.
   · 600px 이하는 이미 완전한 모바일 레이아웃이라 그대로 둔다.
   · 601px 이상에서만 콘텐츠 폭을 모바일 폭(--mobile-w)으로 가두고,
     2단 그리드를 해제하고, 하단 탭바를 노출한다.
   · 관리자(body.admin-body)는 데스크톱 전체폭이 필요하므로 제외.
   · DM 채팅(.dm-thread)은 입력창 정렬 이슈로 이번 범위에서 제외.
   ========================================================================= */
:root { --mobile-w: 630px; }   /* 데스크톱에서도 단일 컬럼 레이아웃을 630px 고정·중앙 정렬 */

@media (min-width: 601px) {
  /* 1) 페이지 콘텐츠 래퍼를 모바일 폭으로 제한 (1120 / 680 → 480) */
  body:not(.admin-body) .container,
  body:not(.admin-body) .feed-wrap,
  body:not(.admin-body) .shell {
    max-width: var(--mobile-w) !important;
    margin-inline: auto !important;
  }

  /* 2) 피드 2단 그리드(>=1300px) 해제 → 단일 컬럼 + 우측 태그 레일 숨김 */
  body:not(.admin-body) .feed-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;   /* ★ 1300px 그리드용 align-items:start 잔재가 flex로 넘어와 본문이 콘텐츠폭으로 줄던 버그 해결 → 항상 컬럼 폭 꽉 채움 */
    grid-template-columns: none !important;
  }
  body:not(.admin-body) .feed-col   { grid-column: auto !important; width: 100% !important; }
  body:not(.admin-body) .feed-aside { display: none !important; }

  /* 3) 상단 sticky 바도 동일 폭으로 중앙 정렬.
        주의: topbar 기본 padding-inline은 calc(max(0,(100%-680)/2)+22)인데,
        %는 topbar가 아니라 부모(body 전체폭) 기준이라 폭을 좁히면 좌우 패딩이
        과도하게 커져 헤더 내용이 겹친다 → 여기서 고정 22px로 덮어쓴다. */
  body:not(.admin-body) .topbar {
    max-width: var(--mobile-w);
    margin-inline: auto;
    padding-inline: 22px !important;
  }

  /* 4) 전체메뉴 그리드(appgrid)를 480 칼럼 좌측 경계에 맞춤 (기존 680 기준값 덮어씀) */
  body:not(.admin-body) .appgrid {
    left: calc(50vw - (var(--mobile-w) / 2) + 10px) !important;
  }

  /* 5) 하단 탭바 노출 + 모바일 폭으로 중앙 고정
        (탭바 본체/내부 스타일은 @media (max-width:600px) 전용이라 여기서 재정의) */
  body:not(.admin-body) .tabbar {
    display: flex !important;
    position: fixed; left: 50%; transform: translateX(-50%); right: auto; bottom: 0;
    z-index: 90; width: 100%; max-width: var(--mobile-w);
    justify-content: space-around; align-items: stretch;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: rgba(251,250,249,0.92);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-top: 1px solid var(--line);
  }
  body:not(.admin-body) .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--ink-3); padding: 4px 0; border-radius: var(--r-sm);
  }
  body:not(.admin-body) .tabbar a span {
    font-size: var(--fs-3xs); font-weight: 650; letter-spacing: -0.02em; line-height: 1;
  }
  body:not(.admin-body) .tabbar a.on { color: var(--ink); }
  body:not(.admin-body) .tabbar svg { width: 23px; height: 23px; }

  /* 6) 본문이 하단 탭바에 가리지 않도록 여백 확보 */
  body:not(.admin-body) .container,
  body:not(.admin-body) .feed-wrap,
  body:not(.admin-body) .shell {
    padding-bottom: calc(74px + env(safe-area-inset-bottom)) !important;
  }
}
