:root {
  /* ── Neutrals (clean white) ── */
  --bg: #fafafa;
  --panel: #ffffff;
  --surface: #ffffff;
  --text: #212121;
  --text-secondary: #424242;
  --text-tertiary: #8b8b8b;
  --muted: #616161;
  --line: #e0e0e0;
  --line-soft: #eeeeee;

  /* ── Brand (vibrant red) ── */
  --brand: #e53935;
  --brand-dark: #c62828;
  --brand-soft: #ffebee;
  --brand-glow: rgba(229, 57, 53, 0.28);
  --brand-border: rgba(229, 57, 53, 0.38);

  /* ── Map & location ── */
  --route-blue: #007aff;
  --route-blue-glow: rgba(0, 122, 255, 0.35);
  --user-blue: #007aff;
  --user-blue-soft: rgba(0, 122, 255, 0.22);
  --transit-blue: #455a64;
  --transit-gray: #546e7a;
  --map-bg: #f5f5f5;
  --office-teal: #0097a7;
  --office-teal-dark: #00838f;
  --office-teal-glow: rgba(0, 151, 167, 0.32);

  /* ── Category accents (saturated, distinct) ── */
  --cat-korean: #E53935;
  --cat-chinese: #FF5722;
  --cat-japanese: #E91E63;
  --cat-western: #1976D2;
  --cat-fastfood: #F57C00;
  --cat-salad: #43A047;
  --cat-mexican: #FF9800;
  --cat-asian: #7B1FA2;
  --cat-cafe: #795548;
  --cat-snack: #EC407A;
  --cat-other: #607D8B;
  --cluster-neutral: #757575;

  /* ── Pin system (v33 — emoji-first, color-accent) ── */
  --pin-bg: #ffffff;
  --pin-bg-soft: #fafafa;
  --pin-shadow: 0 3px 12px rgba(33, 33, 33, 0.16), 0 1px 4px rgba(33, 33, 33, 0.1);
  --pin-border-width: 2.5px;
  --pin-border-korean: var(--cat-korean);
  --pin-border-chinese: var(--cat-chinese);
  --pin-border-japanese: var(--cat-japanese);
  --pin-border-western: var(--cat-western);
  --pin-border-fastfood: var(--cat-fastfood);
  --pin-border-salad: var(--cat-salad);
  --pin-border-mexican: var(--cat-mexican);
  --pin-border-asian: var(--cat-asian);
  --pin-border-cafe: var(--cat-cafe);
  --pin-border-snack: var(--cat-snack);
  --pin-border-other: var(--cat-other);
  --pin-tint-korean: rgba(229, 57, 53, 0.12);
  --pin-tint-chinese: rgba(255, 87, 34, 0.12);
  --pin-tint-japanese: rgba(233, 30, 99, 0.12);
  --pin-tint-western: rgba(25, 118, 210, 0.12);
  --pin-tint-fastfood: rgba(245, 124, 0, 0.12);
  --pin-tint-salad: rgba(67, 160, 71, 0.12);
  --pin-tint-mexican: rgba(255, 152, 0, 0.12);
  --pin-tint-asian: rgba(123, 31, 162, 0.12);
  --pin-tint-cafe: rgba(121, 85, 72, 0.12);
  --pin-tint-snack: rgba(236, 64, 122, 0.12);
  --pin-tint-other: rgba(96, 125, 139, 0.12);

  /* ── Spacing scale ── */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.35rem;
  --space-2xl: 1.75rem;

  /* ── Radius ── */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 3px rgba(33, 33, 33, 0.06);
  --shadow: 0 4px 16px rgba(33, 33, 33, 0.08);
  --shadow-lg: 0 12px 40px rgba(33, 33, 33, 0.12);

  /* ── Typography ── */
  --font-base: 16px;
  --font-sm: 0.875rem;
  --font-md: 0.9375rem;
  --font-lg: 1.125rem;
  --font-xl: 1.3125rem;
  --sheet-peek: 36vh;
  --sheet-half: 80vh;
  --sheet-full: 85vh;
  --sheet-detail: 90vh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  font-size: var(--font-base);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: var(--line-height);
}

