/* ============================================================
   점심 뭐먹지 — 모던 앱 스타일
   ============================================================ */
:root {
  --accent: #ff6b3d;
  --accent-press: #f0552a;
  /* 글자 대비(WCAG 4.5:1)용: 흰 글자를 올리는 버튼 배경 / 흰·연주황 배경 위 주황 글자 / 경고 빨강 */
  --accent-strong: #cc4310;
  --accent-strong-press: #b23a0d;
  --accent-ink: #c2410c;
  --danger: #c81f33;
  --accent-soft: #fff1ec;
  --accent-grad: linear-gradient(135deg, #ff8a3d 0%, #ff5a5f 100%);
  --yellow: #ffc61a;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f2f3f5;
  --line: #eceef1;
  --text: #191f28;
  --text-2: #4e5968;
  --text-3: #66707d;   /* 보조 글자 (흰 배경 5.0 · 회색 배경 4.5 이상) */
  --text-4: #b0b8c1;   /* 장식·아이콘·placeholder·비활성 전용 (글자에는 --text-3) */
  --on-accent: #ffffff;
  --overlay: rgba(0, 0, 0, 0.4);
  --glass: rgba(255, 255, 255, 0.82);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 20px rgba(25, 31, 40, 0.06);
  --shadow-lg: 0 16px 40px rgba(255, 90, 60, 0.28);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;

  --pad: 20px;
  --tab-h: 64px;
  --header-h: 112px;
  --reel-item-h: 104px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
[data-theme="dark"] {
  --accent-soft: rgba(255, 107, 61, 0.14);
  --bg: #101114;
  --surface: #1b1d22;
  --surface-2: #26282e;
  --line: #2a2d33;
  --text: #f2f4f6;
  --text-2: #c3c8cf;
  --text-3: #8b95a1;
  --text-4: #7b838e;
  --accent-ink: var(--accent);
  --danger: #f04452;
  --overlay: rgba(0, 0, 0, 0.6);
  --glass: rgba(16, 17, 20, 0.8);
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 16px 40px rgba(255, 90, 60, 0.2);
}

/* ---------- 아이콘 (icons/ 폴더 SVG를 마스크로) ---------- */
.icon {
  display: inline-block; flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}
.icon-xs { width: 16px; height: 16px; }
.icon-sm { width: 20px; height: 20px; }
.icon-md { width: 24px; height: 24px; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 40px; height: 40px; }
.icon-refresh       { --i: url('icons/action/refresh-ccw.svg'); }
.icon-map-pin       { --i: url('icons/content/map-pin.svg'); }
.icon-chevron-down  { --i: url('icons/navigation/chevron-down.svg'); }
.icon-list          { --i: url('icons/navigation/list.svg'); }
.icon-layout-grid   { --i: url('icons/navigation/layout-grid.svg'); }
.icon-star          { --i: url('icons/content/star.svg'); }
.icon-message-square{ --i: url('icons/content/message-square.svg'); }
.icon-x             { --i: url('icons/navigation/x.svg'); }
.icon-settings      { --i: url('icons/user/settings.svg'); }
.icon-check         { --i: url('icons/action/check.svg'); }
.icon-external-link { --i: url('icons/navigation/external-link.svg'); }
.icon-share         { --i: url('icons/action/share.svg'); }
.icon-search        { --i: url('icons/navigation/search.svg'); }
.icon-alert-triangle{ --i: url('icons/notification/alert-triangle.svg'); }
.icon-alert-circle  { --i: url('icons/notification/alert-circle.svg'); }

/* ---------- 기본 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
/* 탭마다 페이지 길이가 달라도 스크롤바 자리를 항상 확보 → 화면이 옆으로 밀리지 않게 */
html { overflow-y: scroll; scrollbar-gutter: stable; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; letter-spacing: inherit; }
ul { list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

.app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

/* ---------- 헤더 ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  padding: calc(env(safe-area-inset-top) + 14px) var(--pad) 12px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.app-header__row { display: flex; align-items: center; justify-content: space-between; }
.app-header__title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-full);
  color: var(--text-2);
  transition: background-color 0.15s;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn.is-spinning .icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.loc-bar {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; margin-top: 6px;
  padding: 7px 12px 7px 10px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px; font-weight: 500;
  transition: transform 0.15s var(--ease);
}
.loc-bar:active { transform: scale(0.97); }
.loc-bar > .icon:first-child { color: var(--accent); }
.loc-bar__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-bar__radius { font-weight: 700; color: var(--text); }
.loc-bar__radius::before { content: "·"; margin-right: 6px; color: var(--text-4); font-weight: 400; }
.loc-bar > .icon:last-child { color: var(--text-3); }

/* ---------- 메인 ---------- */
.app-main { flex: 1; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); }
/* 탭 전환: 위치 이동 없이 투명도만 바꿔서 화면이 들썩이지 않게 */
.panel { animation: fadeIn 0.2s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- 칩 ---------- */
.chips {
  display: flex; gap: 8px;
  padding: 4px var(--pad) 12px;
  overflow-x: auto; scrollbar-width: none;
  position: sticky; top: var(--header-h); z-index: 10;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.chips::-webkit-scrollbar { display: none; }
/* 마우스(PC)에서는 옆으로 밀 수 없으므로 여러 줄로 펼쳐서 모두 보이게 (터치 기기는 가로 스크롤 유지) */
@media (hover: hover) and (pointer: fine) {
  .chips:not(.chips--wrap) { flex-wrap: wrap; overflow-x: visible; }
}
.chips--wrap { flex-wrap: wrap; position: static; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible; }
.chip {
  flex-shrink: 0;
  height: 36px; padding: 0 14px;
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 0.2s, color 0.2s, transform 0.15s var(--ease);
}
.chip:active { transform: scale(0.95); }
.chip small { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
.chip[aria-pressed="true"] small { color: inherit; opacity: 0.6; }
.chip--off { background: var(--surface-2); box-shadow: none; }
.chip--off[aria-pressed="true"] { background: var(--surface-2); color: var(--text-4); text-decoration: line-through; }
.chip--off[aria-pressed="false"] { background: var(--accent-soft); color: var(--accent-ink); }
.chip--off[aria-pressed="false"] small { color: var(--accent-ink); opacity: 0.8; }

/* ---------- 가게 목록 ---------- */
.list-meta { padding: 8px var(--pad) 0; font-size: 13px; font-weight: 500; color: var(--text-3); }
.place-list { display: flex; flex-direction: column; gap: 10px; padding: 12px var(--pad); }
.place {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px 8px 14px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease);
}
.place:active { transform: scale(0.985); }
.place__thumb {
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 26px;
}
.place__link { flex: 1; min-width: 0; display: block; color: inherit; text-decoration: none; }
.place__name {
  display: flex; align-items: center; gap: 6px;
  font-size: 17px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.place__visited {
  flex-shrink: 0;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-full);
  color: var(--accent-ink); background: var(--accent-soft);
}
.place__meta { display: flex; gap: 6px; margin-top: 2px; font-size: 14px; color: var(--text-3); }
.place__meta > span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place__dist { flex-shrink: 0; white-space: nowrap; color: var(--text-2); font-weight: 600; }
.place__addr { display: block; margin-top: 1px; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-full);
  color: var(--text-4);
  transition: transform 0.2s var(--spring), color 0.2s;
}
.fav-btn:active { transform: scale(0.8); }
.fav-btn[aria-pressed="true"] { color: var(--yellow); }
.share-btn { width: 36px; margin-right: -6px; }

/* 비어있음 / 로딩 */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 64px 24px; text-align: center;
  color: var(--text-3); font-size: 15px;
}
.empty .icon { color: var(--text-4); margin-bottom: 8px; }
.empty strong { color: var(--text); font-size: 19px; font-weight: 700; }
.empty .btn { margin-top: 12px; }
.skeleton {
  height: 80px; border-radius: var(--r-lg);
  background: var(--surface);
  position: relative; overflow: hidden;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--surface-2), transparent);
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 52px; padding: 0 20px;
  border-radius: var(--r-md);
  font-size: 16px; font-weight: 700;
  transition: transform 0.15s var(--ease), background-color 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { cursor: default; transform: none; }
.btn--primary { background: var(--accent-strong); color: var(--on-accent); }
.btn--primary:active { background: var(--accent-strong-press); }
.btn--primary:disabled { opacity: 0.4; }
.btn--ghost { background: var(--surface-2); color: var(--text); height: 48px; font-size: 15px; }

/* ---------- 슬롯머신 ---------- */
.slot { display: flex; flex-direction: column; gap: 16px; padding: 8px var(--pad) 24px; }
.slot__machine {
  position: relative;
  background: var(--accent-grad);
  border-radius: var(--r-xl);
  padding: 20px 14px 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.slot__machine::before {
  content: ""; position: absolute; inset: -40% -20% auto auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.slot__labels {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 10px; text-align: center;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
}
.slot__reels { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.reel {
  position: relative;
  height: var(--reel-item-h);
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}
.reel::before, .reel::after {
  content: ""; position: absolute; left: 0; right: 0; height: 18px; z-index: 1; pointer-events: none;
}
.reel::before { top: 0; background: linear-gradient(var(--surface), transparent); }
.reel::after { bottom: 0; background: linear-gradient(transparent, var(--surface)); }
.reel.is-stopped { animation: reelPop 0.35s var(--spring); }
@keyframes reelPop { 50% { transform: scale(1.06); } }
.reel__strip { will-change: transform; }
.reel__item {
  height: var(--reel-item-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 0 6px; text-align: center;
  font-size: 15px; font-weight: 700; line-height: 1.25;
  word-break: keep-all; overflow-wrap: anywhere;
}
.reel__item .emoji { font-size: 30px; line-height: 1; }
.reel__item--q { font-size: 30px; font-weight: 800; color: var(--text-4); }

.btn--lever {
  height: 60px; border-radius: var(--r-lg);
  font-size: 18px; font-weight: 800;
  background: var(--text); color: var(--bg);
}
.btn--lever:active { background: var(--text); opacity: 0.85; }
.btn--lever:disabled { opacity: 0.35; }

.result {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 28px 20px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: resultIn 0.5s var(--spring);
}
@keyframes resultIn { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
.result__badge {
  display: inline-block;
  padding: 4px 10px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 700;
  color: var(--accent-ink); background: var(--accent-soft);
}
.result__name { margin-top: 10px; font-size: 26px; font-weight: 800; line-height: 1.25; letter-spacing: -0.03em; word-break: keep-all; }
.result__meta { margin-top: 6px; font-size: 15px; color: var(--text-3); }
.result__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.result__actions .btn { padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.result__actions .btn--full { grid-column: 1 / -1; }
.result__actions a.btn { text-decoration: none; }
.result__actions [data-fav][aria-pressed="true"] .icon { color: var(--yellow); }

/* 날씨 반영 안내 한 줄 */
.weather {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-sm);
  font-size: 14px; color: var(--text-2);
}
.weather__now { font-weight: 700; color: var(--text); }
.weather b { color: var(--accent-ink); font-weight: 700; }
.slot-opts { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.slot-opts summary {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 18px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; list-style: none;
}
.slot-opts summary::-webkit-details-marker { display: none; }
.slot-opts summary .icon { color: var(--text-3); }
.slot-opts__count { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.slot-opts__body { display: flex; flex-direction: column; gap: 14px; padding: 0 18px 18px; }
.slot-opts__label { font-size: 13px; font-weight: 600; color: var(--text-3); }

/* iOS 스타일 토글 */
.switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 15px; font-weight: 500; color: var(--text);
  cursor: pointer;
}
.switch span { order: -1; }
.switch input {
  -webkit-appearance: none; appearance: none;
  flex-shrink: 0;
  width: 48px; height: 28px; border-radius: var(--r-full);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  position: relative; cursor: pointer;
  transition: background-color 0.2s;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s var(--spring);
}
.switch input:checked { background: var(--accent); box-shadow: none; }
.switch input:checked::after { transform: translateX(20px); }

/* ---------- 탭바 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12px; font-weight: 600;
  color: var(--text-3);
  transition: color 0.2s;
}
.tabbar__item .icon { transition: transform 0.25s var(--spring); }
.tabbar__item:active .icon { transform: scale(0.85); }
.tabbar__item[aria-selected="true"] { color: var(--text); }

/* ---------- 바텀시트 ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet__dim { position: absolute; inset: 0; background: var(--overlay); animation: fadeIn 0.2s ease-out; }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 12px var(--pad) calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
  animation: sheetUp 0.35s var(--ease);
}
.sheet__panel::before {
  content: ""; align-self: center;
  width: 36px; height: 5px; border-radius: var(--r-full);
  background: var(--line); margin-bottom: 6px;
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; }
.sheet__head h2 { font-size: 20px; font-weight: 800; }
.sheet__label { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.sheet__hint { font-size: 13px; color: var(--text-3); line-height: 1.45; }
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; border-radius: var(--r-md);
  background: var(--surface-2);
}
.seg button {
  height: 40px; border-radius: 12px;
  font-size: 15px; font-weight: 600; color: var(--text-3);
  transition: background-color 0.2s, color 0.2s;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--line); }
.seg button:disabled { opacity: 0.4; }
.sheet .btn--ghost { color: var(--accent-ink); }

/* 회사 주소 검색 */
.addr-search {
  display: flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 6px 0 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.addr-search > .icon { color: var(--text-3); }
.addr-search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: none;
  font: inherit; font-size: 16px; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.addr-search input::placeholder { color: var(--text-4); }
.addr-search:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.addr-search__btn {
  height: 40px; padding: 0 14px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 700;
}
.addr-results { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; }
.addr-results:empty { display: none; }
.addr-results button {
  width: 100%; text-align: left;
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
}
.addr-results button:active { background: var(--surface-2); }
.addr-results strong { font-size: 15px; font-weight: 700; }
.addr-results span { font-size: 13px; color: var(--text-3); }
.addr-results__msg { padding: 12px 6px; font-size: 14px; color: var(--text-3); }
.sheet__panel { max-height: 92vh; overflow-y: auto; }
.empty .btn + .btn { margin-top: 0; }
.empty .btn { min-width: 220px; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px);
  z-index: 60;
  max-width: calc(100% - 40px);
  padding: 12px 18px;
  border-radius: var(--r-md);
  background: rgba(25, 31, 40, 0.92);
  color: #fff;
  font-size: 14px; font-weight: 600;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: toastIn 0.3s var(--spring);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

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

/* ---------- 가게 상세 (카카오 장소 페이지) ---------- */
.sheet--detail .sheet__panel {
  height: 92vh; height: 92dvh; max-height: none; overflow: hidden;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.detail__head { min-width: 0; }
.detail__head h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail__meta { margin-top: 2px; font-size: 14px; color: var(--text-3); }
.detail__hint { font-size: 13px; color: var(--text-3); }
.detail__hint b { color: var(--accent-ink); }
.detail__frame {
  position: relative; flex: 1; min-height: 0;
  border-radius: var(--r-md); overflow: hidden;
  background: #fff; border: 1px solid var(--line);
}
.detail__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.detail__loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #8b8f99;
}
.detail__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail__actions a.btn { text-decoration: none; }
/* 이번 주 뷔페 메뉴 바로가기 */
.buffet { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.buffet__title { font-size: 16px; font-weight: 800; }
.buffet__links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.buffet__link {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 12px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text); text-decoration: none;
}
.buffet__link:active { transform: scale(0.98); }
.buffet__name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buffet__src { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.buffet__hint { font-size: 12px; color: var(--text-3); }
.detail__buffet:empty { display: none; }
.buffet__link--detail { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; background: var(--accent-soft); }
/* 가게 상세: 여기 갈게요 */
.detail__go:empty { display: none; }
.detail__go-btn { width: 100%; height: auto; min-height: 56px; padding: 8px 16px; flex-direction: column; gap: 2px; }
.detail__go-main { display: inline-flex; align-items: center; gap: 6px; }
.detail__go-btn small { font-size: 13px; font-weight: 500; opacity: 0.9; }
.detail__going {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 14px; border-radius: var(--r-md);
  background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent);
}
.detail__going span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; color: var(--text-2); }
.detail__going b { font-size: 15px; color: var(--text); }
.detail__going .btn { flex-shrink: 0; height: 40px; padding: 0 14px; font-size: 14px; }

/* ============================================================
   로그인 · 멤버 취향
   ============================================================ */
.icon-user     { --i: url('icons/user/user.svg'); }
.icon-users    { --i: url('icons/user/users.svg'); }
.icon-log-out  { --i: url('icons/user/log-out.svg'); }
.icon-x-circle { --i: url('icons/notification/x-circle.svg'); }

.app-header__actions { display: flex; align-items: center; gap: 4px; }
.user-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-full);
  color: var(--text-2);
  transition: transform 0.15s var(--ease);
}
.user-btn:active { transform: scale(0.92); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--r-full);
  background: var(--accent-grad); color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: -0.04em;
}
.avatar--lg { width: 52px; height: 52px; font-size: 17px; }

/* 로그인 시트 */
.user-body { display: flex; flex-direction: column; gap: 10px; }
.member-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.member-grid button {
  height: 48px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text);
  font-size: 15px; font-weight: 700;
  transition: background-color 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.member-grid button:active { transform: scale(0.96); }
.member-grid button[aria-pressed="true"] { background: var(--accent-strong); color: var(--on-accent); }
.login-form { display: flex; flex-direction: column; gap: 8px; }
.pw-input {
  height: 52px; padding: 0 16px;
  border: 0; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 18px; letter-spacing: 0.3em;
  outline: none;
}
.pw-input::placeholder { letter-spacing: normal; font-size: 15px; color: var(--text-4); }
.pw-input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.login-error { min-height: 18px; font-size: 13px; font-weight: 600; color: var(--danger); }

/* ---------- 첫 화면 로그인 (login.html) ---------- */
.icon-lock { --i: url('icons/user/lock.svg'); }
.login-page {
  display: flex; flex-direction: column; justify-content: center; gap: 28px;
  max-width: 400px; min-height: 100%; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 24px) var(--pad) calc(env(safe-area-inset-bottom) + 24px);
}
.login-page__head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.login-page__logo { width: 64px; height: 64px; margin-bottom: 8px; border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.login-page__title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.login-page__desc { font-size: 15px; color: var(--text-3); }
.login-page .pw-input { letter-spacing: 0.08em; }
.login-page .btn { margin-top: 4px; }
.me-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: var(--r-lg); background: var(--surface-2);
}
.me-card strong { display: block; font-size: 18px; font-weight: 800; }
.me-card span:not(.avatar) { font-size: 13px; color: var(--text-3); }

/* 같이 가는 멤버 */
.party {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.party__head { display: flex; align-items: center; gap: 6px; }
.party__head .icon { color: var(--accent); }
.party__title { font-size: 16px; font-weight: 800; }
.party__sync {
  margin-left: auto; padding: 3px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700;
  background: var(--surface-2); color: var(--text-3);
}
.party__sync[data-sync="cloud"] { background: rgba(0, 196, 113, 0.12); color: #00a35c; }
.party__sync[data-sync="error"] { background: rgba(240, 68, 82, 0.12); color: var(--danger); }
.chip--member { height: 34px; padding: 0 12px; }
.chip--member small { margin-left: 3px; }
.party__summary { font-size: 13px; line-height: 1.55; color: var(--text-3); }
.party__summary b { color: var(--text); font-weight: 700; }
.party__top { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.party__top:empty { display: none; }
.party__top-title { font-size: 13px; font-weight: 700; color: var(--text-2); }
.party__top button {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--accent-soft); text-align: left;
}
.party__top-name { font-size: 15px; font-weight: 700; color: var(--text); }
.party__top-by { font-size: 12px; color: var(--text-3); }

/* 결과 카드 */
.result__fans { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.result__block {
  display: block; margin: 12px auto 0; padding: 6px 10px;
  font-size: 13px; font-weight: 600; color: var(--text-3);
  text-decoration: underline; text-underline-offset: 3px;
}

/* 목록: 블랙리스트 가게 */
.place--blocked .place__link, .place--blocked .place__thumb { opacity: 0.5; }
.place__black { color: var(--danger); background: rgba(240, 68, 82, 0.12); }
.fav-btn--block, .fav-btn--block[aria-pressed="true"] { color: var(--danger); }

/* 내 취향 탭 */
.taste { padding: 8px var(--pad) 24px; }
.taste .place-list { padding: 0; }
.taste-hello { font-size: 15px; color: var(--text-2); }
.taste-hello span { font-size: 13px; color: var(--text-3); }
.sec-title { margin: 22px 0 10px; font-size: 16px; font-weight: 800; }
.sec-title small { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.sec-empty {
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); font-size: 14px; line-height: 1.5; color: var(--text-3);
}
/* 안 먹는 음식: 누르면(pressed) 빨간 취소선 */
.taste-cats .chip--off[aria-pressed="false"] { background: var(--surface); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.taste-cats .chip--off[aria-pressed="true"] { background: rgba(240, 68, 82, 0.12); color: var(--danger); text-decoration: line-through; }
.taste-login {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 20px; border-radius: var(--r-lg);
  background: var(--surface); text-align: center;
}
.taste-login .icon { color: var(--accent); }
.taste-login strong { font-size: 17px; font-weight: 800; }
.taste-login span:not(.icon) { font-size: 14px; line-height: 1.5; color: var(--text-3); }
.taste-login .btn { margin-top: 6px; min-width: 200px; }

/* 상세 시트: 선호/블랙리스트 */
.detail__taste { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail__taste:empty { display: none; }
.taste-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text-2);
  font-size: 14px; font-weight: 700;
}
.taste-btn[aria-pressed="true"] { background: rgba(255, 198, 26, 0.18); color: #c99400; }
.taste-btn--block[aria-pressed="true"] { background: rgba(240, 68, 82, 0.12); color: var(--danger); }
/* 폐업 신고 버튼: 두 칸 전체, 눌린 상태(신고됨)는 회색 */
.taste-btn--closed { grid-column: 1 / -1; color: var(--text-3); font-weight: 600; }
.taste-btn--closed[aria-pressed="true"] { background: var(--surface-2); color: var(--text-2); }
/* 내 취향 탭: 폐업 신고로 숨긴 가게 */
.place--closed .place__link, .place--closed .place__thumb { opacity: 0.6; }
.place--closed .place__title { text-decoration: line-through; }
.place__reopen { flex-shrink: 0; align-self: center; height: 36px; padding: 0 12px; font-size: 13px; }
.detail__who { grid-column: 1 / -1; font-size: 13px; line-height: 1.5; color: var(--text-3); }

/* ============================================================
   별점 · 후기
   ============================================================ */
.place__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.place__rating {
  flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: #f5a400;
}
.place__rating small { margin-left: 1px; font-size: 12px; font-weight: 500; color: var(--text-3); }

.result__rating {
  display: inline-block; margin-top: 8px; padding: 4px 10px;
  border-radius: var(--r-full);
  background: rgba(255, 198, 26, 0.16); color: #c98a00;
  font-size: 13px; font-weight: 700;
}
[data-theme="dark"] .result__rating { color: var(--yellow); }

/* 상세: 메뉴 / 후기 탭 */
.detail__seg [role="tab"] { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.detail__seg [aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .detail__seg [aria-selected="true"] { background: var(--line); }
#detailReviewCount:not(:empty) {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full);
  background: var(--accent-strong); color: var(--on-accent);
  font-size: 11px; font-weight: 800; line-height: 18px;
}
.detail__frame[hidden], .detail__reviews[hidden], .detail__hint[hidden] { display: none; }
.detail__reviews {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 12px;
}
.rv-summary { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--text-3); }
.rv-summary__avg { font-size: 26px; font-weight: 800; color: #f5a400; letter-spacing: -0.02em; }
.rv-form {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: var(--r-lg); background: var(--surface-2);
}
.rv-form__label { font-size: 14px; font-weight: 700; color: var(--text-2); }
.rv-stars { display: flex; gap: 4px; }
.rv-stars button {
  width: 44px; height: 44px; border-radius: var(--r-sm);
  font-size: 32px; line-height: 1; color: var(--text-4);
  transition: transform 0.15s var(--spring), color 0.15s;
}
.rv-stars button.is-on { color: #ffb800; }
.rv-stars button:active { transform: scale(0.85); }
.rv-text {
  width: 100%; resize: none; padding: 12px 14px;
  border: 0; border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; line-height: 1.45; outline: none;
}
.rv-text::placeholder { color: var(--text-4); font-size: 14px; }
.rv-text:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.rv-form__btns { display: flex; gap: 8px; }
.rv-form__btns .btn { flex: 1; height: 46px; }
.rv-form__btns .btn--ghost { flex: 0 0 88px; background: var(--surface); color: var(--danger); }
.rv-login { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--text-3); }
.rv-login .btn { min-width: 180px; height: 46px; }
.rv-list { list-style: none; display: flex; flex-direction: column; }
.rv-item { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.rv-item:last-child { border-bottom: 0; }
.rv-item__head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rv-item__stars { color: #ffb800; letter-spacing: 1px; font-size: 13px; }
.rv-item__head time { margin-left: auto; font-size: 12px; color: var(--text-3); }
/* 후기 본문: 작성할 때 넣은 줄바꿈을 그대로 보여주고, 5줄(1.5 × 5 = 7.5em)을 넘으면 안에서 스크롤 */
.rv-item p {
  margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--text-2); word-break: keep-all; overflow-wrap: anywhere;
  white-space: pre-line;
  max-height: 7.5em; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
/* 아래에 더 읽을 내용이 있으면 마지막 줄을 흐리게 (app.js updateClip이 is-clipped를 붙였다 뗌) */
.rv-item p.is-clipped {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.5em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.5em), transparent);
}

/* ============================================================
   후기 탭 — 우리 후기 모아보기
   ============================================================ */
.rv-board__sort { padding: 4px var(--pad) 8px; }
.rv-board { list-style: none; display: flex; flex-direction: column; gap: 10px; padding: 12px var(--pad); }
.rv-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.rv-card__head {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  text-align: left; color: inherit;
  transition: transform 0.15s var(--ease);
}
.rv-card__head:active { transform: scale(0.985); }
.rv-card__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rv-card__name { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-card__meta { margin-top: 2px; font-size: 14px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-card__score { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; }
.rv-card__score b { font-size: 18px; font-weight: 800; color: #f5a400; letter-spacing: -0.02em; }
.rv-card__score small { font-size: 12px; color: var(--text-3); }
.rv-card .rv-list { margin-top: 10px; border-top: 1px solid var(--line); }
.rv-card .rv-item { padding: 10px 2px; }
.rv-card__more {
  width: 100%; height: 40px; margin-top: 4px;
  border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text-2);
  font-size: 14px; font-weight: 600;
}
.rv-card__more:active { transform: scale(0.98); }
.rv-board .empty b { color: var(--text-2); }
.rv-notice {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 14px; font-weight: 600; line-height: 1.45;
}
.rv-notice .icon { margin-top: 1px; }

/* ---------- 아이콘 추가 (디자인 시스템 data / user) ---------- */
.icon-bar-chart { --i: url('icons/data/bar-chart.svg'); }
.icon-user-plus { --i: url('icons/user/user-plus.svg'); }
.icon-key       { --i: url('icons/user/key.svg'); }

/* ---------- 근처 맛집 검색 ---------- */
.list-search {
  display: flex; align-items: center; gap: 8px;
  height: 46px; margin: 4px var(--pad) 4px; padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.list-search > .icon { color: var(--text-3); }
.list-search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: none;
  font: inherit; font-size: 16px; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.list-search input::placeholder { color: var(--text-3); }
.list-search:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.list-more {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 6px 0 2px; text-align: center;
  font-size: 14px; font-weight: 600; color: var(--text-3);
}
.empty--search { padding: 28px 24px 12px; }
.empty--search strong { font-size: 17px; }

/* ---------- 오늘 같이 가기 (헤더 아래) ---------- */
.today { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.today__item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
}
.today__item.is-mine { box-shadow: inset 0 0 0 2px var(--accent); }
.today__info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
}
.today__label { font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.today__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 800; color: var(--text); }
.today__who { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-2); }
.today__btn {
  flex-shrink: 0; min-height: 40px; padding: 0 14px;
  border-radius: var(--r-full);
  background: var(--accent-strong); color: var(--on-accent);
  font-size: 14px; font-weight: 700;
}
.today__btn:active { background: var(--accent-strong-press); }
.today__btn--leave { background: var(--surface); color: var(--text-2); }
.today__btn--leave:active { background: var(--surface-2); }

/* ---------- 거부권 ---------- */
.veto { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.veto__label { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.veto__chips { justify-content: center; }

/* ---------- 우리 팀 점심 기록 ---------- */
.stats__empty { font-size: 14px; color: var(--text-3); }
.stats__top { display: flex; flex-direction: column; gap: 6px; list-style: none; }
.stats__top button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2); text-align: left;
}
.stats__rank {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: var(--r-full);
  background: var(--accent-strong); color: var(--on-accent);
  font-size: 12px; font-weight: 800;
}
.stats__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; }
.stats__meta { flex-shrink: 0; font-size: 13px; color: var(--text-3); }
.stats__cats { display: flex; flex-direction: column; gap: 8px; }
.stats__cats li { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.stats__cat { font-weight: 600; white-space: nowrap; }
.stats__bar { height: 8px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; }
.stats__bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.stats__pct { font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* ---------- 새 후기 점 ---------- */
.tabbar__item { position: relative; }
.tabbar__dot {
  position: absolute; top: 10px; left: calc(50% + 8px);
  width: 8px; height: 8px; border-radius: var(--r-full);
  background: var(--danger); box-shadow: 0 0 0 2px var(--surface);
}

/* ---------- 기기 추가 ---------- */
.pair__desc { font-size: 14px; color: var(--text-2); line-height: 1.55; }
.pair { display: flex; gap: 8px; }
.pair .pw-input { flex: 1; min-width: 0; letter-spacing: 0.2em; }
.pair .btn { flex-shrink: 0; }
.pair-code {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--accent-soft); text-align: center;
}
.pair-code span { font-size: 13px; color: var(--text-2); }
.pair-code strong { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 30px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent-ink); }
