:root {
  --ink: #0c1222;
  --ink-soft: #3d4a63;
  --surface: #f6f7f9;
  --white: #fff;
  --accent: #1a6b5c;
  --accent-light: #e8f4f1;
  --line: #dde3ec;
  --navy: #082f46;
  --brand-teal: #159a84;
  --header-h: 96px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.55;
  font-size: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body[data-page="methane-viewer"] {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
body[data-page="methane-viewer"] header {
  position: relative;
  flex-shrink: 0;
}
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(246, 247, 249, 0.94);
  border-bottom: 1px solid var(--line);
}
header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
  position: relative;
}
.logo img {
  height: 72px;
  width: auto;
  aspect-ratio: 1515 / 445;
  display: block;
}
nav ul { list-style: none; display: flex; gap: 1.25rem; flex-wrap: wrap; }
nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
nav a:hover, nav a[aria-current="page"] { color: var(--accent); }
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.menu-toggle-bars {
  display: block;
  width: 18px;
  height: 12px;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 5px / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 10px / 100% 2px no-repeat;
}
.lang-toggle { margin-left: auto; display: flex; gap: 0.25rem; align-items: center; flex-shrink: 0; }
.lang-btn {
  padding: 0.38rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.lang-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.lang-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.wrap { max-width: 1480px; margin: 0 auto; padding: 0 1.5rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.viewer-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  transition: grid-template-columns 0.22s ease;
}
.viewer-shell.is-sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}
.viewer-shell.is-sidebar-collapsed .sidebar {
  overflow: hidden;
  padding: 0;
  border: 0;
  visibility: hidden;
  pointer-events: none;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--white);
  overflow: auto;
  padding: 0.85rem 0.9rem 1.2rem;
  min-height: 0;
  font-size: 0.78rem;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
}
.sidebar-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--navy);
  line-height: 1.25;
}
.sidebar-close {
  display: none;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.sidebar h2 {
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--navy);
  margin: 0;
  font-weight: 700;
}
.sidebar-lead {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 0 0 0.85rem;
}
.sidebar-h {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0.15rem 0 0.45rem;
  letter-spacing: 0;
  text-transform: none;
}
.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.28rem;
}
.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--white);
}
.seg-btn {
  flex: 1 1 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.42rem 0.3rem;
  cursor: pointer;
  min-height: 36px;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn.is-on {
  background: var(--navy);
  color: #fff;
}
.seg-btn:hover:not(.is-on) { background: var(--accent-light); color: var(--navy); }
.date-pair { margin-top: 0.45rem; }
.source-hint {
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin: 0.28rem 0 0;
  line-height: 1.35;
  min-height: 0;
}
.source-hint:empty { display: none; }
.cluster-hint {
  font-size: 0.72rem;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0.1rem 0 0.65rem;
  padding: 0.5rem 0.6rem;
  background: var(--surface);
  border-radius: 6px;
}
.advanced {
  margin: 0.2rem 0 0.7rem;
  border-top: 1px solid var(--line);
  padding-top: 0.35rem;
}
.advanced summary {
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.35rem 0;
  list-style: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before {
  content: "▸ ";
  font-size: 0.7rem;
}
.advanced[open] summary::before { content: "▾ "; }
.obs-layers {
  margin: 0.55rem 0 0.2rem;
  padding: 0.45rem 0.5rem 0.2rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}
.obs-layers .sidebar-h { color: #d7e0ea; margin-bottom: 0.2rem; }
.obs-layers .check { color: #e8f0f5; margin: 0.32rem 0; }
.obs-layers small {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: #9db0c0;
  margin-top: 0.08rem;
}
.check small {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 0.08rem;
}
.filters-fab {
  display: none;
}
.drawer-backdrop {
  display: none;
}
.field { margin-bottom: 0.6rem; }
.field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.22rem;
}
.field input[type="date"],
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.38rem 0.5rem;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink);
  background: var(--white);
}
.check {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  font-size: 0.75rem;
  color: var(--ink);
  margin: 0.38rem 0;
  line-height: 1.35;
}
.check[hidden] { display: none !important; }
.check input { margin-top: 0.12rem; }
.hint { font-size: 0.72rem; color: var(--ink-soft); margin: 0.3rem 0 0.65rem; }
.btn {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.sidebar .btn {
  font-size: 0.72rem;
  padding: 0.4rem 0.65rem;
}
.btn:hover { background: #145a4d; }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-light); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.7rem 0 1rem; }
.map-stage {
  position: relative;
  min-height: 0;
  height: 100%;
}
#map {
  min-height: 0;
  height: 100%;
  background: #d5dcd5;
}
.leaflet-top {
  z-index: 600;
}
.leaflet-container { font-family: "DM Sans", system-ui, sans-serif; background: #d5dcd5; }
.gk-basemap-switch {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: max-content;
  min-width: 34px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  margin-top: 10px;
}
.gk-basemap-switch button {
  border: 0;
  background: #fff;
  color: #082f46;
  font: 600 0.72rem/1 "DM Sans", system-ui, sans-serif;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid #ccc;
  white-space: nowrap;
}
.gk-basemap-switch button:last-child { border-bottom: 0; }
.gk-basemap-switch button.is-on {
  background: #082f46;
  color: #fff;
}
.gk-basemap-switch button:hover:not(.is-on) {
  background: #f4f4f4;
}
.methane-enhancement {
  mix-blend-mode: multiply;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#map.gk-basemap-satellite .methane-enhancement {
  mix-blend-mode: screen;
}
.tropomi-xch4 {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  mix-blend-mode: normal;
}
.colorbar.xch4bar,
.methane-legend .colorbar.xch4bar {
  background: linear-gradient(to right, #081d58, #1e6089, #2e977f, #e8c547, #fcfdbf);
}
.gk-unavailable {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0.55rem 0 0.35rem;
  line-height: 1.4;
}
.leaflet-bottom.leaflet-right {
  max-width: calc(100% - 210px);
}
.cluster-legend {
  position: absolute;
  left: 12px;
  bottom: 14px;
  z-index: 641;
  background: rgba(8, 47, 70, 0.92);
  color: #fff;
  padding: 0.5rem 0.75rem 0.55rem;
  border-radius: 8px;
  min-width: 168px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.cluster-legend-title {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9db0c0;
  margin: 0 0 0.38rem;
}
.cluster-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.28rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  cursor: pointer;
}
.cluster-legend-item input {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #159a84;
  cursor: pointer;
}
.cluster-legend .key-emit,
.cluster-legend .key-tropomi {
  display: inline-block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}
body.gk-focus-mode .cluster-legend { display: none; }
.sidebar-toggle {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 660;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.14);
  transform: translateY(-50%);
}
.sidebar-toggle:hover { background: var(--accent-light); color: var(--accent); }
.viewer-shell.is-sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.methane-legend {
  position: absolute;
  right: 12px;
  bottom: 44px;
  z-index: 640;
  background: rgba(8, 47, 70, 0.88);
  color: #fff;
  padding: 0.55rem 0.7rem 0.6rem;
  border-radius: 8px;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.methane-legend[hidden],
.methane-legend.is-empty {
  display: none !important;
}
body.gk-focus-mode .methane-legend {
  right: 388px;
}
.methane-legend .colorbar {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(to right, #0d0887, #6a00a8, #b12a90, #e16462, #fca636, #f0f921);
  margin-bottom: 0.3rem;
}
.methane-legend .colorbar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}
.methane-legend .leg-title {
  font-size: 0.72rem;
  line-height: 1.35;
  margin: 0;
  color: #d7e0ea;
}
.raster-preview { margin: 0.7rem 0 0.35rem; }
.raster-preview img {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  background: #0b1220;
  border-radius: 6px;
  image-rendering: pixelated;
}
.gk-emit-cluster { background: rgba(21, 154, 132, 0.32); }
.gk-emit-cluster div {
  background: #159a84;
  color: #fff;
  font-weight: 600;
}
.gk-tropomi-cluster { background: rgba(232, 163, 23, 0.35); }
.gk-tropomi-cluster div {
  background: #e8a317;
  border: none;
  color: #082f46;
  font-weight: 700;
}
.gk-popup .leaflet-popup-content-wrapper {
  background: #082f46;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  padding: 0;
}
.gk-popup .leaflet-popup-content {
  margin: 0.55rem 0.75rem 0.6rem;
  min-width: 200px;
}
.gk-popup .leaflet-popup-tip { background: #082f46; }
.gk-popup a.leaflet-popup-close-button { color: #d7e0ea; }
.gk-popup a.leaflet-popup-close-button:hover { color: #f0f921; }
.gk-pop-kicker {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #159a84;
  margin: 0 0 0.4rem;
}
.gk-pop dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.22rem 0.7rem;
  align-items: baseline;
}
.gk-pop dt {
  font-size: 0.65rem;
  font-weight: 600;
  color: #9db0c0;
  margin: 0;
}
.gk-pop dd {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
}
.detail {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  margin-top: 0.4rem;
}
.detail h3 {
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}
.kv { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.kv th {
  text-align: left;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0.28rem 0.5rem 0.28rem 0;
  vertical-align: top;
  width: 42%;
}
.kv td { padding: 0.28rem 0; color: var(--ink); word-break: break-word; }
.kv a { color: var(--accent); font-weight: 600; text-decoration: none; }
.origin-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.docs { padding: 1.1rem 0 1.4rem; }
body[data-page="methane-viewer"] .docs,
body[data-page="methane-viewer"] footer.wrap { display: none; }
.docs p { color: var(--ink-soft); font-size: 0.88rem; }
.docs a { color: var(--accent); font-weight: 600; text-decoration: none; }
.disclaimer {
  background: var(--accent-light);
  border: 1px solid #c5e5dd;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin: 0 0 0.7rem;
}
.docs .notes { max-width: 58rem; margin: 0; line-height: 1.5; }
.contact-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 0 0;
}
footer.wrap {
  padding: 1.4rem 1.5rem 1.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
footer a { color: var(--accent); text-decoration: none; margin-left: 1rem; }
.mobile-toggle { display: none; }
.status-banner {
  font-size: 0.8rem;
  color: var(--ink-soft);
  background: #fff8e8;
  border: 1px solid #ead8a6;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.8rem;
}
.status-banner[hidden] { display: none; }
.layer-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin: 0.35rem 0 0.7rem;
}
.layer-key span { display: inline-flex; align-items: center; gap: 0.35rem; }
.layer-key i {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}
.cluster-key { margin: 0.55rem 0 0.35rem; }
.key-emit { background: #159a84; border-radius: 50%; border: 1px solid #0e6e5e; }
.key-tropomi {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e8a317;
  border: 1px solid #c4840c;
}
.layer-heading {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0.7rem 0 0.28rem;
  font-weight: 600;
}
.gk-pop-rate {
  font-size: 0.84rem;
  font-weight: 600;
  color: #d7e0ea;
  margin: 0 0 0.55rem;
  line-height: 1.35;
}
.gk-pop-rate strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.15rem;
}
.gk-pop-caution {
  font-size: 0.72rem;
  font-weight: 500;
  color: #f0d9a8;
  margin: 0.55rem 0 0.35rem;
  line-height: 1.4;
}
.gk-method {
  margin: 0.35rem 0 0;
}
.gk-method summary {
  font-size: 0.7rem;
  font-weight: 600;
  color: #9db0c0;
  cursor: pointer;
}
.gk-method p {
  font-size: 0.7rem;
  font-weight: 400;
  color: #c5d2dc;
  margin: 0.35rem 0 0;
  line-height: 1.4;
}
.detail .gk-pop-caution { color: #8a6a20; }
.detail .gk-method summary { color: var(--ink-soft); }
.detail .gk-method p { color: var(--ink-soft); }
.methane-legend .leg-class {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.72rem;
  line-height: 1.3;
  margin: 0 0 0.4rem;
  color: #fff;
}
.methane-legend .leg-emit {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f89441;
  border: 1px solid #cc4778;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.methane-legend .leg-tropomi {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid #8eb9b2;
  background: transparent;
  flex-shrink: 0;
  margin-top: 0.12rem;
}
#licence-panel {
  width: min(36rem, calc(100vw - 2rem));
  max-height: min(70vh, 32rem);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem 1.2rem;
}
#licence-panel h2 { font-size: 1.05rem; margin: 0 0 0.7rem; }
#licence-panel h3 { font-size: 0.82rem; margin: 0.85rem 0 0.25rem; color: var(--accent); }
#licence-panel p { font-size: 0.8rem; color: var(--ink-soft); }
#licence-panel form { display: flex; justify-content: flex-end; }
#licence-panel a { color: var(--accent); font-weight: 600; }
@media (max-width: 1100px) {
  header { overflow: visible; }
  .nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }
  .logo { max-width: 100%; min-width: 0; }
  .logo img { max-width: 100%; }
  .lang-toggle { margin-left: 0; }
  .menu-toggle { padding: 0.35rem; justify-self: end; }
  .menu-toggle [data-i18n="nav.menu"] { display: none; }
  header nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #f6f7f9;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 28px rgba(12, 18, 34, 0.12);
    z-index: 1100;
  }
  header.nav-open nav { display: block; }
  header nav ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.35rem 1rem 0.9rem;
  }
  header nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.7rem 0.2rem;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  header nav li:last-child a { border-bottom: 0; }
}
@media (min-width: 1101px) {
  .menu-toggle { display: none; }
}
@media (max-width: 900px) {
  .logo img { height: 36px; max-width: calc(100vw - 168px); }
  .lang-toggle { margin-left: auto; }
  .lang-btn { min-height: 44px; min-width: 44px; }
  body[data-page="methane-viewer"] .nav {
    padding: 0.28rem 0.7rem;
    gap: 0.4rem;
    flex-wrap: nowrap;
  }
  .viewer-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    position: relative;
  }
  .viewer-shell.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .viewer-shell.is-sidebar-collapsed .sidebar {
    overflow: auto;
    padding: 0.85rem 0.9rem 1.2rem;
    border-right: 1px solid var(--line);
    visibility: visible;
    pointer-events: auto;
  }
  .sidebar-toggle { display: none; }
  .leaflet-bottom.leaflet-right {
    max-width: 100%;
  }
  .cluster-legend {
    left: 10px;
    bottom: calc(58px + env(safe-area-inset-bottom));
    min-width: 0;
    padding: 0.42rem 0.58rem 0.45rem;
  }
  .cluster-legend-title { margin-bottom: 0.28rem; }
  .cluster-legend-item { font-size: 0.72rem; }
  .filters-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 620;
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    border: 0;
    border-radius: 8px;
    background: #082f46;
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  }
  body.gk-focus-mode .filters-fab { display: none; }
  .drawer-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(8, 15, 24, 0.45);
    z-index: 700;
  }
  .drawer-backdrop.is-on { display: block; }
  .sidebar {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(340px, 88vw);
    z-index: 720;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--line);
    max-height: none;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.28);
  }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  #map { min-height: 0; height: 100%; }
  .nav { padding: 0.45rem 0.75rem; }
  .wrap { padding: 0 1rem; }
  .leaflet-control-attribution {
    margin-bottom: env(safe-area-inset-bottom);
  }
}
.focus-back {
  position: absolute;
  top: 12px;
  left: 52px;
  z-index: 650;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.48rem 0.75rem 0.48rem 0.45rem;
  border: 0;
  border-radius: 8px;
  background: #082f46;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.sheet-handle { display: none; }
.focus-back[hidden] { display: none; }
.focus-back:hover { background: #0d4564; }
.focus-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 650;
  width: min(360px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  background: #082f46;
  color: #fff;
  border-radius: 12px;
  padding: 0.95rem 1rem 1.05rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
}
.focus-panel[hidden] { display: none; }
.focus-panel .fp-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #159a84;
  margin: 0 0 0.15rem;
}
.focus-panel .fp-sub {
  font-size: 0.78rem;
  color: #c5d2dc;
  margin: 0 0 0.7rem;
}
.focus-panel .fp-detected {
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.55rem;
  line-height: 1.35;
}
.focus-panel .fp-rate-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9db0c0;
  margin: 0;
}
.focus-panel .fp-rate {
  font-size: 1.22rem;
  font-weight: 700;
  color: #fff;
  margin: 0.1rem 0 0.75rem;
  line-height: 1.25;
}
.focus-panel dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.28rem 0.7rem;
  align-items: baseline;
}
.focus-panel dt {
  font-size: 0.68rem;
  font-weight: 600;
  color: #9db0c0;
}
.focus-panel dd {
  font-size: 0.84rem;
  font-weight: 600;
  margin: 0;
}
.focus-panel .fp-note {
  font-size: 0.75rem;
  font-weight: 500;
  color: #f0d9a8;
  margin: 0.75rem 0 0.55rem;
  line-height: 1.4;
}
.focus-panel .fp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0.35rem;
}
.focus-panel .fp-actions button {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.38rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #3d6a80;
  background: transparent;
  color: #e8f0f5;
  cursor: pointer;
}
.focus-panel .fp-actions button:hover,
.focus-panel .fp-actions button[aria-pressed="true"] {
  background: #159a84;
  border-color: #159a84;
  color: #fff;
}
.focus-panel .fp-preview {
  margin: 0.55rem 0 0.2rem;
}
.focus-panel .fp-preview img {
  display: block;
  width: 100%;
  max-height: 110px;
  object-fit: contain;
  background: #0b1220;
  border-radius: 6px;
  image-rendering: pixelated;
}
.focus-panel .kv th { color: #9db0c0; }
.focus-panel .kv td { color: #fff; }
.focus-panel .gk-unavailable { color: #d7e0ea; }
.focus-panel .gk-method p { color: #c5d2dc; }
.focus-panel .gk-method summary { color: #9db0c0; }
.focus-panel code { color: #f0f921; font-size: 0.78rem; }
body.gk-focus-mode .sidebar {
  pointer-events: none;
  opacity: 0.45;
}
body.gk-focus-mode .leaflet-control-attribution {
  margin-right: 380px;
}
.methane-legend .leg-mask {
  width: 14px;
  height: 10px;
  border: 1.5px dashed #f7f3e3;
  background: transparent;
  flex-shrink: 0;
  margin-top: 0.12rem;
}
.methane-legend .leg-source {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid #f0f921;
  background: transparent;
  flex-shrink: 0;
  margin-top: 0.12rem;
}
@media (max-width: 900px) {
  .focus-back {
    left: 52px;
    top: 12px;
    min-height: 44px;
    padding: 0.45rem 0.75rem;
  }
  .focus-panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: min(42vh, calc(100% - 96px));
    border-radius: 14px 14px 0 0;
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .focus-panel.is-collapsed {
    max-height: calc(96px + env(safe-area-inset-bottom));
    overflow: hidden;
  }
  .sheet-handle {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: -0.4rem 0 0.55rem;
    padding: 0.2rem 0 0.35rem;
    border: 0;
    background: transparent;
    color: #c5d2dc;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
  }
  .sheet-handle::before {
    content: "";
    width: 42px;
    height: 4px;
    border-radius: 99px;
    background: #3d6a80;
  }
  body.gk-focus-mode .leaflet-control-attribution { margin-right: 8px; }
  body.gk-focus-mode .sidebar { opacity: 1; pointer-events: auto; }
  body.gk-focus-mode .methane-legend {
    right: 12px;
    left: auto;
    top: 60px;
    bottom: auto;
    max-width: min(200px, calc(100% - 24px));
    padding: 0.45rem 0.5rem 0.5rem;
  }
}
@media (max-width: 560px) {
  .logo img { height: 34px; max-width: calc(100vw - 156px); }
}