.app {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.topbar { grid-row: 1; }

.toolbar {
  grid-row: 2;
  position: relative;
  z-index: 20;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  align-self: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.layout { grid-row: 3; }

.toolbar .controls { border-bottom: none; }
.toolbar .category-bar { border-top: 1px solid var(--line-soft); }

/* ── Header ── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: calc(var(--space-lg) + var(--safe-top)) calc(var(--space-xl) + var(--safe-right)) var(--space-lg) calc(var(--space-xl) + var(--safe-left));
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
}

.brand-text {
  min-width: 0;
}

.brand-tagline {
  margin: 0 0 0.15rem;
  font-size: var(--font-sm);
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  letter-spacing: -0.01em;
}

.topbar h1 {
  margin: 0;
  font-size: var(--font-xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text);
}

.subtitle {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: var(--font-sm);
  line-height: 1.45;
}

/* ── Controls / Search ── */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  align-items: center;
  padding: var(--space-md) var(--space-xl);
  background: var(--panel);
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
}

.control {
  display: grid;
  gap: var(--space-xs);
  font-size: var(--font-sm);
}

.control span {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
}

.control select,
.control input {
  width: 100%;
  max-width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 0.65rem 0.95rem;
  font: inherit;
  font-size: 16px;
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.control select:focus,
.control input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.control input::placeholder { color: #9e9e9e; }

.control.search { flex: 1; min-width: 160px; }

@media (min-width: 901px) {
  .toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .toolbar .controls {
    flex: 1;
    min-width: 0;
    border-bottom: none;
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
  }

  .toolbar .category-bar {
    flex: 1 1 100%;
    border-top: 1px solid var(--line-soft);
  }
}

@media (min-width: 1100px) {
  .toolbar {
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .toolbar .controls {
    flex: 1 1 auto;
    border-bottom: none;
    padding-right: var(--space-md);
  }

  .toolbar .category-bar {
    flex: 1 1 auto;
    border-top: none;
    border-left: 1px solid var(--line-soft);
    padding-left: var(--space-md);
    min-width: 0;
  }
}

/* ── Category filter chips ── */
.category-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--panel);
  height: auto;
  min-height: 0;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.category-bar::-webkit-scrollbar { display: none; }

.cat-chip {
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.55rem 1.1rem;
  min-height: 42px;
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-chip:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.cat-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 3px 10px var(--brand-glow);
}

.cat-chip[data-cat="한식"]:not(.active) { border-color: rgba(229, 57, 53, 0.42); color: #c62828; }
.cat-chip[data-cat="중식"]:not(.active) { border-color: rgba(255, 87, 34, 0.42); color: #e65100; }
.cat-chip[data-cat="일식"]:not(.active) { border-color: rgba(233, 30, 99, 0.42); color: #ad1457; }
.cat-chip[data-cat="양식"]:not(.active) { border-color: rgba(25, 118, 210, 0.42); color: #1565c0; }
.cat-chip[data-cat="패스트푸드"]:not(.active) { border-color: rgba(245, 124, 0, 0.45); color: #e65100; }
.cat-chip[data-cat="샐러드/다이어트"]:not(.active) { border-color: rgba(67, 160, 71, 0.45); color: #2e7d32; }
.cat-chip[data-cat="멕시칸"]:not(.active) { border-color: rgba(255, 152, 0, 0.48); color: #ef6c00; }
.cat-chip[data-cat="아시아"]:not(.active) { border-color: rgba(123, 31, 162, 0.42); color: #6a1b9a; }
.cat-chip[data-cat="카페"]:not(.active) { border-color: rgba(121, 85, 72, 0.42); color: #4e342e; }
.cat-chip[data-cat="간식"]:not(.active) { border-color: rgba(236, 64, 122, 0.42); color: #c2185b; }
.cat-chip[data-cat="기타"]:not(.active) { border-color: rgba(96, 125, 139, 0.42); color: #455a64; }

.cat-chip[data-cat="한식"].active { background: var(--cat-korean); border-color: var(--cat-korean); color: #fff; box-shadow: 0 3px 10px rgba(229, 57, 53, 0.32); }
.cat-chip[data-cat="중식"].active { background: var(--cat-chinese); border-color: var(--cat-chinese); color: #fff; box-shadow: 0 3px 10px rgba(255, 87, 34, 0.32); }
.cat-chip[data-cat="일식"].active { background: var(--cat-japanese); border-color: var(--cat-japanese); color: #fff; box-shadow: 0 3px 10px rgba(233, 30, 99, 0.32); }
.cat-chip[data-cat="양식"].active { background: var(--cat-western); border-color: var(--cat-western); color: #fff; box-shadow: 0 3px 10px rgba(25, 118, 210, 0.32); }
.cat-chip[data-cat="패스트푸드"].active { background: var(--cat-fastfood); border-color: var(--cat-fastfood); color: #fff; box-shadow: 0 3px 10px rgba(245, 124, 0, 0.32); }
.cat-chip[data-cat="샐러드/다이어트"].active { background: var(--cat-salad); border-color: var(--cat-salad); color: #fff; box-shadow: 0 3px 10px rgba(67, 160, 71, 0.32); }
.cat-chip[data-cat="멕시칸"].active { background: var(--cat-mexican); border-color: var(--cat-mexican); color: #fff; box-shadow: 0 3px 10px rgba(255, 152, 0, 0.32); }
.cat-chip[data-cat="아시아"].active { background: var(--cat-asian); border-color: var(--cat-asian); color: #fff; box-shadow: 0 3px 10px rgba(123, 31, 162, 0.32); }
.cat-chip[data-cat="카페"].active { background: var(--cat-cafe); border-color: var(--cat-cafe); color: #fff; box-shadow: 0 3px 10px rgba(121, 85, 72, 0.32); }
.cat-chip[data-cat="간식"].active { background: var(--cat-snack); border-color: var(--cat-snack); color: #fff; box-shadow: 0 3px 10px rgba(236, 64, 122, 0.32); }
.cat-chip[data-cat="기타"].active { background: var(--cat-other); border-color: var(--cat-other); color: #fff; box-shadow: 0 3px 10px rgba(96, 125, 139, 0.32); }

/* ── Layout ── */
.layout {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "sidebar map";
  transition: grid-template-columns 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.layout > * { min-height: 0; min-width: 0; }

.layout.has-detail {
  grid-template-columns: 320px 400px 1fr;
  grid-template-areas: "sidebar detail map";
}

.layout.has-detail .detail-panel:not(.hidden) {
  display: flex !important;
}

.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-width: 0;
}

.detail-panel {
  grid-area: detail;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  border-right: 1px solid var(--line);
  min-width: 0;
  min-height: 0;
  width: 400px;
  max-width: 400px;
}

.map-wrap { grid-area: map; min-width: 0; }

.detail-panel.hidden { display: none; }

.detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.detail-body-inner {
  padding: var(--space-lg) var(--space-lg) var(--space-2xl);
}

.detail-intro {
  margin-bottom: var(--space-xs);
}

.detail-intro > *:last-child {
  margin-bottom: 0;
}

.detail-info-card {
  margin: 0 0 var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  background: #f5f5f5;
  border: 1px solid var(--line);
}

.detail-info-card .rating-row {
  margin-bottom: var(--space-xs);
  min-height: 1.375rem;
}

.detail-info-card .rating-row:last-child {
  margin-bottom: 0;
}

.detail-info-card .detail-location--compact {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.detail-info-card .detail-location__line {
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-info-card .detail-location__sep {
  color: var(--muted);
}

.detail-info-card .detail-location__pin {
  opacity: 0.9;
}

.detail-location--stacked .detail-location__head {
  margin: 0 0 0.35rem;
}

.detail-location--stacked .detail-location__category {
  font-size: 0.8125rem;
  font-weight: 600;
}

.detail-location--stacked .detail-location__row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.detail-location--stacked .detail-location__row + .detail-location__row {
  margin-top: 0.2rem;
}

.detail-location--stacked .detail-location__row--distance {
  padding-left: 1.05rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.detail-hero--compact .detail-hero__main--compact {
  max-height: 5.5rem;
}

.detail-hero--compact .detail-hero__placeholder--compact {
  min-height: 5.5rem;
  max-height: 5.5rem;
}

.detail-hero--compact .detail-hero__emoji {
  font-size: 1.75rem;
}

.detail-body h2 {
  margin: 0 0 var(--space-sm);
  font-size: var(--font-xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.35;
  color: var(--text);
}

.naver-alias {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.match-note.warn { color: var(--brand-dark); }

.menu-skeleton { display: grid; gap: 0; }

.menu-skeleton-row {
  height: 52px;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 50%, var(--line-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.detail-tab-panel .menu-skeleton {
  padding-top: var(--space-xs);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg) var(--space-sm);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.sidebar-head h2 {
  margin: 0;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.625rem;
  height: 1.625rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.8125rem;
  font-weight: 700;
}

.merchant-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.bp-pin-compact .bp-pin-inner { width: 30px; height: 38px; }
.bp-pin-compact .bp-pin-visit-badge {
  width: 12px;
  height: 12px;
  top: 0;
  right: -1px;
  border-width: 1px;
}
.bp-pin-compact .bp-pin-icon .cat-emoji { font-size: 18px; }

.list-more-hint {
  padding: var(--space-md) var(--space-lg) var(--space-xl);
  text-align: center;
  color: var(--muted);
  font-size: var(--font-sm);
  border-bottom: 1px solid var(--line-soft);
}

/* ── Merchant cards ── */
.merchant-card {
  display: flex;
  gap: var(--space-md);
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
  padding: var(--space-lg) var(--space-lg);
  min-height: 96px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.merchant-card:active { transform: scale(0.985); }
.merchant-card:hover { background: rgba(255, 255, 255, 0.65); }

.merchant-card.active {
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  padding-left: calc(var(--space-lg) - 3px);
}

.card-pin {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pin-bg);
  border: var(--pin-border-width) solid var(--pin-border-other);
  box-shadow: var(--pin-shadow);
}

.card-pin[data-cat="한식"] { border-color: var(--pin-border-korean); }
.card-pin[data-cat="중식"] { border-color: var(--pin-border-chinese); }
.card-pin[data-cat="일식"] { border-color: var(--pin-border-japanese); }
.card-pin[data-cat="양식"] { border-color: var(--pin-border-western); }
.card-pin[data-cat="패스트푸드"] { border-color: var(--pin-border-fastfood); }
.card-pin[data-cat="샐러드/다이어트"] { border-color: var(--pin-border-salad); }
.card-pin[data-cat="멕시칸"] { border-color: var(--pin-border-mexican); }
.card-pin[data-cat="아시아"] { border-color: var(--pin-border-asian); }
.card-pin[data-cat="카페"] { border-color: var(--pin-border-cafe); }
.card-pin[data-cat="간식"] { border-color: var(--pin-border-snack); }
.card-pin[data-cat="기타"] { border-color: var(--pin-border-other); }

.card-pin .cat-emoji {
  display: block;
  font-size: 1.375rem;
  line-height: 1;
}

.merchant-card.active .card-pin {
  transform: scale(1.05);
  box-shadow: 0 0 0 2.5px var(--brand), var(--pin-shadow);
}

.card-pin-wrap {
  position: relative;
  flex-shrink: 0;
}

.card-pin-visit-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 2;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  background: #7dd8f0;
  line-height: 0;
  pointer-events: none;
}

.card-pin-visit-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-visit-hint {
  display: inline-flex;
  align-items: center;
  margin: 0.3rem 0 0.15rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 151, 167, 0.08);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--office-teal-dark);
  letter-spacing: -0.01em;
}

.card-visit-hint--mine {
  background: rgba(0, 151, 167, 0.12);
  color: var(--office-teal-dark);
}

.card-body { flex: 1; min-width: 0; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
}

.merchant-card h3 {
  margin: 0;
  font-size: var(--font-md);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--text);
}

.distance-badge {
  flex-shrink: 0;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.walk-eta-badge {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  background: #e3f2fd;
  color: #1565c0;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.35;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.merchant-card .address {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: var(--font-sm);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.biflpay-tag,
.cat-tag {
  display: inline-block;
  margin-top: 0.45rem;
  margin-right: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.biflpay-tag {
  background: var(--brand-soft);
  border-color: rgba(229, 57, 53, 0.25);
  color: var(--brand-dark);
}

.cat-tag {
  background: var(--line-soft);
  border-color: var(--line);
  color: var(--text-secondary);
}

.cat-tag[data-cat="한식"] { background: #ffebee; border-color: #ef9a9a; color: #c62828; }
.cat-tag[data-cat="중식"] { background: #fff3e0; border-color: #ffcc80; color: #e65100; }
.cat-tag[data-cat="일식"] { background: #fce4ec; border-color: #f48fb1; color: #ad1457; }
.cat-tag[data-cat="양식"] { background: #e3f2fd; border-color: #90caf9; color: #1565c0; }
.cat-tag[data-cat="패스트푸드"] { background: #fff3e0; border-color: #ffcc80; color: #e65100; }
.cat-tag[data-cat="샐러드/다이어트"] { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }
.cat-tag[data-cat="멕시칸"] { background: #fff8e1; border-color: #ffe082; color: #f57f17; }
.cat-tag[data-cat="아시아"] { background: #f3e5f5; border-color: #ce93d8; color: #6a1b9a; }
.cat-tag[data-cat="카페"] { background: #efebe9; border-color: #bcaaa4; color: #4e342e; }
.cat-tag[data-cat="간식"] { background: #fce4ec; border-color: #f48fb1; color: #c2185b; }
.cat-tag[data-cat="기타"] { background: #eceff1; border-color: #b0bec5; color: #455a64; }

.status-tag {
  font-weight: 500;
  opacity: 0.92;
}

.status-tag--unverified {
  background: #fff8e1;
  border-color: #ffe082;
  color: #f57f17;
}

.status-tag--closed {
  background: #ffebee;
  border-color: #ef9a9a;
  color: #c62828;
}

.match-warn {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  background: #fef6e8;
  border: 1px solid #ecd9b8;
  color: #8a6530;
}

.place-pending {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Skeleton ── */
.skeleton-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--line-soft);
}

.skeleton {
  background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 50%, var(--line-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
}

.skeleton.pin { width: 2.5rem; height: 2.5rem; border-radius: var(--radius); flex-shrink: 0; }
.skeleton.lines { flex: 1; display: grid; gap: 0.45rem; }
.skeleton.line { height: 0.8rem; }
.skeleton.line.short { width: 40%; }
.skeleton.line.med { width: 70%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Map ── */
.map-wrap {
  position: relative;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.map,
.map.leaflet-container {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 320px;
  background: var(--map-bg);
  z-index: 0;
}

.map .leaflet-tile-pane { opacity: 1; }

.map-marker-loading {
  position: absolute;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(248, 250, 252, 0.42);
  backdrop-filter: blur(1px);
  transition: opacity 0.25s ease;
}

.map-marker-loading.hidden {
  opacity: 0;
  visibility: hidden;
}

.map-marker-loading__text {
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Leaflet marker overrides */
.bp-pin {
  background: none !important;
  border: none !important;
}

.bp-pin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: 130px;
}

.bp-pin-label {
  margin-top: 3px;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.97);
  border: 1.5px solid var(--brand-border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
  pointer-events: none;
}

.bp-pin-wrap.selected .bp-pin-label,
.bp-pin-label.bp-pin-label--selected {
  background: var(--brand);
  border-color: var(--brand-dark);
  color: #fff;
  font-size: 12px;
  max-width: 120px;
  box-shadow: 0 3px 12px var(--brand-glow);
}

.bp-pin--labeled .bp-pin-label {
  border-color: var(--line);
  font-weight: 600;
  font-size: 10px;
  max-width: 80px;
  padding: 0.2rem 0.45rem;
}

.bp-pin-inner {
  position: relative;
  width: 32px;
  height: 40px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.bp-pin-inner:hover { transform: scale(1.1) translateY(-2px); }

.bp-pin-inner.selected {
  transform: scale(1.15) translateY(-4px);
  z-index: 1000 !important;
}

.bp-pin-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  rotate: -45deg;
  background: var(--pin-bg);
  border: var(--pin-border-width) solid var(--pin-border-other);
  box-shadow: var(--pin-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bp-pin-wrap[data-cat="한식"] .bp-pin-body { border-color: var(--pin-border-korean); }
.bp-pin-wrap[data-cat="중식"] .bp-pin-body { border-color: var(--pin-border-chinese); }
.bp-pin-wrap[data-cat="일식"] .bp-pin-body { border-color: var(--pin-border-japanese); }
.bp-pin-wrap[data-cat="양식"] .bp-pin-body { border-color: var(--pin-border-western); }
.bp-pin-wrap[data-cat="패스트푸드"] .bp-pin-body { border-color: var(--pin-border-fastfood); }
.bp-pin-wrap[data-cat="샐러드/다이어트"] .bp-pin-body { border-color: var(--pin-border-salad); }
.bp-pin-wrap[data-cat="멕시칸"] .bp-pin-body { border-color: var(--pin-border-mexican); }
.bp-pin-wrap[data-cat="아시아"] .bp-pin-body { border-color: var(--pin-border-asian); }
.bp-pin-wrap[data-cat="카페"] .bp-pin-body { border-color: var(--pin-border-cafe); }
.bp-pin-wrap[data-cat="간식"] .bp-pin-body { border-color: var(--pin-border-snack); }
.bp-pin-wrap[data-cat="기타"] .bp-pin-body { border-color: var(--pin-border-other); }

.bp-pin-body.cluster-neutral {
  background: var(--pin-bg-soft);
  border-color: var(--cluster-neutral);
  color: var(--cluster-neutral);
}

.bp-pin-inner.selected .bp-pin-body {
  width: 32px;
  height: 32px;
  border-width: 2px;
  box-shadow:
    0 0 0 3px var(--brand),
    var(--pin-shadow);
}

.bp-pin-icon {
  rotate: 45deg;
  line-height: 1;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-pin-icon .cat-emoji {
  display: block;
  line-height: 1;
}

.bp-pin-inner.selected .bp-pin-icon .cat-emoji { font-size: 20px; }

.route-dest .bp-pin-body {
  border-color: var(--route-blue) !important;
  box-shadow:
    0 0 0 2px rgba(0, 122, 255, 0.45),
    var(--pin-shadow);
  animation: route-dest-glow 2.4s ease-in-out infinite;
}

.route-dest .bp-pin-inner.selected .bp-pin-body {
  animation: none;
  box-shadow:
    0 0 0 3px var(--route-blue),
    0 0 10px rgba(0, 122, 255, 0.35),
    var(--pin-shadow);
}

@keyframes route-dest-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.5), var(--pin-shadow); }
  50% { box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.28), var(--pin-shadow); }
}

/* ── Walking route (Apple Maps style) ── */
.leaflet-overlay-pane svg path.route-line-glow {
  filter: drop-shadow(0 2px 6px var(--route-blue-glow));
}

.route-arrow-pin {
  background: none !important;
  border: none !important;
}

.route-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

.leaflet-overlay-pane svg path.route-line-last-mile {
  stroke-linecap: round;
}

/* ── Density grid badges (low zoom) ── */
.bp-density {
  background: transparent;
  border: 0;
}

.bp-density-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pin-bg);
  border: 2px solid #bdbdbd;
  color: var(--text-secondary);
  font-family: "Noto Sans KR", sans-serif;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--pin-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.bp-density-badge:hover {
  transform: scale(1.08);
  border-color: var(--cluster-neutral);
}

/* ── Soft cluster circles (mid zoom) ── */
.bp-soft-cluster {
  background: transparent;
  border: 0;
}

.bp-soft-cluster-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-soft-cluster-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--pin-bg);
  border: 2px solid #bdbdbd;
  color: var(--text-secondary);
  font-family: "Noto Sans KR", sans-serif;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--pin-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.bp-soft-cluster-inner:hover {
  transform: scale(1.08);
  border-color: var(--cluster-neutral);
  box-shadow: 0 4px 14px rgba(33, 33, 33, 0.14);
}

.bp-soft-cluster-inner.expanded {
  transform: scale(1.1);
  border-color: var(--brand);
  color: var(--brand-dark);
  box-shadow: 0 0 0 2px var(--brand-soft), var(--pin-shadow);
}

.bp-cluster-popup-wrap .bp-soft-cluster-wrap {
  pointer-events: auto;
}

/* ── Cluster pins (legacy teardrop — detail zoom only via soft circles) ── */
.bp-cluster-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bp-cluster-inner {
  position: relative;
  width: 36px;
  height: 44px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.bp-cluster-inner:hover { transform: scale(1.1) translateY(-2px); }

.bp-cluster-inner.expanded {
  transform: scale(1.12) translateY(-3px);
  z-index: 2;
}

.bp-cluster-count {
  position: absolute;
  top: -5px;
  right: -10px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 2px solid var(--cluster-neutral);
  color: var(--cluster-neutral);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.bp-cluster-inner .bp-pin-body { width: 30px; height: 30px; }
.bp-cluster-inner .bp-pin-icon .cat-emoji { font-size: 16px; opacity: 0.95; }

/* Spider expand (≤8) */
.bp-spider-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  pointer-events: none;
}

.bp-spider-wrap .bp-cluster-wrap {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.bp-spider-items {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bp-spider-item {
  position: absolute;
  left: 50%;
  top: 54%;
  margin: 0;
  padding: 0.3rem 0.55rem;
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  pointer-events: auto;
  transform-origin: center center;
  transform: rotate(calc(360deg / var(--n) * var(--i) - 90deg)) translateY(-78px) rotate(calc(-360deg / var(--n) * var(--i) + 90deg));
  animation: bp-spider-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--i) * 0.04s);
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}

.bp-spider-item:hover {
  border-color: var(--brand);
  box-shadow: 0 3px 12px var(--brand-glow);
}

.bp-spider-item.selected {
  background: var(--brand);
  border-color: var(--brand-dark);
  color: #fff;
  box-shadow: 0 3px 12px var(--brand-glow);
}

@keyframes bp-spider-in {
  from {
    opacity: 0;
    transform: rotate(calc(360deg / var(--n) * var(--i) - 90deg)) translateY(-36px) rotate(calc(-360deg / var(--n) * var(--i) + 90deg)) scale(0.6);
  }
}

/* List expand (>8) */
.bp-list-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 172px;
  pointer-events: none;
}

.bp-list-wrap .bp-cluster-wrap { pointer-events: auto; }

.bp-cluster-list {
  width: 100%;
  margin-top: 4px;
  padding: 5px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  border: 1.5px solid var(--brand-border);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  pointer-events: auto;
  animation: bp-list-in 0.22s ease backwards;
}

.bp-cluster-list-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.bp-cluster-list-item:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.bp-cluster-list-item.selected {
  background: var(--brand);
  color: #fff;
}

@keyframes bp-list-in {
  from { opacity: 0; transform: translateY(-6px); }
}

/* Cluster expand markers must sit above transit reference pins */
.bp-cluster-expand {
  z-index: 1500 !important;
}

/* ── Cluster popup (expand) ── */
.bp-cluster-popup-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 248px;
  pointer-events: none;
}

.bp-cluster-popup-wrap .bp-cluster-wrap { pointer-events: auto; }

.bp-cluster-popup {
  width: 100%;
  margin-bottom: 8px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1.5px solid var(--brand-border);
  box-shadow: var(--shadow);
  overflow: hidden;
  pointer-events: auto;
  animation: bp-list-in 0.22s ease backwards;
}

.bp-cluster-popup-head {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.bp-cluster-popup-items {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.bp-cluster-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.bp-cluster-item:last-child { border-bottom: 0; }

.bp-cluster-item:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.bp-cluster-item.selected {
  background: var(--brand);
  color: #fff;
}

.bp-cluster-item-pin {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-cluster-item-pin .cat-icon {
  width: 1.75rem;
  height: 1.75rem;
}

.bp-cluster-item.selected .bp-cluster-item-pin .cat-icon {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.65);
}

.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--pin-tint-other);
  border: 2px solid var(--pin-border-other);
  box-shadow: var(--pin-shadow);
}

.cat-icon[data-cat="한식"] { background: var(--pin-tint-korean); border-color: var(--pin-border-korean); }
.cat-icon[data-cat="중식"] { background: var(--pin-tint-chinese); border-color: var(--pin-border-chinese); }
.cat-icon[data-cat="일식"] { background: var(--pin-tint-japanese); border-color: var(--pin-border-japanese); }
.cat-icon[data-cat="양식"] { background: var(--pin-tint-western); border-color: var(--pin-border-western); }
.cat-icon[data-cat="패스트푸드"] { background: var(--pin-tint-fastfood); border-color: var(--pin-border-fastfood); }
.cat-icon[data-cat="샐러드/다이어트"] { background: var(--pin-tint-salad); border-color: var(--pin-border-salad); }
.cat-icon[data-cat="멕시칸"] { background: var(--pin-tint-mexican); border-color: var(--pin-border-mexican); }
.cat-icon[data-cat="아시아"] { background: var(--pin-tint-asian); border-color: var(--pin-border-asian); }
.cat-icon[data-cat="카페"] { background: var(--pin-tint-cafe); border-color: var(--pin-border-cafe); }
.cat-icon[data-cat="간식"] { background: var(--pin-tint-snack); border-color: var(--pin-border-snack); }
.cat-icon[data-cat="기타"] { background: var(--pin-tint-other); border-color: var(--pin-border-other); }

.cat-icon .cat-emoji {
  display: block;
  line-height: 1;
}

.bp-cluster-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.bp-cluster-item-name {
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bp-cluster-item-meta {
  display: flex;
  gap: 0.35rem;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
}

.bp-cluster-item.selected .bp-cluster-item-meta,
.bp-cluster-item.selected .bp-cluster-item-cat,
.bp-cluster-item.selected .bp-cluster-item-dist {
  color: rgba(255, 255, 255, 0.85);
}

.user-pin {
  background: none !important;
  border: none !important;
}

.user-pin-wrap {
  position: relative;
  width: 24px;
  height: 24px;
}

.user-pin-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--user-blue-soft);
  animation: user-pulse 2s ease-out infinite;
}

.user-pin-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--user-blue);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.45);
}

.user-pin.route-origin .user-pin-pulse {
  background: rgba(0, 122, 255, 0.3);
  animation-duration: 1.6s;
}

.user-pin.route-origin .user-pin-dot {
  width: 16px;
  height: 16px;
  box-shadow:
    0 0 0 4px rgba(0, 122, 255, 0.22),
    0 2px 10px rgba(0, 122, 255, 0.55);
}

@keyframes user-pulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.office-pin {
  background: none !important;
  border: none !important;
  z-index: 400 !important;
}

.office-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
}

.office-marker-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px 0 10px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--office-teal-dark) 0%, var(--office-teal) 55%, #26c6da 100%);
  border: 2.5px solid #fff;
  box-shadow:
    0 3px 10px var(--office-teal-glow),
    0 1px 3px rgba(0, 0, 0, 0.12);
}

.office-marker-pulse {
  position: absolute;
  inset: -5px;
  border-radius: 22px;
  background: rgba(0, 151, 167, 0.2);
  animation: user-pulse 2.4s ease-out infinite;
}

.office-marker-emoji {
  position: relative;
  font-size: 16px;
  line-height: 1;
}

.office-marker-label {
  position: relative;
  flex-shrink: 0;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
  font-size: 18px !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  background: var(--surface) !important;
}

.leaflet-tooltip.bp-tooltip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  font-family: inherit;
  font-size: 0.8125rem;
  box-shadow: var(--shadow);
  background: var(--surface);
  color: var(--text);
}

.leaflet-tooltip.bp-tooltip::before { display: none; }

/* ── Transit reference markers ── */
.transit-pin {
  background: none !important;
  border: none !important;
}

.transit-station-pin {
  z-index: 150 !important;
}

.transit-exit-pin {
  z-index: 100 !important;
}

.transit-station-marker,
.transit-exit-marker {
  pointer-events: auto;
  -webkit-font-smoothing: antialiased;
}

/* Subway hub + neighbor markers with compact name labels */
.transit-station-marker {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  width: auto;
}

.transit-station-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(#33a853 0deg 180deg, #d32f2f 180deg 360deg);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.18);
}

.transit-station-ring--l2 {
  background: #33a853;
}

.transit-station-label {
  flex-shrink: 0;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  color: #263238;
  letter-spacing: -0.03em;
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    0 0 2px #fff,
    0 0 4px #fff,
    0 1px 0 rgba(255, 255, 255, 0.85);
}

.transit-station-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #263238;
  border: 2px solid #fff;
  color: #fff;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

/* Exit badges — number only, zoom ≥16 */
.transit-exit-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #37474f;
  border: 2px solid #fff;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.15);
  color: #fff;
  font-family: "Noto Sans KR", sans-serif;
}

.transit-exit-num {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* ── Detail content ── */
.detail-hero {
  position: relative;
  margin: calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg)) var(--space-md);
  overflow: hidden;
}

.detail-hero__main {
  position: relative;
}

.detail-hero__main::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.12) 100%);
  pointer-events: none;
}

.hero,
.detail-hero__image {
  width: 100%;
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0;
  margin-bottom: 0;
  cursor: zoom-in;
  box-shadow: none;
  display: block;
}

.detail-hero .photo-strip {
  margin: 0;
  padding: var(--space-sm) var(--space-lg);
  background: linear-gradient(180deg, rgba(250, 250, 250, 0) 0%, var(--panel) 100%);
  border-bottom: 1px solid var(--line-soft);
}

.detail-hero + .rating-row {
  margin-top: var(--space-xs);
}

.detail-hero--placeholder .detail-hero__main::after {
  display: none;
}

.detail-hero__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 200px;
  background: linear-gradient(145deg, var(--line-soft) 0%, var(--panel) 55%, var(--line-soft) 100%);
}

.detail-hero__emoji {
  font-size: 2.75rem;
  line-height: 1;
  opacity: 0.55;
  filter: saturate(0.85);
}

.detail-hero--placeholder[data-cat="한식"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-korean) 0%, var(--panel) 50%, rgba(255, 235, 238, 0.5) 100%);
}

.detail-hero--placeholder[data-cat="중식"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-chinese) 0%, var(--panel) 50%, rgba(255, 243, 224, 0.5) 100%);
}

.detail-hero--placeholder[data-cat="일식"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-japanese) 0%, var(--panel) 50%, rgba(252, 228, 236, 0.5) 100%);
}

.detail-hero--placeholder[data-cat="양식"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-western) 0%, var(--panel) 50%, rgba(227, 242, 253, 0.5) 100%);
}

.detail-hero--placeholder[data-cat="패스트푸드"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-fastfood) 0%, var(--panel) 50%, rgba(255, 243, 224, 0.5) 100%);
}

.detail-hero--placeholder[data-cat="샐러드/다이어트"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-salad) 0%, var(--panel) 50%, rgba(232, 245, 233, 0.5) 100%);
}

.detail-hero--placeholder[data-cat="멕시칸"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-mexican) 0%, var(--panel) 50%, rgba(255, 248, 225, 0.5) 100%);
}

.detail-hero--placeholder[data-cat="아시아"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-asian) 0%, var(--panel) 50%, rgba(243, 229, 245, 0.5) 100%);
}

.detail-hero--placeholder[data-cat="카페"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-cafe) 0%, var(--panel) 50%, rgba(239, 235, 233, 0.5) 100%);
}

.detail-hero--placeholder[data-cat="간식"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-snack) 0%, var(--panel) 50%, rgba(252, 228, 236, 0.5) 100%);
}

.detail-hero--placeholder[data-cat="기타"] .detail-hero__placeholder {
  background: linear-gradient(145deg, var(--pin-tint-other) 0%, var(--panel) 50%, rgba(236, 239, 241, 0.5) 100%);
}

.photo-strip {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  margin-bottom: var(--space-md);
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.photo-strip::-webkit-scrollbar {
  display: none;
}

.photo-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: zoom-in;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.photo-thumb:hover {
  transform: scale(1.03);
}

.photo-thumb.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), 0 2px 8px rgba(229, 57, 53, 0.2);
}

.rating-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  align-items: center;
  margin: 0 0 var(--space-sm);
  font-size: var(--font-sm);
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
}

.rating-badge.kakao {
  color: var(--text);
}

.rating-badge .rating-src {
  margin-left: 0.25rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.rating-badge .star {
  color: #f5a623;
  font-size: 0.9375rem;
}

.review-count {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 0.8125rem;
}

.rating-row strong { color: #b8862e; }

.detail-intro .rating-badge .star {
  color: #f0b429;
}

.detail-intro .rating-badge .rating-score {
  color: #b8862e;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.detail-intro .rating-row .cat-tag {
  margin-left: auto;
  border-radius: var(--radius-pill);
}

.detail-intro .detail-info-card .rating-placeholder {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.detail-intro .detail-info-card .rating-badge .rating-src {
  color: var(--muted);
}

.detail-intro .detail-info-card .rating-badge .rating-score {
  color: #9a7219;
}

.detail-intro .detail-info-card .rating-badge .star {
  color: #e6a020;
}

.naver-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0 var(--space-sm);
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(3, 199, 90, 0.3);
  background: rgba(3, 199, 90, 0.07);
  color: #028a42;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.naver-cta:hover {
  background: rgba(3, 199, 90, 0.14);
  border-color: rgba(3, 199, 90, 0.45);
}

.naver-cta__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 3px;
  background: #03c75a;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1;
}

.naver-cta__ext {
  font-size: 0.6875rem;
  opacity: 0.65;
}

.tag {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--line-soft);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
}

.match-note {
  margin: 0 0 var(--space-sm);
  font-size: 0.8125rem;
  color: var(--brand-dark);
}

.summary {
  margin: 0 0 var(--space-sm);
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.detail-tab-panel .summary {
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
}

.place-loading {
  color: var(--muted);
  font-size: var(--font-sm);
  margin-bottom: var(--space-sm);
}

.detail-body .meta {
  color: var(--muted);
  font-size: var(--font-sm);
  line-height: 1.6;
}

.detail-location {
  margin: var(--space-sm) 0 var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  background: var(--line-soft);
  border: 1px solid var(--line);
}

.detail-location--compact {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0 0 var(--space-md);
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  background: transparent;
  border: none;
}

.detail-location__pin {
  flex-shrink: 0;
  line-height: 1.5;
  font-size: 0.75rem;
  opacity: 0.7;
}

.detail-location__line {
  min-width: 0;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.detail-location__sep {
  color: var(--muted);
  font-weight: 400;
}

.detail-location__row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--font-sm);
  line-height: 1.5;
}

.detail-location__row + .detail-location__row {
  margin-top: 0.35rem;
}

.detail-location__icon {
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.5;
  opacity: 0.85;
}

.detail-location__text {
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.detail-actions {
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--line-soft);
}

.detail-action-chips {
  display: flex;
  gap: var(--space-sm);
}

.detail-action-chip {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 36px;
  min-width: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.detail-action-chip:hover {
  border-color: #d0d0d0;
  background: #fafafa;
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.detail-action-chip:active {
  transform: scale(0.98);
}

.detail-action-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.detail-action-chip--route:hover {
  border-color: rgba(0, 122, 255, 0.28);
  background: rgba(0, 122, 255, 0.06);
  color: #0066cc;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.08);
}

.detail-action-chip--route.route-btn--active {
  background: rgba(0, 122, 255, 0.08);
  color: #0066cc;
  border-color: rgba(0, 122, 255, 0.32);
}

.detail-action-chip--route.route-btn--active:hover {
  background: rgba(0, 122, 255, 0.14);
  border-color: rgba(0, 122, 255, 0.42);
  color: #005bb5;
}

.detail-action-chip--naver {
  color: #028a42;
  border-color: rgba(3, 199, 90, 0.28);
  background: rgba(3, 199, 90, 0.05);
}

.detail-action-chip--naver:hover {
  background: rgba(3, 199, 90, 0.12);
  border-color: rgba(3, 199, 90, 0.4);
  color: #026e36;
}

.detail-actions__row {
  display: flex;
  gap: var(--space-sm);
}

.btn-route.route-btn,
.btn-call.call-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 44px;
  min-width: 0;
  padding: 0.4375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-route.route-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1.5px solid var(--line);
  box-shadow: none;
  cursor: pointer;
}

.btn-route.route-btn:hover {
  border-color: #bdbdbd;
  background: var(--line-soft);
  color: var(--text);
}

.btn-route.route-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-route.route-btn--active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: var(--brand-border);
}

.btn-route.route-btn--active:hover {
  background: #ffe5e5;
  border-color: var(--brand);
}

.btn-call.call-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1.5px solid var(--line);
  box-shadow: none;
  cursor: pointer;
}

.btn-call.call-btn:hover {
  border-color: #bdbdbd;
  background: var(--line-soft);
  color: var(--text);
}

.btn-call.call-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-route .route-btn__icon,
.btn-call .call-btn__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  font-size: 1rem;
  line-height: 1;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.btn-call .call-btn__icon {
  color: var(--brand);
}

.btn-call .call-btn__icon svg {
  display: block;
}

.btn-route .route-btn__label,
.btn-call .call-btn__number {
  min-width: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-call .call-btn__number {
  color: inherit;
}

.detail-actions .visit-btn:not(.visit-btn--prominent) {
  width: 100%;
  min-height: 44px;
  margin-top: var(--space-sm);
  padding: 0.4375rem var(--space-md);
  font-size: 0.875rem;
  border-radius: var(--radius);
}

.route-duration {
  margin: var(--space-xs) 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-dark);
}

.route-location-note {
  margin: var(--space-xs) 0 0;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  background: var(--brand-soft);
  border: none;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.route-banner {
  position: absolute;
  top: calc(var(--space-md) + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  max-width: calc(100% - 8.5rem);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.97);
  border: 1.5px solid rgba(229, 57, 53, 0.25);
  box-shadow: 0 4px 20px rgba(229, 57, 53, 0.18);
  pointer-events: none;
}

.route-banner.hidden { display: none; }

.route-banner--loading {
  border-color: rgba(0, 122, 255, 0.28);
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.14);
  animation: route-banner-pulse 1.4s ease-in-out infinite;
}

@keyframes route-banner-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.route-banner__text {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-end-btn {
  position: absolute;
  top: calc(var(--space-md) + var(--safe-top));
  right: calc(var(--space-md) + var(--safe-right));
  z-index: 501;
  padding: 0.55rem 1rem;
  min-height: 44px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(229, 57, 53, 0.35);
}

.route-end-btn.hidden { display: none; }

.route-end-btn:hover { background: var(--brand-dark); }

.route-end-btn:focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: 2px;
}

.list-sheet-toggle {
  display: none;
}

/* Route focus mode — map only */
.app.route-mode {
  grid-template-rows: auto minmax(0, 1fr);
}

/* Layout must occupy row 2; default grid-row 3/4 targets a row that no longer exists */
.app.route-mode .layout {
  grid-row: 2;
  min-height: 0;
}

.app.route-mode .toolbar {
  display: none !important;
}

.layout.route-mode {
  grid-template-columns: 1fr !important;
  grid-template-areas: "map" !important;
}

.layout.has-detail.route-mode .detail-panel {
  display: none !important;
}

.layout.route-mode .sidebar,
.layout.route-mode .detail-panel {
  display: none !important;
}

.layout.route-mode .map-wrap {
  display: block !important;
}

.detail-body .section {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line-soft);
}

.detail-body .section h3 {
  margin: 0 0 var(--space-md);
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  text-transform: none;
}

/* ── Detail panel section blocks ── */
.detail-section {
  margin-top: var(--space-lg);
}

.detail-section--visit .visit-area {
  margin-top: 0;
  padding: var(--space-lg);
  border-top: 0;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
}

.detail-section--content {
  margin-top: 0;
  margin-left: calc(-1 * var(--space-lg));
  margin-right: calc(-1 * var(--space-lg));
  padding: 0 var(--space-lg) var(--space-2xl);
  background: var(--panel);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.section-header__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
}

/* Menu/reviews zone — sticky segmented control below team visit module */
.detail-tabs-wrap {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0 calc(-1 * var(--space-lg)) 0;
  padding: var(--space-sm) var(--space-lg) var(--space-md);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.team-visit-module + .detail-tabs-wrap {
  margin-top: 0;
}

.detail-tabs-wrap .detail-tabs {
  margin: 0;
}

.detail-section--content > .detail-tab-panel {
  margin-left: calc(-1 * var(--space-lg));
  margin-right: calc(-1 * var(--space-lg));
  padding: var(--space-md) var(--space-lg) 0;
  background: var(--panel);
  animation: detailTabIn 0.22s ease;
}

@keyframes detailTabIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-section--content > .detail-tab-panel {
    animation: none;
  }
}

.detail-section--content > .detail-tab-panel:last-child {
  padding-bottom: var(--space-2xl);
}

.detail-tabs {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.12);
}

