/* 台灣支付地圖 — CardSwitch 金色 + 玻璃質感；UI UX PRO MAX：Inter、backdrop-blur、對比 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #1a1a1a;
  --accent-color: #cfb378;
  --accent-muted: rgba(207, 179, 120, 0.35);
  --bg-color: #f5f7fa;
  --card-bg: rgba(255, 255, 255, 0.88);
  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.55);
  --shadow-soft: 0 8px 32px rgba(15, 23, 42, 0.08);
  --shadow-chip: 0 2px 12px rgba(15, 23, 42, 0.12);
  --map-control-z: 400;
  --overlay-z: 500;
  --fab-z: 520;
  --sheet-z: 600;
  --modal-z: 700;
  --radius: 14px;
  --radius-pill: 999px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --primary-color: #f8fafc;
  --bg-color: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.92);
  --glass-bg: rgba(15, 23, 42, 0.78);
  --glass-border: rgba(248, 250, 252, 0.12);
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-chip: 0 2px 16px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg-color);
  color: var(--primary-color);
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

#map {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* —— 頂部搜尋 + 藥丸 —— */
.map-overlay-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--overlay-z);
  padding: max(12px, env(safe-area-inset-top)) 12px 8px;
  pointer-events: none;
}

.map-overlay-top > * {
  pointer-events: auto;
}

/* —— 篩選收折 —— */
.filter-panel {
  border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.filter-panel-head {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--glass-border);
}

.filter-toggle {
  flex: 1;
  min-width: 0;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--primary-color);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.filter-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .filter-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.filter-toggle:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -2px;
}

.filter-toggle-chevron {
  flex-shrink: 0;
  opacity: 0.55;
  transition: transform 0.25s ease;
}

.filter-panel.collapsed .filter-toggle-chevron {
  transform: rotate(-90deg);
}

.filter-clear-btn {
  flex-shrink: 0;
  align-self: center;
  margin: 4px 10px 4px 0;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--primary-color);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s, background 0.15s;
}

.filter-clear-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .filter-clear-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.filter-clear-btn:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.filter-panel.collapsed .filter-scroll-area {
  max-height: 0 !important;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* 可捲動篩選區：避免被底部列表或矮螢幕裁切，確保藥丸可見 */
.filter-scroll-area {
  max-height: min(42vh, 340px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 12px;
  overscroll-behavior: contain;
  transition: max-height 0.28s ease, opacity 0.22s ease, padding 0.22s ease;
}

@media (min-width: 900px) {
  .filter-scroll-area {
    max-height: min(50vh, 420px);
  }
}

.filter-hint {
  margin: 8px 12px 0;
  font-size: 0.7rem;
  line-height: 1.4;
  opacity: 0.55;
}

.search-bar-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 0.95rem;
  color: var(--primary-color);
  box-shadow: var(--shadow-soft);
}

.search-input::placeholder {
  color: var(--primary-color);
  opacity: 0.45;
}

.search-input:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  color: var(--primary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, background 0.2s;
}

.icon-btn:hover {
  transform: scale(1.04);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 12px 8px;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  scrollbar-width: thin;
  -ms-overflow-style: auto;
}

.chip-scroll::-webkit-scrollbar {
  height: 4px;
}

.chip-scroll::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
}

.chip-scroll-quick {
  margin-top: 6px;
}

.chip-row-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
  margin: 8px 12px 6px;
}

.chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-chip);
  color: var(--primary-color);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.chip:hover {
  border-color: var(--accent-muted);
}

.chip:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.chip[aria-pressed="true"] {
  background: rgba(26, 26, 26, 0.08);
  border-color: rgba(26, 26, 26, 0.35);
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
}

[data-theme="dark"] .chip[aria-pressed="true"] {
  background: rgba(248, 250, 252, 0.12);
  border-color: rgba(248, 250, 252, 0.35);
  box-shadow: inset 0 0 0 1px rgba(248, 250, 252, 0.08);
}

.chip.chip-twqr[aria-pressed="true"] {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.45);
}

/* —— 底部列表抽屜 —— */
.sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--sheet-z) - 1);
  background: rgba(15, 23, 42, 0.35);
}

.sheet-backdrop.visible {
  display: block;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--sheet-z);
  max-height: min(52vh, 420px);
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--glass-border);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--primary-color);
  opacity: 0.2;
  margin: 10px auto 6px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 10px;
  border-bottom: 1px solid var(--glass-border);
}

.sheet-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.sheet-toggle-hint {
  font-size: 0.75rem;
  opacity: 0.6;
}

.store-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 12px 16px;
}

.store-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.store-item:hover,
.store-item:focus-visible {
  border-color: var(--accent-color);
  outline: none;
  box-shadow: var(--shadow-soft);
}

