/* === GOOGLE FONT IMPORT === */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100dvh;
}

#map.explore-mode canvas {
  filter: none;
}

#fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #333;
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

#fab.drop-mode {
  background: #e05c2a;
  transform: rotate(45deg);
}

#fab:hover {
  opacity: 0.9;
}

.memory-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 220px;
  padding: 4px 0;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-bottom: 1px solid #ccc;
  outline: none;
  padding: 4px 0;
  width: 100%;
  background: transparent;
}

.card-body {
  font-size: 13px;
  border: none;
  outline: none;
  resize: none;
  width: 100%;
  height: 80px;
  background: transparent;
  line-height: 1.5;
}

.card-save {
  align-self: flex-end;
  padding: 5px 14px;
  font-size: 12px;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.card-save:hover {
  background: #f0f0f0;
}

.card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #e0d8cc;
}

.card-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
}

.card-username {
  font-size: 11px;
  color: #888;
  margin-right: 12px;
  padding-bottom: 2px;
}

.card-you {
  font-size: 11px;
  color: #aaa;
  font-style: italic;
}

.card-follow {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.card-follow:hover {
  background: #f0f0f0;
}

/* Auth Screen */
#auth-screen {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#auth-screen.hidden {
  display: none;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 340px;
  padding: 48px 40px;
  background: #faf7f2;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.auth-card.hidden {
  display: none;
}

.auth-card h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 42px;
  font-weight: 400;
  font-style: bold;
  color: #1a1a1a;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 2px;
}

.auth-subtitle {
  font-family: 'Instrument Serif', serif;
  font-style: normal;
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
}

.auth-required {
  font-size: 11px;
  color: #c0392b;
  font-family: 'Instrument Serif', serif;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid #ddd;
  border-radius: 0;
  font-size: 14px;
  font-family: 'Instrument Serif', serif;
  outline: none;
  width: 100%;
  background: transparent;
  color: #1a1a1a;
}

.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.auth-card input[type="text"]:focus {
  border-bottom-color: #1a1a1a;
}

.auth-card input::placeholder {
  color: #bbb;
  font-style: italic;
}

.marketing-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: #999;
  cursor: pointer;
}

#auth-error,
#signup-error {
  font-size: 12px;
  font-family: 'Instrument Serif', serif;
  color: #c0392b;
  min-height: 16px;
}

#btn-login,
#btn-signup {
  padding: 12px;
  border: none;
  border-radius: 2px;
  font-size: 14px;
  font-family: 'Instrument Serif', serif;
  font-style: normal;
  letter-spacing: 0.03em;
  cursor: zoom-in;
  background: #1a1a1a;
  color: #faf7f2;
  margin-top: 4px;
}

#btn-login:hover,
#btn-signup:hover {
  opacity: 0.85;
  font-style: italic;
}

.auth-toggle {
  font-size: 12px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: #aaa;
  text-align: center;
}

#toggle-to-signup,
#toggle-to-login {
  color: #1a1a1a;
  cursor: pointer;
  text-decoration: underline;
}

/* Card Privacy Settings */
.card-privacy {
  display: flex;
  gap: 6px;
}

.privacy-btn {
  flex: 1;
  padding: 4px 0;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #888;
}

.privacy-btn.active[data-value="open"] {
  background: #e8f5e9;
  border-color: #2e7d32;
  color: #2e7d32;
  font-weight: 600;
}

.privacy-btn.active[data-value="private"] {
  background: #ffebee;
  border-color: #c62828;
  color: #c62828;
  font-weight: 600;
}

.privacy-btn:hover {
  border-color: #999;
  color: #555;
}

/* User Menu */
#user-menu {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
}

#avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#avatar-btn:hover {
  opacity: 0.85;
}

#user-dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
  min-width: 140px;
}

#user-dropdown.hidden {
  display: none;
}

#user-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  border: none;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  color: #2c2c2c;
}

#user-dropdown button:hover {
  background: #f5f5f5;
}

#btn-logout {
  color: #c0392b !important;
}