.detail-tab {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 0.4375rem 0.75rem;
  min-height: 32px;
  background: transparent;
  color: var(--text-tertiary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.detail-tab:hover {
  color: var(--text-secondary);
}

.detail-tab.active {
  background: var(--panel);
  color: var(--brand-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0.5px 1px rgba(0, 0, 0, 0.06);
}

.detail-tab.active .detail-tab-count {
  color: rgba(198, 40, 40, 0.55);
}

.detail-tab-count {
  font-size: 0.8125em;
  font-weight: 500;
  color: var(--text-tertiary);
}

.detail-tab-panel.hidden { display: none; }

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.menu-item,
.menu-placeholder {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.75rem 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s;
}

.menu-item:last-child,
.menu-placeholder:last-child {
  border-bottom: none;
}

.menu-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

.menu-item img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  cursor: zoom-in;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.menu-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
}

.menu-item strong,
.menu-placeholder strong {
  font-size: var(--font-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.menu-item span,
.menu-placeholder span {
  color: var(--text);
  font-weight: 700;
  font-size: 0.8125rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.detail-tab-panel .menu-item span {
  color: var(--brand-dark);
}

.menu-item--match {
  background: rgba(229, 57, 53, 0.04);
  margin: 0 calc(-1 * var(--space-sm));
  padding-left: var(--space-sm);
  padding-right: var(--space-sm);
  border-radius: var(--radius-sm);
  border-bottom-color: transparent;
}

.menu-item--match + .menu-item {
  border-top: 1px solid var(--line-soft);
}

.menu-placeholder {
  padding: var(--space-lg) 0;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-md);
  border-bottom: none;
}

.place-warning {
  color: var(--text-muted);
  background: rgba(255, 196, 86, 0.12);
  border: 1px solid rgba(255, 196, 86, 0.35);
  border-radius: var(--radius);
  padding: var(--space-md);
  line-height: 1.45;
}

.menu-placeholder--failed {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-md);
}

.menu-placeholder--hints {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
}

.menu-placeholder--hints span {
  color: var(--text-muted);
  font-weight: 500;
  white-space: normal;
  line-height: 1.4;
}

.menu-hints {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
  font-size: var(--font-sm);
  line-height: 1.5;
}

.menu-hints li + li {
  margin-top: var(--space-xs);
}

.menu-placeholder-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.menu-placeholder-text span {
  color: var(--text-muted);
  font-weight: 500;
  white-space: normal;
  line-height: 1.4;
}

.menu-bundle-note {
  color: var(--text-muted);
  font-size: var(--font-xs);
  font-weight: 500;
}

.menu-retry-btn {
  align-self: flex-start;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-sm);
}

.menu-item--match strong {
  font-weight: 700;
}

mark.menu-highlight {
  background: rgba(229, 57, 53, 0.22);
  color: inherit;
  font-weight: 700;
  padding: 0 0.12em;
  border-radius: 2px;
}

/* ── Reviews ── */
.review-disclaimer {
  margin: 0 0 var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.03);
  border: none;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.45;
}

.review-footer-link {
  margin: var(--space-xl) 0 0;
  text-align: center;
}

.review-footer-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.review-footer-link a:hover {
  background: #fafafa;
  border-color: #d0d0d0;
  color: var(--text);
}

.review-footer-link a:active {
  transform: scale(0.98);
}

.review-rating {
  color: #f5a623;
  font-weight: 700;
}

.review-meta {
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.review-item {
  padding: var(--space-md) 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--font-sm);
  line-height: 1.65;
  color: var(--text);
}

.review-item:last-child {
  border-bottom: none;
}

.review-item p {
  margin: 0;
  color: var(--text-secondary);
}

.review-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.5rem;
}