.store-item.selected {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.store-item-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.store-item-meta {
  font-size: 0.75rem;
  opacity: 0.65;
}

/* —— 詳情面板 —— */
.detail-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(100%, 400px);
  z-index: calc(var(--sheet-z) + 2);
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  box-shadow: -8px 0 40px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

.detail-panel.open {
  transform: translateX(0);
}

@media (max-width: 768px) {
  .detail-panel {
    left: 0;
    width: 100%;
    border-left: none;
    transform: translateY(100%);
  }
  .detail-panel.open {
    transform: translateY(0);
  }
}

.detail-panel h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  padding-right: 40px;
}

.detail-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--glass-bg);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.detail-section {
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.detail-section h3 {
  margin: 0 0 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.55;
}

.payment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  background: var(--accent-muted);
  border: 1px solid var(--glass-border);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--accent-color);
  color: #1a1a1a;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-size: 0.875rem;
}

.btn-link.secondary {
  background: var(--glass-bg);
  color: var(--primary-color);
  border: 1px solid var(--glass-border);
}

.btn-link:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* —— FAB 回報（淺色：白底黑圖示；深色：反轉） —— */
.fab-report {
  --fab-bg: #ffffff;
  --fab-fg: #111111;
  --fab-border: rgba(0, 0, 0, 0.12);
  --fab-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
  position: fixed;
  bottom: max(24px, calc(20px + env(safe-area-inset-bottom)));
  right: 16px;
  z-index: var(--fab-z);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--fab-border);
  background: var(--fab-bg);
  color: var(--fab-fg);
  cursor: pointer;
  box-shadow: var(--fab-shadow);
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

[data-theme="dark"] .fab-report {
  --fab-bg: #1e293b;
  --fab-fg: #f8fafc;
  --fab-border: rgba(248, 250, 252, 0.15);
  --fab-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.fab-report:hover {
  transform: scale(1.06);
}

.fab-report:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
}

/* —— 模態回報精靈 —— */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: var(--modal-z);
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  padding: env(safe-area-inset-top) 0 0;
}

.modal-root.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  max-height: min(92vh, 720px);
  background: var(--card-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
}

@media (min-width: 540px) {
  .modal-root {
    align-items: center;
    padding: 24px;
  }
  .modal-dialog {
    border-radius: var(--radius);
  }
}

.modal-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--primary-color);
}

.btn-primary {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #1a1a1a;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  opacity: 0.85;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--bg-color);
  color: var(--primary-color);
  font: inherit;
  margin-bottom: 12px;
}

.form-textarea {
  min-height: 72px;
  resize: vertical;
}

.wizard-steps {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-bottom: 12px;
}

.report-merge-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-chip);
  font-size: 0.8rem;
  line-height: 1.5;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#report-mini-map {
  height: 200px;
  border-radius: var(--radius);
  margin: 12px 0;
  border: 1px solid var(--glass-border);
}

/* 回報精靈：Google 地圖分享教學（截圖置於 ./PNG/） */
.report-share-tutorial {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.report-tutorial-heading {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.report-tutorial-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .report-tutorial-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
  }
}

.report-tutorial-block {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.report-tutorial-sub {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 700;
}

.report-tutorial-caption {
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.85;
}

.report-tutorial-img-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.04);
  line-height: 0;
}

[data-theme="dark"] .report-tutorial-img-wrap {
  background: rgba(0, 0, 0, 0.25);
}

.report-tutorial-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.report-tutorial-attribution {
  margin: 14px 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  opacity: 0.7;
}

.payment-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  font-size: 0.8125rem;
  cursor: pointer;
}

.payment-option input {
  margin: 0;
}

.taiwan-pay-sub {
  margin-left: 1.5rem;
  margin-top: 4px;
  font-size: 0.8rem;
}

/* —— 更新提示 —— */
.update-toast {
  position: fixed;
  bottom: max(90px, calc(80px + env(safe-area-inset-bottom)));
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 800;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--primary-color);
  color: var(--bg-color);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}

.update-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.update-toast button {
  margin-left: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--accent-color);
  color: #1a1a1a;
  font-weight: 700;
  cursor: pointer;
}

/* —— 回報成功提示 —— */
.success-toast {
  position: fixed;
  bottom: max(96px, calc(88px + env(safe-area-inset-bottom)));
  left: 50%;
  transform: translateX(-50%) translateY(160%);
  z-index: 850;
  max-width: min(420px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.3s ease;
}

.success-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.success-toast-btn {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--primary-color);
  color: var(--bg-color);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
}

.success-toast-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--primary-color);
  opacity: 0.6;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

/* —— 設定面板 —— */
.modal-settings-root .settings-dialog {
  max-height: min(92vh, 640px);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(180deg, var(--glass-bg) 0%, var(--card-bg) 100%);
}

