/* ============================================================
   style.css — MapPin App
   ============================================================ */

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

.hidden {
  display: none !important;
}

:root {
  --bg: #182235;
  --surface: #202b40;
  --surface1: #202b40;
  --surface2: #26334a;
  --surface3: #30405b;
  --surface4: #3a4c69;
  --border: rgba(198, 211, 232, 0.14);
  --text: #f3f6fb;
  --text-muted: #b7c2d4;
  --text-dim: #7f8ea6;
  --accent: #6C63FF;
  --accent2: #5fd3e8;
  --accent-glow: rgba(108, 99, 255, 0.16);
  --danger: #e54858;
  --success: #39c985;
  --star: #ffd166;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --sidebar-w: 340px;
  --nav-h: 60px;
  --shadow: 0 14px 36px rgba(7, 13, 24, 0.28);
}

html,
body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ── Screens ─────────────────────────────────────────────── */
.screen {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.screen.active {
  display: flex;
}

.screen.hidden {
  display: none;
}

/* ── Auth Screen ─────────────────────────────────────────── */
#auth-screen {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(108, 99, 255, 0.22), transparent 32%),
    radial-gradient(circle at bottom right, rgba(95, 211, 232, 0.16), transparent 34%),
    var(--bg);
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.14;
  animation: float 8s ease-in-out infinite;
}

.orb1 {
  width: 480px;
  height: 480px;
  background: var(--accent);
  top: -120px;
  left: -100px;
  animation-delay: 0s;
}

.orb2 {
  width: 360px;
  height: 360px;
  background: var(--accent2);
  bottom: -80px;
  right: -60px;
  animation-delay: 2.5s;
}

.orb3 {
  width: 250px;
  height: 250px;
  background: #ff6584;
  top: 40%;
  left: 55%;
  animation-delay: 5s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-30px) scale(1.05);
  }
}

.auth-card {
  position: relative;
  background: rgba(32, 43, 64, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow), 0 0 60px rgba(108, 99, 255, 0.12);
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-public-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -12px 0 22px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.auth-public-links a {
  color: var(--accent);
  text-decoration: none;
}

.auth-public-links a:hover {
  text-decoration: underline;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface3);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}

.auth-tab.active {
  background: var(--surface2);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(7, 13, 24, 0.22);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
  color: var(--text-dim);
}

.auth-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  text-align: center;
}

.auth-privacy-notice {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
}

.auth-privacy-notice a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Verify Email Screen ─────────────────────────────────── */
.verify-card {
  position: relative;
  background: rgba(32, 43, 64, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(7, 13, 24, 0.3);
}

.verify-icon {
  font-size: 52px;
  margin-bottom: 16px;
  line-height: 1;
}

.verify-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}

.verify-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 4px 0;
  line-height: 1.5;
}

.verify-email {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin: 4px 0 12px;
  word-break: break-all;
}

.verify-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.verify-btn-secondary {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}

.verify-btn-secondary:hover { background: var(--surface4, #3a4c69); }

.verify-btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.verify-btn-link:hover { color: var(--text); }

.auth-privacy-notice a:hover {
  text-decoration: underline;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b84ff);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity var(--transition), transform var(--transition);
  font-family: 'Inter', sans-serif;
  margin-top: 4px;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-spinner.hidden {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(32, 43, 64, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  min-width: 110px;
}

.search-wrapper {
  flex: 1;
  position: relative;
  max-width: 540px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

#search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 9px 16px 9px 38px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#search-input::placeholder {
  color: var(--text-dim);
}

/* Google Places autocomplete dropdown */
.pac-container {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
  font-family: 'Inter', sans-serif !important;
  margin-top: 4px !important;
}

.pac-item {
  color: var(--text-muted) !important;
  border-top: 1px solid var(--border) !important;
  padding: 8px 14px !important;
  cursor: pointer;
}

.pac-item:hover {
  background: var(--surface3) !important;
}

.pac-item-query {
  color: var(--text) !important;
}

.pac-matched {
  color: var(--accent) !important;
  font-weight: 600;
}

.pac-icon {
  filter: none;
  opacity: 0.52;
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-width: 500px;
  max-height: 400px;
  background: var(--surface2);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow-y: auto;
  z-index: 1000;
  margin-top: 8px;
}

.search-results-dropdown.hidden {
  display: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

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

.search-result-item:hover, .search-result-item.selected {
  background: var(--surface3);
}

.search-result-icon {
  width: 28px;
  height: 28px;
  background: var(--surface3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-address {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-glow);
  color: var(--accent);
  text-transform: uppercase;
  margin-left: 8px;
  border: 1px solid rgba(108, 99, 255, 0.3);
}

.search-result-item.local .search-result-name {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: stretch;
  padding: 0 10px 0 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
}

.user-info:hover {
  background: var(--surface3);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.user-premium-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1a1a1a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 2px 5px;
  border-radius: 6px;
  margin-left: 4px;
  line-height: 1;
}

.btn-logout {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

.btn-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ── App Layout ──────────────────────────────────────────── */
#app-screen {
  flex-direction: column;
}

.app-layout {
  display: flex;
  height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-layout.planner-active .sidebar {
  width: 50%;
  min-width: 450px;
}

/* Main content area stacks vertically: explorer bar on top, map below */
.app-layout.planner-active .main-content-area {
  flex-direction: column;
}

/* ── Onboarding Guide ───────────────────────────────────── */
.onboarding-card {
  position: relative;
  margin: 14px 14px 12px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(108, 99, 255, 0.18), rgba(72, 202, 228, 0.08)),
    var(--surface2);
  border: 1px solid rgba(108, 99, 255, 0.28);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(7, 13, 24, 0.24);
  overflow: hidden;
}

.onboarding-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(72, 202, 228, 0.2), transparent 34%);
  pointer-events: none;
}

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

.onboarding-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}

.onboarding-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.onboarding-kicker,
.onboarding-title,
.onboarding-copy,
.onboarding-steps,
.onboarding-actions,
.onboarding-skip {
  position: relative;
  z-index: 1;
}

.onboarding-kicker {
  color: var(--accent2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.onboarding-title {
  max-width: calc(100% - 34px);
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
}

.onboarding-copy {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 7px 0 13px;
}

.onboarding-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.onboarding-steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 9px;
  align-items: flex-start;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.onboarding-steps li > span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(108, 99, 255, 0.22);
  border: 1px solid rgba(108, 99, 255, 0.4);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.onboarding-steps strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.onboarding-steps small {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 1px;
}

.onboarding-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.onboarding-btn {
  flex: 1;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition), border-color var(--transition);
}

.onboarding-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.onboarding-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--text);
}

.onboarding-skip {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 5px;
}

.onboarding-skip:hover {
  color: var(--text-muted);
}

.app-layout.planner-active .map-container {
  flex: 1;
  min-height: 0;
}

/* ── Explorer panel compact bar (planner mode only) ──────── */
.app-layout.planner-active #map-explorer-panel {
  flex-direction: row;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  height: 48px;
  flex-shrink: 0;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  border-right: none;
}

/* Left section: title + divider */
.app-layout.planner-active .explorer-header {
  align-items: center;
  flex-shrink: 0;
  padding-right: 16px;
  margin-right: 16px;
  border-right: 1px solid var(--border);
}

/* Hide subtitle in compact mode */
.app-layout.planner-active .explorer-hint {
  display: none;
}

/* Toggle floats to the right of the title */
.app-layout.planner-active .explorer-toggle-wrap {
  margin-left: 12px;
}

/* Filters fill available space */
.app-layout.planner-active .explorer-content {
  flex: 1;
  flex-wrap: nowrap;
  min-width: 0;
}

.app-layout.planner-active .explorer-dropdown-wrap {
  max-width: 260px;
}

/* Tags popover opens downward into the map */
.app-layout.planner-active .explorer-tags-popover {
  top: calc(100% + 4px);
  border-radius: var(--radius-sm);
}

.main-content-area {
  display: flex;
  flex: 1;
  min-width: 0;
  position: relative;
}