.review-photo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--line-soft);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--space-2xl) + var(--safe-top)) calc(var(--space-2xl) + var(--safe-right)) calc(var(--space-2xl) + var(--safe-bottom)) calc(var(--space-2xl) + var(--safe-left));
  background: rgba(33, 33, 33, 0.88);
  backdrop-filter: blur(8px);
}

.lightbox.hidden { display: none; }

.lightbox-img {
  max-width: min(92vw, 900px);
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  margin: var(--space-md) 0 0;
  color: #eeeeee;
  font-size: var(--font-md);
  text-align: center;
  max-width: 600px;
}

.lightbox-close {
  position: absolute;
  top: calc(var(--space-lg) + var(--safe-top));
  right: calc(var(--space-lg) + var(--safe-right));
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-radius: var(--radius);
  padding: 0.7rem 1.2rem;
  min-height: 48px;
  font: inherit;
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn:active { transform: scale(0.97); }

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 4px 12px var(--brand-glow);
}

.btn.primary:hover {
  box-shadow: 0 6px 16px var(--brand-glow);
}

.btn.ghost {
  background: var(--line-soft);
  color: var(--text);
}

.icon-btn {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--line-soft);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.detail-panel .icon-btn,
.detail-panel .detail-close-btn {
  position: static;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.2rem;
}

