:root {
  --ink: #152329;
  --muted: #65737c;
  --line: #dbe4e1;
  --paper: #f6f3ec;
  --panel: rgba(255, 255, 255, 0.88);
  --teal: #0b7774;
  --teal-soft: #dff2ee;
  --coral: #cf5948;
  --blue: #3f67a8;
  --gold: #bc861e;
  --green: #2d7a4b;
  --violet: #6c5aa7;
  --shadow: 0 28px 90px rgba(21, 35, 41, 0.17);
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */
body.dark {
  --ink: #e8edf0;
  --muted: #8fa3ac;
  --line: #2a3338;
  --paper: #111618;
  --panel: rgba(22, 28, 32, 0.95);
  --teal: #0fa9a5;
  --teal-soft: #0d2e2d;
  --shadow: 0 28px 90px rgba(0,0,0,0.5);
  color-scheme: dark;
}
body.dark {
  background:
    radial-gradient(circle at 12% 12%, rgba(11, 119, 116, 0.18), transparent 28rem),
    radial-gradient(circle at 88% 16%, rgba(207, 89, 72, 0.1), transparent 24rem),
    linear-gradient(135deg, #0d1618, #111a1e 46%, #0e1a18);
}
body.dark .app {
  background: rgba(16, 22, 26, 0.92);
  border-color: rgba(255,255,255,0.07);
}
body.dark .strategy {
  background: rgba(16, 22, 26, 0.85);
  border-color: rgba(255,255,255,0.07);
}
body.dark .topbar { border-bottom-color: var(--line); }
body.dark .topbar h1 { color: var(--ink); }
body.dark .chip {
  background: #1c2529;
  border-color: #2e3d44;
  color: var(--ink);
}
body.dark .chip.active { background: var(--teal); color: #fff; border-color: var(--teal); }
body.dark .context-pill { background: #1c2529; border-color: #2e3d44; color: var(--ink); }
body.dark .context-pill.active { border-color: var(--teal); }
body.dark .card {
  background: #161e22;
  border-color: #252f35;
}
body.dark .card:hover { background: #1c2730; }
body.dark .search-box { background: #1c2529; border-color: #2e3d44; }
body.dark .search-box input { color: var(--ink); background: transparent; }
body.dark .search-box input::placeholder { color: var(--muted); }
body.dark .filter-btn { background: #1c2529; border-color: #2e3d44; color: var(--muted); }
body.dark .filter-btn.active { background: var(--teal); color: #fff; border-color: var(--teal); }
body.dark .mode { background: #1c2529; border-color: #2e3d44; color: var(--muted); }
body.dark .mode.active { background: var(--teal-soft); color: var(--teal); }
body.dark .quick-actions button { background: #1c2529; border-color: #2e3d44; color: var(--ink); }
body.dark .quick-actions button:hover { background: #242f36; }
body.dark .insights { background: #1c2529; border-color: #2e3d44; }
body.dark .metrics > div { background: #1c2529; border-color: #2e3d44; }
body.dark .drawer { background: #141c20; color: var(--ink); border-color: #2e3d44; }
body.dark .drawer-title { color: var(--ink); }
body.dark .badge { background: #1c2529; border-color: #2e3d44; color: var(--muted); }
body.dark .backend-badge { background: #1c2529; color: var(--muted); border-color: #2e3d44; }
body.dark .topbar-btn { background: #1c2529 !important; border-color: #2e3d44 !important; color: var(--ink) !important; }
body.dark .kid-toggle-btn.kid-mode-active { background: #2e2400 !important; }
body.dark .map { background: #101618; border-color: #252f35; }
body.dark .city-grid { background-image: repeating-linear-gradient(0deg,#1e282d 0,#1e282d 1px,transparent 1px,transparent 100%),repeating-linear-gradient(90deg,#1e282d 0,#1e282d 1px,transparent 1px,transparent 100%); }
body.dark .map-card { background: #1c2529; border-color: #2e3d44; }
body.dark .mood-chip { background: #1c2529; border-color: #2e3d44; color: var(--ink); }
body.dark .mood-chip.active { background: #0d2e2d; border-color: var(--teal); color: var(--teal); }
body.dark .dark-toggle-btn { font-size: 1rem !important; }
body.dark #liveTrackBtn.active { background: #0d2e2d !important; border-color: var(--teal) !important; color: var(--teal) !important; }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(11, 119, 116, 0.14), transparent 28rem),
    radial-gradient(circle at 88% 16%, rgba(207, 89, 72, 0.11), transparent 24rem),
    linear-gradient(135deg, #eaf1ee, #faf6ee 46%, #e6f0ef);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 450px) minmax(300px, 430px);
  gap: 34px;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.app {
  width: min(100%, 450px);
  height: min(920px, calc(100vh - 42px));
  min-height: 720px;
  overflow: hidden auto;
  border: 1px solid rgba(21, 35, 41, 0.16);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.77);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  padding: 16px;
  scrollbar-width: none;
}

.app::-webkit-scrollbar {
  display: none;
}

.topbar,
.context-row,
.search-panel,
.insights,
.place-card,
.strategy,
.metrics div,
.drawer {
  border: 1px solid var(--line);
  background: var(--panel);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 24px;
  padding: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(1.55rem, 6vw, 2.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.icon-btn {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 17px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 1.25rem;
}

.context-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  border-radius: 20px;
  padding: 8px;
}

.context-pill,
.filter-btn,
.mode,
.quick-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 850;
  font-size: 0.84rem;
}

.context-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.context-pill strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-pill.active,
.filter-btn.active,
.mode.active {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  border-radius: 20px;
  padding: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.chips,
.mode-row,
.quick-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 0;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar,
.mode-row::-webkit-scrollbar,
.quick-actions::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  padding: 0 13px;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 850;
}

.chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.map {
  position: relative;
  height: 292px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid #cbd8d4;
  border-radius: 26px;
  background:
    linear-gradient(30deg, transparent 42%, rgba(11, 119, 116, 0.18) 43%, rgba(11, 119, 116, 0.18) 48%, transparent 49%),
    linear-gradient(115deg, transparent 48%, rgba(207, 89, 72, 0.15) 49%, rgba(207, 89, 72, 0.15) 53%, transparent 54%),
    linear-gradient(90deg, #eef3ed 0 20%, #dbeae6 20% 25%, #f7f1e7 25% 66%, #e2eadf 66% 72%, #f3efe6 72%);
}

.city-grid {
  position: absolute;
  inset: -38px;
  background-image:
    linear-gradient(rgba(21, 35, 41, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 35, 41, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: rotate(-10deg) scale(1.12);
}

.main-road,
.side-road {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(21, 35, 41, 0.08);
}

.main-road {
  left: 7%;
  top: 51%;
  width: 86%;
  height: 20px;
  transform: rotate(-18deg);
}

.side-road.one {
  left: 16%;
  top: 19%;
  width: 70%;
  height: 15px;
  transform: rotate(32deg);
}

.side-road.two {
  left: 43%;
  top: 4%;
  width: 14px;
  height: 72%;
  transform: rotate(15deg);
}

.user-location {
  position: absolute;
  left: 45%;
  top: 54%;
  width: 24px;
  height: 24px;
  border: 5px solid white;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 12px rgba(63, 103, 168, 0.13), 0 8px 24px rgba(21, 35, 41, 0.24);
}

.pin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 4px solid white;
  border-radius: 50% 50% 50% 10px;
  background: var(--teal);
  color: white;
  font-size: 0.7rem;
  font-weight: 950;
  transform: rotate(-45deg);
  box-shadow: 0 12px 24px rgba(21, 35, 41, 0.22);
  transition: transform 160ms ease, opacity 160ms ease;
}

.pin span {
  transform: rotate(45deg);
}

.pin:hover {
  transform: rotate(-45deg) translateY(-4px) scale(1.04);
}

.map-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 0.82rem;
  backdrop-filter: blur(16px);
}

.map-card strong {
  color: var(--ink);
  text-align: right;
}

.insights {
  margin-top: 12px;
  border-radius: 20px;
  padding: 13px 14px;
}

.insights div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.insights p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.38;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(45, 122, 75, 0.35);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(45, 122, 75, 0);
  }
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.feed-header h2 {
  font-size: 1.12rem;
}

.feed-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.feed {
  display: grid;
  gap: 10px;
  padding: 10px 0 4px;
}

.place-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  border-radius: 22px;
  padding: 12px;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.place-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(21, 35, 41, 0.12);
}

.place-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: white;
  font-weight: 950;
}

.place-card h3 {
  font-size: 1rem;
  line-height: 1.15;
}

.place-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #eef3f1;
  color: #435159;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 850;
}

.badge.open {
  background: #e1f2e7;
  color: var(--green);
}

.badge.soon {
  background: #fff0d8;
  color: #8e5f06;
}

.badge.closed {
  background: #f2e5e2;
  color: #994435;
}

.score {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 0.86rem;
  font-weight: 950;
}

.strategy {
  max-width: 430px;
  border-radius: 30px;
  padding: 28px;
  box-shadow: 0 18px 60px rgba(21, 35, 41, 0.12);
}

.strategy h2 {
  margin-top: 8px;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 0.95;
}

.strategy p {
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.metrics div {
  border-radius: 18px;
  padding: 16px;
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  font-size: 1.45rem;
}

.metrics span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.drawer {
  width: min(92vw, 430px);
  border-radius: 28px;
  padding: 24px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.drawer::backdrop {
  background: rgba(21, 35, 41, 0.42);
  backdrop-filter: blur(5px);
}

.drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--ink);
  font-size: 1.35rem;
}

.drawer-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 21px;
  color: white;
  font-weight: 950;
}

.drawer-title {
  margin-top: 16px;
  padding-right: 34px;
  font-size: 1.55rem;
  line-height: 1.08;
}

.drawer-copy {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.drawer-actions button,
.primary-wide {
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  font-weight: 900;
}

.primary-action,
.primary-wide {
  background: var(--teal);
  color: white;
}

.secondary-action {
  background: #edf2f0;
  color: var(--ink);
}

.pref-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.pref-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
}

.pref-item strong,
.pref-item span {
  display: block;
}

.pref-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.pref-item input {
  width: 74px;
  accent-color: var(--teal);
}

.primary-wide {
  width: 100%;
  margin-top: 14px;
}

.secondary-wide {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

/* Auth form */
.auth-form {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.auth-field {
  display: grid;
  gap: 5px;
}

.auth-field span {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--muted);
}

.auth-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}

.auth-field input:focus {
  outline: 2px solid var(--teal);
  border-color: var(--teal);
}

.auth-error {
  color: #994435;
  font-size: 0.88rem;
  min-height: 1em;
}

/* Backend status badge */
.datetime {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.backend-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.backend-badge.live {
  background: #e1f2e7;
  color: #2d7a4b;
}

.backend-badge.demo {
  background: #f2e5e2;
  color: #994435;
}

@media (max-width: 880px) {
  .shell {
    display: block;
    padding: 0;
  }

  .app {
    width: 100%;
    height: 100vh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .strategy {
    display: none;
  }
}

@media (max-width: 390px) {
  .app {
    padding: 12px;
  }

  .context-row {
    grid-template-columns: 1fr;
  }

  .map-card {
    display: block;
  }

  .map-card strong {
    display: block;
    margin-top: 4px;
    text-align: left;
  }

  .place-card {
    grid-template-columns: 50px 1fr;
  }

  .score {
    grid-column: 2;
    justify-self: start;
    width: auto;
    height: auto;
    border-radius: 999px;
    padding: 5px 10px;
  }
}

/* Feed header right (toggle + count) */
.feed-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Map / list view toggle button */
.view-toggle-btn {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.2px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.view-toggle-btn:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

/* List-view mode: hide the map section */
.list-view #mapSection {
  display: none;
}

/* User feedback buttons row */
.feedback-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.feedback-btn {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.feedback-btn:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

.feedback-btn.feedback-active {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

.feedback-btn.feedback-danger:hover {
  background: #fdecea;
  border-color: var(--coral);
  color: var(--coral);
}

/* Visited badge on place cards */
.place-card.visited .place-name::after {
  content: " ✓";
  font-size: 0.75em;
  color: var(--green);
  font-weight: 900;
}

.place-card.visited {
  opacity: 0.72;
}

/* SOS / Emergency button in topbar */
.sos-btn {
  background: #fff1f0 !important;
  border-color: #f5c4bf !important;
  color: #993322 !important;
}

.sos-btn:hover {
  background: #fde8e6 !important;
  border-color: var(--coral) !important;
  color: var(--coral) !important;
}

/* Emergency drawer */
.emergency-drawer {
  max-width: 400px;
}

.sos-country {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.sos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.sos-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 16px 10px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--sos-color, #666) 10%, white);
  border: 1.5px solid color-mix(in srgb, var(--sos-color, #666) 30%, white);
  text-decoration: none;
  color: var(--sos-color, #333);
  transition: background 0.15s, transform 0.1s;
  cursor: pointer;
}

.sos-card:hover {
  background: color-mix(in srgb, var(--sos-color, #666) 18%, white);
  transform: scale(1.03);
}

.sos-card:active {
  transform: scale(0.97);
}

.sos-icon {
  font-size: 1.7rem;
  line-height: 1;
}

.sos-card strong {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.sos-number {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--sos-color, #333);
}

.sos-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 14px;
  padding: 8px 12px;
  background: var(--paper);
  border-radius: 10px;
}

.sos-actions {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.sos-actions .secondary-wide {
  margin-top: 0;
}

/* ── Personal contacts in SOS drawer ────────────────────────────────────── */
.my-contacts-section {
  margin-bottom: 4px;
}
.my-contacts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.my-contacts-title {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.add-contact-btn {
  background: var(--teal);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.add-contact-btn:hover { opacity: 0.85; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f7fcfb;
  border: 1px solid #d4eeeb;
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
}
.contact-call {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
}
.contact-call:hover { background: #e8f7f5; }
.contact-icon { font-size: 1.3rem; }
.contact-info { flex: 1; }
.contact-info strong { display: block; font-size: 0.92rem; }
.contact-info span { font-size: 0.8rem; color: var(--muted); }
.contact-call-icon { font-size: 1.1rem; opacity: 0.6; }
.contact-delete {
  background: none;
  border: none;
  color: #cc4444;
  font-size: 1.3rem;
  padding: 0 12px;
  cursor: pointer;
  opacity: 0.6;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.contact-delete:hover { opacity: 1; background: #fff0f0; }
.no-contacts-msg {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  padding: 8px 0 4px;
}
.add-contact-form {
  flex-direction: column;
  gap: 8px;
  background: #f7fcfb;
  border: 1px solid #d4eeeb;
  border-radius: 10px;
  padding: 12px;
  margin-top: 4px;
}
.add-contact-form input {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}
.add-contact-form input:focus { border-color: var(--teal); }
.add-contact-actions {
  display: flex;
  gap: 8px;
}
.primary-btn-sm {
  background: var(--teal);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 7px 18px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
}
.primary-btn-sm:hover { opacity: 0.85; }
.secondary-btn-sm {
  background: white;
  color: var(--muted);
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 7px 14px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}
.secondary-btn-sm:hover { border-color: #999; }
.sos-divider {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 14px 0;
}

/* ── Photo thumbnails on cards ──────────────────────────────────────────── */
.card-photo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--line);
}
.place-card.has-photo {
  align-items: flex-start;
  gap: 12px;
}
.card-body { flex: 1; min-width: 0; }
.drawer-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 12px;
  background: var(--line);
}

/* ── Vibe tags ──────────────────────────────────────────────────────────── */
.vibe-section { margin: 12px 0 4px; }
.vibe-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 6px;
}
.vibe-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vibe-chip {
  padding: 5px 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: white;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.12s;
}
.vibe-chip:hover { border-color: var(--teal); background: var(--teal-soft); }
.vibe-chip.active { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); font-weight: 700; }
.card-vibes { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0; }
.card-vibe-tag {
  font-size: 0.72rem;
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
}
.saved-badge { background: #fff8e1 !important; color: #bc861e !important; border-color: #ffe082 !important; }
.list-badge  { background: #f0f4ff !important; color: #3f67a8 !important; border-color: #c7d4f5 !important; }

/* ── Saved collections in drawer ────────────────────────────────────────── */
.save-to-list-section {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.save-to-list-toggle {
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f9f9f9;
}
.save-to-list-toggle::-webkit-details-marker { display: none; }
.save-to-list-section[open] .save-to-list-toggle { border-bottom: 1px solid var(--line); }
.collection-list { padding: 8px 14px; display: flex; flex-direction: column; gap: 4px; }
.collection-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 4px 0;
}
.collection-option input { accent-color: var(--teal); width: 16px; height: 16px; }
.no-lists-msg { font-size: 0.8rem; color: var(--muted); padding: 4px 0; margin: 0; }
.new-list-form {
  display: flex;
  gap: 8px;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--line);
}
.new-list-form input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.85rem;
  font-family: inherit;
}
.new-list-form input:focus { outline: none; border-color: var(--teal); }

/* Dark mode overrides for new elements */
body.dark .card-photo { background: #252f35; }
body.dark .drawer-photo { background: #252f35; }
body.dark .vibe-chip { background: #1c2529; border-color: #2e3d44; color: var(--ink); }
body.dark .vibe-chip.active { background: #0d2e2d; border-color: var(--teal); color: var(--teal); }
body.dark .save-to-list-toggle { background: #1c2529; }
body.dark .save-to-list-section { border-color: var(--line); }
body.dark .new-list-form input { background: #1c2529; border-color: #2e3d44; color: var(--ink); }

/* ── Swipe cards mode ───────────────────────────────────────────────────── */
.swipe-container {
  padding: 0 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.swipe-stack {
  position: relative;
  width: 100%;
  height: 400px;
  margin-bottom: 20px;
}
.swipe-card {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  will-change: transform;
}
.swipe-card:active { cursor: grabbing; }
.swipe-overlay {
  position: absolute;
  top: 24px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.06s;
  z-index: 10;
}
.like-overlay {
  left: 20px;
  background: rgba(45, 122, 75, 0.9);
  color: white;
  border: 3px solid #2d7a4b;
  transform: rotate(-12deg);
}
.nope-overlay {
  right: 20px;
  background: rgba(207, 89, 72, 0.9);
  color: white;
  border: 3px solid #cf5948;
  transform: rotate(12deg);
}
.swipe-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 18px 18px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  color: white;
}
.swipe-meta-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.swipe-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(4px);
}
.swipe-badge.open   { background: rgba(45,122,75,0.85); }
.swipe-badge.closed { background: rgba(207,89,72,0.85); }
.swipe-place-name {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 4px;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.swipe-place-sub {
  font-size: 0.85rem;
  margin: 0 0 8px;
  opacity: 0.85;
}
.swipe-vibes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.swipe-vibe {
  font-size: 0.72rem;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  padding: 3px 10px;
}
.swipe-actions {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 10px;
}
.swipe-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: white;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.12s, box-shadow 0.12s;
}
.swipe-btn:hover { transform: scale(1.12); box-shadow: 0 6px 18px rgba(0,0,0,0.15); }
.swipe-btn:active { transform: scale(0.96); }
.swipe-nope { color: #cf5948; border-color: #f4c0b8; font-size: 1.1rem; }
.swipe-nope:hover { background: #fff5f3; border-color: #cf5948; }
.swipe-info { color: var(--blue); border-color: #c7d4f5; font-size: 1rem; width: 44px; height: 44px; }
.swipe-info:hover { background: #f0f4ff; }
.swipe-like { color: #2d7a4b; border-color: #b2ddc4; font-size: 1.3rem; }
.swipe-like:hover { background: #f0faf4; border-color: #2d7a4b; }
.swipe-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 4px;
  text-align: center;
}
.swipe-counter {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  text-align: center;
}
.swipe-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--teal-soft);
  border-radius: 22px;
  color: var(--teal);
  text-align: center;
  padding: 24px;
}
.swipe-empty-icon { font-size: 3rem; }
.swipe-empty p { font-size: 1rem; font-weight: 600; margin: 0; }

/* Swipe toggle active state */
#swipeToggle.active { background: var(--teal) !important; color: white !important; border-color: var(--teal) !important; }

/* Dark mode */
body.dark .swipe-btn { background: #1c2529; border-color: #2e3d44; }
body.dark .swipe-nope:hover { background: #2a1a18; }
body.dark .swipe-info:hover { background: #1a2030; }
body.dark .swipe-like:hover { background: #162219; }
body.dark .swipe-empty { background: #0d2e2d; }

/* ── Mood discovery chips ───────────────────────────────────────────────── */
.mood-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 8px;
  scrollbar-width: none;
}
.mood-row:empty { display: none; }
.mood-row::-webkit-scrollbar { display: none; }
.mood-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: white;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.mood-chip:hover { border-color: var(--teal); background: var(--teal-soft); }
.mood-chip.active { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); font-weight: 700; }
.mood-emoji { font-size: 1.2rem; line-height: 1; }
.mood-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em; }

/* ── Share button ───────────────────────────────────────────────────────── */
.share-btn { min-width: auto !important; }

/* ── Dark toggle button ─────────────────────────────────────────────────── */
.dark-toggle-btn { font-size: 1rem !important; min-width: 36px; justify-content: center; }

/* ── Budget / dietary filter chips ─────────────────────────────────────── */
.filter-chips-row {
  display: flex;
  gap: 6px;
  padding: 0 16px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.filter-chips-row:empty { display: none; }
.filter-chips-row::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 5px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: white;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.13s;
  font-family: inherit;
}
.filter-chip:hover { border-color: var(--teal); background: var(--teal-soft); }
.filter-chip.active { background: var(--teal); color: white; border-color: var(--teal); }

/* ── Trending banner ────────────────────────────────────────────────────── */
.trending-strip {
  padding: 0 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.trending-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--coral);
}
.trending-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.trending-scroll::-webkit-scrollbar { display: none; }
.trending-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  background: white;
  border: 1.5px solid #ffe0d6;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
  font-family: inherit;
  transition: all 0.13s;
  min-width: 120px;
}
.trending-item:hover { border-color: var(--coral); background: #fff5f3; }
.trending-name { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.trending-meta { font-size: 0.72rem; color: var(--muted); }

/* ── Personal stats / My Journey ────────────────────────────────────────── */
.my-journey {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.journey-heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 10px;
}
.journey-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}
.journey-stat {
  background: var(--teal-soft);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}
.journey-stat strong { display: block; font-size: 1.1rem; font-weight: 900; color: var(--teal); }
.journey-stat span   { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.journey-fav {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}
.journey-fav strong { color: var(--ink); }
.journey-empty {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 16px 0 0;
  text-align: center;
  line-height: 1.5;
}

/* Dark mode */
body.dark .filter-chip { background: #1c2529; border-color: #2e3d44; color: var(--ink); }
body.dark .filter-chip.active { background: var(--teal); color: white; }
body.dark .trending-item { background: #1c2529; border-color: #3a2520; }
body.dark .trending-item:hover { background: #2a1a18; border-color: var(--coral); }
body.dark .journey-stat { background: #0d2e2d; }

/* ── Preferences redesign ───────────────────────────────────────────────── */
.pref-section {
  margin-bottom: 22px;
}
.pref-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 10px;
}
.pref-section-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 6px 0 0;
}

/* Priority cards */
.priority-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.priority-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: white;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.priority-card:hover { border-color: var(--teal); background: var(--teal-soft); }
.priority-card.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 2px var(--teal);
}
.priority-emoji { font-size: 1.4rem; line-height: 1; }
.priority-card strong { font-size: 0.85rem; color: var(--ink); }
.priority-desc { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }

/* Radius options */
.radius-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.radius-btn {
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: white;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
  font-family: inherit;
}
.radius-btn:hover { border-color: var(--teal); background: var(--teal-soft); }
.radius-btn.active { background: var(--teal); color: white; border-color: var(--teal); }

/* Lifestyle chips */
.lifestyle-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lifestyle-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: white;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.13s;
  font-family: inherit;
}
.lifestyle-chip:hover { border-color: var(--teal); background: var(--teal-soft); }
.lifestyle-chip.active {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 700;
}
.lifestyle-chip.active::after {
  content: "✓";
  margin-left: auto;
  font-weight: 900;
}

/* Mode preset row */
.mode-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mode-preset-btn {
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: white;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
  font-family: inherit;
}
.mode-preset-btn:hover { border-color: var(--teal); background: var(--teal-soft); }
.mode-preset-btn.active { background: var(--teal); color: white; border-color: var(--teal); }

/* Dark mode overrides */
body.dark .priority-card  { background: #1c2529; border-color: #2e3d44; }
body.dark .priority-card:hover,
body.dark .priority-card.active { background: #0d2e2d; border-color: var(--teal); }
body.dark .radius-btn,
body.dark .mode-preset-btn { background: #1c2529; border-color: #2e3d44; color: var(--ink); }
body.dark .radius-btn.active,
body.dark .mode-preset-btn.active { background: var(--teal); color: white; }
body.dark .lifestyle-chip { background: #1c2529; border-color: #2e3d44; color: var(--ink); }
body.dark .lifestyle-chip.active { background: #0d2e2d; border-color: var(--teal); color: var(--teal); }

/* ── Location picker dialog ─────────────────────────────────────────────── */
.location-picker-dialog {
  border: none;
  border-radius: 18px;
  padding: 28px 24px 24px;
  max-width: 420px;
  width: calc(100vw - 32px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
.location-picker-dialog::backdrop {
  background: rgba(0,0,0,0.35);
}
.loc-option-btn {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--teal);
  border-radius: 12px;
  background: #f0faf9;
  color: var(--teal);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.loc-option-btn:hover { background: #d9f3f0; }
.loc-or-divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin: 14px 0;
  position: relative;
}
.loc-or-divider::before,
.loc-or-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: #ddd;
}
.loc-or-divider::before { left: 0; }
.loc-or-divider::after  { right: 0; }
.address-search-form { display: flex; flex-direction: column; gap: 8px; }
.address-input-row {
  display: flex;
  align-items: center;
  position: relative;
}
.address-input-row input {
  flex: 1;
  border: 1.5px solid #ccc;
  border-radius: 10px;
  padding: 11px 40px 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}
.address-input-row input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,119,116,0.12); }
.addr-search-spinner {
  position: absolute;
  right: 12px;
  font-size: 0.9rem;
  animation: spin 1s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.address-search-error {
  font-size: 0.8rem;
  color: #c0392b;
  min-height: 1rem;
}
.address-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 2px;
}
.address-result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f7f7f7;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
  transition: background 0.12s;
  width: 100%;
}
.address-result-item:hover { background: #e8f7f5; border-color: var(--teal); }
.addr-icon { flex-shrink: 0; font-size: 1rem; margin-top: 2px; }
.addr-text { display: flex; flex-direction: column; gap: 1px; }
.addr-main { font-size: 0.88rem; font-weight: 600; color: #1a1a1a; }
.addr-sub  { font-size: 0.78rem; color: var(--muted); }
.addr-no-results { font-size: 0.82rem; color: var(--muted); text-align: center; padding: 8px 0; }

/* ── Admin panel ─────────────────────────────────────────────────────────── */
.admin-btn { background: #f0f4ff !important; border-color: #c7d4f5 !important; color: #2a3f8f !important; }
.admin-btn:hover { background: #dce6ff !important; border-color: #3f67a8 !important; }
.admin-drawer { max-width: 440px; }
.admin-loading { color: var(--muted); font-size: 0.9rem; }
.admin-error { color: var(--coral); font-size: 0.9rem; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.admin-stat { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.admin-stat strong { font-size: 1.4rem; font-weight: 900; color: var(--teal); }
.admin-stat span { font-size: 0.72rem; color: var(--muted); font-weight: 700; margin-top: 2px; }
.admin-section-title { font-size: 0.8rem; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin: 0 0 10px; }
.admin-user-list { display: grid; gap: 8px; }
.admin-user-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.admin-user-inactive { opacity: 0.55; }
.admin-user-info { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.admin-user-email { font-size: 0.82rem; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.admin-role-badge { font-size: 0.68rem; font-weight: 900; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.3px; }
.admin-role-admin { background: #e8f0fe; color: #1a5db5; }
.admin-role-user { background: var(--teal-soft); color: var(--teal); }
.admin-role-inactive { background: #fdecea; color: var(--coral); }
.admin-user-actions { display: flex; gap: 5px; flex-shrink: 0; }
.admin-action-btn { padding: 4px 10px; border-radius: 8px; font-size: 0.76rem; font-weight: 900; border: 1px solid var(--line); background: white; color: var(--muted); cursor: pointer; }
.admin-action-btn:hover { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.admin-delete-btn:hover { background: #fdecea; border-color: var(--coral); color: var(--coral); }
.admin-muted { font-size: 0.75rem; color: var(--muted); font-style: italic; }

/* ── Labelled topbar buttons (Kids, SOS, Sign in) ────────────────────────── */
.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.2px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.topbar-btn:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

/* ── Kid Mode toggle button ──────────────────────────────────────────────── */
.kid-toggle-btn {
  background: #fff8e1 !important;
  border-color: #ffe082 !important;
  color: #7a5500 !important;
}

.kid-toggle-btn:hover {
  background: #fff3cd !important;
  border-color: #f9a825 !important;
}

.kid-mode .kid-toggle-btn {
  background: #f9a825 !important;
  border-color: #e65100 !important;
  color: #fff !important;
}

/* ── Kid Mode app shell overrides ────────────────────────────────────────── */
.kid-mode {
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 200, 0, 0.18), transparent 22rem),
    radial-gradient(circle at 88% 20%, rgba(255, 100, 130, 0.14), transparent 20rem),
    radial-gradient(circle at 50% 90%, rgba(0, 180, 120, 0.12), transparent 18rem),
    linear-gradient(135deg, #fefce8, #fdf2f8 46%, #ecfdf5) !important;
  border-radius: 28px !important;
}

/* Bigger topbar title in kid mode */
.kid-mode .topbar h1 {
  font-size: 1.6rem;
  line-height: 1.2;
}

/* Hide complex controls kids don't need */
.kid-mode .mode-row,
.kid-mode .filter-btn {
  display: none;
}

/* Swipe mode — hide the list-only controls */
.swipe-mode .quick-actions,
.swipe-mode .mode-row,
.swipe-mode .filter-btn,
.swipe-mode .view-toggle-btn:not(#swipeToggle) {
  display: none;
}
.swipe-mode .feed-header h2::after {
  content: " — swipe to discover";
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

/* Keep location pill visible but simplify — hide walking/route pills */
.kid-mode .context-row .context-pill:not(:first-child) {
  display: none;
}

/* Make the location pill bigger and friendlier in kid mode */
.kid-mode #locationButton {
  font-size: 1rem;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--teal);
  color: white;
  font-weight: 900;
}

.kid-mode #locationButton:hover {
  background: #0a6360;
}

/* Bigger search box */
.kid-mode .search-panel {
  gap: 0;
}

.kid-mode .search-box input {
  font-size: 1.1rem;
  min-height: 52px;
  border-radius: 18px;
}

/* Kid category chips — big, colorful, spaced out */
.kid-chip {
  font-size: 1rem !important;
  padding: 10px 18px !important;
  min-height: 46px !important;
  border-radius: 999px !important;
  font-weight: 900 !important;
  gap: 6px !important;
}

.kid-chip:nth-child(1) { --chip-color: #6c5aa7; }
.kid-chip:nth-child(2) { --chip-color: #e07b20; }
.kid-chip:nth-child(3) { --chip-color: #2d7a4b; }
.kid-chip:nth-child(4) { --chip-color: #cf5948; }
.kid-chip:nth-child(5) { --chip-color: #3f67a8; }
.kid-chip:nth-child(6) { --chip-color: #9c27b0; }
.kid-chip:nth-child(7) { --chip-color: #1a8a6e; }

.kid-chip {
  background: color-mix(in srgb, var(--chip-color, var(--teal)) 12%, white) !important;
  border-color: color-mix(in srgb, var(--chip-color, var(--teal)) 35%, white) !important;
  color: var(--chip-color, var(--teal)) !important;
}

.kid-chip.active {
  background: var(--chip-color, var(--teal)) !important;
  border-color: var(--chip-color, var(--teal)) !important;
  color: white !important;
}

/* Kid quick-action buttons */
.kid-mode .quick-actions button {
  font-size: 1rem;
  padding: 10px 16px;
  min-height: 46px;
  border-radius: 14px;
  font-weight: 900;
  background: white;
  border: 2px solid var(--line);
}

.kid-mode .quick-actions button:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

/* Kid place cards */
.kid-card {
  padding: 16px !important;
  border-radius: 22px !important;
  gap: 14px !important;
  min-height: 80px !important;
  align-items: center !important;
}

.kid-place-icon {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  font-size: 1.3rem !important;
  border-radius: 18px !important;
}

.kid-place-name {
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  line-height: 1.3 !important;
}

.kid-dist {
  font-size: 0.9rem !important;
  color: var(--teal) !important;
  font-weight: 700 !important;
  margin: 3px 0 !important;
}

/* Sidebar in kid mode */
.kid-mode ~ .strategy .metrics {
  display: none;
}

/* Feed header in kid mode */
.kid-mode .feed-header h2 {
  font-size: 1.2rem;
}

/* ── Live tracking button ────────────────────────────────────────────────── */
#liveTrackBtn.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11, 119, 116, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(11, 119, 116, 0); }
}
#liveTrackBtn.active {
  animation: live-pulse 2s infinite;
}

/* ── Crowd / busy indicator badges ──────────────────────────────────────── */
.busy-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 600;
  border: none !important;
}
.busy-peak     { color: #e07b20 !important; background: rgba(224,123,32,0.13) !important; }
.busy-moderate { color: #bc861e !important; background: rgba(188,134,30,0.13) !important; }
.busy-quiet    { color: #2d7a4b !important; background: rgba(45,122,75,0.13)  !important; }

.swipe-busy { font-size: 0.7rem; }

/* ── App footer ─────────────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.app-footer a { color: var(--muted); text-decoration: underline; }
.app-footer a:hover { color: var(--teal); }