.calendar-view-container {
  flex: 2;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  min-width: 0;
  animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.map-container {
  flex: 1;
  position: relative;
  min-width: 0;
}

/* ── Navbar View Toggle ──────────────────────────────────── */
.nav-view-toggle {
  display: flex;
  background: var(--surface2);
  padding: 4px;
  border-radius: 12px;
  margin: 0 16px;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 4px rgba(7, 13, 24, 0.14);
}

.nav-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-view-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-view-btn.active {
  background: var(--surface3);
  color: var(--accent2);
  box-shadow: 0 2px 6px rgba(7, 13, 24, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}


/* ── Calendar Redesign Styles ────────────────────────────── */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cal-toolbar-left, .cal-toolbar-center, .cal-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-view-modes {
  display: flex;
  background: var(--surface3);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.btn-cal-mode {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-cal-mode.active {
  background: var(--surface2);
  color: var(--accent2);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-cal-mode:hover:not(.active) {
  color: var(--text);
}

.cal-view-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  min-width: 150px;
  text-align: center;
}

.btn-cal-today {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.calendar-render-area {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Trip Filter Popover */
.calendar-trip-toggle {
  position: relative;
}

.btn-trip-filter-toggle {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.trip-filter-popover {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  z-index: 200;
  box-shadow: var(--shadow);
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.cal-month-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.btn-cal-nav {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background var(--transition);
}

.btn-cal-nav:hover {
  background: var(--surface3);
}

.cal-month-grid-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.calendar-day-names {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.cal-day-name {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 8px 0;
}

.cal-days-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(100px, 1fr);
  gap: 0;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  min-height: 0;
}

.cal-day-cell {
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.cal-day-cell:hover {
  background: rgba(255, 255, 255, 0.03);
  z-index: 1;
  box-shadow: inset 0 0 0 1px var(--accent-light);
}

.cal-day-cell.other-month {
  opacity: 0.3;
}

.cal-day-cell.today {
  background: rgba(108, 99, 255, 0.05);
}

.cal-day-cell.today .cal-day-number {
  background: var(--accent);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  align-self: flex-end;
}

.cal-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

/* Week View */
.cal-week-view {
  display: flex;
  height: 100%;
  border-left: 1px solid var(--border);
}

.cal-week-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  min-width: 0;
  background: var(--surface);
}

.cal-week-col.today {
  background: rgba(108, 99, 255, 0.03);
}

.cal-week-header {
  padding: 15px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.cal-week-header .day-name {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.cal-week-header .day-num {
  font-size: 20px;
  font-weight: 700;
}

.cal-week-events {
  flex: 1;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

/* Day View */
.cal-day-view {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 800px;
  margin: 0 auto;
}

.cal-day-event-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.event-time {
  width: 80px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 10px;
}

.event-details {
  flex: 1;
  background: var(--surface2);
  padding: 15px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform var(--transition);
  border: 1px solid var(--border);
}

.event-details:hover {
  transform: translateY(-2px);
  background: var(--surface3);
}

.event-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.event-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.cal-empty-day {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-dim);
  font-size: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  line-height: 1.45;
}

.cal-empty-day strong {
  color: var(--text);
  font-size: 14px;
}

.cal-empty-day span,
.calendar-trip-empty {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}

/* Year View */
.cal-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  padding: 30px;
}

.cal-year-month {
  background: var(--surface2);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

.cal-year-month:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.cal-year-month-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 15px;
  text-align: center;
  color: var(--accent2);
}

.cal-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.mini-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-dim);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.mini-day:hover {
  background: var(--surface3);
  color: var(--text);
  transform: scale(1.1);
  z-index: 2;
}

.mini-day.has-events {
  background: rgba(108, 99, 255, 0.2);
  color: var(--text);
  font-weight: 700;
}

.mini-day.today {
  color: var(--accent2);
  text-decoration: underline;
  font-weight: 800;
}

/* Shared Badges */
.cal-event-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  background: var(--surface3);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: filter 0.2s;
}

.cal-event-badge:hover {
  filter: brightness(1.2);
}

.cal-event-badge.trip-stop {
  background: rgba(72, 202, 228, 0.1);
  border-left-color: var(--accent2);
}

.badge-time {
  font-weight: 700;
  color: var(--accent2);
  margin-right: 4px;
}

/* ── Sidebar Header ──────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.sidebar-stats {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.sidebar-stats span {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  margin-right: 2px;
}

#sort-select {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
}

.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
  flex-shrink: 0;
}

.list-search-wrap {
  padding: 10px 14px 6px;
  flex-shrink: 0;
}

.tag-filter-mode-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tag-filter-mode-label {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Push Tags + selection button to the right end of the bar */
.tag-filter-mode-bar .btn-manage-tags {
  margin-left: auto;
}

.tag-filter-mode-bar .btn-bulk-toggle {
  margin-left: 0;
}

#list-search {
  width: 100%;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
}

#list-search::placeholder {
  color: var(--text-dim);
}

.place-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px;
}

.place-list::-webkit-scrollbar {
  width: 4px;
}

.place-list::-webkit-scrollbar-track {
  background: transparent;
}

.place-list::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 2px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px;
  gap: 10px;
  color: var(--text-dim);
  text-align: center;
}

.empty-state p {
  font-size: 15px;
  font-weight: 500;
}

.empty-state span {
  font-size: 13px;
}

.empty-state-actionable {
  align-items: stretch;
}

.empty-state-actionable svg,
.empty-state-actionable p,
.empty-state-actionable span {
  align-self: center;
}

.empty-state-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.empty-state-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.empty-state-btn.secondary {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}

.inline-empty-state {
  padding: 12px 14px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}

/* Skeleton loader — shown while the initial Firestore snapshot is in flight */
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-list {
  padding: 6px 0;
}

.skeleton-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 10px;
  margin-bottom: 4px;
}

.skeleton-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--surface3) 25%, var(--surface2) 50%, var(--surface3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-body {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface3) 25%, var(--surface2) 50%, var(--surface3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

/* Place Card */
.place-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid transparent;
  margin-bottom: 4px;
}

.place-card:hover {
  background: var(--surface2);
  border-color: var(--border);
}

.place-card.active {
  background: var(--surface2);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.place-card-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.place-card-thumb img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
}

.place-card-thumb svg {
  opacity: 0.3;
}

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

.place-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-card-address {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.place-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.place-card-stars {
  color: var(--star);
  font-size: 11px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
}

.tag-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-chip.active-filter {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

.tag-chip .remove-tag {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
  display: inline-flex;
  align-items: center;
}

/* Show more button */
.show-more-row {
  padding: 6px 4px 4px;
  text-align: center;
}

.btn-show-more {
  width: 100%;
  background: none;
  border: 1px solid var(--surface3);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-show-more:hover {
  background: var(--surface2);
  border-color: var(--accent2);
  color: var(--text);
}

.show-more-remaining {
  opacity: 0.55;
  font-size: 11px;
  margin-left: 3px;
}

/* Tag filter chips */
.filter-chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-chip.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ── Map ─────────────────────────────────────────────────── */
.map-container {
  flex: 1;
  position: relative;
}

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

/* Subtly dim Google map tiles so the map fits the navy UI without hiding markers. */
.gm-style > div:first-child {
  filter: brightness(0.88) saturate(0.92) contrast(1.03);
}

/* Custom InfoWindow */
.gm-style .gm-style-iw {
  background: var(--surface2) !important;
  border-radius: 10px !important;
  padding: 0 !important;
}

.gm-style .gm-style-iw-d {
  overflow: hidden !important;
}

.gm-style .gm-style-iw-tc {
  display: none;
}

.gm-style .gm-style-iw button {
  display: none !important;
}

/* ── Detail Panel ────────────────────────────────────────── */
.detail-overlay {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  pointer-events: none;
}

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

.detail-panel {
  pointer-events: all;
}

.detail-panel {
  width: 420px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  position: relative;
  animation: panelIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.detail-panel::-webkit-scrollbar {
  width: 4px;
}

.detail-panel::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 2px;
}

@keyframes panelIn {
  from {
    transform: translateX(40px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Active marker highlight when detail panel is open */
.custom-marker.marker-active {
  transform: scale(1.3) translateY(-5px);
  z-index: 99;
  filter: drop-shadow(0 4px 12px rgba(255, 101, 132, 0.6));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.custom-marker.marker-active .marker-bubble {
  background: linear-gradient(135deg, #ff6584, #ffd166);
  border-color: #fff;
  animation: markerPulse 1.4s ease-in-out infinite;
}

.custom-marker.marker-active .marker-name {
  background: rgba(255, 101, 132, 0.92);
  border-color: rgba(255, 101, 132, 0.5);
  color: #fff;
  font-weight: 700;
}

.custom-marker.marker-active .marker-tip {
  border-top-color: #ffd166;
}

@keyframes markerPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 101, 132, 0.5);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(255, 101, 132, 0);
  }
}

.detail-close {
  position: fixed;
  top: calc(var(--nav-h) + 14px);
  right: 14px;
  z-index: 210;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.detail-close:hover {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--text-muted);
}

.detail-photo-wrap {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--surface3);
  flex-shrink: 0;
}

.detail-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

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

.detail-photo-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.detail-photo-placeholder.hidden {
  display: none;
}

.detail-content {
  padding: 20px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-name-input {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 6px;
  transition: all var(--transition);
  font-family: inherit;
}

.detail-name-input:hover {
  background: var(--surface3);
  border-color: var(--border);
}

.detail-name-input:focus {
  background: var(--surface2);
  border-color: var(--accent);
  outline: none;
}

.detail-address {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-gmaps-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 20px;
  transition: opacity var(--transition);
}

.detail-gmaps-link:hover {
  opacity: 0.8;
}

.detail-section {
  margin-bottom: 18px;
}

.section-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* Stars */
.star-rating {
  display: flex;
  gap: 4px;
}

.star {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--surface3);
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
  padding: 0;
}

.star:hover,
.star.active {
  color: var(--star);
}

.star:hover {
  transform: scale(1.15);
}

/* Tags in detail */
.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 28px;
}

.detail-tag-btn {
  display: inline-flex;
  align-items: center;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}

.detail-tag-btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.detail-tag-btn.active {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #22c55e;
  font-weight: 600;
}

.tag-input-wrap {
  display: flex;
  gap: 8px;
}

#tag-input {
  flex: 1;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
}

#tag-input:focus {
  border-color: var(--accent);
}

#tag-input::placeholder {
  color: var(--text-dim);
}

.btn-tag-add {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 600;
}

.btn-tag-add:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Notes */
#detail-notes {
  width: 100%;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color var(--transition);
  line-height: 1.6;
  white-space: pre-wrap;
}

#detail-notes:focus {
  border-color: var(--accent);
}

#detail-notes::placeholder {
  color: var(--text-dim);
}

.detail-shared-note-label {
  color: var(--accent);
}

#detail-shared-note {
  width: 100%;
  background: var(--surface3);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.6;
  white-space: pre-wrap;
}