.detail-back-btn {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--line-soft);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.detail-head h2,
.detail-head__name {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-filter-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-shrink: 0;
  padding: 0.55rem var(--space-lg);
  border-bottom: 1px solid rgba(229, 57, 53, 0.12);
  background: rgba(229, 57, 53, 0.04);
}

.detail-filter-hint.hidden {
  display: none;
}

.detail-filter-hint__text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--muted);
}

.detail-filter-hint__reset {
  flex-shrink: 0;
  min-height: 1.75rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid rgba(229, 57, 53, 0.28);
  border-radius: 999px;
  background: var(--panel);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.detail-filter-hint__reset:hover {
  background: rgba(229, 57, 53, 0.08);
  border-color: rgba(229, 57, 53, 0.45);
}

.bp-pin--filtered-out .bp-pin-wrap.selected.filtered-out .bp-pin-body,
.bp-pin--filtered-out .bp-pin-inner.selected.filtered-out .bp-pin-body {
  opacity: 0.72;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 4px rgba(120, 120, 120, 0.35);
}

.bp-pin--filtered-out .bp-pin-label {
  opacity: 0.82;
}

.icon-btn:hover {
  background: var(--line);
  color: var(--text);
}

.empty {
  padding: var(--space-2xl) var(--space-xl);
  color: var(--muted);
  text-align: center;
  font-size: var(--font-sm);
  line-height: 1.65;
}

.empty.list-error {
  color: var(--brand);
}

/* ── Bottom sheet (mobile) ── */
.sheet-handle-wrap {
  display: none;
  flex-shrink: 0;
  flex-direction: column;
  align-items: stretch;
  padding: 0.45rem 1rem 0.35rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.sheet-handle {
  width: 2.5rem;
  height: 4px;
  margin: 0 auto 0.35rem;
  border-radius: var(--radius-pill);
  background: #bdbdbd;
  flex-shrink: 0;
}

.sheet-handle-peek {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.25rem;
}

.sheet-handle-peek__label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sheet-handle-peek__hint {
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--brand);
}

.list-sheet.sheet-dragging {
  transition: none !important;
}

.sheet-handle-wrap:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.list-sheet.sheet-dragging[data-snap="peek"] {
  box-shadow: 0 -8px 28px rgba(33, 33, 33, 0.18);
}

.list-sheet.sheet-dragging[data-snap="half"] {
  box-shadow: 0 -16px 48px rgba(33, 33, 33, 0.24);
}

.list-sheet.sheet-dragging .sheet-handle-wrap,
.list-sheet.sheet-dragging .sidebar-head {
  cursor: grabbing;
}

.list-sheet,
.detail-sheet,
.visits-sheet {
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .list-sheet,
  .detail-sheet,
  .visits-sheet {
    transition: none;
  }
}

/* ── Mobile / PWA ── */
@media (max-width: 900px) {
  .app {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .topbar {
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  .layout {
    grid-row: 3;
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .layout.has-detail {
    grid-template-columns: unset;
    grid-template-areas: unset;
  }

  .detail-panel {
    width: 100%;
    max-width: 100%;
  }

  .map-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
  }

  .sidebar.list-sheet {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    height: 100%;
    max-height: 100%;
    border-right: 0;
    padding-bottom: var(--safe-bottom);
    visibility: visible;
    transform: translateY(calc(100% - min(var(--sheet-peek-vh, var(--sheet-peek)), 100%)));
    will-change: transform;
  }

  /* Map mode — peek shows handle + list header + ~3–4 cards */
  .list-sheet[data-snap="peek"] {
    background: var(--panel);
    border-top: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -6px 24px rgba(33, 33, 33, 0.14);
    pointer-events: auto;
    transform: translateY(calc(100% - min(var(--sheet-peek-vh, var(--sheet-peek)), 100%)));
  }

  .list-sheet[data-snap="peek"] .sheet-handle-wrap {
    display: flex;
    background: var(--panel);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: 0.2rem;
  }

  .list-sheet[data-snap="peek"] .sheet-handle-peek {
    display: none;
  }

  .list-sheet[data-snap="peek"] .sidebar-head {
    display: flex;
  }

  .list-sheet[data-snap="peek"] .merchant-list {
    visibility: visible;
    pointer-events: auto;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  /* List mode — full sheet, list is primary */
  .list-sheet[data-snap="half"] {
    background: var(--panel);
    border-top: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -12px 40px rgba(33, 33, 33, 0.2);
    pointer-events: auto;
    transform: translateY(calc(100% - min(var(--sheet-half), 100%)));
  }

  .list-sheet[data-snap="half"] .sidebar-head,
  .list-sheet[data-snap="half"] .merchant-list {
    visibility: visible;
    pointer-events: auto;
  }

  /* Detail open: collapse list fully off-screen (no stacked peek + detail) */
  .layout.detail-sheet-open .sidebar.list-sheet,
  .layout.list-sheet-hidden .sidebar.list-sheet {
    transform: translateY(100%) !important;
    visibility: hidden;
    pointer-events: none;
  }

  .sheet-handle-wrap {
    display: block;
    position: sticky;
    top: 0;
    z-index: 3;
    background: transparent;
  }

  .list-sheet[data-snap="half"] .sheet-handle-wrap {
    background: var(--panel);
  }

  .list-sheet[data-snap="half"] .sheet-handle-peek {
    display: none;
  }

  .sidebar-head {
    position: sticky;
    top: var(--sheet-handle-sticky-top, 2.25rem);
    z-index: 2;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }

  .merchant-list {
    touch-action: pan-y;
  }

  .detail-panel.detail-sheet {
    position: absolute;
    inset: 0;
    z-index: 40;
    width: 100%;
    max-width: 100%;
    /* Pin to layout box (below topbar + toolbar); inset beats height:100% on iOS */
    height: auto;
    max-height: none;
    border-right: 0;
    border-top: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -12px 40px rgba(33, 33, 33, 0.18);
    padding-bottom: var(--safe-bottom);
    transform: translateY(100%);
    pointer-events: none;
    overflow: hidden;
    overscroll-behavior: contain;
  }

  .layout.detail-sheet-open .detail-panel.detail-sheet:not(.hidden) {
    display: flex !important;
    flex-direction: column;
    /* transform:none — translateY(0) still breaks position:sticky on iOS */
    transform: none;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    pointer-events: auto;
    visibility: visible;
    overflow: hidden;
  }

  .layout.detail-sheet-open .detail-head {
    flex-shrink: 0;
    position: relative;
    top: auto;
    z-index: 10;
    touch-action: none;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .layout.detail-sheet-open .detail-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    position: relative;
    z-index: 1;
  }

  .app.detail-sheet-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .detail-back-btn {
    display: inline-flex;
  }

  .detail-close-btn {
    display: none;
  }

  /* Route focus mode on mobile */
  .app.route-mode {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app.route-mode .layout {
    grid-row: 2;
    min-height: 0;
  }

  .layout.route-mode .sidebar.list-sheet,
  .layout.route-mode .detail-panel {
    display: none !important;
  }

  .layout.route-mode .map-wrap {
    display: block !important;
  }

  .route-banner {
    top: auto;
    bottom: calc(1rem + var(--safe-bottom));
    left: calc(0.75rem + var(--safe-left));
    right: calc(4.75rem + var(--safe-right));
    transform: none;
    max-width: none;
    border-radius: var(--radius-lg);
  }

  .route-banner__text {
    white-space: normal;
  }

  .route-end-btn {
    top: auto;
    bottom: calc(1rem + var(--safe-bottom));
    right: calc(0.75rem + var(--safe-right));
    min-width: 5.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
  }

  .list-sheet-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    position: absolute;
    left: 50%;
    z-index: 35;
    pointer-events: auto;
    min-height: 44px;
    padding: 0.55rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    font-family: "Noto Sans KR", sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 24px rgba(33, 33, 33, 0.16);
    transform: translateX(-50%);
    transition:
      top 0.32s cubic-bezier(0.22, 1, 0.36, 1),
      bottom 0.32s cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .list-sheet-toggle.hidden {
    display: none;
  }

  .list-sheet-toggle__chev {
    font-size: 0.75rem;
    line-height: 1;
    color: var(--brand);
  }

  .list-sheet-toggle:active {
    box-shadow: 0 3px 12px rgba(33, 33, 33, 0.12);
  }

  .list-sheet-toggle:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
  }

  /* Expanded list — pill is secondary "지도 보기" affordance */
  .layout[data-list-snap="half"] .list-sheet-toggle {
    top: calc(100% - min(var(--sheet-half), 100%) + 0.4rem);
    bottom: auto;
    box-shadow: 0 4px 16px rgba(33, 33, 33, 0.12);
  }

  .layout.detail-sheet-open .list-sheet-toggle,
  .layout.route-mode .list-sheet-toggle,
  .layout.list-sheet-hidden .list-sheet-toggle {
    display: none !important;
  }

  .brand-tagline { display: none; }

  .search-label { display: none; }

  .controls {
    flex-wrap: nowrap;
    padding: var(--space-sm) var(--space-lg);
    gap: var(--space-sm);
    overflow: hidden;
  }

  .control.search {
    flex: 1 1 auto;
    min-width: 0 !important;
    max-width: 100%;
  }

  .topbar {
    padding-top: calc(var(--space-md) + var(--safe-top));
    padding-bottom: var(--space-sm);
    padding-left: calc(var(--space-lg) + var(--safe-left));
    padding-right: calc(var(--space-lg) + var(--safe-right));
    gap: var(--space-sm);
  }

  .topbar h1 { font-size: var(--font-lg); }

  .toolbar .category-bar {
    padding: var(--space-sm) var(--space-lg);
  }

  .social-login-btn {
    min-height: 44px;
    padding: 0.45rem 0.75rem;
  }

  .cat-chip {
    min-height: 44px;
    padding: 0.6rem 1.15rem;
  }

  .merchant-list {
    max-width: 100%;
    overflow-x: hidden;
  }

  .merchant-card {
    min-height: 100px;
    max-width: 100%;
    padding: var(--space-lg) var(--space-lg);
    overflow: hidden;
  }

  .hero,
  .detail-hero__image,
  .detail-hero__placeholder {
    height: 180px;
  }
  .lightbox-img { max-height: 70vh; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* ── Social / team visits ── */
.social-chrome {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.social-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.social-actions.hidden { display: none; }

.visit-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: var(--font-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.visit-filter-chip:hover:not(.visit-filter-chip--disabled) {
  border-color: rgba(229, 57, 53, 0.35);
  color: var(--text);
}

.visit-filter-chip.active {
  background: rgba(229, 57, 53, 0.08);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.18);
}

.visit-filter-chip--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.notification-bell__icon {
  display: block;
}

.notification-bell__badge {
  position: absolute;
  top: 0.15rem;
  right: 0.1rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

.notification-bell__badge.hidden { display: none; }

.notifications-panel {
  position: fixed;
  inset: 0;
  z-index: 5100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--space-lg) + 3.5rem) var(--space-lg) var(--space-lg);
}

.notifications-panel.hidden { display: none; }

.notifications-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
}

.notifications-panel__sheet {
  position: relative;
  width: min(100%, 26rem);
  max-height: 60vh;
  min-height: min(20rem, 55vh);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.18));
  overflow: hidden;
}

.notifications-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--line-soft);
}

.notifications-panel__head h2 {
  margin: 0;
  font-size: var(--font-lg);
}

.notifications-panel__read-all {
  font-size: var(--font-sm);
  padding: 0.35rem 0.65rem;
}

.notifications-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notifications-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-xs) 0;
}