/* Settings Panel */
#settings-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 320px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  z-index: 50;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

#settings-panel.open {
  right: 0;
}

#settings-panel.hidden {
  display: none;
}

#settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

#settings-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #2c2c2c;
}

#close-settings {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
  line-height: 1;
}

#close-settings:hover {
  color: #2c2c2c;
}

#settings-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.settings-label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#settings-username,
#settings-zip {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  width: 100%;
}

#settings-username:focus,
#settings-zip:focus {
  border-color: #999;
}

#settings-error {
  font-size: 12px;
  color: #c0392b;
  min-height: 16px;
}

#settings-save {
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #2c2c2c;
  color: white;
  margin-top: 8px;
}

#settings-save:hover {
  opacity: 0.85;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

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

.settings-display {
  font-size: 14px;
  color: #2c2c2c;
}

.settings-edit-btn {
  font-size: 11px;
  padding: 2px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #555;
}

.settings-edit-btn:hover {
  border-color: #999;
  color: #2c2c2c;
}

.hidden {
  display: none !important;
}

.card-report {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #e0b0b0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #c0392b;
}

.card-report:hover {
  background: #fff0f0;
}

.card-report:disabled {
  opacity: 0.5;
  cursor: default;
}

#saved-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#saved-btn:hover {
  opacity: 0.85;
}

#user-menu {
  display: flex;
  gap: 8px;
  align-items: center;
}

#saved-panel {
  position: fixed;
  top: 0;
  left: -360px;
  width: 320px;
  height: 100vh;
  background: white;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  z-index: 50;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
}

#saved-panel.open {
  left: 0;
}

#saved-panel.hidden {
  display: none;
}

#saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

#saved-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #2c2c2c;
}

#close-saved {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
  line-height: 1;
}

#close-saved:hover {
  color: #2c2c2c;
}

#saved-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  overflow-y: auto;
}

.saved-empty {
  font-size: 13px;
  color: #aaa;
  text-align: center;
  margin-top: 40px;
}

.saved-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 8px;
}

.saved-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #2c2c2c;
}

.saved-card-note {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.saved-card-author {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}

.saved-card-goto {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #555;
}

.saved-card-goto:hover {
  border-color: #999;
  color: #2c2c2c;
}

.card-save-pin {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #555;
}

.card-save-pin:hover {
  background: #f0f0f0;
}

.card-save-pin:disabled {
  opacity: 0.5;
  cursor: default;
}

/* === DROP MODE OVERLAY === */
#drop-overlay {
  display: none;
}

#drop-overlay.active {
  opacity: 1;
}

/* === DROP MODE CARD === */
.drop-mode-active .mapboxgl-popup-content {
  background: #1a0f0a !important;
  border: 1px solid rgba(201, 74, 42, 0.4);
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,74,42,0.15);
  padding: 20px !important;
  box-sizing: border-box !important;
}

.drop-mode-active .memory-card {
  width: 100%;
  box-sizing: border-box;
}

.drop-mode-active .mapboxgl-popup-tip {
  border-top-color: #1a0f0a;
}

.drop-mode-active .card-title {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  color: #f0e6d3;
  border-bottom: 1px solid rgba(201, 74, 42, 0.35);
  padding: 4px 0 10px;
  letter-spacing: 0.01em;
}

.drop-mode-active .card-title::placeholder {
  color: rgba(240, 230, 211, 0.35);
  font-style: italic;
}

.drop-mode-active .card-body {
  font-family: 'Instrument Serif', serif;
  font-size: 14px;
  color: rgba(240, 230, 211, 0.8);
  line-height: 1.7;
}

.drop-mode-active .card-body::placeholder {
  color: rgba(240, 230, 211, 0.3);
  font-style: italic;
}

.drop-mode-active .card-save {
  font-family: 'Instrument Serif', serif;
  font-size: 13px;
  font-style: italic;
  border: 1px solid rgba(201, 74, 42, 0.6);
  color: #f0e6d3;
  background: rgba(201, 74, 42, 0.2);
  border-radius: 2px;
  padding: 6px 18px;
  letter-spacing: 0.04em;
  transition: background 0.2s;
}