#detail-shared-note:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 99, 102, 241), 0.15);
}

#detail-shared-note::placeholder {
  color: var(--text-dim);
}

/* ── Date & Recurrence Form ──────────────────────────────── */
.date-config-wrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.date-enable-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.date-enable-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.date-config-body,
.recurrence-config-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 24px;
  border-left: 1px solid var(--border);
  margin-left: 8px;
}

.date-config-body.hidden,
.recurrence-config-body.hidden,
.date-input-group.hidden,
.recurrence-row.hidden {
  display: none !important;
}

.date-type-radios {
  display: flex;
  gap: 16px;
}

.date-type-radios label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.date-type-radios input[type="radio"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.date-inputs-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.date-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.date-input-group span {
  font-size: 11px;
  color: var(--text-muted);
}

.detail-input-field,
.detail-select-field {
  width: 100%;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
}

.detail-input-field:focus,
.detail-select-field:focus {
  border-color: var(--accent);
}

.detail-select-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b93ad' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.recurrence-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.recurrence-enable-wrap {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 8px;
}

/* Detail actions */
.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.detail-main-actions {
  display: flex;
  gap: 10px;
}

.btn-save,
.btn-delete {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}

.btn-save {
  background: var(--accent);
  color: #fff;
}

.btn-save:hover {
  background: #5a53d6;
}

.btn-delete {
  background: var(--surface3);
  color: var(--danger);
  border: 1px solid rgba(255, 92, 106, 0.3);
}

.btn-delete:hover {
  background: rgba(255, 92, 106, 0.12);
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 9999;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 32px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.hidden {
  display: none;
}

/* ── Custom Map Markers ──────────────────────────────────── */
.custom-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  transition: transform 0.15s ease;
}

.custom-marker:hover {
  transform: scale(1.12) translateY(-2px);
}

.marker-bubble {
  background: linear-gradient(135deg, #6C63FF, #48CAE4);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.marker-bubble-inner {
  transform: rotate(45deg);
  font-size: 17px;
  line-height: 1;
}

.marker-tip {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #48CAE4;
  margin-top: -1px;
}

.marker-name {
  margin-top: 3px;
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(6px);
  color: #e8eaf6;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ── Icon Picker ─────────────────────────────────────────── */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.icon-option {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--surface3);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.icon-option:hover {
  background: var(--surface2);
  border-color: var(--border);
  transform: scale(1.1);
}

.icon-option.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 0 1px var(--accent);
}

/* ── Tag Autocomplete ────────────────────────────────────── */
.tag-input-wrap {
  display: flex;
  gap: 8px;
}

.tag-autocomplete-wrap {
  flex: 1;
  position: relative;
}

.tag-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 500;
  overflow: hidden;
  display: none;
  box-shadow: var(--shadow);
}

.tag-suggestions.open {
  display: block;
}

.tag-suggestion-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-suggestion-item:hover {
  background: var(--surface3);
  color: var(--text);
}

.tag-suggestion-item::before {
  content: "🏷️";
  font-size: 12px;
}

/* ── Utils ───────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── Import Method Selection ─────────────────────────────── */
.import-method-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.import-method-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  width: 100%;
}

.import-method-card:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.07);
  transform: translateY(-1px);
}

.method-card-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

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

.method-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.method-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.method-card-arrow {
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color var(--transition), transform var(--transition);
}

.import-method-card:hover .method-card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* back link inside steps */
.import-back-method {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
  align-self: flex-start;
}

.import-back-method:hover {
  color: var(--accent);
}

.import-method-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.import-method-card.disabled:hover {
  border-color: var(--border);
  background: var(--surface2);
  transform: none;
}

/* ── Google Maps Text Import ───────────────────────────── */
.import-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  resize: vertical;
  margin-bottom: 12px;
  min-height: 100px;
}

.import-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.import-gmaps-table-wrap {
  width: 100%;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--surface);
}

.import-gmaps-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.import-gmaps-table th {
  background: var(--surface2);
  color: var(--text-dim);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.import-gmaps-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.import-gmaps-table tr:hover {
  background: var(--surface2);
}

.gmaps-result-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.gmaps-result-photo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface3);
}

.gmaps-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gmaps-result-name {
  color: var(--text);
  font-weight: 600;
}

.gmaps-result-address {
  color: var(--text-muted);
  font-size: 11px;
}

/* ── Takeout Drop Zone ───────────────────────────────────── */
.takeout-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: center;
}

.takeout-drop-zone:hover,
.takeout-drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.07);
}

.takeout-drop-icon {
  font-size: 36px;
  line-height: 1;
}

.takeout-drop-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.takeout-drop-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.takeout-drop-sub code {
  background: var(--surface3);
  border-radius: 4px;
  padding: 1px 4px;
  color: var(--accent2);
}

/* ── Import Button (navbar) ──────────────────────────────── */

.btn-import-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent), #8b84ff);
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 2px 12px rgba(108, 99, 255, 0.35);
}

.btn-import-nav:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-import-nav svg {
  flex-shrink: 0;
}

/* ── Import Modal Overlay ────────────────────────────────── */
.import-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 24, 42, 0.36);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  
  /* Safari Performance Fix: forces separate compositing layer to prevent text input lag */
  will-change: transform, opacity;
  transform: translateZ(0);
}

.import-overlay.hidden {
  display: none;
}

.import-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  height: auto;
  min-height: 400px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 80px rgba(108, 99, 255, 0.15);
  animation: cardIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.import-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.import-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.import-close {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.import-close:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.import-step {
  padding: 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.import-step.hidden {
  display: none;
}

.import-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.import-hint code {
  background: var(--surface3);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  color: var(--accent2);
}

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

#import-url-input {
  flex: 1;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#import-url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#import-url-input::placeholder {
  color: var(--text-dim);
}

.btn-load-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--accent), #8b84ff);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity var(--transition);
  min-width: 128px;
}

.btn-load-list:hover {
  opacity: 0.88;
}

.btn-load-list:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.import-error {
  font-size: 13px;
  color: var(--danger);
  background: rgba(255, 92, 106, 0.1);
  border: 1px solid rgba(255, 92, 106, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.5;
}

/* ── Import List Step ────────────────────────────────────── */
.import-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.import-list-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.import-list-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.import-list-count {
  font-size: 12px;
  color: var(--text-muted);
}

.import-resolution-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  animation: pulseOpacity 2s infinite ease-in-out;
}

.res-status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

#res-status-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@keyframes pulseOpacity {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.btn-select-all {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-select-all:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.import-place-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  padding-right: 2px;
}

.import-place-list::-webkit-scrollbar {
  width: 4px;
}

.import-place-list::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 2px;
}

.import-place-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.import-place-item:hover {
  border-color: rgba(108, 99, 255, 0.35);
}

.import-place-item.checked {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.08);
}

.import-place-item.already-saved {
  opacity: 0.5;
  cursor: not-allowed;
}

.import-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: var(--surface3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.import-place-item.checked .import-check {
  background: var(--accent);
  border-color: var(--accent);
}

.import-check-tick {
  display: none;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.import-place-item.checked .import-check-tick {
  display: block;
}

.import-place-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.import-place-info {
  flex: 1;
  min-width: 0;
}

.import-place-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-place-addr {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.import-place-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-place-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--surface3);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.import-place-badge.saved {
  background: rgba(76, 222, 144, 0.15);
  color: var(--success);
}

.import-place-resolving {
  font-size: 11px;
  color: var(--text-dim);
  animation: pulse-opacity 1.2s ease-in-out infinite;
}

@keyframes pulse-opacity {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ── Tag row in import ───────────────────────────────────── */
.import-tag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.import-tag-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

#import-tag-input {
  flex: 1;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
}

#import-tag-input:focus {
  border-color: var(--accent);
}

#import-tag-input::placeholder {
  color: var(--text-dim);
}

/* ── Import Actions ──────────────────────────────────────── */
.import-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.btn-back-import {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-back-import:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-do-import {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--accent), #8b84ff);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 2px 12px rgba(108, 99, 255, 0.35);
}

.btn-do-import:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-do-import:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ── Admin Nav Button ────────────────────────────────────── */
.btn-admin-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 11px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-admin-nav:hover {
  background: var(--surface3);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Profile Modal ───────────────────────────────────────── */
.profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 42, 0.36);
  backdrop-filter: blur(8px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.profile-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  padding: 28px;
  box-shadow: 0 28px 80px rgba(24, 39, 68, 0.22);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.profile-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b84ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar-upload {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  border: 2px solid var(--surface1);
  transition: background var(--transition);
}

.profile-avatar-upload:hover {
  background: #8b84ff;
}

.profile-avatar-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.profile-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-field input {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
}

.profile-field input:focus {
  border-color: var(--accent);
}

.profile-field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.btn-profile-save {
  background: linear-gradient(135deg, var(--accent), #8b84ff);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 2px 10px rgba(108, 99, 255, 0.35);
}

.btn-profile-save:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-profile-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.profile-save-msg {
  font-size: 12px;
  color: #4caf82;
  font-weight: 500;
}

.profile-save-msg.error {
  color: #ff6b6b;
}

.profile-plan-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface3);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.profile-plan-row--active {
  background: rgba(255, 215, 0, 0.07);
  border-color: rgba(255, 215, 0, 0.25);
  color: var(--text);
}

.profile-plan-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.profile-plan-label {
  flex: 1;
  font-weight: 600;
}

.profile-plan-storage {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.75;
}

.profile-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.profile-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0;
}