.notifications-list.hidden { display: none; }

.notification-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  padding: 0.85rem var(--space-lg);
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.notification-item:last-child { border-bottom: 0; }

.notification-item--unread {
  background: rgba(229, 57, 53, 0.05);
}

.notification-item__title {
  font-size: var(--font-sm);
  font-weight: 600;
  line-height: 1.45;
}

.notification-item__body {
  font-size: var(--font-sm);
  color: var(--muted);
  line-height: 1.4;
}

.notification-item__text {
  font-size: var(--font-sm);
  line-height: 1.45;
}

.notification-item__preview {
  font-size: var(--font-sm);
  color: var(--muted);
  line-height: 1.4;
}

.notification-item__time {
  font-size: 0.75rem;
  color: var(--muted);
}

.notifications-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 12rem;
  margin: 0;
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  color: var(--muted);
}

.notifications-empty.hidden {
  display: none;
}

.notifications-empty__icon {
  font-size: 1.75rem;
  line-height: 1;
  opacity: 0.65;
}

.notifications-empty__title {
  margin: 0;
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text);
}

.notifications-empty__hint {
  margin: 0;
  font-size: var(--font-sm);
  line-height: 1.45;
  max-width: 16rem;
}

.visit-modal__panel {
  width: min(100%, 24rem);
}

