/* osaka pick v2. 모바일 먼저(360~430px), 768~1023 은 가운데로 넓게, 1024 이상은 웹 배치 */
:root {
  --bg: #FFFFFF;
  --surface: #FAFAFA;
  --elevated: #FFFFFF;
  --text: #000000;
  --muted: #737373;
  --line: #DBDBDB;
  --primary: #0095F6;
  --heart: #FF3040;
  --ring: linear-gradient(45deg, #FEDA75, #FA7E1E, #D62976, #962FBF, #4F5BD5);
  --btn: #EFEFEF;
  --warn: #ED4956;
  --toast: #262626;
  /* 글자 전용 색. 아이콘은 위 색 그대로 두고, 글자만 바탕 대비 4.5 이상 */
  --heart-text: #D0142C;
  --must-text: #C2185B;
  --primary-text: #0068B8;
  --warn-text: #C62828;
  --btn-primary: #0074CC;
  --topbar: 48px;
  --tabh: 50px;
  --side: 0px;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  color: var(--text);
  background: var(--bg);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #121212;
    --elevated: #262626;
    --text: #F5F5F5;
    --muted: #A8A8A8;
    --line: #262626;
    --btn: #363636;
    --toast: #363636;
    --heart-text: #FF6B76;
    --must-text: #EA5B9B;
    --primary-text: #0095F6;
    --warn-text: #ED4956;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
/* hidden 을 쓰면 body 가 스크롤 틀이 되어 상단 막대가 붙지 않는다. clip 은 그렇지 않다 */
html, body { margin: 0; overflow-x: clip; }
body { min-height: 100dvh; font-size: 14px; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tnum, .num, .stats b, .hl-left, .m-pos { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pad { padding: 8px 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--elevated); padding: 8px 12px; border-radius: 8px; }

/* 아이콘 스프라이트는 화면에 안 보이게만 둔다. display:none 이면 그라데이션이 사라진다 */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 24px; height: 24px; flex: none; display: inline-block; vertical-align: middle; }
.cut { stroke: var(--bg); }

.wordmark { font-family: 'Grand Hotel', cursive; font-size: 28px; font-weight: 400; line-height: 1; letter-spacing: 0; }

/* ---------- 상단 막대 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 4px;
  min-height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 4px 0 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.tb-text { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#back-btn { margin-left: -8px; }
.icon-btn {
  width: 48px; height: 48px; flex: none;
  display: inline-grid; place-items: center;
  border: 0; background: transparent; color: var(--text); border-radius: 8px; padding: 0;
}
.sync { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 4px 8px; border-radius: 999px; white-space: nowrap; color: var(--muted); }
.pill .ic { width: 14px; height: 14px; }
.pill.warn { color: var(--warn-text); font-weight: 600; }
.pill-btn { border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 600; min-height: 32px; padding: 0 6px; white-space: nowrap; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-banner {
  /* 위 막대 바로 아래에 붙어 모든 화면에서 늘 보인다. 흐름 안에 있어 본문 첫 요소를 가리지 않는다 */
  position: sticky; top: 0; z-index: 19;
  margin: 0; padding: 10px 16px;
  background: linear-gradient(rgba(237, 73, 86, 0.12), rgba(237, 73, 86, 0.12)), var(--bg);
  border-bottom: 1px solid rgba(237, 73, 86, 0.3);
  color: var(--warn-text); font-size: 13px; font-weight: 600;
}
body.in-app .auth-banner { top: calc(var(--topbar) + env(safe-area-inset-top)); }

/* ---------- 본문 ---------- */
.view { display: block; max-width: 640px; margin: 0 auto; outline: none; }
/* 아래 탭에 행동 줄이 가리지 않게 본문 아래를 비운다 */
body.in-app .view { padding-bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 24px); }
.loading { padding: 48px 16px; text-align: center; color: var(--muted); }
/* 휴대폰은 화면 제목을 위 막대가 보여서 숨기되, 읽기 프로그램에는 h1 로 남긴다 */
.page-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sec-title { font-size: 14px; font-weight: 600; padding: 20px 16px 8px; }
.sec-title .num { color: var(--muted); font-weight: 400; }