.profile-data-section {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.profile-data-section > div:first-child {
  flex: 1;
  min-width: 0;
}

.profile-data-copy {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 32rem;
}

.profile-data-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
}

.btn-profile-secondary,
.btn-profile-danger {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-profile-secondary {
  background: var(--surface3);
  color: var(--text);
}

.btn-profile-danger {
  background: rgba(255, 92, 106, 0.1);
  color: var(--danger);
  border-color: rgba(255, 92, 106, 0.24);
}

/* ── Offline Banner ──────────────────────────────────────── */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: #b45309;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

/* ── Admin Panel ─────────────────────────────────────────── */
.admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 42, 0.34);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1180px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(24, 39, 68, 0.2);
  overflow: hidden;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.admin-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.admin-tab {
  min-width: 96px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: 700 12px/1 'Inter', sans-serif;
  cursor: pointer;
}

.admin-tab.active {
  background: var(--surface2);
  color: var(--text);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.16);
}

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

.admin-settings-section {
  margin-bottom: 18px;
}

.admin-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.admin-settings-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-settings-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.admin-settings-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.admin-section-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 18px;
}

.admin-loading {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  color: var(--text);
  table-layout: auto;
}

.admin-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 10.5px;
  white-space: nowrap;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.admin-avatar-small {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b84ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.admin-avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.admin-badge-admin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(108, 99, 255, 0.18);
  color: var(--accent);
  border: 1px solid rgba(108, 99, 255, 0.35);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

.admin-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 21px;
}

.admin-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface3);
  border-radius: 21px;
  border: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

.admin-toggle-slider::before {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}

.admin-toggle input:checked+.admin-toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.admin-toggle input:checked+.admin-toggle-slider::before {
  transform: translateX(17px);
}

.btn-admin-edit {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.btn-admin-edit:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-admin-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-admin-delete:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 92, 106, 0.08);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-admin-csv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-admin-csv:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.analytics-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.analytics-range {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.analytics-range button {
  width: 54px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: 700 11px/1 'Inter', sans-serif;
  cursor: pointer;
}

.analytics-range button.active {
  background: var(--accent);
  color: #fff;
}

.analytics-total-events {
  font-size: 12px;
  color: var(--text-muted);
}

.analytics-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.analytics-card {
  min-height: 92px;
  padding: 13px 14px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analytics-card span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-card strong {
  color: var(--text);
  font-size: 25px;
  line-height: 1;
}

.analytics-card small {
  color: var(--text-dim);
  font-size: 12px;
}

.analytics-chart-row,
.analytics-table-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.analytics-chart-panel,
.analytics-side-panel,
.analytics-table-panel {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.analytics-panel-title {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

#admin-analytics-chart {
  width: 100%;
  height: 230px;
  display: block;
}

.analytics-sharing-grid {
  display: grid;
  gap: 8px;
}

.analytics-sharing-grid div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.analytics-sharing-grid b {
  color: var(--text-muted);
}

.analytics-sharing-grid span {
  color: var(--text);
  font-weight: 700;
}

.analytics-table {
  table-layout: auto;
}

.analytics-table td {
  white-space: nowrap;
}

.analytics-table td:first-child {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.admin-broadcast-section {
  margin-bottom: 18px;
}

.admin-broadcast-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.admin-broadcast-input {
  flex: 1;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 9px 12px;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
  transition: border-color var(--transition);
}

.admin-broadcast-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-admin-broadcast {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.btn-admin-broadcast:hover { opacity: 0.85; }
.btn-admin-broadcast:disabled { opacity: 0.5; cursor: not-allowed; }

.admin-toggle-slider-danger {
  background: var(--surface3);
  border: 1.5px solid var(--border);
}

.admin-toggle input:checked + .admin-toggle-slider-danger {
  background: var(--danger);
  border-color: var(--danger);
}

.admin-row-suspended td {
  opacity: 0.5;
}

.admin-row-suspended td:last-child {
  opacity: 1;
}

.admin-badge-suspended {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 92, 106, 0.15);
  color: var(--danger);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  margin-left: 6px;
  letter-spacing: 0.03em;
}

.admin-badge-premium {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 215, 0, 0.15);
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  margin-left: 4px;
  letter-spacing: 0.03em;
}

.admin-toggle-slider-premium {
  background: var(--surface3);
  border: 1.5px solid var(--border);
}

.admin-toggle input:checked + .admin-toggle-slider-premium {
  background: #FFD700;
  border-color: #FFD700;
}

.admin-storage-info {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  opacity: 0.7;
}

.admin-toggle-slider-verify {
  background: var(--surface3);
  border: 1.5px solid var(--border);
}

.admin-toggle input:checked + .admin-toggle-slider-verify {
  background: #48CAE4;
  border-color: #48CAE4;
}

.admin-verified-cell {
  white-space: nowrap;
}

.admin-verified-icon {
  font-size: 14px;
  margin-right: 4px;
  vertical-align: middle;
}

.admin-self-badge {
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
}

.admin-stat-cell {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-stat-loading {
  color: var(--text-dim);
}

.admin-email-cell {
  color: var(--text-muted);
  font-size: 12px;
}

.admin-date-cell {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.admin-date-empty {
  color: var(--text-dim);
}

.admin-edit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 42, 0.36);
  backdrop-filter: blur(4px);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-edit-modal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(24, 39, 68, 0.22);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.admin-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.btn-admin-reset {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.btn-admin-reset:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Sidebar Accordion Layout ────────────────────────────── */
.sidebar-accordion-controls {
  display: flex;
  padding: 10px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.accordion-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.btn-accordion {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-accordion:hover {
  background: var(--surface3);
  border-color: var(--text-muted);
  color: var(--text);
}

/* Accordion sections in place list */
.category-accordion-group {
  margin-bottom: 8px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.category-accordion-group:last-child {
  margin-bottom: 0;
}

.category-accordion-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  background: var(--surface3);
  user-select: none;
  transition: background var(--transition);
}

.cat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-category-visibility {
  background: transparent;
  border: none;
  padding: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all var(--transition);
}

.btn-category-visibility:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.btn-category-visibility.is-hidden {
  color: var(--accent);
  opacity: 1;
}

.category-accordion-header:hover {
  background: var(--surface2);
}

.category-accordion-content {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-accordion-content.hidden {
  display: none;
}

.accordion-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.category-accordion-group.collapsed .accordion-chevron {
  transform: rotate(-90deg);
}

.cat-tab-manage {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition);
  margin-left: auto;
}

.cat-tab-manage:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Tag Filter Section ──────────────────────────────────── */
.tag-filter-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border);
  min-height: 0;
}

.tag-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 0;
}

.tag-filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.filter-mode-toggle {
  display: flex;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.filter-mode-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.filter-mode-btn.active {
  background: var(--accent);
  color: #fff;
}

.btn-manage-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  margin-left: auto;
  transition: border-color var(--transition), color var(--transition);
}

.btn-manage-tags:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Detail Category Select ──────────────────────────────── */
.detail-category-select {
  width: 100%;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b93ad' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  transition: border-color var(--transition);
}

.detail-category-select:focus {
  border-color: var(--accent);
}

.detail-category-select option {
  background: var(--surface1);
}

.tag-cat-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Manager Modals (shared) ─────────────────────────────── */
.manager-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 42, 0.34);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.manager-modal {
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(24, 39, 68, 0.2);
  overflow: hidden;
}

.manager-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.manager-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.manager-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Category / Tag list rows */
.cat-list,
.tag-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-row,
.tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), background var(--transition);
}

.cat-row:hover,
.tag-row:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.cat-row[draggable="true"] {
  cursor: grab;
}

.cat-row[draggable="true"]:active {
  cursor: grabbing;
}

.cat-row-drag-handle {
  pointer-events: auto !important;
  cursor: grab;
}

.cat-row .cat-row-actions,
.cat-row .btn-row-action {
  pointer-events: auto;
}

.cat-row.drag-over {
  border-top: 2px solid var(--accent);
  background: rgba(108, 99, 255, 0.05);
}

.cat-row-drag-handle {
  color: var(--text-dim);
  font-size: 16px;
  margin-right: 2px;
  user-select: none;
  display: flex;
  align-items: center;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.cat-row:hover .cat-row-drag-handle {
  opacity: 1;
}

.cat-row-drag-handle:active {
  cursor: grabbing;
}

.cat-row-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.cat-row-name,
.tag-row-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.cat-row-count,
.tag-row-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface3);
  border-radius: 10px;
  padding: 1px 7px;
}

.cat-row-actions,
.tag-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-row-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.btn-row-action:hover {
  color: #ff6b6b;
  border-color: #ff6b6b;
}

.btn-row-action.edit:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.cat-row-default-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.7;
  background: rgba(108, 99, 255, 0.12);
  border-radius: 8px;
  padding: 1px 6px;
}

/* Add row */
.manager-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.manager-emoji-pick {
  font-size: 22px;
  cursor: pointer;
  user-select: none;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background var(--transition);
}

.manager-emoji-pick:hover {
  background: var(--surface3);
}

.manager-add-input {
  flex: 1;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
}

.manager-add-input:focus {
  border-color: var(--accent);
}

.manager-add-btn {
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--accent), #8b84ff);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.manager-add-btn:hover {
  opacity: 0.88;
}

/* Bulk section */
.manager-bulk {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.manager-bulk-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.manager-bulk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.manager-select {
  flex: 1;
  min-width: 100px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--text);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
}

.manager-select option {
  background: var(--surface1);
}

