* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#map {
  position: fixed;
  inset: 0;
}

.topbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  pointer-events: none;
}

.topbar > * { pointer-events: auto; }

.topbar-actions {
  display: flex;
  gap: 8px;
}

.topbar-actions button {
  background: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.topbar-actions button.active {
  background: #e1306c;
  color: #fff;
}

/* Filter panel */
.filter-section { margin-top: 14px; }
.filter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.filter-head h3 { font-size: 14px; margin: 0; }
.filter-toggle { font-size: 12px; color: #999; }
.link-btn {
  background: none;
  border: none;
  color: #e1306c;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.filter-list {
  margin-top: 8px;
  max-height: 34vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.filter-list .filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  color: #333;
  cursor: pointer;
}
.filter-list .filter-item:hover { background: #fafafa; }
.filter-list .filter-item input {
  margin: 0;
  flex: none;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
}
.filter-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-count {
  color: #999;
  font-size: 12px;
  background: #f0f0f0;
  border-radius: 999px;
  padding: 1px 8px;
}

.panel textarea {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.hint {
  font-size: 13px;
  color: #555;
  margin: 10px 0 0;
}

#import-embed {
  width: 100%;
  height: 300px;
  margin-top: 10px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .primary { flex: 2; }

.secondary {
  flex: 1;
  margin-top: 18px;
  padding: 12px;
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.error.success { color: #1e8e4e; }

.secondary.detect {
  width: 100%;
  margin-top: 12px;
  flex: none;
}

.detect-status { margin: 8px 0 0; }
.detect-status.working { color: #b26a00; }
.detect-status.failed { color: #c0392b; }

.multi-venues { margin-top: 12px; }
#multi-list { list-style: none; margin: 8px 0; padding: 0; }
#multi-list li {
  padding: 8px 10px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
#multi-list li.no-match { color: #999; }
#multi-list label { display: flex; align-items: baseline; gap: 8px; cursor: pointer; }
#multi-list .addr { display: block; color: #666; font-size: 12px; margin-top: 2px; }

.transcript {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f5f5f7;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  font-size: 13px;
  color: #333;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.guess-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.guess-chip {
  padding: 5px 10px;
  border: 1px solid #e1306c;
  color: #e1306c;
  background: #fff;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.guess-chip:hover { background: #fdf0f5; }

.bookmarklet-help {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f8f8f8;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 13px;
  color: #444;
}

.bookmarklet-help summary {
  cursor: pointer;
  font-weight: 600;
}

.bookmarklet-help ol {
  margin: 10px 0 0;
  padding-left: 18px;
}

.bookmarklet-help li { margin-bottom: 8px; }

.profile-import {
  margin-top: 12px;
  padding: 12px;
  background: #fdf0f5;
  border: 1px solid #f4c6da;
  border-radius: 10px;
}
.profile-import #profile-count { width: 72px; flex: none; text-align: center; }
.profile-import select {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.profile-import .mode-hint { font-size: 13px; color: #666; align-self: center; }
.profile-import #mode-until input { width: 100%; }
#profile-import-btn { width: 100%; margin-top: 10px; padding: 12px; }
#profile-import-btn {
  flex: 1;
  margin-top: 4px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: #e1306c;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
#profile-import-btn:disabled { opacity: 0.6; cursor: default; }
.profile-status.working { color: #b26a00; }
.profile-status.failed { color: #c0392b; }
.profile-status.done { color: #1e8e4e; }
.or-divider {
  text-align: center;
  color: #999;
  font-size: 12px;
  margin: 16px 0 4px;
}

.bookmarklet {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 14px;
  background: #333;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  cursor: grab;
}

#import-search-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

#import-search-results li {
  padding: 8px 10px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  cursor: pointer;
}

#import-search-results li:hover { background: #fdf0f5; border-color: #e1306c; }

#import-selected {
  margin-top: 8px;
  padding: 8px 10px;
  background: #eafaf0;
  border: 1px solid #2ecc71;
  border-radius: 8px;
  font-size: 13px;
}

.logo {
  background: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#locate-btn {
  background: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fab {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #e1306c;
  color: #fff;
  border: none;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(225, 48, 108, 0.4);
}

.panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, 100vw);
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  padding: 16px 20px 24px;
  z-index: 1100;
}

.panel.hidden, .hidden { display: none !important; }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 { font-size: 18px; margin: 0; }

.close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #666;
}

.panel label {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
}

.panel input {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.search-row {
  display: flex;
  gap: 8px;
}

.search-row button {
  margin-top: 4px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: #333;
  color: #fff;
  cursor: pointer;
}

#search-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

#search-results li {
  padding: 8px 10px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  cursor: pointer;
}

#search-results li:hover { background: #fdf0f5; border-color: #e1306c; }
#search-results li.selected {
  background: #eafaf0;
  border-color: #2ecc71;
  font-weight: 600;
}
#search-results li.selected::before { content: "✓ "; color: #2ecc71; }

#selected-place {
  margin-top: 8px;
  padding: 8px 10px;
  background: #eafaf0;
  border: 1px solid #2ecc71;
  border-radius: 8px;
  font-size: 13px;
}

.primary {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  background: #e1306c;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.error {
  color: #c0392b;
  font-size: 13px;
  min-height: 16px;
  margin: 8px 0 0;
}

.reel-popup { width: 280px; }
.reel-popup h3 { margin: 0 0 4px; font-size: 15px; }
.reel-popup .meta { font-size: 12px; color: #666; margin-bottom: 8px; }
.reel-popup .reel-age { color: #999; white-space: nowrap; }
.reel-popup iframe {
  width: 100%;
  height: 360px;
  border: none;
  border-radius: 8px;
  background: #fafafa;
}
.reel-popup .senti { margin-right: 5px; font-size: 15px; }

/* Tabs when several feeds share one location */
.reel-popup .feed-count { font-size: 11px; color: #999; font-weight: 400; }
.reel-popup .feed-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }
.reel-popup .feed-tab {
  border: 1px solid #ddd;
  background: #f7f7f7;
  color: #444;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.reel-popup .feed-tab.active { background: #e1306c; border-color: #e1306c; color: #fff; }
.reel-popup .feed-pane { display: none; }
.reel-popup .feed-pane.active { display: block; }
.reel-popup .feed-place {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
}
.reel-popup .feed-place .feed-name { font-weight: 700; font-size: 14px; }
.reel-popup .feed-place .food-tag { margin: 0; }
.reel-popup .feed-place .feed-by { color: #999; font-size: 12px; }
.reel-popup .food-tag {
  display: inline-block;
  margin: 2px 0 6px;
  padding: 2px 9px;
  background: #fff3e0;
  border: 1px solid #f0c48a;
  color: #b26a00;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.reel-popup .addr { font-size: 12px; color: #555; margin: 0 0 6px; line-height: 1.35; }
.reel-popup .fallback { font-size: 13px; }

/* "You are here" pointer — pulsing blue dot */
.user-dot { background: transparent; border: none; }
.user-dot-inner {
  display: block;
  width: 16px;
  height: 16px;
  background: #1a73e8;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.35), 0 1px 4px rgba(0, 0, 0, 0.4);
}
.reel-popup .pin-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.reel-popup .pin-actions button {
  flex: 1;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.reel-popup .fix-btn {
  border: 1px solid #e1306c;
  background: #fff;
  color: #e1306c;
}
.reel-popup .fix-btn:hover { background: #fdf0f5; }
.reel-popup .del-btn {
  border: 1px solid #e3b0b0;
  background: #fff;
  color: #c0392b;
}
.reel-popup .del-btn:hover { background: #fdecea; border-color: #c0392b; }

.pin-icon {
  font-size: 26px;
  line-height: 26px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