.drop-mode-active .card-save:hover {
  background: rgba(201, 74, 42, 0.4);
}

.drop-mode-active .privacy-btn {
  color: rgba(240, 230, 211, 0.4);
  border-color: rgba(240, 230, 211, 0.15);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.drop-mode-active .privacy-btn.active[data-value="open"] {
  background: rgba(46, 125, 50, 0.3);
  border-color: rgba(100, 200, 100, 0.5);
  color: #a5d6a7;
}

.drop-mode-active .privacy-btn.active[data-value="private"] {
  background: rgba(198, 40, 40, 0.3);
  border-color: rgba(220, 100, 100, 0.5);
  color: #ef9a9a;
}

/* === FAB drop mode refinement === */
#fab.drop-mode {
  background: #c94a2a;
  box-shadow: 0 4px 20px rgba(201, 74, 42, 0.5);
}

/* === DROP MODE HINT === */
#drop-hint {
  position: fixed;
  bottom: 100px;
  right: 32px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 13px;
  color: #1a0f0a;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
  pointer-events: none;
  z-index: 10;
  text-shadow: 0 1px 3px rgba(255,255,255,0.6);
}

#drop-hint.active {
  opacity: 1;
  transform: translateY(0);
}

/* COLOR PICKER */
.card-color-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-preview {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  transition: background 0.1s;
}

.color-sliders {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-slider-label {
  font-family: 'Instrument Serif', serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240, 230, 211, 0.5);
  width: 10px;
}

.color-slider-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  background: rgba(240, 230, 211, 0.15);
}

.color-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Explore mode popup card */
.mapboxgl-popup-content {
  border-radius: 2px !important;
  padding: 20px !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25) !important;
  background: #faf7f2 !important;
  min-width: 200px;
}

.mapboxgl-popup-close-button {
  color: #aaa !important;
  font-size: 16px !important;
  background: transparent !important;
  padding: 8px !important;
}

.mapboxgl-popup-close-button:hover {
  color: #333 !important;
  background: transparent !important;
}

.card-title {
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  font-weight: 400;
  color: #1a1a1a;
  border-bottom: 1px solid #e0d8cc;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.card-body {
  font-family: 'Instrument Serif', serif;
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}

.card-username {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 12px;
  color: #aaa;
}

.card-you {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 12px;
  color: #bbb;
}

.card-actions button {
  font-family: 'Instrument Serif', serif;
  font-size: 11px;
}

.memory-card {
  box-sizing: border-box;
  width: 100%;
}

/* === HELP BUTTON === */
#help-btn {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: white;
  font-size: 16px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: #888;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

#help-btn:hover {
  color: #333;
  border-color: #999;
}

#help-popup {
  position: fixed;
  bottom: 80px;
  left: 32px;
  width: 300px;
  background: #faf7f2;
  border-radius: 2px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#help-popup.hidden {
  display: none;
}

#help-popup p:first-of-type {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  font-weight: 400;
  color: #1a1a1a;
  border-bottom: 1px solid #e0d8cc;
  padding-bottom: 10px;
}

#help-popup p:last-of-type {
  font-family: 'Instrument Serif', serif;
  font-size: 13px;
  color: #555;
  line-height: 1.7;
}

#help-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
}

#help-close:hover {
  color: #333;
}

#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 1s ease;
}

#particle-canvas.active {
  opacity: 1;
}

/* === INTRO ANIMATION === */
#intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99;
  pointer-events: none;
  display: grid;
}

.intro-tile {
  background: #faf7f2;
  opacity: 0;
  transform: translateY(0);
  transition: transform var(--tile-duration) cubic-bezier(0.4, 0, 1, 1), opacity var(--tile-duration) ease;
}

.intro-tile.fall {
  transform: translateY(110vh);
  opacity: 0;
}

