* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Cabin', sans-serif; display: flex; height: 100vh; color: #111; }

/* ── Sidebar ── */
#sidebar {
  width: 340px; min-width: 340px; background: #fff;
  display: flex; flex-direction: column; border-right: 2px solid #2f5d50;
}
.sidebar-header { padding: 11px 20px 12px; background: #2f5d50; color: #fff; }
.header-top { display: flex; align-items: center; gap: 8px; position: relative; }
.header-top h1 {
  flex: 1; font-family: 'Lato', sans-serif; font-size: 21px; font-weight: 900;
  letter-spacing: 0.3px;
}
.burger {
  flex-shrink: 0; width: 32px; height: 30px; border: none; border-radius: 6px; cursor: pointer;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 17px; line-height: 1;
}
.burger:hover { background: rgba(255,255,255,0.3); }
.burger-menu {
  display: none; position: absolute; top: 36px; right: 0; z-index: 20; min-width: 190px;
  background: #fff; border-radius: 8px; box-shadow: 0 3px 14px rgba(0,0,0,0.28); overflow: hidden;
}
.burger-menu.open { display: block; }
.burger-menu a {
  display: block; padding: 10px 14px; color: #234; text-decoration: none;
  font-size: 13.5px; font-weight: 700; border-bottom: 1px solid #f0f0f0;
}
.burger-menu a:last-child { border-bottom: none; }
.burger-menu a:hover { background: #f2f7f5; }
.burger-menu a.current { color: #2f5d50; background: #eef4f1; }
.burger-menu a .bm-sub { display: block; font-weight: 500; font-size: 11px; color: #999; margin-top: 1px; }
.sidebar-header .subtitle { font-size: 12px; color: rgba(255,255,255,0.8); line-height: 1.4; margin-top: 2px; }
.progress { margin-top: 9px; }
.progress-bar { height: 8px; background: rgba(255,255,255,0.18); border-radius: 4px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: #9fe0c4; border-radius: 4px; transition: width .4s; }
.progress-label { font-size: 12px; color: rgba(255,255,255,0.9); margin-top: 6px; }
.progress-label b { font-family: 'Lato', sans-serif; font-weight: 900; font-size: 15px; color: #fff; }

/* ── Search + order toggle (one line) ── */
.searchbar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #e6e6e6; }
.searchbar input {
  flex: 1; min-width: 0; padding: 9px 12px; font-family: 'Cabin', sans-serif; font-size: 14px;
  border: 1.5px solid #cfdad6; border-radius: 8px; outline: none;
}
.searchbar input:focus { border-color: #2f5d50; }
.order-toggle { display: flex; flex-shrink: 0; border: 1.5px solid #2f5d50; border-radius: 7px; overflow: hidden; }
.order-toggle button {
  padding: 7px 9px; font-family: 'Cabin', sans-serif; font-size: 11px; font-weight: 600;
  border: none; background: #fff; color: #2f5d50; cursor: pointer; white-space: nowrap;
}
.order-toggle button + button { border-left: 1px solid #cfe0da; }
.order-toggle button.active { background: #2f5d50; color: #fff; }

/* Spreadsheet download — last item in the burger menu, under the catalogues. */
.bm-export { border-top: 1px solid #e6e6e6; color: #2f5d50 !important; font-weight: 700; }

/* ── "can't reach the log" banner (no baked history to fall back on) ── */
.logerror { padding: 10px 14px; background: #fdf0ee; border-bottom: 1px solid #f0cfc9; color: #8c3327; font-size: 12px; line-height: 1.5; }
.logerror b { display: block; margin-bottom: 2px; }
.logerror button { margin-top: 7px; padding: 5px 12px; border: 1.5px solid #c4534a; border-radius: 6px; background: #fff; color: #b3382f; font: 700 12px 'Cabin', sans-serif; cursor: pointer; }
.logerror button:hover:not(:disabled) { background: #f7e3e0; }
.logerror button:disabled { opacity: .6; cursor: default; }

/* ── Fell list ── */
.fell-list { flex: 1; overflow-y: auto; }
.book-header {
  padding: 7px 20px; font-family: 'Lato', sans-serif; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: #2f5d50;
  background: #f0f5f3; border-bottom: 1px solid #e2ede9; position: sticky; top: 0; z-index: 1;
}
.fell-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 18px; cursor: pointer;
  border-bottom: 1px solid #f3f3f3;
}
.fell-row:hover { background: #f6faf8; }
.fell-row .fr-no { font-size: 11px; color: #b0b0b0; font-variant-numeric: tabular-nums; width: 30px; text-align: right; flex-shrink: 0; }
.fell-row .fr-shape { width: 16px; height: 16px; flex-shrink: 0; }
.fell-row .fr-name { flex: 1; font-size: 13.5px; font-weight: 600; color: #222; min-width: 0; }
.fell-row .fr-alt { font-size: 11.5px; color: #999; font-variant-numeric: tabular-nums; }
.fell-row.undone .fr-name { color: #9a9a9a; font-weight: 500; }
.no-results { padding: 24px 20px; text-align: center; color: #999; font-size: 13px; }

#map { flex: 1; }

/* ── Hover name label ── */
#tip {
  position: fixed; z-index: 10; display: none; pointer-events: none; white-space: nowrap;
  background: rgba(30,40,36,0.95); color: #fff; padding: 4px 8px; border-radius: 5px;
  font: 600 12.5px 'Cabin', sans-serif; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Top-left map control box (over the map) ── */
.map-ctl {
  background: rgba(255,255,255,0.97); border-radius: 8px; box-shadow: 0 1px 5px rgba(0,0,0,0.28);
  margin: 10px; padding: 8px 10px; font-family: 'Cabin', sans-serif; font-size: 13px;
  display: flex; flex-direction: column; gap: 7px;
}
.map-ctl button {
  font-family: 'Cabin', sans-serif; font-size: 12px; font-weight: 600; color: #2f5d50;
  background: #eef4f1; border: none; padding: 7px 10px; border-radius: 6px; cursor: pointer;
  text-transform: uppercase; letter-spacing: .4px;
}
.map-ctl button:hover { background: #e0ece7; }
.map-ctl label { display: flex; align-items: center; gap: 6px; color: #444; cursor: pointer; }
.map-ctl label input { cursor: pointer; }

/* Show: Bagged | Not | All */
.show-toggle { display: flex; align-items: center; gap: 6px; }
.show-toggle .show-label { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .5px; }
.map-ctl .show-toggle button { padding: 5px 9px; border-radius: 0; background: #fff; border: 1px solid #cfe0da; color: #2f5d50; }
.map-ctl .show-toggle button:first-of-type { border-radius: 6px 0 0 6px; }
.map-ctl .show-toggle button:last-of-type { border-radius: 0 6px 6px 0; }
.map-ctl .show-toggle button + button { border-left: none; }
.map-ctl .show-toggle button:hover { background: #eef4f1; }
.map-ctl .show-toggle button.active { background: #2f5d50; color: #fff; border-color: #2f5d50; }

/* ── Top-right display panel ── */
#panel {
  position: fixed; top: 12px; right: 12px; z-index: 5; width: 208px;
  background: rgba(255,255,255,0.97); border-radius: 10px; padding: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18); font-size: 12.5px;
}
#panel .panel-title {
  font-family: 'Lato', sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: #2f5d50; margin-bottom: 8px;
}
.segmented { display: flex; border: 1.5px solid #2f5d50; border-radius: 7px; overflow: hidden; margin-bottom: 10px; }
.segmented button {
  flex: 1; padding: 6px 4px; font-family: 'Cabin', sans-serif; font-size: 11.5px; font-weight: 600;
  border: none; background: #fff; color: #2f5d50; cursor: pointer;
}
.segmented button + button { border-left: 1px solid #cfe0da; }
.segmented button.active { background: #2f5d50; color: #fff; }

.panel-section { margin-top: 4px; }
.panel-section h4 {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: #999; margin: 8px 0 6px;
}
.legend-row, .filter-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px; }
.legend-row .lg-swatch { width: 14px; height: 14px; flex-shrink: 0; }
.filter-row { cursor: pointer; user-select: none; }
.filter-row input { cursor: pointer; }
.filter-row .fl-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.filter-row .fl-count { margin-left: auto; color: #aaa; font-size: 11.5px; }
.filter-row.off { opacity: .45; }
.panel-note { font-size: 10.5px; color: #999; line-height: 1.4; margin-top: 8px; }

/* ── Info window ── */
/* Cap the height so a summit with a long log still fits on screen (Google's
   auto-pan can't rescue a bubble taller than the map) — it scrolls instead. */
.iw { font-family: 'Cabin', sans-serif; font-size: 13px; line-height: 1.55; max-width: 300px; max-height: min(56vh, 420px); overflow-y: auto; padding-right: 4px; }
.iw h3 { margin: 0; font-family: 'Lato', sans-serif; font-size: 17px; font-weight: 900; color: #111; }
.iw .iw-sub { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .5px; margin: 2px 0 8px; }
.iw .iw-sub b { color: #2f5d50; }
.iw .iw-people { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.iw .iw-p { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.iw .iw-p .dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.iw .iw-p .who { font-weight: 700; min-width: 62px; }
.iw .iw-p .when { color: #555; }
.iw .iw-p.not .who, .iw .iw-p.not .when { color: #bbb; font-weight: 500; }
.iw .iw-p.tentative .when { color: #c57a1a; font-style: italic; }
.iw .iw-notes { font-size: 12px; color: #555; background: #f6f8f7; padding: 7px 9px; border-radius: 6px; margin: 8px 0; }
.iw .iw-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.iw .iw-link {
  display: inline-block; padding: 7px 12px; background: #2f5d50; color: #fff; text-decoration: none;
  border-radius: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
}
.iw .iw-link:hover { background: #26493f; }
.iw .iw-link--strava { background: #fc4c02; }
.iw .iw-link--strava:hover { background: #d94002; }
.iw .iw-link--ghost { background: #e8efec; color: #2f5d50; }
.iw .iw-link--ghost:hover { background: #dbe6e1; }

/* info-window ascent editor */
.iw-edit { border-top: 1px solid #eee; margin-top: 10px; padding-top: 9px; }
.iw .iw-p .iw-strava { color: #fc4c02; font-size: 11px; text-decoration: none; font-weight: 600; }
.iw .iw-p .iw-del { margin-left: auto; border: none; background: #f4dede; color: #b3382f; width: 18px; height: 18px; border-radius: 9px; cursor: pointer; font-size: 13px; line-height: 1; flex-shrink: 0; }
.iw .iw-p .iw-del:hover { background: #ecc9c9; }
.iw-form-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #2f5d50; margin-bottom: 6px; }
.iw-form-people { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 7px; }
.iw-chk { font-size: 12px; display: flex; align-items: center; gap: 3px; cursor: pointer; accent-color: var(--pc); }
.iw-in { width: 100%; margin-bottom: 5px; padding: 6px 8px; font: 13px 'Cabin', sans-serif; border: 1.5px solid #cfdad6; border-radius: 6px; }
.iw-in:focus { outline: none; border-color: #2f5d50; }
.iw-save { width: 100%; padding: 8px; border: none; border-radius: 6px; background: #2f5d50; color: #fff; font: 700 12px 'Cabin', sans-serif; text-transform: uppercase; letter-spacing: .4px; cursor: pointer; }
.iw-save:hover { background: #26493f; }
.iw-save:disabled { opacity: .6; cursor: default; }