.settings-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.settings-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--glass-bg);
  color: var(--primary-color);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-close:hover {
  background: rgba(26, 26, 26, 0.06);
}

[data-theme="dark"] .settings-close:hover {
  background: rgba(248, 250, 252, 0.08);
}

.settings-body {
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  flex: 1;
}

.settings-section {
  margin-top: 20px;
}

.settings-section:first-of-type {
  margin-top: 12px;
}

.settings-section-title {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
}

.settings-about {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  opacity: 0.92;
}

.settings-muted {
  margin: 0 0 12px;
  font-size: 0.8rem;
  opacity: 0.65;
  line-height: 1.5;
}

.theme-segment {
  display: flex;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(26, 26, 26, 0.06);
  border: 1px solid var(--glass-border);
  gap: 4px;
}

[data-theme="dark"] .theme-segment {
  background: rgba(248, 250, 252, 0.06);
}

.theme-segment-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.theme-segment-btn.active {
  background: var(--card-bg);
  box-shadow: var(--shadow-chip);
}

.settings-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-link {
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.2s, transform 0.15s;
}

.settings-link:hover {
  border-color: rgba(26, 26, 26, 0.2);
  transform: translateX(2px);
}

.settings-version {
  margin: 24px 0 8px;
  font-size: 0.75rem;
  opacity: 0.45;
  text-align: center;
}

/* —— 法律頁共用 —— */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 18px 48px;
  line-height: 1.65;
}

.legal-page h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.legal-back {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--primary-color);
  font-weight: 600;
}

/* Leaflet：自訂店家圓形標記（非預設藍色圖釘） */
.leaflet-div-icon.map-pin-marker {
  background: transparent !important;
  border: none !important;
}

.map-pin-marker__disc {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
  border: 2px solid rgba(26, 26, 26, 0.14);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  color: #1e293b;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.map-pin-marker__disc svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.88;
}

.map-pin-marker--selected .map-pin-marker__disc {
  border-color: var(--accent-color);
  box-shadow:
    0 0 0 3px var(--accent-muted),
    0 6px 18px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.95) inset;
  transform: scale(1.08);
}

[data-theme="dark"] .map-pin-marker__disc {
  background: linear-gradient(145deg, #334155 0%, #1e293b 100%);
  border-color: rgba(248, 250, 252, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  color: #e2e8f0;
}

[data-theme="dark"] .map-pin-marker--selected .map-pin-marker__disc {
  border-color: var(--accent-color);
}

.map-pin-marker__disc--report {
  border-color: rgba(207, 179, 120, 0.55);
}

.map-pin-marker--closed .map-pin-marker__disc {
  opacity: 0.6;
  filter: grayscale(1);
}

.map-pin-marker--paused .map-pin-marker__disc {
  opacity: 0.85;
}

/* Leaflet：縮放鈕在 CardSwitch 連結上方（預留左下導流列高度） */
.leaflet-bottom.leaflet-left {
  margin-bottom: calc(52px + env(safe-area-inset-bottom));
  margin-left: max(10px, env(safe-area-inset-left));
}

.leaflet-control-zoom {
  border: none !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: var(--shadow-soft) !important;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 18px !important;
  background: var(--glass-bg) !important;
  color: var(--primary-color) !important;
  border-bottom: 1px solid var(--glass-border) !important;
}

.leaflet-control-zoom a:last-child {
  border-bottom: none !important;
}

/* 左下角：CardSwitch 在縮放「−」下方（貼近下緣），縮放鈕整体上移避免重疊 */
.map-footer-cardswitch {
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 410;
  margin: 0;
  max-width: min(220px, 48vw);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  line-height: 1.35;
  pointer-events: auto;
}

.map-footer-cardswitch a {
  color: #111827 !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.map-footer-cardswitch a:hover {
  text-decoration: underline;
}

[data-theme="dark"] .map-footer-cardswitch {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .map-footer-cardswitch a {
  color: #111827 !important;
}

/* 定位：目前位置標記 */
.leaflet-div-icon.user-locate-marker {
  background: transparent !important;
  border: none !important;
}

.user-locate-marker__wrap {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-locate-marker__core {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.55);
}

.user-locate-marker__pulse {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.5);
  animation: user-locate-pulse 2s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .user-locate-marker__pulse {
    animation: none;
    opacity: 0.35;
  }
}

@keyframes user-locate-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.parse-msg-hint {
  font-size: 0.8rem;
  margin-top: 8px;
  min-height: 1.25em;
  line-height: 1.4;
  opacity: 0.82;
}

.form-hint-muted {
  font-size: 0.75rem;
  margin-top: 6px;
  line-height: 1.45;
  opacity: 0.62;
}

.rep-other-cat-wrap {
  margin-top: 10px;
}

.rep-other-cat-wrap[hidden] {
  display: none !important;
}
