:root {
  color-scheme: light;
  --ink: #172421;
  --muted: #64716d;
  --paper: #f4f1e9;
  --panel: #fffdf8;
  --line: #d9ddd4;
  --accent: #175f52;
  --accent-2: #d8ead7;
  --warning: #915623;
  --shadow: 0 12px 40px rgb(22 39 34 / 12%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); }
button, select, input { font: inherit; }
button, select { color: inherit; }

.app-shell {
  display: grid;
  grid-template: auto auto minmax(0, 1fr) / minmax(0, 1fr) 390px;
  height: 100%;
  min-height: 650px;
}

.topbar {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 0; }
.topbar-title .eyebrow { margin-bottom: 2px; font-size: 8px; }

.eyebrow, .kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}

h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(19px, 2vw, 25px); font-weight: 500; line-height: 1; }
h2 { margin: 4px 0 0; font: 500 clamp(24px, 4vw, 38px)/1.08 Georgia, serif; }
h3 { margin: 12px 0 6px; font-size: 15px; }

.view-tabs { display: flex; align-self: stretch; gap: 3px; }
.view-tab { min-height: 34px; padding: 6px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #50605b; cursor: pointer; font-size: 12px; font-weight: 800; }
.view-tab.active { background: white; color: var(--accent); box-shadow: 0 1px 4px rgb(20 35 31 / 12%); }
.view-tab:focus-visible { outline: 2px solid #3e8f7f; outline-offset: 2px; }
.button, .icon-button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
}
.button-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button:hover, .button:focus-visible { filter: brightness(.94); }

.explore-toolbar {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) minmax(125px, .55fr) minmax(160px, .75fr) minmax(210px, 1fr) minmax(180px, .85fr) auto;
  align-items: end;
  gap: 8px 12px;
  padding: 8px 14px 7px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.metric-control { min-width: 0; }
.metric-control > label, .explore-toolbar .top-control legend { display: block; width: 100%; margin: 0 0 4px; padding: 0; color: #40504b; font-size: 9px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.metric-control select { height: 34px; padding: 6px 30px 6px 9px; font-size: 11px; }
.reset-view { min-height: 34px; padding: 7px 10px; white-space: nowrap; }
.toolbar-meta { grid-column: 1 / -1; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.toolbar-meta .badges { min-width: 0; overflow: hidden; flex: 0 1 auto; flex-wrap: nowrap; margin: 0; }
.toolbar-meta .badge { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-meta .metric-description { min-width: 0; flex: 1 1 auto; overflow: hidden; margin: 0; padding: 0; border: 0; background: transparent; font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-meta .field-note { display: none; }
.load-state { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; font-size: 9px; white-space: nowrap; }

.details-panel {
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line);
}
.details-header { padding: 20px 22px 17px; border-bottom: 1px solid var(--line); }
.details-header { order: 1; }
.details-panel .trajectory-panel { order: 2; }
.details-panel .selection { order: 3; }
.details-header h2 { margin: 0; font: 500 23px/1.08 Georgia, serif; }
.details-header > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.intro { padding: 20px 22px 17px; border-bottom: 1px solid var(--line); }
.intro p:last-child { margin: 0; color: #42504c; font-size: 13px; line-height: 1.5; }
.top-control { margin: 0; padding: 0; border: 0; min-width: 0; }
.top-control legend { width: 100%; margin: 0 0 4px; padding: 0; font-size: 10px; font-weight: 800; }
.basis-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.component-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.coverage-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.coverage-control { max-width: 165px; }
.basis-options label { position: relative; min-width: 0; cursor: pointer; }
.basis-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.basis-options span { display: grid; min-height: 34px; padding: 6px 5px; border: 1px solid #cad1c9; border-radius: 7px; background: white; place-items: center; text-align: center; font-size: 10px; font-weight: 750; }
.basis-options input:checked + span { border-color: var(--accent); background: var(--accent); color: white; }
.basis-options input:focus-visible + span { outline: 2px solid #3e8f7f; outline-offset: 2px; }
.basis-options input:disabled + span { cursor: not-allowed; opacity: .42; text-decoration: line-through; }
.component-weight-heading { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 750; line-height: 1.2; }
.component-weight-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 2px; }
.component-weight-controls label { min-width: 0; display: block; color: var(--muted); font-size: 9px; font-weight: 800; }
.component-weight-controls input { width: 100%; min-width: 0; height: 28px; border: 1px solid #cad1c9; border-radius: 6px; background: #fff; padding: 3px 2px 3px 5px; color: var(--ink); text-align: right; font-size: 10px; font-weight: 750; }
.component-weight-controls input:focus-visible { outline: 2px solid #3e8f7f; outline-offset: 1px; }
.component-weight-controls input:disabled { cursor: not-allowed; opacity: .42; }
.top-control > p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.period-detail-controls { margin-top: 4px; }
.period-detail-controls label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 750; }
.period-detail-controls select { min-height: 30px; padding: 5px 28px 5px 7px; font-size: 10px; }
.time-period.period-locked .period-mode-options label:not(:first-child) span { opacity: .42; text-decoration: line-through; }
.control-section, .metric-description, .calibration, .selection { margin: 0; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.control-section label, .calibration label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 750; }
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd1c9;
  border-radius: 8px;
  background: white;
  padding: 10px 34px 10px 10px;
  font-size: 13px;
}
.two-up { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.badge { max-width: 100%; border-radius: 999px; background: #e8eee9; color: #345047; padding: 5px 8px; font-size: 10px; font-weight: 800; line-height: 1.2; }
.badge-resolution { background: var(--accent-2); color: #194d42; }
.badge-personal { background: #ffe9c7; color: #73491e; }
.field-note, .fine-print { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.metric-description { padding-top: 13px; padding-bottom: 13px; color: #43504c; background: #faf8f2; font-size: 12px; line-height: 1.45; }

.calibration { background: #fffaf0; }
.calibration summary { cursor: pointer; font-size: 12px; font-weight: 800; }
.calibration > p { color: var(--muted); font-size: 11px; line-height: 1.45; }
.calibration-grid { display: grid; gap: 11px; margin-top: 12px; }
.calibration-grid label { margin: 0; }
.calibration-grid label > span { float: right; font-weight: 500; color: var(--muted); }
.calibration-value { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
.calibration-value span { color: var(--muted); }
.calibration-value strong { text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.display-controls { display: grid; gap: 12px; }
.check-row { display: flex; gap: 18px; }
.check-row label { margin: 0; font-weight: 600; }
.display-controls > label output { float: right; color: var(--muted); font-weight: 500; }

.selection { flex: 0 0 auto; min-height: 132px; }
.selection-empty { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.selection-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.selection-title strong { font-size: 14px; }
.selection-title span { color: var(--muted); font-size: 11px; }
.reading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.reading { min-width: 0; padding: 9px; border-radius: 8px; background: #f0f2ec; }
.reading span { display: block; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; line-height: 1.25; }
.reading strong { display: block; margin-top: 2px; font-size: 15px; }
.basis-reading-grid { margin-bottom: 13px; }
.basis-reading { background: #e4efe6; box-shadow: inset 0 0 0 1px #c4d9c8; }
.raw-breakdown-title { margin-top: 2px; }
.breakdown { margin-top: 10px; display: grid; gap: 5px; }
.breakdown-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 30px; align-items: center; gap: 7px; font-size: 10px; }
.breakdown-row.excluded { opacity: .48; }
.breakdown-row.excluded .breakdown-track { background: repeating-linear-gradient(135deg, #e2e3dc, #e2e3dc 3px, #f2f2ed 3px, #f2f2ed 6px); }
.breakdown-track { height: 5px; border-radius: 99px; background: #e2e3dc; overflow: hidden; }
.breakdown-fill { height: 100%; background: #d4773d; }
.proxy-breakdown { margin-top: 14px; border: 1px solid #d7ded6; border-radius: 10px; background: #f8faf5; padding: 11px; }
.proxy-breakdown > strong { display: block; font-size: 12px; }
.proxy-breakdown-note { margin: 4px 0 9px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.proxy-equation { display: grid; gap: 4px; }
.proxy-equation-row { display: grid; grid-template-columns: minmax(84px, 1fr) auto auto; align-items: baseline; gap: 6px; border-bottom: 1px solid #e1e6df; padding: 4px 0; font-size: 10px; }
.proxy-equation-row span:nth-child(2) { color: var(--muted); font-variant-numeric: tabular-nums; }
.proxy-equation-row strong { min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.proxy-equation-row.excluded { opacity: .52; }
.proxy-equation-row.summary { grid-template-columns: minmax(0, 1fr) auto; border-bottom: 0; border-top: 1px solid #cbd6ce; margin-top: 3px; padding-top: 7px; }
.proxy-equation-row.summary + .proxy-equation-row.summary { margin-top: -1px; border-top-color: #e1e6df; }
.proxy-equation-row.final { color: var(--accent); font-size: 11px; }
.proxy-submeasure { margin: 5px 0 7px; border: 1px solid #dbe4dc; border-radius: 7px; background: #fff; padding: 5px 7px; }
.proxy-submeasure summary { cursor: pointer; color: #35544b; font-size: 9px; font-weight: 800; }
.proxy-equation-row.submeasure span:first-child small { display: block; margin-top: 1px; color: var(--muted); font-size: 8px; font-weight: 500; }
.proxy-worst-months { margin: 2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.stored-breakdown { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 9px; }
.stored-breakdown summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; color: #3c4d48; font-size: 10px; font-weight: 800; }
.stored-breakdown summary span { color: var(--muted); font-weight: 600; }
.stored-breakdown .reading-grid { margin-top: 9px; }

.trajectory-panel { padding: 18px 14px 22px; border-bottom: 1px solid var(--line); }
.trajectory-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 0 7px; }
.trajectory-heading h3 { margin: 0; font: 500 19px/1.1 Georgia, serif; }
.trajectory-heading label { width: 158px; margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.trajectory-heading select { margin-top: 4px; padding-top: 8px; padding-bottom: 8px; font-size: 11px; }
.surface-status { margin: 12px 7px 7px; }
.surface-status p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.assumption-badge { display: inline-block; padding: 4px 7px; border-radius: 999px; background: #dcecdf; color: #225648; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.assumption-badge.conditional { background: #ffebc9; color: #7a4c20; }
.assumption-badge.held { background: #e8e5ef; color: #554e72; }
.comfort-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-background-cell { shape-rendering: crispEdges; }
.chart-grid-line { stroke: rgb(255 255 255 / 52%); stroke-width: .8; }
.chart-axis { stroke: #41504b; stroke-width: 1.1; }
.chart-tick { fill: #5f6c68; font-size: 9px; }
.chart-axis-label { fill: #33433e; font-size: 10px; font-weight: 750; }
.trajectory-line { stroke: #132d28; stroke-width: 1.7; opacity: .86; }
.trajectory-point { fill: #fffdf8; stroke: #132d28; stroke-width: 1.4; }
.trajectory-number { fill: #10211d; font-size: 7px; font-weight: 900; pointer-events: none; }
.trajectory-cycle { stroke: #132d28; stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .48; }
.chart-legend { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; margin: 0 12px; color: var(--muted); font-size: 9px; }
.chart-legend div { height: 7px; border-radius: 99px; }
.month-key { margin: 8px 10px 0; color: #3f504b; font-size: 9px; font-weight: 700; line-height: 1.45; }
.chart-summary { margin: 10px 8px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.chart-data { margin: 12px 8px 0; border-top: 1px solid var(--line); padding-top: 9px; }
.chart-data summary { cursor: pointer; color: #3c4d48; font-size: 10px; font-weight: 800; }
.chart-table-wrap { overflow-x: auto; margin-top: 8px; }
.chart-data table { width: 100%; border-collapse: collapse; font-size: 9px; white-space: nowrap; }
.chart-data th, .chart-data td { padding: 5px 4px; border-bottom: 1px solid #e7e9e3; text-align: right; }
.chart-data th:first-child, .chart-data td:first-child { text-align: left; }
.chart-data th { color: var(--muted); font-weight: 750; }

.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 13px 22px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #c69538; flex: 0 0 auto; }
.status-dot.ready { background: #2d866e; }
.status-dot.error { background: #c45942; }

.map-region { position: relative; min-width: 0; min-height: 0; background: #dce6df; overflow: hidden; }
#map { width: 100%; height: 100%; background: #dce6df; }
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { font-size: 9px; }
.leaflet-control-zoom {
  display: flex;
  flex-direction: column;
}
.leaflet-control-zoom a {
  display: block !important;
  width: 30px !important;
  height: 30px !important;
  overflow: hidden;
  line-height: 30px !important;
  text-align: center;
}
.climate-canvas { pointer-events: none; image-rendering: auto; }
.cell-tooltip { border: 0 !important; border-radius: 8px !important; box-shadow: var(--shadow) !important; color: var(--ink) !important; font-size: 11px !important; }

.legend {
  position: absolute;
  z-index: 800;
  bottom: 20px;
  left: 20px;
  width: min(300px, calc(100% - 40px));
  padding: 13px 14px 11px;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 12px;
  background: rgb(255 253 248 / 93%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.legend-heading { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
.legend-heading span { color: var(--muted); }
.legend-ramp { height: 9px; margin-top: 9px; border-radius: 10px; }
.legend-labels { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: 9px; }
.legend p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.3; }

.map-message { position: absolute; z-index: 1000; inset: 20px 20px auto; padding: 12px 14px; border-radius: 10px; background: #fff8e6; color: var(--warning); box-shadow: var(--shadow); font-size: 12px; }

dialog { width: min(860px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 0; border: 0; border-radius: 18px; background: var(--panel); color: var(--ink); box-shadow: 0 25px 80px rgb(0 0 0 / 30%); }
dialog::backdrop { background: rgb(21 35 31 / 64%); backdrop-filter: blur(3px); }
.dialog-card { padding: clamp(22px, 4vw, 40px); overflow-y: auto; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.icon-button { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 23px; line-height: 1; }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
.method-grid article { min-width: 0; border-top: 1px solid var(--line); padding-top: 13px; }
.method-grid p, .current-source p, .dialog-footnote { color: var(--muted); font-size: 12px; line-height: 1.55; }
.method-number { color: var(--accent); font: italic 18px Georgia, serif; }
.current-source { margin-top: 26px; padding: 16px; border-radius: 10px; background: #edf3ed; }
.current-source p { margin: 6px 0; }
.current-source a { color: var(--accent); font-size: 12px; font-weight: 700; }
.dialog-footnote { margin: 20px 0 0; }

.explore-view { display: contents; }
.glossary-view { grid-column: 1 / -1; grid-row: 2 / -1; min-width: 0; min-height: 0; overflow-y: auto; padding: clamp(24px, 4vw, 54px); background: #f7f4ec; }
.glossary-header { max-width: 780px; }
.glossary-header h2 { margin: 2px 0 10px; }
.glossary-header > p:last-child { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.glossary-content { display: grid; gap: 34px; margin-top: 30px; }
.glossary-section { min-width: 0; }
.glossary-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 13px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.glossary-section-heading h3 { margin: 0; font: 500 22px/1.15 Georgia, serif; }
.glossary-section-heading p { max-width: 660px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.source-grid, .metric-glossary-grid, .formula-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.glossary-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 5px 18px rgb(22 39 34 / 5%); }
.glossary-card h4 { margin: 0 0 7px; font-size: 14px; }
.source-key { margin: 0 0 5px !important; color: var(--accent) !important; font-size: 9px !important; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.glossary-card p, .glossary-card li, .glossary-card dd { color: #4d5c57; font-size: 11px; line-height: 1.55; }
.glossary-card p { margin: 6px 0; }
.glossary-meta { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0; }
.glossary-meta span { border-radius: 999px; background: #e8eee9; color: #365148; padding: 4px 7px; font-size: 9px; font-weight: 800; }
.glossary-card dl { display: grid; grid-template-columns: minmax(72px, auto) minmax(0, 1fr); gap: 5px 9px; margin: 10px 0 0; }
.glossary-card dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.glossary-card dd { margin: 0; overflow-wrap: anywhere; }
.metric-glossary-card details { margin-top: 9px; border-top: 1px solid #e5e7df; padding-top: 8px; }
.metric-glossary-card summary { cursor: pointer; color: var(--accent); font-size: 10px; font-weight: 800; }
.formula-code { overflow-x: auto; margin: 10px 0 0; padding: 12px; border-radius: 8px; background: #172421; color: #eaf2ed; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.formula-editor { border: 1px solid #bed2c7; background: #eef6f0; box-shadow: none; }
.formula-editor + .formula-grid { margin-top: 12px; }
.formula-editor-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.formula-editor-heading p { max-width: 680px; margin: 3px 0 0; }
.formula-editor-status { min-height: 18px; margin: 10px 0 0 !important; color: var(--accent) !important; font-weight: 750; }
.formula-editor-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 10px; margin-top: 12px; }
.formula-editor-group { min-width: 0; border: 1px solid #d7e2d9; border-radius: 10px; background: #fffdf8; padding: 12px; }
.formula-editor-group h5 { margin: 0 0 5px; font-size: 12px; }
.formula-editor-group > p { margin: 0 0 9px; font-size: 9px; }
.formula-editor-group > .formula-effective { margin-top: -3px; color: var(--accent); font-weight: 800; }
.formula-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.formula-field { min-width: 0; display: grid; gap: 3px; color: #4d5c57; font-size: 9px; font-weight: 750; }
.formula-field.wide { grid-column: 1 / -1; }
.formula-field input { width: 100%; min-width: 0; height: 31px; border: 1px solid #cbd5cd; border-radius: 6px; background: #fff; padding: 4px 7px; color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.formula-field input:focus-visible { outline: 2px solid #3e8f7f; outline-offset: 1px; }
.formula-knot-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 9px; }
.formula-range-table caption { padding: 4px 0 6px; color: var(--muted); font-size: 9px; line-height: 1.35; text-align: left; }
.formula-knot-table th, .formula-knot-table td { padding: 3px; border-bottom: 1px solid #e8ebe5; text-align: left; }
.formula-knot-table th { color: var(--muted); font-weight: 800; }
.formula-knot-table input { width: 100%; min-width: 48px; height: 28px; border: 1px solid #cbd5cd; border-radius: 5px; padding: 3px 5px; font-size: 10px; }
.formula-reset { flex: 0 0 auto; min-height: 32px; padding: 6px 10px; font-size: 10px; }
.caveat-list { margin: 8px 0 0; padding-left: 18px; }
.glossary-empty { padding: 20px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }

@media (max-width: 1180px) {
  .app-shell { display: flex; flex-direction: column; height: auto; min-height: 100%; }
  .topbar { order: 1; }
  .explore-toolbar { order: 2; display: flex; flex-wrap: wrap; align-items: end; }
  .metric-control { flex: 2 1 310px; }
  .explore-toolbar .top-control { flex: 1 1 190px; }
  .explore-toolbar .coverage-control { flex: 0 1 165px; }
  .toolbar-meta { flex: 1 0 100%; }
  .map-region { order: 3; height: 62vh; min-height: 430px; }
  .details-panel { order: 4; overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
  .details-panel .selection { min-height: 0; }
  .trajectory-panel { max-width: 620px; }
  .glossary-view { order: 2; overflow: visible; }
}

@media (max-width: 960px) {
  .explore-toolbar { display: flex; flex-wrap: wrap; align-items: end; }
  .metric-control { flex: 2 1 310px; }
  .explore-toolbar .top-control { flex: 1 1 220px; }
  .toolbar-meta { flex: 1 0 100%; }
}

@media (max-width: 560px) {
  .topbar { padding: 7px 10px; gap: 8px; }
  .topbar-title .eyebrow { display: none; }
  .topbar h1 { max-width: 205px; font-size: 17px; }
  .view-tab { padding-inline: 8px; font-size: 10px; }
  .explore-toolbar { gap: 8px; padding: 8px 10px; }
  .metric-control, .explore-toolbar .top-control { flex: 1 0 100%; max-width: none; }
  .reset-view { margin-left: auto; }
  .toolbar-meta { align-items: flex-start; flex-wrap: wrap; }
  .toolbar-meta .badges { flex: 1 1 100%; width: 100%; max-width: 100%; }
  .toolbar-meta .badge-resolution { width: 100%; max-width: 100%; }
  .toolbar-meta .metric-description { flex-basis: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .toolbar-meta .badges .badge:not(.badge-resolution) { display: none; }
  .legend { bottom: 12px; left: 12px; width: calc(100% - 24px); }
  .selection { padding-left: 16px; padding-right: 16px; }
  .trajectory-heading { align-items: start; }
  .trajectory-heading label { width: 144px; }
  .glossary-section-heading { display: block; }
  .glossary-section-heading p { margin-top: 5px; }
  .formula-editor-heading { display: block; }
  .formula-reset { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
