:root {
  --bg-body: #f4f7f6;
  --bg-card: #ffffff;
  --bg-closed: #fcfcfc;
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --text-muted: #868e96;
  --border-color: #e9ecef;
  --border-strong: #dddddd;
  --shadow-color: rgba(0, 0, 0, 0.05);
  --input-bg: #f1f3f5;
  --highlight-bg: #fff0f0;
  --filter-btn-bg: #f1f3f5;
  --filter-btn-text: #495057;
  --scroll-btn-bg: rgba(0, 0, 0, 0.5);
  --scroll-btn-text: #ffffff;
  --accent: #007bff;
  --danger: #e53935;
}

[data-theme="dark"] {
  --bg-body: #121212;
  --bg-card: #1e1e1e;
  --bg-closed: #161616;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b3b8;
  --text-muted: #888888;
  --border-color: #333333;
  --border-strong: #444444;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --input-bg: #2c2c2c;
  --highlight-bg: #3a1a1a;
  --filter-btn-bg: #2c2c2c;
  --filter-btn-text: #d0d0d0;
  --scroll-btn-bg: rgba(255, 255, 255, 0.2);
  --scroll-btn-text: #ffffff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg-body); }
body {
  min-height: 100vh;
  margin: 0;
  padding: calc(20px + env(safe-area-inset-top)) 10px calc(20px + env(safe-area-inset-bottom));
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: background-color .3s ease, color .3s ease;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
body.has-overlay { overflow: hidden; }
.container { width: 100%; max-width: 640px; margin: auto; color: var(--text-primary); }

.header-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, .02);
  border-radius: 24px;
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, .05);
}
[data-theme="dark"] .header-section { border-color: var(--border-color); }
.header-top-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: center;
  min-height: 40px;
}
.header-back-link {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 10px;
  transition: background-color .2s ease;
}
.header-back-link:hover { background: var(--input-bg); }
.header-back-link svg { width: 20px; height: 20px; }
.header-title-wrap { width: 100%; min-width: 0; text-align: center; pointer-events: none; }
.main-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  color: var(--text-primary);
  font-size: 1.12em;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main-title-icon { flex: 0 0 auto; font-size: .96em; line-height: 1; }