.auth-feedback {
  font-size: 12px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  min-height: 16px;
  margin: -8px 0 4px 0;
}

/* === SAVED PANEL TABS === */
#saved-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}

.saved-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: 'Instrument Serif', serif;
  color: #aaa;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.saved-tab.active {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
}

.saved-tab:hover {
  color: #555;
}

/* === MINE TAB CARDS === */
.mine-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.mine-edit-btn {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #555;
}

.mine-edit-btn:hover {
  border-color: #999;
  color: #1a1a1a;
}

.mine-card-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mine-edit-title {
  font-size: 14px;
  font-family: 'Instrument Serif', serif;
  border: none;
  border-bottom: 1px solid #ddd;
  outline: none;
  padding: 4px 0;
  width: 100%;
  background: transparent;
  color: #1a1a1a;
}

.mine-edit-note {
  font-size: 12px;
  font-family: 'Instrument Serif', serif;
  border: 1px solid #eee;
  border-radius: 4px;
  outline: none;
  padding: 8px;
  width: 100%;
  height: 80px;
  resize: none;
  background: transparent;
  color: #555;
  line-height: 1.5;
}

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

.mine-save-btn {
  font-size: 11px;
  padding: 3px 12px;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  background: #1a1a1a;
  color: white;
  cursor: pointer;
}

.mine-save-btn:hover {
  opacity: 0.85;
}

.mine-cancel-btn {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #888;
}

.mine-cancel-btn:hover {
  border-color: #999;
  color: #555;
}

.card-inline-edit {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #555;
  font-family: 'Instrument Serif', serif;
}

.card-inline-edit:hover {
  border-color: #999;
  color: #1a1a1a;
}

.card-inline-edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.card-inline-title {
  font-family: 'Instrument Serif', serif;
  font-size: 14px;
  border: none;
  border-bottom: 1px solid rgba(240, 230, 211, 0.3);
  outline: none;
  padding: 4px 0;
  width: 100%;
  background: transparent;
  color: #f0e6d3;
}

.card-inline-note {
  font-family: 'Instrument Serif', serif;
  font-size: 12px;
  border: 1px solid rgba(240, 230, 211, 0.2);
  border-radius: 4px;
  outline: none;
  padding: 8px;
  width: 100%;
  height: 70px;
  resize: none;
  background: transparent;
  color: rgba(240, 230, 211, 0.8);
  line-height: 1.5;
}

.card-inline-save {
  font-size: 11px;
  padding: 3px 12px;
  border: 1px solid rgba(240, 230, 211, 0.5);
  border-radius: 4px;
  background: rgba(240, 230, 211, 0.15);
  color: #f0e6d3;
  cursor: pointer;
  font-family: 'Instrument Serif', serif;
}

.card-inline-save:hover {
  background: rgba(240, 230, 211, 0.25);
}

.card-inline-cancel {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid rgba(240, 230, 211, 0.2);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: rgba(240, 230, 211, 0.5);
  font-family: 'Instrument Serif', serif;
}

#context-menu {
  position: fixed;
  background: #faf7f2;
  border: 1px solid #e0d8cc;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 50;
  overflow: visible;
}

#context-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: #2c2c2c;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

#context-menu button:hover {
  background: #f0ebe3;
}

/* === NEW PIN CARD (previously drop mode) === */
.mapboxgl-popup-content:has(.card-save) {
  background: #1a0f0a !important;
  border: 1px solid rgba(201, 74, 42, 0.4);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,74,42,0.15);
}

.mapboxgl-popup-content:has(.card-save) .card-title {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  color: #f0e6d3;
  border-bottom: 1px solid rgba(201, 74, 42, 0.35);
  padding: 4px 0 10px;
}

.mapboxgl-popup-content:has(.card-save) .card-title::placeholder {
  color: rgba(240, 230, 211, 0.35);
  font-style: italic;
}

.mapboxgl-popup-content:has(.card-save) .card-body {
  font-family: 'Instrument Serif', serif;
  font-size: 14px;
  color: rgba(240, 230, 211, 0.8);
  line-height: 1.7;
}