.tag-cat-selector-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Status Chips in List */
.tag-chip.to-try {
  background: rgba(255, 171, 0, 0.1);
  color: #ffab00;
  border: 1px solid rgba(255, 171, 0, 0.2);
}

.tag-chip.done {
  background: rgba(0, 184, 117, 0.1);
  color: #00b875;
  border: 1px solid rgba(0, 184, 117, 0.2);
}


/* ── Status Filter (Sidebar) ──────────────────────────────── */
.status-filter-wrap {
  display: flex;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin: 12px 12px 15px 12px;
  gap: 2px;
}

.status-filter-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 0;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-filter-btn:hover {
  color: var(--text);
}

.status-filter-btn.active {
  background: var(--surface1);
  color: var(--accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ── Status Toggle (Detail Panel) ─────────────────────────── */
.status-toggle-wrap {
  display: flex;
  background: var(--surface3);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  margin-top: 5px;
}

.status-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-btn.active.to-try {
  background: rgba(255, 171, 0, 0.1);
  border-color: #ffab00;
  color: #ffab00;
}

.status-btn.active.done {
  background: rgba(0, 184, 117, 0.1);
  border-color: #00b875;
  color: #00b875;
}

.status-btn:not(.active):hover {
  background: var(--surface2);
  color: var(--text-dim);
}

/* ── Export Modal ────────────────────────────────────────── */
.export-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 42, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.export-overlay.hidden {
  display: none !important;
}

.export-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modalScale 0.3s cubic-bezier(0.2, 1, 0.3, 1);
}

.export-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.export-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.export-modal-title svg {
  color: var(--accent);
}

.export-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all var(--transition);
}

.export-close:hover {
  color: var(--text);
  background: var(--surface3);
}

.export-cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.export-cat-item:hover {
  border-color: var(--accent);
  background: var(--surface3);
}

.export-cat-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.export-cat-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.export-cat-name {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.export-cat-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Place Card Checkbox ────────────────────────────────── */
.place-card-checkbox-wrap {
  margin-right: 4px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.place-card-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
  background: var(--surface3);
}

.place-card-checkbox:hover {
  border-color: var(--accent);
}

.place-card-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.place-card-checkbox.checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

/* ── Import Backup Method ────────────────────────────────── */
#method-card-backup .method-card-icon {
  background: rgba(0, 184, 117, 0.1);
}