.main-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.header-right-icons { z-index: 1; display: flex; align-items: center; gap: 0; margin-right: -3px; }
.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  overflow: visible;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s ease;
}
.icon-btn svg { width: 20px; height: 20px; stroke-width: 1.8; }
.icon-btn:hover, .icon-btn[aria-pressed="true"] { color: var(--text-primary); background: var(--input-bg); }
.header-bookmark-btn[aria-pressed="true"] svg { fill: #f1c40f; stroke: #f1c40f; }
.filter-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  color: #fff;
  background: #ff6b6b;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
  font-size: 10px;
  font-weight: 800;
  animation: popIn .2s cubic-bezier(.175, .885, .32, 1.275);
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

.integrated-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: 14px;
  transition: all .2s cubic-bezier(.25, .8, .25, 1);
}
.integrated-search-bar:focus-within {
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 4px 15px rgba(0, 123, 255, .12);
  transform: translateY(-1px);
}
.search-icon { flex: 0 0 auto; width: 17px; height: 17px; color: #adb5bd; }
.search-input {
  min-width: 0;
  width: 100%;
  padding: 0;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: .95rem;
  font-weight: 500;
}
.search-input::placeholder { color: #adb5bd; font-weight: 400; }
.search-clear-btn { padding: 0 2px; color: var(--text-muted); background: none; border: 0; font-size: 20px; cursor: pointer; }

.segmented-control {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 218px;
  padding: 2px;
  background: var(--border-color);
  border-radius: 18px;
}
.segment-item {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 5px 9px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  font-size: .8em;
  font-weight: 500;
  letter-spacing: -.5px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s ease;
}
.segment-item.active { color: var(--text-primary); font-weight: 700; }
.segment-item.active[data-sort="recommended"] { color: var(--danger); }
[data-theme="dark"] .segment-item.active[data-sort="recommended"] { color: #ff6b6b; }
.segment-bg {
  position: absolute;
  z-index: 1;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc((100% - 4px) / 3);
  background: var(--bg-card);
  border-radius: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  transform: translateX(0);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.segmented-control[data-active-index="1"] .segment-bg { transform: translateX(100%); }
.segmented-control[data-active-index="2"] .segment-bg { transform: translateX(200%); }
[data-theme="dark"] .segment-bg { background: #3d3d3d; }

.map-location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 16px;
}
.map-location-label {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--text-secondary);
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-location-label.is-denied { color: var(--text-muted); font-weight: 500; }
.map-toggle-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  color: #fff;
  background: #1677ff;
  border: 1px solid #1677ff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(22,119,255,.28);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.map-toggle-btn:hover { transform: translateY(-1px); }
.map-toggle-btn:active { transform: translateY(1px); }
.map-toggle-icon { flex: 0 0 auto; }
.map-toggle-btn[aria-pressed="true"] { color: #1677ff; background: #eef5ff; border-color: #1677ff; box-shadow: none; }
.active-filter-row { display: flex; align-items: center; gap: 8px; margin: 0 4px 12px; }
.active-filter-chips { display: flex; flex: 1; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.active-filter-chips::-webkit-scrollbar { display: none; }
.active-filter-chip {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  font-size: .72em;
  font-weight: 700;
  cursor: pointer;
}
[data-theme="dark"] .active-filter-chip { color: #93c5fd; background: rgba(30, 64, 175, .2); border-color: rgba(147, 197, 253, .25); }
#resetAllFilters { flex: 0 0 auto; padding: 4px; color: var(--text-muted); background: none; border: 0; font-size: .72em; cursor: pointer; }

.explorer-grid { display: flex; flex-direction: column; gap: 12px; }
.explorer-grid .map-panel { order: -1; }
.explorer-grid[data-map-open="false"] .map-panel { display: none; }
.list-group { display: flex; flex-direction: column; gap: 10px; }
.post-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 110px;
  padding: 12px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 5px 15px var(--shadow-color);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.post-item:hover, .post-item.is-selected { border-color: #cfe2ff; box-shadow: 0 8px 20px rgba(0, 123, 255, .08); transform: translateY(-1px); }
.post-item:focus-within { outline: 2px solid rgba(0, 123, 255, .25); outline-offset: 2px; }
.post-top-info { display: flex; align-items: center; gap: 4px; min-width: 0; margin-bottom: 8px; color: var(--text-secondary); font-size: .75em; white-space: nowrap; overflow: hidden; }
.restaurant-distance-chip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2px;
  min-height: 24px;
  margin: -6px 0;
  padding: 6px 8px;
  color: #a83a5f;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: underline;
  text-decoration-color: rgba(168,58,95,.45);
  text-underline-offset: 2px;
  cursor: pointer;
}
.restaurant-distance-chip:hover { text-decoration-color: #a83a5f; }
.restaurant-distance-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(168,58,95,.2); }
.restaurant-distance-chip .dist-pin { font-size: .78rem; line-height: 1; }
.chip { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 6px; font-size: .92em; font-weight: 650; line-height: 1.4; }
.chip-info { color: #1e40af; background: #eff6ff; border: 1px solid #dbeafe; }
.chip-success { color: #047857; background: #ecfdf5; border: 1px solid #d1fae5; }
.chip-warning { color: #8a6200; background: #fff4db; border: 1px solid #ffe1a4; }
.chip-danger { color: #b91c1c; background: #fef2f2; border: 1px solid #fee2e2; }
[data-theme="dark"] .chip-info { color: #93c5fd; background: rgba(30,64,175,.18); border-color: rgba(147,197,253,.2); }
[data-theme="dark"] .chip-success { color: #6ee7b7; background: rgba(4,120,87,.18); border-color: rgba(110,231,183,.2); }
[data-theme="dark"] .chip-warning { color: #fcd34d; background: rgba(138,98,0,.18); border-color: rgba(252,211,77,.2); }
[data-theme="dark"] .chip-danger { color: #fca5a5; background: rgba(185,28,28,.18); border-color: rgba(252,165,165,.2); }
.top-stats { display: flex; align-items: center; gap: 8px; margin-left: auto; color: #a7adb3; font-size: .85em; }
.stat-item { display: inline-flex; align-items: center; gap: 3px; }
.stat-item svg { width: 14px; height: 14px; }
.bookmark-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  color: #ccc;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.bookmark-btn svg { width: 15px; height: 15px; fill: transparent; stroke: currentColor; stroke-width: 2.5; }
.bookmark-btn.is-saved { color: #f1c40f; }
.bookmark-btn.is-saved svg { fill: #f1c40f; transform: scale(1.15); }
.post-main-content { display: flex; align-items: flex-start; gap: 12px; }
.thumb-box {
  position: relative;
  display: flex;
  flex: 0 0 74px;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  overflow: hidden;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}
.restaurant-thumb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.visual-coral { background: linear-gradient(145deg, #fff0ec, #ffe0d8); }
.visual-gold { background: linear-gradient(145deg, #fff8db, #ffe9a8); }
.visual-green { background: linear-gradient(145deg, #edf8ea, #d7efcf); }
.visual-blue { background: linear-gradient(145deg, #eaf5ff, #d7eaff); }
.visual-purple { background: linear-gradient(145deg, #f5efff, #e8dcff); }
[data-theme="dark"] .restaurant-thumb { filter: brightness(.78) saturate(.8); }
.thumb-rank { position: absolute; top: 4px; left: 4px; min-width: 18px; height: 18px; padding: 0 4px; color: #fff; background: rgba(44,62,80,.78); border-radius: 5px; font-size: 10px; font-weight: 800; line-height: 18px; text-align: center; }
.info-box { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 74px; }
.post-title { margin-top: auto; margin-bottom: 2px; color: var(--text-primary); font-size: 1em; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.post-subtitle { margin-bottom: 5px; color: var(--text-secondary); font-size: .78em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-location-row { display: flex; align-items: center; width: 100%; margin-top: auto; }
.location-name { min-width: 0; color: var(--text-muted); font-size: .78em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time { flex: 0 0 auto; margin-left: auto; color: #bbb; font-size: .78em; }

.skeleton-list { display: flex; flex-direction: column; gap: 10px; }
.skeleton-card { height: 110px; border: 1px solid var(--border-color); border-radius: 14px; background: linear-gradient(100deg, var(--bg-card) 30%, var(--input-bg) 48%, var(--bg-card) 66%); background-size: 220% 100%; animation: skeleton 1.3s infinite linear; }
@keyframes skeleton { to { background-position-x: -220%; } }
.empty-state { padding: 48px 20px; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; text-align: center; box-shadow: 0 5px 15px var(--shadow-color); }
.empty-illustration { display: block; margin-bottom: 10px; font-size: 2.5rem; }
.empty-state h2 { margin: 0 0 8px; color: var(--text-primary); font-size: 1rem; }
.empty-state p { margin: 0 0 18px; font-size: .85rem; line-height: 1.55; }
.empty-state button { padding: 8px 14px; color: #fff; background: var(--accent); border: 0; border-radius: 10px; font-size: .82rem; font-weight: 700; cursor: pointer; }

.map-panel { min-height: 0; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 5px 15px var(--shadow-color); }
.map-surface { position: relative; height: 52vh; min-height: 320px; max-height: 540px; overflow: hidden; background: #edf1e7; }
.kakao-map, .fallback-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.fallback-map { overflow: hidden; touch-action: none; cursor: grab; background: linear-gradient(140deg, #eff1e8, #e6eadf); }
.fallback-map.is-dragging { cursor: grabbing; }
[data-theme="dark"] .fallback-map { filter: brightness(.62) contrast(1.1); }
.fallback-map [hidden] { display: none !important; }
.map-unavailable { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; padding: 24px; color: var(--text-muted); background: var(--bg-card); text-align: center; }
.map-unavailable strong { color: var(--text-main); font-size: 1rem; }
.map-unavailable span { font-size: .82rem; }
.river { position: absolute; left: -10%; right: -10%; bottom: -15%; height: 34%; background: #cfe2e7; transform: rotate(-4deg); }
.park-zone { position: absolute; left: 7%; top: 9%; width: 31%; height: 29%; color: #6d8d66; background: #cfe0c4; border-radius: 48% 42% 52% 40%; transform: rotate(-8deg); }
.park-zone span { position: absolute; left: 27%; top: 40%; font-size: .75rem; font-weight: 800; }
.road { position: absolute; background: rgba(255,255,255,.9); box-shadow: 0 0 0 1px rgba(185,190,180,.42); }
.road-a { left: -5%; top: 51%; width: 112%; height: 10px; transform: rotate(-6deg); }
.road-b { left: 53%; top: -10%; width: 9px; height: 125%; transform: rotate(10deg); }
.road-c { left: 15%; top: 66%; width: 90%; height: 7px; transform: rotate(8deg); }
.road-d { left: 37%; top: 15%; width: 7px; height: 80%; transform: rotate(-17deg); }
.map-label { position: absolute; color: rgba(70,80,70,.62); font-size: .68rem; font-weight: 700; }
.label-seongsu { left: 61%; top: 39%; }
.label-ttukseom { left: 44%; top: 71%; }
.label-forest { left: 17%; top: 20%; }
.map-user-anchor { position: absolute; z-index: 3; width: 15px; height: 15px; background: var(--accent); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 7px rgba(0,123,255,.13); transform: translate(-50%,-50%); }
.map-marker { position: absolute; z-index: 5; padding: 0; background: none; border: 0; transform: translate(-50%,-100%); cursor: pointer; }
.map-marker > span { display: flex; align-items: center; justify-content: center; width: 30px; height: 36px; color: #fff; background: #334155; border: 3px solid #fff; border-radius: 50% 50% 50% 8px; box-shadow: 0 4px 12px rgba(0,0,0,.22); transform: rotate(-45deg); }
.map-marker b { font-size: .7rem; transform: rotate(45deg); }
.map-marker.is-selected { z-index: 10; }
.map-marker.is-selected > span { background: var(--danger); transform: rotate(-45deg) scale(1.14); }
.map-marker svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transform: rotate(45deg); }
.map-marker.marker-type-korean > span { background: #9a5b32; }
.map-marker.marker-type-chinese > span { background: #c2413b; }
.map-marker.marker-type-japanese > span { background: #315f8c; }
.map-marker.marker-type-western > span { background: #6d4c8b; }
.map-marker.marker-type-meat > span { background: #a63c2f; }
.map-marker.marker-type-cafe > span { background: #7c5b45; }
.map-marker.marker-type-noodle > span { background: #bf7b25; }
.map-marker.marker-type-bar > span { background: #4f587d; }
.map-marker.is-selected > span { background: var(--danger); }
.map-area-search { position: absolute; top: 14px; left: 50%; z-index: 30; display: flex; align-items: center; gap: 4px; height: 38px; padding: 0 18px; color: #16314f; background: #fff; border: 1px solid var(--border-strong); border-radius: 999px; box-shadow: 0 6px 24px rgba(22,49,79,.16); font-size: .84rem; font-weight: 800; white-space: nowrap; cursor: pointer; transform: translateX(-50%); animation: map-search-pop .18s ease; }
.map-area-search[hidden] { display: none; }
.map-area-search:disabled { cursor: wait; opacity: .78; }
@keyframes map-search-pop { from { transform: translateX(-50%) scale(.9); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.map-fab-group { position: absolute; right: 14px; bottom: 16px; z-index: 30; display: flex; flex-direction: column; gap: 10px; }
.map-fab { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; color: #1f6f8b; background: #fff; border: 1px solid var(--border-color); border-radius: 50%; box-shadow: 0 6px 24px rgba(22,49,79,.16); cursor: pointer; }
.map-fab:active { background: #f0f4f7; }
.map-fab:disabled { cursor: wait; opacity: .75; }
.map-fab.locating svg { animation: map-fab-spin 1s linear infinite; }
@keyframes map-fab-spin { to { transform: rotate(360deg); } }
.fallback-zoom-control { position: absolute; right: 12px; bottom: 48px; z-index: 25; display: grid; overflow: hidden; border: 1px solid rgba(15,23,42,.14); border-radius: 10px; box-shadow: 0 3px 12px rgba(15,23,42,.15); }
.fallback-zoom-control button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: #334155; background: rgba(255,255,255,.96); border: 0; font-size: 1.25rem; font-weight: 700; cursor: pointer; }
.fallback-zoom-control button + button { border-top: 1px solid rgba(15,23,42,.12); }
.map-selected-card { padding: 10px; border-top: 1px solid var(--border-color); }
.map-mini-card { display: flex; align-items: center; gap: 10px; }
.map-mini-emoji { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--input-bg); border-radius: 10px; font-size: 1.4rem; }
.map-mini-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.map-mini-copy strong { font-size: .88rem; }
.map-mini-copy span { color: var(--text-muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-mini-open { padding: 6px 11px; color: #fff; background: var(--accent); border: 0; border-radius: 9px; font-size: .75rem; font-weight: 700; cursor: pointer; }

.filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 1999;
  visibility: hidden;
  opacity: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  transition: all .45s cubic-bezier(.16,1,.3,1);
}
.filter-overlay.is-visible { visibility: visible; opacity: 1; }
.filter-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  z-index: 2000;
  display: flex;
  visibility: hidden;
  flex-direction: column;
  width: 85%;
  max-width: 380px;
  height: 100%;
  padding-top: env(safe-area-inset-top);
  color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: 5px 0 25px rgba(0,0,0,.15);
  transition: left .45s cubic-bezier(.16,1,.3,1), visibility .45s;
}
.filter-drawer.is-open { left: 0; visibility: visible; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 8px 16px; border-bottom: 1px solid var(--border-color); }
.drawer-title-row { display: flex; align-items: center; gap: 8px; }
.drawer-title { color: var(--text-primary); font-size: 1em; font-weight: 700; }
.drawer-reset-btn { padding: 2px 6px; color: var(--text-muted); background: transparent; border: 0; font-size: .75em; font-weight: 600; cursor: pointer; }
.close-drawer-btn { display: flex; padding: 4px; color: var(--text-secondary); background: none; border: 0; cursor: pointer; }
.close-drawer-btn svg { width: 24px; height: 24px; }
.drawer-content { flex: 1; padding: 20px 20px 30px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.filter-group { margin: 0; }
.filter-group-title { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: .8em; font-weight: 700; }
.filter-group p { margin: -2px 0 10px; color: var(--text-muted); font-size: .72em; line-height: 1.45; }
.filter-section { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.filter-btn { position: relative; display: flex; align-items: center; gap: 3px; padding: 4px 9px; color: var(--filter-btn-text); background: var(--filter-btn-bg); border: 1px solid var(--border-strong); border-radius: 16px; font-size: .76em; font-weight: 500; cursor: pointer; user-select: none; transition: all .2s ease; }
.filter-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filter-btn:has(input:checked) { color: #fff; background: var(--accent); border-color: var(--accent); }
.drawer-divider { margin: 14px 0; border: 0; border-top: 1px solid var(--border-color); }
.settings-list { overflow: hidden; border: 1px solid var(--border-color); border-radius: 12px; }
.settings-item { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 10px 12px; }
.settings-label { display: flex; align-items: center; gap: 9px; font-size: .85em; font-weight: 600; }
.settings-icon { font-size: 1rem; }
.ios-toggle { position: relative; width: 48px; height: 26px; padding: 0; background: #cbd5e1; border: 0; border-radius: 26px; box-shadow: inset 0 1px 3px rgba(0,0,0,.1); cursor: pointer; transition: background-color .3s; }
.ios-toggle.active { background: var(--accent); }
.ios-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .3s cubic-bezier(.4,0,.2,1); }
.ios-toggle.active::after { transform: translateX(22px); }
.drawer-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border-color); background: var(--bg-card); }
.drawer-footer button { width: 100%; min-height: 44px; color: #fff; background: var(--accent); border: 0; border-radius: 12px; font-size: .9rem; font-weight: 700; cursor: pointer; }

.bottom-sheet-overlay { position: fixed; inset: 0; z-index: 3000; visibility: hidden; opacity: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); transition: opacity .3s; }
.bottom-sheet-overlay.is-visible { visibility: visible; opacity: 1; }
.detail-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 3001;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  padding: 20px 20px calc(18px + env(safe-area-inset-bottom));
  overflow: hidden;
  color: var(--text-primary);
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -5px 25px rgba(0,0,0,.2);
  transform: translate(-50%, 100%);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.detail-sheet.is-open { transform: translate(-50%, 0); }
.sheet-handle { width: 42px; height: 4px; margin: -8px auto 12px; background: var(--border-strong); border-radius: 4px; }
.detail-close { position: absolute; top: 12px; right: 14px; z-index: 3; width: 34px; height: 34px; color: var(--text-secondary); background: var(--input-bg); border: 0; border-radius: 50%; font-size: 23px; line-height: 1; cursor: pointer; }
#detailContent { min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
.detail-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border-color);
}
.detail-hero-emoji {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(190px, 52vw, 300px);
  overflow: hidden;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  font-size: 3rem;
}
.detail-hero-copy { min-width: 0; padding-right: 42px; }
.detail-hero-copy span { color: var(--text-muted); font-size: .72em; font-weight: 700; }
.detail-hero-copy h2 { margin: 4px 0; overflow-wrap: break-word; color: var(--text-primary); font-size: 1.15rem; line-height: 1.3; word-break: keep-all; }
.detail-hero-copy p { margin: 0; color: var(--text-secondary); font-size: .78rem; }
.detail-body { padding: 14px 0 76px; }
.detail-meta-line { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.detail-meta-line span { padding: 3px 7px; color: var(--text-secondary); background: var(--input-bg); border-radius: 7px; font-size: .72em; font-weight: 650; }
.detail-meta-line .detail-rating { color: #8a6200; background: #fff4db; }
[data-theme="dark"] .detail-meta-line .detail-rating { color: #fcd34d; background: rgba(138,98,0,.2); }
.detail-headline { margin: 0 0 7px; font-size: 1rem; }
.detail-description { margin: 0 0 14px; color: var(--text-secondary); font-size: .84rem; line-height: 1.65; }
.detail-feature-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.detail-feature-row span { padding: 3px 7px; color: #047857; background: #ecfdf5; border: 1px solid #d1fae5; border-radius: 8px; font-size: .7em; font-weight: 700; }
[data-theme="dark"] .detail-feature-row span { color: #6ee7b7; background: rgba(4,120,87,.18); border-color: rgba(110,231,183,.2); }
.detail-info-card, .menu-section { margin-bottom: 12px; padding: 12px; background: var(--input-bg); border-radius: 12px; }
.detail-info-row { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 6px 0; font-size: .78rem; }
.detail-info-row span { color: var(--text-muted); }
.detail-info-row strong { color: var(--text-primary); font-weight: 650; }
.detail-info-row a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.detail-info-row a:hover { text-decoration: underline; text-underline-offset: 2px; }
.menu-section header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.menu-section h3 { margin: 0; font-size: .84rem; }
.menu-list { display: flex; flex-direction: column; }
.menu-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border-color); font-size: .78rem; }
.menu-row:first-child { border-top: 0; }
.detail-actions { position: absolute; right: 20px; bottom: calc(14px + env(safe-area-inset-bottom)); left: 20px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 8px; padding-top: 14px; background: linear-gradient(to top, var(--bg-card) 75%, transparent); }
.detail-actions button { min-height: 44px; border-radius: 11px; font-size: .82rem; font-weight: 750; cursor: pointer; }
.detail-save-action { color: var(--text-primary); background: var(--input-bg); border: 1px solid var(--border-strong); }
.detail-map-action { color: #fff; background: var(--accent); border: 1px solid var(--accent); }

.location-dialog { width: calc(100% - 20px); max-width: 600px; margin: auto auto 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); color: var(--text-primary); background: var(--bg-card); border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -5px 25px rgba(0,0,0,.2); }
.location-dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.location-dialog header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.location-dialog header span { color: var(--text-muted); font-size: .72rem; font-weight: 700; }
.location-dialog h2 { margin: 3px 0 0; font-size: 1.08rem; }
.location-dialog header button { width: 34px; height: 34px; color: var(--text-secondary); background: var(--input-bg); border: 0; border-radius: 50%; font-size: 23px; cursor: pointer; }
.use-current-location { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px; color: var(--text-primary); background: #eff6ff; border: 1px solid #dbeafe; border-radius: 12px; text-align: left; cursor: pointer; }
[data-theme="dark"] .use-current-location { background: rgba(30,64,175,.18); border-color: rgba(147,197,253,.2); }
.use-current-location svg { width: 22px; height: 22px; color: var(--accent); }
.use-current-location span { display: flex; flex-direction: column; }
.use-current-location strong { font-size: .84rem; }
.use-current-location small { margin-top: 2px; color: var(--text-muted); font-size: .68rem; }
.location-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.location-presets button { display: flex; flex-direction: column; gap: 3px; padding: 11px 8px; color: var(--text-primary); background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 11px; cursor: pointer; }
.location-presets strong { font-size: .8rem; }
.location-presets small { color: var(--text-muted); font-size: .64rem; }
.location-note { margin: 12px 0 0; color: var(--text-muted); font-size: .68rem; text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 5000; visibility: hidden; padding: 10px 14px; color: #fff; background: rgba(32,38,44,.94); border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: .8rem; font-weight: 650; opacity: 0; transform: translate(-50%, 12px); transition: all .22s ease; }
.toast.is-visible { visibility: visible; opacity: 1; transform: translate(-50%, 0); }
#scrollTopBtn { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: flex; visibility: hidden; align-items: center; justify-content: center; width: 50px; height: 50px; color: var(--scroll-btn-text); background: var(--scroll-btn-bg); border: 0; border-radius: 50%; font-size: 24px; opacity: 0; cursor: pointer; transition: .3s; }
#scrollTopBtn.show { visibility: visible; opacity: 1; }

@media (max-width: 520px) {
  body { padding-top: calc(12px + env(safe-area-inset-top)); padding-right: 8px; padding-left: 8px; }
  .header-section { padding: 15px 16px; border-radius: 20px; margin-bottom: 16px; }
  .header-top-row { grid-template-columns: 34px minmax(0,1fr) auto; column-gap: 5px; }
  .header-back-link { width: 34px; height: 34px; }
  .main-title { font-size: 1.06em; }
  .segmented-control { min-width: 205px; }
  .segment-item { padding-right: 7px; padding-left: 7px; font-size: .74em; }
  .map-location-row { padding-right: 8px; padding-left: 8px; }
  .post-item { padding: 11px; }
  .post-top-info { margin-bottom: 6px; }
  .thumb-box { flex-basis: 70px; width: 70px; height: 70px; }
  .info-box { min-height: 70px; }
  .map-surface { height: 48vh; min-height: 340px; max-height: 520px; }
  .location-presets { grid-template-columns: 1fr; }
  .location-presets button { align-items: center; flex-direction: row; justify-content: space-between; }
}

@media (max-width: 370px) {
  .total-count { font-size: .76em; }
  .segmented-control { min-width: 190px; }
  .segment-item { font-size: .7em; }
  .result-caption { display: none; }
  .post-main-content { gap: 9px; }
  .thumb-box { flex-basis: 66px; width: 66px; height: 66px; }
}

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