.visit-modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.visit-modal__actions {
  margin-top: var(--space-lg);
}

.visit-btn--prominent {
  width: 100%;
  min-height: 3rem;
  font-size: var(--font-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.team-visit-card__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
}

.team-visit-card__actions {
  flex-shrink: 0;
}

.visit-cancel-btn,
.team-visit-card__actions .visit-cancel-btn {
  font-size: var(--font-sm);
  padding: 0.25rem 0.55rem;
  min-height: auto;
}

.visit-replies {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.visit-reply {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}

.visit-reply__avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.visit-reply__avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.visit-reply__body {
  flex: 1;
  min-width: 0;
}

.visit-reply__meta {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.visit-reply__meta strong {
  font-size: var(--font-sm);
}

.visit-reply__meta span {
  font-size: 0.75rem;
  color: var(--muted);
}

.visit-reply__text {
  margin: 0;
  font-size: var(--font-sm);
  line-height: 1.45;
  color: var(--text);
}

.visit-reply-section {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line-soft);
}

.visit-replies + .visit-reply-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.visit-reply-form {
  display: flex;
  gap: 0.35rem;
}

.visit-reply-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--font-sm);
}

.visit-reply-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.visit-reply-submit {
  flex-shrink: 0;
  min-height: 2.5rem;
  font-size: var(--font-sm);
}

.team-visit-card--highlight {
  animation: visit-highlight 2.4s ease;
}

@keyframes visit-highlight {
  0%, 100% { background: transparent; }
  15%, 55% { background: rgba(229, 57, 53, 0.08); }
}

.social-login-btn {
  white-space: nowrap;
  font-size: var(--font-sm);
  padding: 0.45rem 0.85rem;
  min-height: 44px;
}

.profile-chip__avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-chip__avatar.hidden { display: none; }

.google-signin-wrap {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin-bottom: var(--space-md);
}

.google-signin-wrap.hidden { display: none; }

.google-setup-notice {
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius);
  background: rgba(255, 243, 224, 0.85);
  border: 1px solid rgba(245, 124, 0, 0.25);
  font-size: var(--font-sm);
  line-height: 1.5;
}

.google-setup-notice.hidden { display: none; }

.google-setup-notice p { margin: 0 0 0.5rem; }

.google-setup-notice code {
  font-size: 0.85em;
  word-break: break-all;
}

.google-setup-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
}

.google-setup-steps li { margin-bottom: 0.35rem; }

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 11rem;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  cursor: pointer;
  font: inherit;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.profile-chip--has-avatar {
  padding-left: 0.3rem;
}

.profile-chip--has-avatar .profile-chip__avatar {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid var(--brand-soft);
}

.profile-chip--initials .profile-chip__name::before {
  content: attr(data-initial);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: 0.25rem;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.8125rem;
}

.visit-area {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line-soft);
}

.detail-actions .visit-area {
  padding: var(--space-md) 0 0;
  border-top: 1px solid var(--line-soft);
  background: transparent;
}

.detail-section--visit .visit-register,
.detail-section--visit .visit-register--done,
.detail-section--visit .visit-register--blocked,
.detail-section--visit .visit-register--guest {
  padding: 0;
}

.visit-area--placeholder {
  pointer-events: none;
}

.visit-area__stub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem var(--space-md);
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--line);
  background: var(--line-soft);
  color: var(--muted);
}

.visit-area__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
  font-size: 0.75rem;
  font-weight: 700;
}

.visit-area__label {
  font-size: 0.8125rem;
  font-weight: 600;
}

.profile-chip__name {
  font-size: var(--font-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.login-modal.hidden { display: none; }

.hidden { display: none !important; }

.login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.login-modal__panel {
  position: relative;
  width: min(100%, 22rem);
  padding: var(--space-xl);
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.18));
}

.login-modal__panel h2 {
  margin: 0 0 var(--space-sm);
  font-size: var(--font-xl);
}

.login-modal__hint {
  margin: 0 0 var(--space-lg);
  color: var(--muted);
  font-size: var(--font-sm);
  line-height: 1.45;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: var(--font-sm);
  font-weight: 600;
}

.login-field input {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.login-error {
  margin: 0;
  color: var(--brand);
  font-size: var(--font-sm);
}

.login-error.hidden { display: none; }

.login-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.admin-link-btn {
  display: block;
  width: 100%;
  margin-top: var(--space-md);
  text-align: center;
  text-decoration: none;
}

.visit-btn {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--font-lg);
  font-weight: 700;
  cursor: pointer;
}

.visit-btn--done {
  background: #fff;
  color: #2e7d32;
  border: 1.5px solid rgba(46, 125, 50, 0.45);
}

.visit-section {
  margin-top: var(--space-lg);
  padding: var(--space-lg) 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line-soft);
}

.visit-section.team-visits,
.detail-section.team-visits,
.team-visit-module {
  margin-top: 0;
  margin-bottom: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--panel);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 3px solid rgba(0, 151, 167, 0.32);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
}

.team-visit-module__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.team-visit-module__title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.team-visit-module__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  padding: 1px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 151, 167, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.team-visit-module__record-btn {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-dark);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.team-visit-module__record-btn:hover {
  background: #ffe5e5;
}

.team-visit-module__empty {
  display: block;
  width: 100%;
  margin: 0;
  padding: var(--space-sm) 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: var(--font-sm);
  line-height: 1.5;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s;
}

.team-visit-module__empty:hover {
  color: var(--text-secondary);
}

.team-visit-module__summary {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.team-visit-module__avatars {
  display: flex;
  flex-shrink: 0;
}

.team-visit-module__avatar {
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--panel);
  margin-left: -0.4rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.team-visit-module__avatar:first-child {
  margin-left: 0;
}

.team-visit-module__avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.625rem;
  font-weight: 700;
}

.team-visit-module__preview {
  flex: 1;
  min-width: 0;
}

.team-visit-module__preview-text {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-visit-module--done {
  background: var(--panel);
  border-color: rgba(76, 175, 80, 0.14);
  border-left-color: rgba(0, 151, 167, 0.32);
}

.team-visit-module__mini-card {
  padding: var(--space-sm) 0;
}

.team-visit-module__mini-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.team-visit-module__mini-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
}

.team-visit-module__mini-avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.8125rem;
  font-weight: 700;
}

.team-visit-module__mini-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.team-visit-module__mini-meta strong {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.team-visit-module__mini-meta span {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.35;
}

.team-visit-module__mini-actions {
  flex-shrink: 0;
  margin-left: auto;
}

.team-visit-module__mini-comment {
  margin: 0.45rem 0 0;
  padding-left: calc(2rem + var(--space-sm));
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.team-visit-module__photo-strip {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding-left: calc(2rem + var(--space-sm));
}

.team-visit-module__photo {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--line-soft);
}

.team-visit-module__success {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.team-visit-module__success-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.12);
  color: #43a047;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
}

.team-visit-module__success-body {
  flex: 1;
  min-width: 0;
}

.team-visit-module__success-label {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.team-visit-module__success-comment {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-tertiary);
}

.team-visit-module__remove {
  flex-shrink: 0;
  align-self: center;
  padding: 0.25rem 0.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.team-visit-module__remove:hover {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.04);
}

.team-visit-module__others {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--line-soft);
}

.team-visit-module__all-btn {
  display: block;
  width: 100%;
  margin-top: var(--space-sm);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  background: var(--panel);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.team-visit-module__all-btn:hover {
  border-color: #d0d0d0;
  background: #fafafa;
  color: var(--text);
}

.team-visit-module__all-btn:active {
  transform: scale(0.98);
}

.team-visit-module__all {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
}

.team-visit-module__all:hover {
  text-decoration: underline;
}

.team-visit-module__blocked {
  margin: 0 0 var(--space-sm);
  font-size: var(--font-sm);
  line-height: 1.45;
  color: var(--muted);
}

.team-visit-module__delete {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
}

.team-visit-module__delete:hover {
  color: var(--text-secondary);
}

.visit-section__title,
.section-header__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
}

.visit-section__names {
  margin: 0;
  font-size: var(--font-md);
  line-height: 1.45;
}

.visit-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(67, 160, 71, 0.12);
  color: #2e7d32;
  font-size: var(--font-xs);
  font-weight: 600;
}

.visit-login-hint {
  margin: 0 0 var(--space-sm);
  font-size: var(--font-sm);
  color: var(--muted);
  line-height: 1.45;
}

.visit-login-btn {
  width: 100%;
}

.visit-register {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md) 0 0;
}

.visit-register--done,
.visit-register--blocked,
.visit-register--guest {
  padding: var(--space-md) 0 0;
  border: 0;
  background: transparent;
}

.visit-done-label {
  margin: 0;
  font-weight: 700;
  color: #2e7d32;
}

.visit-done-note,
.visit-blocked-note {
  margin: 0;
  font-size: var(--font-sm);
  line-height: 1.45;
  color: var(--text);
}

