/* Explore shell, nav, compare, policies, mobile-first markets */

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 10000;
  padding: 10px 14px;
  background: #fff;
  border-radius: 10px;
  font-weight: 700;
}
.skip-link:focus { left: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(251,248,242,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
}
.site-nav-brand {
  font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.site-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.site-nav-links a:hover { color: var(--ink); }

.explore-shell {
  margin-top: 8px;
}
.explore-toolbar {
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(246,242,234,.96));
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.search-wrap { position: relative; z-index: 5; }
.search-input {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 48px;
  border-radius: 14px !important;
  font-size: 16px;
  padding: 0 16px !important;
}
.explore-filters {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.explore-filters .map-select { min-height: 40px; }
.explore-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 12px;
  align-items: center;
}
.explore-meta-row .map-note { margin: 0; }

.explore-shell .map-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: start;
}
.explore-list-col {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 14px;
  min-height: 200px;
  max-height: 680px;
  overflow: auto;
  order: 1;
}
.list-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.list-head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -.02em;
}
.explore-list-col .map-region-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0;
}
.explore-list-col .region-pill {
  width: 100%;
  justify-content: space-between;
  border-radius: 12px;
  text-align: left;
  padding: 10px 12px;
}
.explore-list-col .region-pill.active {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.pill-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 8px;
}

.map-stage {
  order: 2;
  min-height: 0 !important;
  padding: 12px !important;
  border-radius: 18px;
}
#leaflet-map {
  width: 100%;
  height: 560px;
  border-radius: 14px;
  z-index: 1;
  position: relative;
  background: #e8e4dc;
}
.map-loading {
  position: absolute;
  inset: 12px;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(251,248,242,.88);
  font-weight: 700;
  color: var(--muted);
}
.map-loading.is-done { display: none; }

.trade-card {
  order: 3;
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 88px);
  overflow: auto;
}

.compare-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(31,95,74,.06);
  border: 1px solid var(--line);
  font-size: 13px;
}
.compare-tray .btn {
  padding: 6px 10px;
  font-size: 13px;
  min-height: 34px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(29,27,24,.92);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  max-width: min(92vw, 420px);
  text-align: center;
}
.toast[hidden] { display: none !important; }

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.panel-actions .btn {
  padding: 8px 12px;
  font-size: 13px;
  min-height: 36px;
}

.sample-badge.restored {
  color: #3d4f7a;
  background: #eaf0fb;
  border-color: #c9d6ef;
}

/* Compare / policies pages */
.explore-main { padding: 40px 0 80px; max-width: 1100px; }
.explore-main h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; margin: 8px 0 12px; }
.explore-main h2 { margin-top: 36px; font-size: 22px; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); }
.compare-picker label { display: block; font-weight: 700; margin-bottom: 8px; }
.compare-picker input[type="search"],
.map-controls input[type="search"] {
  width: 100%;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 15px;
  background: #fff;
}
.suggest-list {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  max-width: 100%;
  max-height: 260px;
  overflow: auto;
  box-shadow: var(--shadow);
}
.suggest-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.suggest-list button:hover,
.suggest-list button:focus {
  background: rgba(31,95,74,.06);
  outline: none;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
}
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 24px; }
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.compare-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.compare-card h3 { margin: 8px 0; font-size: 22px; }
.compare-card dl { margin: 0; display: grid; gap: 8px; }
.compare-card dt { font-size: 12px; color: var(--muted); }
.compare-card dd { margin: 0; font-weight: 700; }
.empty-box, .peer-box, .warn-box, .result-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.warn-box { background: #fff7ea; border-color: #f0dfb8; color: #5c4a22; }
.result-box strong { display: block; font-size: 20px; margin-bottom: 8px; }
.peer-box h3 { margin-top: 0; font-size: 16px; }
.card-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.link-card {
  display: block;
  padding: 18px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.link-card strong { display: block; margin-bottom: 8px; font-size: 17px; }
.link-card span { color: var(--muted); font-size: 14px; }
.policy-list { display: grid; gap: 14px; }
.policy-item {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.policy-item h3 { margin: 6px 0 8px; }
.steps { display: grid; gap: 16px; margin-top: 20px; }
.step-card {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.step-card h3 { margin: 0 0 8px; font-size: 17px; }
.option-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.option-row label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}
.timeline { display: grid; gap: 0; border-left: 3px solid rgba(31,95,74,.25); margin-left: 8px; }
.tl-item { position: relative; padding: 0 0 24px 20px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(31,95,74,.12);
}
.tl-item.review_required::before { background: var(--accent-2); }
.tl-date { font-size: 13px; color: var(--muted); font-weight: 700; }
.tl-item h3 { margin: 4px 0 8px; font-size: 18px; }

/* Mobile: search/list/panel first, map second */
@media (max-width: 1100px) {
  .explore-shell .map-layout {
    grid-template-columns: 1fr;
  }
  .explore-list-col { order: 1; max-height: 280px; }
  .trade-card {
    order: 2;
    position: static;
    max-height: none;
  }
  .map-stage { order: 3; }
  #leaflet-map { height: 380px; }
  .site-nav-brand { font-size: 14px; }
  .site-nav-links { font-size: 13px; gap: 6px 10px; }
}

@media (max-width: 720px) {
  .explore-toolbar { padding: 14px; border-radius: 16px; }
  .search-input { font-size: 16px; }
  .site-nav-inner { min-height: 48px; }
  .compare-tray {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: rgba(251,248,242,.96);
    backdrop-filter: blur(8px);
  }
  #leaflet-map { height: 320px; }
}