/* ---------- 아래 탭 막대 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: stretch;
  height: calc(var(--tabh) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.tab { flex: 1 1 0; display: grid; place-items: center; min-height: var(--tabh); color: var(--text); }
.tab .ic { width: 26px; height: 26px; }
.nav-me { display: inline-grid; place-items: center; border-radius: 50%; padding: 2px; border: 2px solid transparent; }
.nav-me .av { --s: 24px; font-size: 11px; }
.nav-me.on { border-color: var(--text); }

/* ---------- 사람 원 ---------- */
.av {
  --s: 32px;
  width: var(--s); height: var(--s); border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  color: #fff; font-weight: 700; font-size: 14px; line-height: 1;
}
.p0 { background: #C2410C; }
.p1 { background: #1D4ED8; }
.p2 { background: #15803D; }
.av.xl { --s: 80px; font-size: 32px; }
.ring-av { display: inline-grid; place-items: center; padding: 3px; border-radius: 50%; background: var(--line); flex: none; }
.ring-av > .av { border: 3px solid var(--bg); }
.ring-av.big > .av { --s: 80px; font-size: 32px; }

/* ---------- 입장 ---------- */
.enter { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 32px 16px; text-align: center; }
.wordmark.big { font-size: 44px; }
.enter-lead { font-size: 16px; font-weight: 600; }
.stories { display: flex; justify-content: center; gap: 4px; width: 100%; max-width: 400px; }
.stories li { flex: 1 1 0; min-width: 0; }
.story { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 2px; border-radius: 12px; }
.story-name { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.this-device { font-size: 11px; font-weight: 600; color: var(--primary); }
.story-sub { font-size: 12px; color: var(--muted); text-wrap: balance; }
.enter-hint { font-size: 12px; color: var(--muted); max-width: 300px; }

/* ---------- 홈: 프로필처럼 ---------- */
.profile { display: flex; align-items: center; gap: 20px; padding: 16px 16px 8px; }
.profile-right { flex: 1 1 auto; min-width: 0; }
.profile-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.stats { display: flex; justify-content: space-between; gap: 8px; }
.stats li { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.stats b { font-size: 16px; font-weight: 600; }
.stats span { font-size: 13px; }
.profile-line { padding: 0 16px 12px; font-size: 12px; color: var(--muted); }

.highlights { display: flex; gap: 14px; overflow-x: auto; padding: 4px 16px 16px; scrollbar-width: none; }
.highlights::-webkit-scrollbar { display: none; }
.hl { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 72px; border: 0; background: transparent; padding: 0; }
.hl-ring { width: 66px; height: 66px; border-radius: 50%; padding: 2px; display: block; background: var(--line); }
.hl-ring.live { background: var(--ring); }
.hl-in { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--bg); overflow: hidden; display: grid; place-items: center; color: #fff; }
.hl-in img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.hl-ic { width: 26px; height: 26px; }
.hl-name { font-size: 12px; margin-top: 4px; max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-left { font-size: 11px; color: var(--muted); }

.ptabs { display: flex; border-top: 1px solid var(--line); }
.ptab {
  flex: 1 1 0; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-top: 1px solid transparent; margin-top: -1px; background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600;
}
.ptab .ic { width: 16px; height: 16px; }
.ptab.on { color: var(--text); border-top-color: var(--text); }

/* ---------- 3열 격자 ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.cell { position: relative; aspect-ratio: 1 / 1; border: 0; padding: 0; overflow: hidden; background: var(--surface); display: block; width: 100%; }
.cell img { width: 100%; height: 100%; object-fit: cover; }
.cell-mine { position: absolute; top: 6px; right: 6px; color: #fff; display: flex; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.cell-mine .ic { width: 18px; height: 18px; }
.cell-rec { position: absolute; top: 6px; left: 6px; color: #fff; display: flex; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.cell-rec .ic { width: 14px; height: 14px; }
.cell-hover { display: none; }

/* ---------- 사진 없는 칸: 분류별 두 색 그라데이션 ---------- */
.fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: #fff; text-align: center; padding: 12px;
}
.fallback .fb-ic { width: 40%; height: auto; max-width: 96px; aspect-ratio: 1; }
.fb-name { font-weight: 700; font-size: 18px; line-height: 1.25; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.fallback.cell { gap: 6px; padding: 8px; }
.fallback.cell .fb-ic { width: 30%; }
.fallback.cell .fb-name { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-food { background: linear-gradient(135deg, #E1306C, #F77737); }
.c-cafe { background: linear-gradient(135deg, #6F4E37, #B07D56); }
.c-shop { background: linear-gradient(135deg, #833AB4, #C13584); }
.c-sight { background: linear-gradient(135deg, #405DE6, #5B51D8); }
.c-exp { background: linear-gradient(135deg, #C13584, #E1306C); }
.c-act { background: linear-gradient(135deg, #0F766E, #0EA5A4); }
.c-stay { background: linear-gradient(135deg, #1E3A8A, #3B82F6); }

.thumb { position: relative; display: inline-grid; place-items: center; overflow: hidden; color: #fff; flex: none; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.round32 { width: 32px; height: 32px; border-radius: 50%; }
.round32 .th-ic { width: 16px; height: 16px; }
.sq44 { width: 44px; height: 44px; border-radius: 4px; }
.sq44 .th-ic { width: 20px; height: 20px; }

/* ---------- 게시물 ---------- */
.post { margin-bottom: 16px; scroll-margin-top: calc(var(--topbar) + env(safe-area-inset-top) + var(--banner-h, 0px)); }
.post-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 4px 12px; }
.ph-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ph-name { font-size: 14px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface); touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; }
.post-photo img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.rec-tag { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; font-weight: 600; z-index: 2; }
.rec-tag .ic { width: 12px; height: 12px; }

.burst { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: #fff; z-index: 3; opacity: 0; }
.burst .ic { width: 96px; height: 96px; filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3)); }
.burst.pop { animation: burst 900ms ease-out; }
@keyframes burst {
  0% { opacity: 0; transform: scale(0.2); }
  15% { opacity: 1; transform: scale(1.2); }
  30% { transform: scale(0.95); }
  45% { transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.9); }
}

.actions { display: flex; align-items: flex-start; padding: 4px 4px 0; }
.act {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 56px; min-height: 52px; padding: 4px 6px;
  border: 0; background: transparent; color: var(--text); border-radius: 8px;
}
.act .ic { width: 28px; height: 28px; transition: transform 120ms ease; }
.act:active .ic { transform: scale(0.88); }
.act-label { font-size: 11px; line-height: 1.2; white-space: nowrap; }
.act.on .act-label { font-weight: 600; }
.act.want.on { color: var(--heart); }
.act.must.on { color: #D62976; }
.act.no.on { color: var(--text); }
.act.here.on, .act.ok.on { color: var(--primary); }
.act.want.on .act-label { color: var(--heart-text); }
.act.must.on .act-label { color: var(--must-text); }
.act.here.on .act-label, .act.ok.on .act-label { color: var(--primary-text); }
.act.on .ic { animation: tick 260ms ease-out; }
@keyframes tick { 0% { transform: scale(0.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.act-gap { flex: 1 1 auto; }
.act.side { min-width: 48px; }

.others { display: flex; align-items: center; gap: 8px; padding: 2px 12px 4px; }
.others-text { font-size: 14px; min-width: 0; }
.st { font-size: 12px; color: var(--muted); white-space: nowrap; }
.st-conflict { color: var(--warn-text); font-weight: 600; }
.st-in, .st-strong { color: var(--primary-text); font-weight: 600; }
.hidden-note { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 2px 12px 4px; }
.hidden-note .ic { width: 16px; height: 16px; }
.stack { display: inline-flex; flex: none; }
.stack-av { position: relative; display: inline-flex; margin-left: -6px; }
.stack-av:first-child { margin-left: 0; }
.stack-av .av { --s: 24px; font-size: 11px; border: 2px solid var(--bg); }
.mini-badge { position: absolute; right: -4px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; color: var(--text); }
.mini-badge .ic { width: 11px; height: 11px; }
.mini-badge.want { color: var(--heart); }
.mini-badge.here, .mini-badge.ok { color: var(--primary); }

.caption-box { padding: 2px 12px 0; display: flex; flex-direction: column; align-items: flex-start; }
.caption { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.caption b { font-weight: 600; }
/* 글자 크기는 그대로, 위아래 여백으로 누르는 높이 32px 이상 */
.link-more, .link-muted { border: 0; background: transparent; padding: 7px 0; min-height: 32px; line-height: 18px; color: var(--muted); font-size: 14px; text-align: left; }
.cap-list { display: flex; flex-direction: column; gap: 4px; padding: 2px 0; }
.cap-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.cap-list .ic { width: 16px; height: 16px; color: var(--muted); margin-top: 2px; }
.post-meta { display: flex; gap: 12px; padding: 0 12px 4px; font-size: 12px; color: var(--muted); overflow: hidden; }
.post-meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta span:first-child { flex: 0 1 auto; }
.post-meta .ic { width: 14px; height: 14px; }
.feed-note { display: flex; align-items: center; gap: 6px; padding: 12px; font-size: 12px; color: var(--muted); }
.feed-note .ic { width: 16px; height: 16px; }

/* ---------- 단추, 칩 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px;
  background: var(--btn); color: var(--text); font-size: 14px; font-weight: 600;
}
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--btn-primary); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--btn); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip .num { color: var(--muted); font-weight: 400; }
.chip.on { background: var(--text); color: var(--bg); }
.chip.on .num { color: inherit; opacity: 0.7; }
.explore-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 24px; text-align: center; }
.empty-ic { width: 56px; height: 56px; color: var(--muted); margin-bottom: 8px; }
.empty .btn { margin-top: 12px; }

/* ---------- 결과: 활동 알림처럼 ---------- */
.note { padding: 12px 16px 0; font-size: 12px; color: var(--muted); }
.group-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; padding: 20px 16px 6px; }
.group-title .ic { width: 20px; height: 20px; }
.group-title .num { color: var(--muted); font-weight: 400; font-size: 14px; }
/* 라이트 바탕에서 글자 대비 4.5 이상이 되게 글자만 진한 빨강. 아이콘은 경고색 그대로 */
.g-conflict .group-title { color: var(--warn-text); }
.g-conflict .group-title > .ic { color: var(--warn); }
.r-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 16px; border: 0; background: transparent; text-align: left; }
.r-row:hover { background: var(--surface); }
.r-text { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.35; }
.r-text b { font-weight: 600; }
.tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line); font-size: 11px; line-height: 18px; color: var(--muted); white-space: nowrap; vertical-align: 1px; }
.tag.warn { color: var(--warn-text); border-color: currentColor; }
.dots { display: inline-flex; flex: none; }
.dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; border: 2px solid var(--bg); margin-left: -5px; }
.dot:first-child { margin-left: 0; }
.dot .ic { width: 14px; height: 14px; }
.dot.none { background: var(--bg); color: var(--muted); border: 1.5px dashed var(--muted); }
.dot.hid { opacity: 0.55; }
.result-cols .col { min-width: 0; }
/* 아직 묶음: 내가 안 고른 곳 요약, 기다리는 곳 소제목, 모두 보기 */
.todo-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 16px 4px; padding: 10px 12px; border-radius: 8px; background: var(--surface); }
.todo-line p { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.todo-line p .ic { width: 20px; height: 20px; color: var(--muted); }
.todo-line .btn { flex: none; }
.wait-title { font-size: 13px; font-weight: 600; color: var(--muted); padding: 14px 16px 2px; }
.wait-title .num { font-weight: 400; }
.more-rows { display: block; width: calc(100% - 32px); min-height: 44px; margin: 4px 16px 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); font-size: 14px; font-weight: 600; }
.more-rows:hover { background: var(--surface); }

/* ---------- 나 ---------- */
.wide-stats { padding: 8px 16px 4px; justify-content: space-around; }
.wide-stats li { gap: 2px; }
.wide-stats .ic { width: 22px; height: 22px; }
.wide-stats .heart { color: var(--heart); }
.wide-stats .heart b, .wide-stats .heart span { color: var(--text); }
.me-actions { display: flex; gap: 8px; padding: 12px 16px 0; }
.me-actions .btn { flex: 1 1 auto; }
.people li { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.people .ring-av { padding: 2px; }
.people .ring-av > .av { --s: 40px; border-width: 2px; font-size: 16px; }
.person-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.person-text .muted { font-size: 12px; font-weight: 400; }
.people progress { width: 72px; accent-color: var(--primary); }
.me-sync { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; font-size: 12px; }
.mock-box { margin: 8px 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: var(--muted); }
.mock-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---------- 상세 시트 (휴대폰) ---------- */
.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto;
  width: 100%; max-width: 640px; max-height: 88dvh; height: auto;
  padding: 0; border: 0; border-radius: 16px 16px 0 0;
  background: var(--elevated); color: var(--text);
  overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; animation: up 220ms ease-out; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.5); }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-grab { flex: none; height: 24px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grab span { width: 40px; height: 4px; border-radius: 2px; background: var(--muted); opacity: 0.5; }
.sheet-inner { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 0 4px 8px 12px; }
.sheet-photo { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); }
.sheet-photo img { width: 100%; height: 100%; object-fit: cover; }
.sheet-photo .fb-ic { width: 25%; }

.fields { padding: 4px 16px; }
.f-row { position: relative; min-width: 0; padding: 10px 0 10px 32px; border-bottom: 1px solid var(--line); }
.f-row:last-child { border-bottom: 0; }
/* 아이콘은 dt 안에 있지만 보이는 자리는 전처럼 왼쪽 칸 */
.f-row dt > .ic { position: absolute; left: 0; top: 11px; width: 20px; height: 20px; color: var(--muted); }
.f-row dt { font-size: 12px; color: var(--muted); }
.f-row dd { font-size: 14px; min-width: 0; }
.sub { font-size: 14px; font-weight: 600; padding: 16px 16px 4px; }
.plain { padding: 0 16px; }
.plain li { padding: 6px 0; font-size: 14px; }
.plain a, .fields a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.plain .ic, .fields .plain .ic { width: 14px; height: 14px; margin-left: 4px; color: var(--muted); vertical-align: -2px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 8px; }
.link-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 8px; background: var(--btn); font-size: 13px; font-weight: 600; }
.link-chip .ic { width: 16px; height: 16px; }

/* ---------- 알림 ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 12px);
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100% - 24px);
  padding: 8px 8px 8px 16px; border-radius: 8px;
  background: var(--toast); color: #fff; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.toast-btn { border: 0; background: transparent; color: #4CB5F9; font-weight: 600; min-height: 36px; padding: 0 8px; white-space: nowrap; }

/* ---------- 웹 모달 (휴대폰에서는 열지 않는다) ---------- */
.modal { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); }
.modal[open] { display: flex; align-items: center; justify-content: center; gap: 16px; }
.modal::backdrop { background: rgba(0, 0, 0, 0.65); }
.m-box { display: flex; background: var(--elevated); border-radius: 4px; overflow: hidden; max-height: 90vh; }
.m-photo { position: relative; height: min(90vh, calc((100vw - 560px) * 1.25)); aspect-ratio: 4 / 5; background: #000; flex: none; cursor: pointer; user-select: none; }
.m-photo img { width: 100%; height: 100%; object-fit: cover; }
.m-panel { width: 400px; flex: none; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.m-panel .post-head { border-bottom: 1px solid var(--line); padding: 8px 12px; min-height: 60px; }
.m-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.m-foot { flex: none; border-top: 1px solid var(--line); padding-bottom: 8px; }
.m-pos { padding: 0 12px; font-size: 12px; }
.m-nav { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.9); color: #000; display: grid; place-items: center; padding: 0; }
.m-nav:disabled { opacity: 0; pointer-events: none; }
.m-close { position: fixed; top: 8px; right: 8px; width: 48px; height: 48px; border: 0; background: transparent; color: #fff; display: grid; place-items: center; }
.m-close .ic { width: 28px; height: 28px; }

/* 웹 사이드바는 1024 이상에서만 */
.sidebar { display: none; }

/* ---------- 768~1023: 모바일 배치를 가운데로 넓게 ---------- */
@media (min-width: 768px) {
  .view { max-width: 640px; }
  .grid { gap: 3px; }
  .topbar { padding-left: max(12px, calc((100vw - 640px) / 2)); padding-right: max(4px, calc((100vw - 640px) / 2 - 8px)); }
  .tabbar { padding-left: calc((100vw - 640px) / 2); padding-right: calc((100vw - 640px) / 2); }
  .auth-banner { padding-left: max(16px, calc((100vw - 640px) / 2 + 16px)); padding-right: max(16px, calc((100vw - 640px) / 2 + 16px)); }
  .post { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0 0 20px; }
  .feed { padding-top: 16px; }
}

/* ---------- 1024 이상: 웹 배치 ---------- */
@media (min-width: 1024px) {
  :root { --side: 72px; }
  body.in-app { padding-left: var(--side); }
  body.in-app .view { padding-bottom: 48px; }
  .tabbar { display: none !important; }
  /* 웹에서는 상단 막대 대신 오른쪽 위에 저장 상태만 띄운다 */
  .topbar { position: fixed; top: 12px; right: 16px; left: auto; min-height: 0; padding: 0; border: 0; background: transparent; z-index: 30; }
  .topbar #back-btn, .topbar .topbar-title, .topbar #topbar-result { display: none; }
  .topbar .pill { background: var(--elevated); border: 1px solid var(--line); }
  /* 웹은 위 막대가 오른쪽 위 저장 표시뿐이라 띠를 맨 위에 붙이고, 그 표시 자리만큼 오른쪽을 비운다 */
  body.in-app .auth-banner { top: 0; padding: 14px 200px 14px 24px; }
  .toast { bottom: 24px; }

  .sidebar:not([hidden]) {
    display: flex; flex-direction: column; gap: 4px;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 26; width: var(--side);
    padding: 8px 12px 20px; border-right: 1px solid var(--line); background: var(--bg);
  }
  .side-brand { display: flex; align-items: center; min-height: 72px; padding: 0 12px; margin-bottom: 8px; }
  .side-brand .wordmark { display: none; }
  .side-mark { display: grid; place-items: center; }
  .side-menu { display: flex; flex-direction: column; gap: 4px; }
  .side-item { display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 12px; border-radius: 8px; font-size: 16px; }
  .side-item:hover { background: var(--surface); }
  .side-item.on { font-weight: 700; }
  .side-item .nav-me { margin: -3px; }
  .side-label { display: none; white-space: nowrap; }
  .side-sync { display: none; }
  .side-bottom { margin-top: auto; }

  .view { max-width: none; margin: 0; padding: 0 24px; }
  .page { max-width: 935px; margin: 0 auto; padding-top: 32px; }
  .feed, .lodging-feed { max-width: 470px; }
  .page-head { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: block; padding: 0 0 20px; }
  .page-head h1 { font-size: 20px; font-weight: 600; }
  .page-head p { font-size: 14px; color: var(--muted); margin-top: 2px; }
  .feed-note { display: none; }

  .home .profile { gap: 64px; padding: 0 0 24px 48px; }
  .home .ring-av.big > .av { --s: 140px; font-size: 56px; border-width: 4px; }
  .home .ring-av.big { padding: 4px; }
  .profile-name { font-size: 20px; font-weight: 400; margin-bottom: 16px; }
  .home .stats { justify-content: flex-start; gap: 40px; }
  .home .stats li { flex-direction: row; gap: 4px; align-items: baseline; }
  .profile-line { padding: 0 0 20px 48px; font-size: 14px; }
  .highlights { gap: 32px; padding: 0 0 32px 24px; }
  .hl { width: 87px; }
  .hl-ring { width: 87px; height: 87px; }
  .hl-ic { width: 32px; height: 32px; }
  .hl-name { font-size: 12px; font-weight: 600; max-width: 87px; }
  .ptabs { justify-content: center; gap: 60px; }
  .ptab { flex: 0 0 auto; min-height: 52px; letter-spacing: 1px; }
  .grid { gap: 4px; }

  /* 마우스를 올리면 집계 대신 내 선택 아이콘만 */
  .cell-hover { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; gap: 6px; background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 16px; font-weight: 700; opacity: 0; transition: opacity 120ms; }
  .cell-hover .ic { width: 24px; height: 24px; }
  .cell:hover .cell-hover, .cell:focus-visible .cell-hover { opacity: 1; }

  .explore-cta, .chips { padding-left: 0; padding-right: 0; }
  .me .profile, .me .wide-stats, .me .people li, .me .me-sync, .me .me-actions { padding-left: 0; padding-right: 0; }
  .me .sec-title { padding-left: 0; }
  .me .mock-box { margin-left: 0; margin-right: 0; }

  .result-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .result .note { padding-left: 0; }
  .result .group-title { padding-left: 8px; }
  .result .r-row { padding-left: 8px; padding-right: 8px; border-radius: 8px; }
  .result .todo-line { margin-left: 0; margin-right: 0; }
  .result .wait-title { padding-left: 8px; }
  .result .more-rows { width: 100%; margin-left: 0; margin-right: 0; }
}

@media (min-width: 1264px) {
  :root { --side: 244px; }
  .side-brand .wordmark { display: block; }
  .side-mark { display: none; }
  .side-label { display: inline; }
}

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