.mapboxgl-popup-content:has(.card-save) .card-body::placeholder {
  color: rgba(240, 230, 211, 0.3);
  font-style: italic;
}

.mapboxgl-popup-content:has(.card-save) .card-save {
  font-family: 'Instrument Serif', serif;
  font-size: 13px;
  font-style: italic;
  border: 1px solid rgba(201, 74, 42, 0.6);
  color: #f0e6d3;
  background: rgba(201, 74, 42, 0.2);
  border-radius: 2px;
  padding: 6px 18px;
  transition: background 0.2s;
}

.mapboxgl-popup-content:has(.card-save) .card-save:hover {
  background: rgba(201, 74, 42, 0.4);
}

.mapboxgl-popup-content:has(.card-save) .privacy-btn {
  color: rgba(240, 230, 211, 0.4);
  border-color: rgba(240, 230, 211, 0.15);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mapboxgl-popup-content:has(.card-save) .privacy-btn.active[data-value="open"] {
  background: rgba(46, 125, 50, 0.3);
  border-color: rgba(100, 200, 100, 0.5);
  color: #a5d6a7;
}

.mapboxgl-popup-content:has(.card-save) .privacy-btn.active[data-value="private"] {
  background: rgba(198, 40, 40, 0.3);
  border-color: rgba(220, 100, 100, 0.5);
  color: #ef9a9a;
}

.mapboxgl-popup-content:has(.card-save) .color-slider-label {
  color: rgba(240, 230, 211, 0.5);
}

.mapboxgl-popup-content:has(.card-save) .color-slider-row input[type="range"] {
  background: rgba(240, 230, 211, 0.15);
}

.mapboxgl-popup-content:has(.card-save) .mapboxgl-popup-tip {
  border-top-color: #1a0f0a;
}

/* === INLINE EDIT CARD === */
.mapboxgl-popup-content:has(.card-inline-save) .card-inline-title {
  color: #1a1a1a;
  border-bottom: 1px solid #ddd;
}

.mapboxgl-popup-content:has(.card-inline-save) .card-inline-note {
  color: #333;
  border: 1px solid #ddd;
}

.mapboxgl-popup-content:has(.card-inline-save) .card-inline-save {
  background: #1a1a1a;
  color: white;
  border: 1px solid #1a1a1a;
}

.mapboxgl-popup-content:has(.card-inline-save) .card-inline-cancel {
  color: #888;
  border: 1px solid #ccc;
  background: transparent;
}

/* === GEOCODER SEARCH BAR === */
.mapboxgl-ctrl-geocoder {
  position: fixed !important;
  top: 16px !important;
  left: 16px !important;
  z-index: 20 !important;
  width: 260px !important;
  max-width: calc(100vw - 32px) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
  border-radius: 2px !important;
  font-family: 'Instrument Serif', serif !important;
}

.mapboxgl-ctrl-geocoder--input {
  font-family: 'Instrument Serif', serif !important;
  font-size: 14px !important;
  color: #1a1a1a !important;
}

.mapboxgl-ctrl-geocoder--input::placeholder {
  font-style: italic !important;
  color: #bbb !important;
}

/* === LOCATE BUTTON === */
#locate-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 10;
  color: #555;
}

#locate-btn:hover {
  border-color: #999;
  color: #1a1a1a;
}

#locate-btn.locating {
  color: #c94a2a;
  border-color: #c94a2a;
}

/* === USER LOCATION DOT === */
.user-location-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4a90e2;
  border: 2px solid white;
  box-shadow: 0 0 0 2px rgba(74,144,226,0.4);
  animation: pulse-dot 2s ease-out infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 2px rgba(74,144,226,0.4); }
  70% { box-shadow: 0 0 0 10px rgba(74,144,226,0); }
  100% { box-shadow: 0 0 0 2px rgba(74,144,226,0); }
}

/* ADD arrow to context menu */
#context-menu::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #faf7f2;
}

#context-menu::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid #e0d8cc;
}