/* ── Bulk Selection ──────────────────────────────────────── */
.btn-bulk-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-bulk-toggle:hover {
  background: var(--surface2);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-bulk-toggle.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.selection-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
  z-index: 500;
  animation: slideUpFixed 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUpFixed {
  from {
    transform: translate(-50%, 100%);
  }

  to {
    transform: translate(-50%, 0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.selection-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

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

.btn-selection-cancel {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
}

.btn-selection-delete {
  background: #ff4d4d;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn-selection-delete:hover {
  opacity: 0.9;
}

.btn-selection-add-trip {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-selection-add-trip:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.bulk-trip-wrap {
  position: relative;
}

.bulk-trip-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bulk-trip-popover.hidden {
  display: none;
}

.bulk-trip-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface2);
}

.bulk-trip-list {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.bulk-trip-item {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.bulk-trip-item:hover {
  background: var(--surface3);
  color: var(--accent);
}

/* selection checkbox on card */
.place-card-selection-wrap {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
}

.place-card.selection-mode {
  padding-left: 44px !important;
  cursor: pointer;
}

.place-card.selection-mode:hover {
  background: var(--surface2);
}

.place-card.selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.place-card-selection-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.place-card.selected .place-card-selection-check {
  background: var(--accent);
  border-color: var(--accent);
}

.place-card.selected .place-card-selection-check::after {
  content: "✓";
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.selection-batch {
  flex: 1;
  margin: 0 12px;
  min-width: 0;
}

#selection-cat-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  outline: none;
}

#selection-cat-select:focus {
  border-color: var(--accent);
}

/* ── Selection Popover ───────────────────────────────────── */
.selection-batch {
  position: relative;
  flex: 1;
  margin: 0 12px;
  min-width: 0;
}

.btn-selection-popover-toggle {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s;
}

.btn-selection-popover-toggle:hover {
  border-color: var(--accent);
}

.btn-selection-popover-toggle .chevron {
  font-size: 8px;
  opacity: 0.6;
}

.selection-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  animation: popIn 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.selection-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 13px;
  color: var(--text);
}

.selection-popover-item:hover {
  background: var(--surface2);
}

.selection-popover-item.all {
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 6px;
  padding-bottom: 10px;
  font-weight: 600;
}

.sel-pop-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.selection-popover-item.checked .sel-pop-check {
  background: var(--accent);
  border-color: var(--accent);
}

.selection-popover-item.checked .sel-pop-check::after {
  content: "✓";
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.sel-pop-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Mobile Sidebar Toggle ──────────────────────────────── */
.btn-sidebar-toggle {
  display: none;
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  margin-right: 8px;
  transition: all var(--transition);
}

.btn-sidebar-toggle:hover {
  background: var(--surface2);
  border-color: var(--accent);
}

.btn-sidebar-toggle.active {
  background: var(--accent);
  color: white;
}

/* ── Responsive breakpoints ─────────────────────────────── */

@media (max-width: 1024px) {
  :root {
    --sidebar-w: 300px;
  }
}

@media (max-width: 900px) {
  .nav-logo span {
    display: none;
  }

  .nav-logo {
    min-width: auto;
  }
}

@media (max-width: 768px) {
  .btn-sidebar-toggle {
    display: flex;
  }

  .navbar {
    padding: 0 12px;
    gap: 8px;
  }

  .nav-view-toggle {
    margin: 0 8px;
  }

  .nav-view-btn span {
    display: none;
  }

  .btn-manual-add span {
    display: none;
  }

  .btn-import-nav span,
  .btn-export-nav span {
    display: none;
  }

  .user-name {
    display: none;
  }

  .app-layout {
    position: relative;
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    top: var(--nav-h);
    left: -100%;
    width: 100%;
    height: calc(100% - var(--nav-h));
    z-index: 2000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg);
    border-right: none;
  }

  .sidebar.open {
    left: 0;
  }

  .map-container {
    width: 100%;
  }

  .detail-panel {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }

  .profile-modal,
  .export-modal,
  .import-modal,
  .share-modal,
  .admin-panel {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    border-radius: 12px;
  }

  .profile-data-section,
  .sharing-row,
  .planner-header-top,
  .planner-trip-manager,
  .calendar-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-data-actions,
  .sharing-row-actions,
  .planner-trip-actions,
  .cal-toolbar-center,
  .cal-view-modes {
    flex-wrap: wrap;
  }

  .share-mode-selector {
    grid-template-columns: 1fr;
  }

  .share-body,
  .share-footer,
  .profile-modal,
  .export-body {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .planner-item-main,
  .planner-leg-content {
    gap: 8px;
  }

  .planner-item-name {
    white-space: normal;
    line-height: 1.25;
  }

  .map-explorer-panel {
    max-height: 42vh;
    overflow-y: auto;
  }

  .selection-bar {
    max-width: 95%;
    padding: 10px 16px;
  }

  .selection-info {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .navbar {
    height: auto;
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .nav-logo {
    order: 1;
  }

  .btn-sidebar-toggle {
    order: 0;
    margin-right: 4px;
  }

  .nav-view-toggle {
    order: 2;
    margin: 0;
  }

  .btn-manual-add {
    order: 2.5;
    margin: 0;
  }

  .nav-right {
    order: 3;
    margin-left: auto;
  }

  .search-wrapper {
    order: 10;
    width: 100%;
    max-width: none;
    margin-top: 4px;
  }

  .app-layout {
    margin-top: 104px;
    /* logo/view row (~50px) + search row (~44px) + padding */
    height: calc(100vh - 104px);
  }

  .sidebar {
    top: 104px;
    height: calc(100% - 104px);
  }

  .modal-content {
    width: 95% !important;
    padding: 20px 16px !important;
  }
}

/* ── Manual Add Button ──────────────────────────────────── */
.btn-manual-add {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
  margin-left: 0;
  font-weight: 600;
  font-size: 13px;
}

.btn-manual-add:hover {
  background: var(--surface3);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn-manual-add svg {
  stroke-width: 2.5px;
  flex-shrink: 0;
}

/* ── Planner View ────────────────────────────────────────── */
.planner-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.planner-header {
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.planner-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
}

.planner-header {
  padding: 16px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 12px;
}

.planner-selector-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.planner-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.btn-clear-planner {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-clear-planner:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.planner-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.planner-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  cursor: grab;
  transition: all var(--transition);
  position: relative;
}

.planner-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.planner-item:hover {
  border-color: var(--accent);
  background: var(--surface3);
}

.planner-item.sortable-ghost {
  opacity: 0.4;
  border: 2px dashed var(--accent);
}

.planner-item-handle {
  color: var(--text-dim);
  cursor: grab;
  display: flex;
  align-items: center;
}

.planner-item-icon {
  width: 32px;
  height: 32px;
  background: var(--surface3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.planner-item-notes {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dim);
  padding: 4px 10px;
  border-left: 2px solid var(--accent);
  line-height: 1.4;
  transition: all var(--transition);
  white-space: pre-wrap;
}

.planner-item-notes[contenteditable="true"]:hover {
  background: var(--surface3);
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  cursor: text;
}

/* ── Enhanced Notes ─────────────────────────────────────── */
.planner-note-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  min-height: 1.2em;
  outline: none;
}

.planner-note-title:empty:before {
  content: "Note Title";
  opacity: 0.3;
  font-weight: 400;
}

.planner-note-editor {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  min-height: 1.5em;
  outline: none;
}

.planner-note-editor b { font-weight: 700; color: var(--text); }
.planner-note-editor i { font-style: italic; }
.planner-note-editor u { text-decoration: underline; }

.planner-item-notes[contenteditable="true"]:focus {
  outline: none;
  background: var(--surface2);
  color: var(--text);
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.planner-item-notes.empty-note {
  border-left-color: transparent;
  padding: 4px 6px;
}

.planner-item-notes.empty-note:empty:before {
  content: attr(data-placeholder);
  color: var(--text-dim);
  font-style: italic;
  pointer-events: none;
  opacity: 0.6;
}

.planner-item-notes.empty-note:focus:before {
  content: "";
}

/* ── Planner Statistics ─────────────────────────────────── */
.planner-day-stats {
  margin: 0 12px 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.planner-day-stats-title {
  width: 100%;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: -4px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.stat-item b {
  color: var(--text);
  font-weight: 600;
}

.stat-icon {
  font-size: 14px;
}

.planner-trip-stats {
  margin: 24px 12px 24px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.08), rgba(72, 202, 228, 0.05));
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.planner-trip-stats .planner-day-stats-title {
  color: var(--accent);
  font-size: 11px;
  margin-bottom: 8px;
}

.planner-trip-stats .stat-item {
  color: var(--text);
}

.planner-trip-stats .stat-item b {
  font-size: 13px;
}

/* ── Map Explorer (Discovery) ────────────────────────────── */
.map-explorer-panel {
  position: relative;
  width: 100%;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.map-explorer-panel.hidden {
  display: none;
}

.explorer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.explorer-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.explorer-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.explorer-hint {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.7;
  margin: 0;
}

.explorer-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.explorer-toggle-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0;
}

.explorer-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.explorer-dropdown-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.btn-explorer-dropdown {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
  overflow: hidden;
}

.btn-explorer-dropdown:hover {
  background: var(--surface4);
}

.btn-explorer-dropdown.has-filter {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-explorer-dropdown span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-explorer-dropdown .chevron {
  flex-shrink: 0;
  opacity: 0.5;
  transition: transform var(--transition);
}

.btn-explorer-dropdown.open .chevron {
  transform: rotate(180deg);
}

.explorer-cat-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 110;
  overflow: hidden;
}

.explorer-cat-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-cat-select-all {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-cat-select-all:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.explorer-cat-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.explorer-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 12px;
  color: var(--text);
}

.explorer-cat-item:hover {
  background: var(--surface3);
}

.explorer-cat-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.explorer-cat-item .cat-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.explorer-cat-item .cat-name {
  flex: 1;
  font-weight: 500;
}

.explorer-tags-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-explorer-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.btn-explorer-tags:hover {
  background: var(--surface4);
}

.explorer-active-tags {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
}

.explorer-tags-popover {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 101;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
}

.explorer-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.explorer-tag-chip {
  font-size: 10px;
  padding: 3px 8px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
}

.explorer-tag-chip:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.explorer-tag-chip.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}

/* Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--surface4);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(14px);
}

.slider.round {
  border-radius: 18px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Explorer Markers */
.custom-marker.marker-explorer {
  opacity: 0.6;
  transform: scale(0.85);
  filter: grayscale(0.3);
  z-index: 5;
}

.custom-marker.marker-explorer:hover {
  opacity: 1;
  transform: scale(1.1);
  filter: grayscale(0);
  z-index: 50;
}

.planner-item-info {
  flex: 1;
  min-width: 0;
}

.planner-item-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-item-index {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
  user-select: none;
}

.planner-item-index:hover {
  transform: scale(1.1);
  background: var(--accent-light, #8d85ff);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.position-picker {
  width: 200px;
  border-radius: 12px;
  overflow: hidden;
}

.position-picker .picker-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.position-picker label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-left: 2px;
}

.position-picker input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
}

.position-picker input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.btn-confirm-move {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-confirm-move:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-remove-from-trip {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition);
}

.btn-remove-from-trip:hover {
  color: var(--danger);
  background: var(--danger-dim);
}

.planner-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.planner-empty-state p {
  font-weight: 600;
  margin: 12px 0 4px;
  color: var(--text);
}

.planner-empty-state span {
  font-size: 12px;
  opacity: 0.7;
}

.btn-add-to-trip {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
  flex: 1;
}

.btn-add-to-trip:hover {
  background: var(--surface3);
  border-color: var(--accent);
}

.btn-add-to-trip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Multi-Trip UI ────────────────────────────────────────── */
.planner-trip-manager {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

#planner-trip-select {
  flex: 1;
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
}

.btn-new-trip {
  background: var(--accent);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.btn-new-trip:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.planner-trip-actions {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.btn-trip-action {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition);
}

.btn-trip-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-trip-action.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-trip-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.detail-trip-add-wrap {
  display: flex;
  gap: 8px;
  flex: 1;
}

.detail-trip-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  max-width: 120px;
  transition: all var(--transition);
}

.detail-trip-select:hover {
  border-color: var(--accent);
}

/* Last lines removed */

/* ── Travel Legs ─────────────────────────────────────────── */
.planner-leg {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: -6px 0 -6px 44px;
  /* Align with icons */
  padding: 8px 0;
  position: relative;
  z-index: 1;
}

.planner-leg-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-image: linear-gradient(to bottom, var(--border) 50%, transparent 50%);
  background-size: 2px 8px;
  transform: translateX(-50%);
  z-index: -1;
}

.planner-leg-content {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all var(--transition);
  position: relative;
}

.planner-leg-content:hover {
  border-color: var(--accent);
}

.planner-mode-select {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--transition);
}

.planner-mode-select.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.planner-leg-info {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.planner-leg-info b {
  color: var(--text);
}

.planner-leg-loading {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Better Travel Mode Visibility ──────────────────────── */
.planner-mode-select.active {
  color: white;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface3), 0 0 0 4px var(--accent);
}

.planner-leg-content {
  border-width: 2px;
  /* Slightly thicker */
}

.planner-leg-info b {
  color: var(--accent);
  /* Highlight distance/time */
}

/* ── Color-Coded Leg Enhancements ───────────────────────── */
.planner-leg-line {
  background-image: none !important;
  /* Remove dotted line */
  width: 3px !important;
  opacity: 0.6;
}

.planner-leg-content {
  border-left-width: 4px;
}

.planner-leg:hover .planner-leg-line {
  opacity: 1;
  width: 5px !important;
}

/* ── Route Optimization ─────────────────────────────────── */
.planner-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}


.btn-trip-action {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-trip-action:hover {
  background: var(--surface3);
  color: var(--text);
}

.btn-trip-action.danger:hover {
  background: var(--red-dim);
  color: #ff4d4d;
  border-color: #ff4d4d;
}

/* ── Refined Planner Header Layout ──────────────────────── */
.planner-header {
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.planner-trip-manager {
  display: flex;
  align-items: center;
  gap: 8px;
}

#planner-trip-select {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}

.planner-trip-actions {
  display: flex;
  gap: 4px;
}


/* ── Trip Summary ───────────────────────────────────────── */
.planner-summary {
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
  margin: 0 16px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px dashed var(--border);
}

.planner-summary:empty {
  display: none;
}

.planner-summary span b {
  color: var(--accent);
}

/* ── Start/End Point Styling ────────────────────────────── */
.planner-item-start .planner-item-index {
  background: #32CD32 !important;
  /* Lime green */
  color: white !important;
  font-size: 9px !important;
  font-weight: 800 !important;
}

.planner-item-end .planner-item-index {
  background: #FF4B2B !important;
  /* Red */
  color: white !important;
  font-size: 9px !important;
  font-weight: 800 !important;
}

.planner-item-start {
  border-left: 4px solid #32CD32;
}

.planner-item-end {
  border-left: 4px solid #FF4B2B;
}
/* ── Trip Planner Daily Segments ─────────────────────────── */

.planner-day-segment {
  transition: opacity 0.3s;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.planner-day-segment.hidden-on-map .planner-day-title,
.planner-day-segment.hidden-on-map .planner-day-date {
  opacity: 0.5;
  text-decoration: line-through;
}

.planner-day-segment.collapsed .planner-day-list,
.planner-day-segment.collapsed .planner-day-stats,
.planner-day-segment.collapsed .btn-add-places-to-day {
  display: none !important;
}

.planner-day-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface3);
  border-radius: 8px;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.planner-day-header:hover {
  background: var(--surface2);
  border-color: var(--accent);
}

.planner-day-drag-handle {
  color: var(--text-dim);
  cursor: grab;
  padding: 4px;
  margin-left: -8px;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.planner-day-drag-handle:hover {
  opacity: 1;
}

.planner-day-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.planner-day-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent2);
}

.planner-day-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.planner-day-actions {
  display: flex;
  gap: 4px;
}

.btn-day-visibility {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.btn-day-visibility:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
}

.planner-day-segment.hidden-on-map .btn-day-visibility {
  color: var(--accent);
}

.btn-day-optimize {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-day-optimize:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
}

/* ── Optimize Day Modal ─────────────────────────────────── */
.optimize-day-modal {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  animation: modal-appear 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.optimize-day-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.optimize-day-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.optimize-day-close:hover {
  color: var(--text);
}

.optimize-day-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.optimize-day-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.optimize-day-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.optimize-toggle-row {
  display: flex;
  gap: 6px;
}

.optimize-toggle-btn {
  flex: 1;
  padding: 7px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.optimize-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.optimize-toggle-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.optimize-day-footer {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.optimize-day-footer .confirm-modal-btn {
  flex: 1;
}

.planner-day-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 20px;
  flex-shrink: 0;
}

.btn-add-places-to-day {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}

.btn-add-places-to-day:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ── Add Places to Day Modal ─────────────────────────────── */
.add-places-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 42, 0.36);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.add-places-overlay.hidden {
  display: none;
}

.add-places-modal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(24, 39, 68, 0.22);
  width: 600px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-appear 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-appear {
  from { transform: scale(0.92) translateY(16px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.add-places-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.add-places-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.add-places-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.btn-add-places-close {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all var(--transition);
}

.btn-add-places-close:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.add-places-filters {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface3);
}

.add-places-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  transition: border-color var(--transition);
}

.add-places-search-wrap:focus-within {
  border-color: var(--accent);
}

.add-places-search-wrap svg {
  color: var(--text-dim);
  flex-shrink: 0;
}

.add-places-search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
}

.add-places-search-wrap input::placeholder {
  color: var(--text-dim);
}

.add-places-filter-row {
  display: flex;
  gap: 10px;
}

.add-places-filter-wrap {
  flex: 1;
}

.add-places-filter-wrap select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.add-places-list-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.add-places-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  background: var(--surface3);
  flex-shrink: 0;
}

.add-places-sel-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.btn-add-select-all, .btn-add-select-none {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 600;
}

.btn-add-select-all:hover, .btn-add-select-none:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.add-places-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.add-places-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid transparent;
}

.add-places-item:hover {
  background: var(--surface3);
}

.add-places-item.selected {
  background: var(--accent-glow);
  border-color: rgba(108, 99, 255, 0.3);
}

.add-places-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.add-places-item-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--surface3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.add-places-item.selected .add-places-item-icon {
  background: var(--accent);
}

.add-places-item-body {
  flex: 1;
  min-width: 0;
}

.add-places-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.add-places-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.add-places-item-order {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.add-places-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 13px;
}

.add-places-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface3);
}

.btn-add-places-cancel {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-add-places-cancel:hover {
  background: var(--surface4);
  color: var(--text);
}

.btn-add-places-confirm {
  background: var(--accent);
  border: none;
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-add-places-confirm:hover:not(:disabled) {
  background: var(--accent2);
  transform: translateY(-1px);
}

.btn-add-places-confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.manager-add-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* Trip Planner Phase 2 */
.planner-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-hover);
  border-radius: 10px;
  margin-bottom: 12px;
}

.planner-day-info {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  flex: 1;
}


/* Markers per day start/end */
.planner-item-start .planner-item-number {
  background: var(--accent2);
  color: white;
  border-color: var(--accent2);
}

.planner-item-end .planner-item-number {
  background: var(--text-muted);
  color: white;
  border-color: var(--text-muted);
}

/* Map Markers Phase 2 */
.marker-label {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 10px;
  border: 1.5px solid var(--bg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  white-space: nowrap;
  z-index: 2;
}

.marker-start .marker-label {
  background: var(--accent2);
}

.marker-end .marker-label {
  background: var(--text-muted);
}

.marker-start .marker-bubble {
  border: 2px solid var(--accent2);
}

.marker-end .marker-bubble {
  border: 2px solid var(--text-muted);
}

.planner-item-times {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.planner-time-input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 11px;
    padding: 2px 4px;
    width: 65px;
    cursor: pointer;
    transition: all 0.2s;
}

.planner-time-input:hover {
    border-color: #4285F4;
}

.planner-time-input:focus {
    outline: none;
    border-color: #4285F4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.planner-item-conflict {
    border-left: 3px solid #ff4444 !important;
}

.conflict-warning {
    color: #ff4444;
    cursor: help;
    font-weight: bold;
    font-size: 14px;
    margin-left: 4px;
}

.planner-time-display {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 11px;
    padding: 2px 6px;
    min-width: 45px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.planner-time-display:hover {
    background: var(--surface3);
    border-color: #4285F4;
}

.custom-time-picker {
    position: absolute;
    z-index: 10000;
    box-shadow: 0 16px 36px rgba(24, 39, 68, 0.2);
}

.premium-picker {
    width: 260px;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.picker-header {
    background: var(--surface2);
    padding: 15px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.picker-header span {
    cursor: pointer;
    transition: color 0.2s;
}

.picker-header span.active {
    color: #4285F4;
}

.picker-body {
    padding: 12px;
    position: relative;
    height: 240px;
}

.grid-view {
    display: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    position: absolute;
    width: calc(100% - 24px);
    animation: fadeIn 0.2s ease-out;
}

.grid-view.active {
    display: grid;
}

.minute-grid {
    overflow-y: auto;
    max-height: 220px;
    padding-right: 4px;
}

.minute-grid::-webkit-scrollbar {
    width: 4px;
}

.minute-grid::-webkit-scrollbar-thumb {
    background: #5f6368;
    border-radius: 2px;
}

.grid-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: #e8eaed;
}

.grid-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.grid-item.selected {
    background: #4285F4;
    color: #fff;
}

.min-item {
    font-size: 11px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ── Insertion Points ───────────────────────────────────── */
.btn-insert-point {
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface3);
  border: 2px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
  padding: 0;
}

.btn-insert-point:hover,
.btn-insert-point.open {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.25);
  transform: translateY(-50%) scale(1.15);
}

.insert-menu {
  position: fixed;
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 3px;
  z-index: 99999;
  min-width: 230px;
  animation: insertMenuIn 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes insertMenuIn {
  from { opacity: 0; transform: scale(0.92) translateY(-6px); transform-origin: top right; }
  to   { opacity: 1; transform: scale(1)    translateY(0);    transform-origin: top right; }
}

/* each row */
.insert-menu-btn {
  background: none;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
  transition: background 0.15s;
  width: 100%;
}

.insert-menu-btn:hover { background: rgba(255,255,255,0.06); }
.insert-menu-btn:active { background: rgba(255,255,255,0.1); }

/* icon circle */
.insert-menu-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* label */
.insert-menu-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

/* color variants */
.insert-menu-place   .insert-menu-icon { background: rgba(108,99,255,0.18); color: #8b84ff; }
.insert-menu-note    .insert-menu-icon { background: rgba(255,212,0,0.15);  color: #FFD400; }
.insert-menu-booking .insert-menu-icon { background: rgba(72,202,228,0.15); color: #48CAE4; }
.insert-menu-attach  .insert-menu-icon { background: rgba(255,122,118,0.15);color: #FF7A76; }

.insert-menu-place:hover   .insert-menu-label { color: #8b84ff; }
.insert-menu-note:hover    .insert-menu-label { color: #FFD400; }
.insert-menu-booking:hover .insert-menu-label { color: #48CAE4; }
.insert-menu-attach:hover  .insert-menu-label { color: #FF7A76; }

/* thin divider */
.insert-menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 3px 4px;
}

/* ── General Notes in Planner ────────────────────────────── */
.planner-item.planner-note-item {
  border-left: 4px solid #ffd400;
  background: rgba(255, 212, 0, 0.03);
}

.planner-note-item:hover {
  background: rgba(255, 212, 0, 0.06);
}

.planner-note-item .planner-item-icon {
  background: #ffd400 !important;
  color: #000 !important;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.planner-note-editor {
  width: 100%;
  min-height: 40px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  outline: none;
  cursor: text;
}

.planner-note-editor:empty:before {
  content: "Type your note here...";
  color: var(--text-dim);
  opacity: 0.5;
  font-style: italic;
}

.already-in-trip-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 212, 0, 0.15);
  color: #ffd400;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  border: 1px solid rgba(255, 212, 0, 0.3);
  vertical-align: middle;
  letter-spacing: 0.05em;
}

/* ── Travel Booking in Planner ──────────────────────────── */
.planner-item.planner-booking-item {
  border-left: 4px solid var(--accent);
  background: linear-gradient(to right, rgba(108, 99, 255, 0.05), var(--surface2));
  padding: 16px;
  cursor: pointer;
}

.planner-booking-item:hover {
  background: linear-gradient(to right, rgba(108, 99, 255, 0.08), var(--surface3));
}

.booking-ticket {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.booking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 10px;
}

.booking-type-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-light);
}

.booking-trip-num {
  font-family: inherit;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.booking-route {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.booking-route-arrow {
  color: var(--text-dim);
  opacity: 0.6;
}

.booking-time-info {
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.booking-time-node {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.booking-time-node b {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.booking-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 20px;
  font-size: 12px;
}

.booking-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-muted);
}

.booking-meta-item b {
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.booking-meta-item span {
  color: var(--text-muted);
  word-break: break-all;
}

.booking-note-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  border-left: 3px solid var(--accent);
  margin-top: 4px;
}

/* ── File Attachments in Planner ───────────────────────────── */
.planner-item.planner-attachment-item {
  border-left: 4px solid #FF7A76;
  background: linear-gradient(to right, rgba(255, 122, 118, 0.05), var(--surface2));
  padding: 14px 16px;
  cursor: pointer;
}

.planner-attachment-item:hover {
  background: linear-gradient(to right, rgba(255, 122, 118, 0.1), var(--surface3));
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.attachment-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 122, 118, 0.15);
  border: 1px solid rgba(255, 122, 118, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FF7A76;
}

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

.attachment-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
}

.attachment-title:focus {
  white-space: normal;
}

.attachment-title:empty:before {
  content: "Untitled";
  opacity: 0.4;
}

.attachment-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment-download {
  flex-shrink: 0;
  background: rgba(255, 122, 118, 0.12);
  border: 1px solid rgba(255, 122, 118, 0.3);
  color: #FF7A76;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
  text-decoration: none;
}

.attachment-download:hover {
  background: rgba(255, 122, 118, 0.22);
}

.planner-attachment-upload-progress {
  height: 3px;
  background: rgba(255, 122, 118, 0.15);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.planner-attachment-upload-progress-bar {
  height: 100%;
  background: #FF7A76;
  width: 0%;
  transition: width 0.3s;
  border-radius: 2px;
}

/* ── Notifications & Sharing ──────────────────────────────── */
.notif-wrapper {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.btn-notif {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.btn-notif:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface2);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--surface2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1000;
  overflow: hidden;
  animation: slideInDown 0.2s ease;
}

@keyframes slideInDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-header span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.btn-notif-clear {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent2);
  cursor: pointer;
  padding: 0;
}

.notif-list {
  max-height: 400px;
  overflow-y: auto;
}

.notif-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  gap: 12px;
}

.notif-item:hover {
  background: var(--surface3);
}

.notif-item.unread {
  background: rgba(108, 99, 255, 0.05);
}

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  line-height: 1.4;
}

.notif-item-time {
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Sharing Modal ───────────────────────────────────────── */
.share-modal {
  background: var(--surface);
  width: 100%;
  max-width: 440px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.share-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.share-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.share-explainer,
.share-permissions-note,
.accept-permissions-note,
.sharing-help-card {
  background: rgba(95, 211, 232, 0.08);
  border: 1px solid rgba(72, 202, 228, 0.24);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.58;
  padding: 16px 18px;
}

.share-explainer strong,
.share-permissions-note strong,
.accept-permissions-note strong,
.sharing-help-card strong {
  color: var(--text);
}

.sharing-help-card {
  margin-bottom: 20px;
  box-shadow: 0 12px 32px rgba(24, 39, 68, 0.1);
}

.sharing-help-card p {
  margin: 10px 0 0;
}

.share-preview {
  background: var(--surface2);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-preview-icon {
  font-size: 24px;
}

.share-preview-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.share-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.share-mode-selector.copy-only {
  grid-template-columns: 1fr;
}

.share-mode-card {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-mode-card.hidden {
  display: none;
}

.share-mode-card:hover {
  border-color: var(--accent2);
  transform: translateY(-2px);
}

.share-mode-card.disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.share-mode-card.disabled:hover {
  border-color: var(--border);
  transform: none;
}

.share-mode-card.active {
  background: rgba(72, 202, 228, 0.08);
  border-color: var(--accent2);
  box-shadow: 0 4px 12px rgba(72, 202, 228, 0.15);
}

.share-mode-icon {
  font-size: 20px;
}

.share-mode-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.share-mode-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.share-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.share-footer {
  padding: 20px 24px;
  background: var(--surface2);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-share-confirm {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-share-confirm:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── Profile Tabs ────────────────────────────────────────── */
.profile-tabs {
  display: flex;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}

.profile-tab {
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

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

.profile-tab.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.28);
}

.profile-tab.active::after {
  display: none;
}

.profile-tab-content {
  display: none !important;
  flex-direction: column;
}

.profile-tab-content.active {
  display: flex !important;
}

.sharing-section {
  display: flex;
  flex-direction: column;
}

#profile-tab-sharing .profile-section-title {
  margin-bottom: 0;
}

.sharing-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.sharing-empty {
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  background: var(--surface2);
  border-radius: 12px;
  border: 1px dashed var(--border);
}

.sharing-row {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 28px rgba(24, 39, 68, 0.1);
}

.sharing-row-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.sharing-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(108, 99, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sharing-row-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sharing-row-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.sharing-row-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

.sharing-row-note {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.btn-revoke {
  background: rgba(255, 92, 106, 0.14);
  color: #ff6f7f;
  border: 1px solid rgba(255, 92, 106, 0.2);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-revoke:hover {
  background: var(--danger);
  color: #fff;
}

.sharing-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-share-choice {
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-share-keep {
  background: rgba(99, 179, 237, 0.15);
  color: #63b3ed;
}

.btn-share-keep:hover {
  background: #63b3ed;
  color: #fff;
}

.btn-share-remove {
  background: rgba(255, 92, 106, 0.12);
  color: var(--danger);
}

.btn-share-remove:hover {
  background: var(--danger);
  color: #fff;
}

.btn-share-cancel {
  background: var(--surface3);
  color: var(--text-dim);
}

.btn-share-cancel:hover {
  background: var(--surface4);
  color: var(--text);
}

/* ── Collaborate Indicator ────────────────────────────────── */
.collab-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent2);
  color: #fff;
  font-size: 10px;
  margin-left: 6px;
  box-shadow: 0 0 8px rgba(72, 202, 228, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(72, 202, 228, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(72, 202, 228, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(72, 202, 228, 0); }
}

/* ── Share Button Styles ────────────────────────────────── */
.btn-selection-share, .btn-share-detail, .btn-share-trip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--accent2) !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-selection-share:hover, .btn-share-detail:hover, .btn-share-trip:hover {
  background: var(--surface3);
  border-color: var(--accent2);
  transform: translateY(-1px);
}

.btn-share-trip {
  padding: 8px;
}

/* ── Accept Modal ─────────────────────────────────────────── */
.accept-sender-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.sender-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.sender-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.sender-email {
  font-size: 12px;
  color: var(--text-dim);
}

.accept-content-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.content-icon {
  font-size: 28px;
}

.content-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.content-mode {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent2);
  letter-spacing: 0.5px;
}

.accept-items-list {
  max-height: 200px;
  overflow-y: auto;
  background: var(--surface2);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 12px;
}

.accept-category-wrap {
  margin-bottom: 8px;
}

.accept-category-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.btn-reject {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.btn-accept {
  background: var(--success);
  color: #0d0f14;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
}

/* ── Confirm Modal ───────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 24, 42, 0.36);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.confirm-overlay.hidden {
  display: none;
}

.confirm-modal {
  background: var(--surface1, #202b40);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px 24px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(24, 39, 68, 0.22);
  animation: slideUp 0.18s ease;
}

.confirm-modal-icon {
  font-size: 36px;
  margin-bottom: 12px;
  line-height: 1;
}

.confirm-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.confirm-modal-message {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-modal-btn {
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background var(--transition), transform 0.1s ease;
  min-width: 100px;
}

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

.confirm-modal-btn.cancel {
  background: var(--surface3, #30405b);
  color: var(--text-muted);
}

.confirm-modal-btn.cancel:hover {
  background: var(--surface2, #26334a);
  color: var(--text);
}

.confirm-modal-btn.confirm {
  background: var(--danger, #ff5c6a);
  color: #fff;
  border-color: transparent;
}

.confirm-modal-btn.confirm:hover {
  background: #e04f5c;
}

.confirm-modal-btn.confirm.safe {
  background: var(--accent, #6C63FF);
}

.confirm-modal-btn.confirm.safe:hover {
  background: #5a52e0;
}

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

/* Extra buttons in confirm modal (choice dialogs) */
.confirm-modal-actions:has(.confirm-extra-btn) {
  flex-direction: column;
  gap: 8px;
}

.confirm-modal-actions:has(.confirm-extra-btn) .confirm-modal-btn {
  width: 100%;
  justify-content: center;
}

.confirm-modal-btn.confirm.confirm-extra-btn {
  background: var(--surface3, #30405b);
  color: var(--text);
  border: 1px solid var(--border);
}

.confirm-modal-btn.confirm.confirm-extra-btn:hover {
  background: var(--surface2, #26334a);
}

.confirm-modal-btn.confirm.confirm-extra-btn.safe {
  background: rgba(108, 99, 255, 0.15);
  color: #a09fff;
  border-color: rgba(108, 99, 255, 0.3);
}

.confirm-modal-btn.confirm.confirm-extra-btn.safe:hover {
  background: rgba(108, 99, 255, 0.25);
}

/* ── Shared / Collaborate indicators ─────────────────────── */

/* Badge on place card name */
.shared-badge {
  display: inline-block;
  font-size: 11px;
  margin-left: 5px;
  vertical-align: middle;
  opacity: 0.85;
  cursor: default;
}

/* Detail panel banner */
.detail-shared-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(108, 99, 255, 0.12);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: 8px;
  padding: 8px 14px;
  margin: 12px 20px 0;
  font-size: 12px;
  font-weight: 600;
  color: #a09fff;
}

.detail-shared-banner.hidden {
  display: none;
}

.detail-shared-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.detail-shared-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shared place marker — slightly different bubble color */
.custom-marker.marker-shared .marker-bubble {
  background: linear-gradient(135deg, #6C63FF 0%, #a09fff 100%);
  box-shadow: 0 2px 10px rgba(108, 99, 255, 0.45);
}

.custom-marker.marker-shared .marker-tip {
  border-top-color: #6C63FF;
}

/* Accept modal — place details preview */
.accept-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.accept-item-tags {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface3);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
}

.accept-item-rating {
  font-size: 11px;
  color: #f5c518;
  letter-spacing: -1px;
}

/* Virtual "Shared" group in the place list */
.category-accordion-group.shared-group .category-accordion-header {
  background: rgba(108, 99, 255, 0.07);
  border-left: 3px solid rgba(108, 99, 255, 0.5);
}