.visit-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.visit-field__label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--muted);
}

.visit-field__optional {
  font-weight: 400;
  color: var(--muted);
}

.visit-comment {
  width: 100%;
  min-height: 4.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font: inherit;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.visit-comment:focus {
  outline: none;
  border-color: rgba(46, 125, 50, 0.5);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.visit-field--photos {
  gap: 0.35rem;
}

.visit-photo-picker {
  display: block;
  cursor: pointer;
}

.visit-photo-picker__face {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.15s, background 0.15s;
}

.visit-photo-picker:hover .visit-photo-picker__face,
.visit-photo-picker:focus-within .visit-photo-picker__face {
  border-color: rgba(46, 125, 50, 0.45);
  background: rgba(46, 125, 50, 0.04);
}

.visit-photo-picker__icon {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.visit-photo-picker__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.visit-photo-picker__label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text);
}

.visit-photo-picker__hint {
  font-size: var(--font-xs);
  color: var(--muted);
}

.visit-photo-picker__count {
  flex-shrink: 0;
  font-size: var(--font-xs);
  font-weight: 600;
  color: #2e7d32;
}

.visit-photos-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.visit-photo-previews {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-top: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.visit-photo-previews:not(.hidden):not(:empty) {
  display: flex;
}

.visit-photo-preview {
  flex-shrink: 0;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--line-soft);
}

.visit-delete-btn {
  align-self: flex-start;
}

.team-visits__head {
  margin-bottom: var(--space-md);
}

.team-visits__head.section-header {
  margin-bottom: var(--space-md);
}

.team-visits__all {
  flex-shrink: 0;
  padding: 0.35rem 0.55rem;
  margin: -0.35rem -0.55rem -0.35rem 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  font: inherit;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  transition: background 0.15s;
}

.team-visits__all:hover {
  background: var(--brand-soft);
}

.team-visits-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.team-visits-list .team-visit-card,
.team-visits-list .team-visit-line {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--line-soft);
}

.team-visits-list .team-visit-card:last-child,
.team-visits-list .team-visit-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.team-visits-list .team-visit-card:first-child,
.team-visits-list .team-visit-line:first-child {
  padding-top: 0;
}

.team-visits-empty {
  margin: 0;
  padding: var(--space-xs) 0 0;
  font-size: var(--font-sm);
  line-height: 1.5;
  color: var(--muted);
}

.team-visit-line {
  margin: 0;
  font-size: var(--font-md);
  line-height: 1.45;
}

.team-visit-card {
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: var(--panel);
}

.team-visits-list .team-visit-card {
  padding: var(--space-md) 0;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.team-visit-card--simple {
  padding: 0.75rem var(--space-md);
}

.team-visits-list .team-visit-card--simple {
  padding: var(--space-md) 0;
}

.team-visit-card__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.team-visit-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.team-visit-avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.875rem;
}

.team-visit-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.team-visit-card__meta strong {
  font-size: var(--font-md);
}

.team-visit-card__meta span {
  font-size: var(--font-xs);
  color: var(--muted);
}

.team-visit-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.team-visit-photo {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
}

.team-visit-comment {
  margin: 0;
  font-size: var(--font-md);
  line-height: 1.5;
  white-space: pre-wrap;
}

.visits-page {
  background: var(--bg);
  min-height: 100vh;
}

.visits-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.visits-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.visits-back {
  flex-shrink: 0;
  margin-top: 0.35rem;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.visits-eyebrow {
  margin: 0 0 0.15rem;
  font-size: var(--font-sm);
  color: var(--muted);
}

.visits-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.visits-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.visits-gate,
.visits-loading,
.visits-empty {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: var(--panel);
  text-align: center;
}

.visits-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.visits-more {
  width: 100%;
}

/* ── Visits sheet (stacked over detail) ── */
.visits-sheet {
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.visits-sheet:not(.hidden) {
  display: flex;
}

.visits-sheet__head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--space-md) var(--space-lg) var(--space-sm);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.visits-sheet__titles {
  flex: 1;
  min-width: 0;
}

.visits-sheet__title {
  margin: 0;
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.visits-sheet__subtitle {
  margin: 0.15rem 0 0;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visits-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-md) var(--space-lg) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.visits-sheet__status,
.visits-sheet__gate {
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  color: var(--muted);
  font-size: var(--font-sm);
  line-height: 1.5;
}

.visits-sheet__error {
  display: block;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.visits-sheet__retry {
  margin-top: var(--space-xs);
}

.visits-sheet__gate .visit-btn {
  margin-top: var(--space-md);
}

.visits-sheet .visits-feed {
  gap: var(--space-sm);
}

.visits-sheet .visits-feed .team-visit-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.visits-sheet .visit-reply-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.visits-sheet .visit-reply-input {
  background: var(--bg);
}

.visits-back-btn {
  display: inline-flex;
}

@media (min-width: 901px) {
  .visits-sheet {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 320px;
    width: 400px;
    z-index: 45;
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 32px rgba(33, 33, 33, 0.12);
    transform: translateX(100%);
    pointer-events: none;
    visibility: hidden;
  }

  .layout.visits-sheet-open .visits-sheet:not(.hidden) {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
  }

  .layout:not(.has-detail) .visits-sheet {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .visits-sheet {
    position: absolute;
    inset: 0;
    z-index: 50;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-top: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -12px 40px rgba(33, 33, 33, 0.2);
    padding-bottom: var(--safe-bottom);
    transform: translateY(100%);
    pointer-events: none;
    visibility: hidden;
  }

  .layout.visits-sheet-open .visits-sheet:not(.hidden) {
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
  }

  .layout.visits-sheet-open .visits-sheet__head {
    position: sticky;
    top: 0;
  }
}

.bp-pin-inner {
  position: relative;
}

.bp-pin-body { position: relative; }

.bp-pin-visit-badge {
  position: absolute;
  top: -1px;
  right: -2px;
  z-index: 3;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  background: #7dd8f0;
  line-height: 0;
}

.bp-pin-visit-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.bp-pin--team-visit .bp-pin-body {
  box-shadow: var(--pin-shadow), 0 0 0 2px rgba(61, 200, 230, 0.48);
}

@media (max-width: 900px) {
  .bp-pin--labeled .bp-pin-label {
    margin-top: 2px;
    padding: 0.12rem 0.38rem;
    font-size: 9px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    max-width: 68px;
    border-width: 1px;
    box-shadow: 0 1px 4px rgba(33, 33, 33, 0.1);
  }

  .bp-pin-wrap.selected .bp-pin-label,
  .bp-pin-label.bp-pin-label--selected {
    font-size: 10px;
    max-width: 88px;
    padding: 0.18rem 0.45rem;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .brand h1 {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .social-chrome {
    order: 3;
    width: auto;
    margin-left: 0;
    flex-shrink: 0;
  }

  .profile-chip {
    max-width: 8.5rem;
  }

  .profile-chip__name { max-width: 4.5rem; }
}

/* v167 — subtle app-wide accents (~10% color) */
.topbar {
  background: linear-gradient(180deg, #fff 0%, rgba(255, 251, 251, 0.98) 100%);
  border-bottom-color: rgba(229, 57, 53, 0.12);
}

.brand-tagline {
  color: var(--brand-dark);
  opacity: 0.72;
}

.sidebar-head {
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 251, 251, 0.5) 100%);
}

.count-badge {
  background: rgba(229, 57, 53, 0.1);
  color: var(--brand-dark);
  border: 1px solid rgba(229, 57, 53, 0.18);
}

.control.search input:focus {
  border-color: rgba(229, 57, 53, 0.45);
}

.visit-filter-chip.active {
  background: rgba(0, 151, 167, 0.1);
  border-color: rgba(0, 151, 167, 0.45);
  color: var(--office-teal-dark);
  box-shadow: 0 2px 8px rgba(0, 151, 167, 0.16);
}

.notification-bell:hover {
  border-color: rgba(0, 151, 167, 0.35);
  color: var(--office-teal-dark);
}

.notification-item--unread {
  background: rgba(0, 151, 167, 0.06);
  border-left: 3px solid rgba(0, 151, 167, 0.35);
}

.notifications-panel__head {
  border-bottom-color: rgba(0, 151, 167, 0.15);
}

.notifications-empty__icon {
  color: var(--office-teal);
  opacity: 0.85;
}

.empty:not(.list-error) {
  border-left: 3px solid rgba(229, 57, 53, 0.22);
  background: rgba(255, 251, 251, 0.65);
  border-radius: var(--radius-md);
  padding-left: calc(var(--space-lg) + 2px);
}

.merchant-card:focus-visible {
  outline: 2px solid rgba(229, 57, 53, 0.35);
  outline-offset: -2px;
}

#visitModalSubmitBtn.primary {
  box-shadow: 0 4px 14px var(--brand-glow);
}

/* ── Delete visit confirmation modal ── */
.delete-visit-modal {
  z-index: 5200;
}

.delete-visit-modal__backdrop {
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.delete-visit-modal--visible .delete-visit-modal__backdrop {
  opacity: 1;
}

.delete-visit-modal__panel {
  width: min(100%, 20.5rem);
  text-align: center;
  transform: scale(0.96) translateY(10px);
  opacity: 0;
  transition:
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
}

.delete-visit-modal--visible .delete-visit-modal__panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.delete-visit-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto var(--space-md);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: 0 0 0 1px rgba(229, 57, 53, 0.08);
}

.delete-visit-modal__panel h2 {
  margin-bottom: var(--space-xs);
  font-size: var(--font-lg);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.delete-visit-modal__place {
  margin: 0 0 var(--space-sm);
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.delete-visit-modal__hint {
  margin: 0 0 var(--space-lg);
}

.delete-visit-modal__actions {
  justify-content: stretch;
  gap: var(--space-sm);
  margin-top: 0;
}

.delete-visit-modal__actions .btn {
  flex: 1;
  min-height: 48px;
}

.btn.btn-danger {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1.5px solid rgba(229, 57, 53, 0.22);
  box-shadow: none;
}

.btn.btn-danger:hover {
  background: #ffcdd2;
  color: var(--brand-dark);
}

.btn.btn-danger:focus-visible {
  outline: 2px solid rgba(229, 57, 53, 0.45);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .delete-visit-modal__backdrop,
  .delete-visit-modal__panel {
    transition: none;
  }
}

