/* ---------- Sidebar ---------- */

#sheetHandle { display: none; }   /* only the mobile bottom sheet shows a drag grabber */

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--line);
  z-index: 1100;   /* above Leaflet's controls (z 1000) so the attribution never paints over the sheet */
  touch-action: pan-y;   /* vertical scroll only — no pinch-zoom into the panel */
}

.brand {
  /* extra top padding clears the iOS status bar / notch in standalone PWA mode */
  padding: calc(22px + env(safe-area-inset-top)) 20px 14px;
  background: linear-gradient(135deg, #fff1ee 0%, #ffe3e6 100%);
  border-bottom: 1px solid var(--line);
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.brand h1 span { color: var(--accent); }
.brand h1 em { font-style: normal; font-size: 22px; }

.brand p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* Hidden until renderTagline() sets the final text, so the HTML default never
   flashes before the random pick. Space stays reserved (no layout jump). */
#brandTagline { visibility: hidden; }

#accountBar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 0;
}

#accountBar[hidden] { display: none; }

#accountBar .acct-email {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

#accountBar .wide { width: 100%; }

#accountBar { flex-wrap: wrap; }

.map-switcher {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-soft);
  cursor: pointer;
  outline: none;
}

.map-switcher:focus { border-color: var(--accent); }

.searchbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 6px;
}

.searchbox-icon {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
  opacity: 0.6;
}

.searchbox input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px 8px 36px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  outline: none;
  background: var(--bg-soft);
  transition: border-color 0.15s;
}

.searchbox input:focus { border-color: var(--accent); background: #fff; }

.searchbox .chip-manage {
  flex: 0 0 auto;
  margin: 0;
}

/* One always-single-row chip strip: scrolls horizontally instead of wrapping,
   so filters never eat more than ~45px of sidebar height. */
#chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;             /* Firefox */
}

#chips::-webkit-scrollbar { display: none; }

/* Edge fades hint that there are more chips off-screen */
#chips.fade-right {
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}

#chips.fade-left {
  mask-image: linear-gradient(to right, transparent, #000 28px);
}

#chips.fade-left.fade-right {
  mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}

.chip {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}

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

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Place list ---------- */

#placeList {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

#placeList .empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

#placeList .empty strong { color: var(--ink); }

.place-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
}

.place-item:hover { background: var(--bg-soft); }

.place-item .dot {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: inset 0 0 0 2.5px rgba(255, 255, 255, 0.55);
}

.place-item .meta { min-width: 0; }

.place-item .meta strong {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-item .meta strong .fav { color: var(--accent); margin-left: 4px; }

.place-item .sub {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-item .sub .rating { color: #f5a623; letter-spacing: 1px; }

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 700;
}

.io { display: flex; gap: 6px; }

.build-info {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
  opacity: 0.7;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

button { font-family: inherit; }

.ghost {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}

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

.primary {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}

.primary:hover { background: var(--accent-dark); }

.danger {
  border: 1.5px solid #fecaca;
  background: #fff;
  color: #dc2626;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.danger:hover { background: #fef2f2; }

