:root {
  --ink: #17262a;
  --ink-soft: #42555a;
  --muted: #718085;
  --accent: #116c68;
  --accent-dark: #0b514f;
  --accent-soft: #eaf2ef;
  --warm: #9a644c;
  --paper: #f5f6f2;
  --surface: #fdfefc;
  --line: #dce2de;
  --line-strong: #cbd4cf;
  --code: #142326;
  --shadow: 0 18px 50px rgba(23, 38, 42, .055);
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}


html {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(rgba(255,255,255,.56), rgba(255,255,255,0) 380px),
    var(--paper);
}


.shell { width: min(1440px, 100%); min-height: 100vh; margin: 0 auto; }

.topbar {
  height: 74px;
  padding: 0 clamp(22px, 5vw, 70px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand strong { display: block; font: 500 17px/1.1 var(--serif); letter-spacing: -.15px; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; letter-spacing: 1.65px; text-transform: uppercase; }

.brand-mark {
  position: relative;
  display: inline-block;
  width: 35px;
  height: 35px;
  overflow: hidden;
  border: 1px solid rgba(17,108,104,.25);
  border-radius: 50%;
  background: var(--accent-dark);
}
.brand-mark::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -4px;
  width: 31px;
  height: 9px;
  border: 1px solid #8fc4bc;
  border-radius: 50%;
  transform: rotate(-18deg);
}
.brand-mark i { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: #d6a58e; }
.brand-mark.large { width: 58px; height: 58px; }
.brand-mark.large::before { top: 20px; left: -6px; width: 52px; height: 16px; }
.brand-mark.large i { top: 12px; right: 11px; width: 10px; height: 10px; }

.top-actions, .status { display: flex; align-items: center; gap: 14px; }
.status { gap: 8px; color: var(--muted); font-size: 10px; letter-spacing: .35px; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: #4a9c78; }
.quiet { padding: 8px; border: 0; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.quiet:hover { color: var(--ink); }
.earthdata-connect { text-decoration: none; }
.earthdata-connect.connected { color: var(--accent); cursor: default; }

main { padding: 22px clamp(22px, 5vw, 70px) 70px; }

.hero {
  position: relative;
  min-height: 255px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}
.eyebrow { margin: 0; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: 2.25px; }
.hero h1 { margin: 13px 0 16px; font: 400 clamp(39px, 5vw, 66px)/.98 var(--serif); letter-spacing: -2.4px; }
.hero h1 em { color: var(--accent); font-weight: 400; }
.lede { max-width: 570px; margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }

.orbit { position: relative; width: 270px; height: 185px; margin-right: 3%; flex: 0 0 auto; opacity: .78; }
.orbit::before { content: ""; position: absolute; top: 56px; left: 18px; width: 232px; height: 75px; border: 1px solid rgba(17,108,104,.2); border-radius: 50%; transform: rotate(-18deg); }
.planet {
  position: absolute;
  top: 30px;
  left: 75px;
  width: 118px;
  height: 118px;
  overflow: hidden;
  border: 1px solid rgba(17,108,104,.25);
  border-radius: 50%;
  background: linear-gradient(145deg, #4b8a8a, #174b54 65%, #14343b);
  box-shadow: 0 22px 45px rgba(23,38,42,.12);
}
.planet span { position: absolute; border-radius: 50%; background: #a6c8bb; opacity: .48; transform: rotate(-20deg); }
.planet span:nth-child(1) { top: 29px; left: -8px; width: 58px; height: 20px; }
.planet span:nth-child(2) { top: 46px; right: 12px; width: 40px; height: 54px; }
.planet span:nth-child(3) { bottom: 15px; left: 9px; width: 52px; height: 13px; }
.satellite { position: absolute; top: 52px; right: 15px; width: 9px; height: 9px; border: 1px solid var(--warm); background: var(--paper); transform: rotate(15deg); }

.top-visuals { margin-bottom: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.top-map-panel { position: relative; min-width: 0; background: #071f2d; }
.top-map-panel .world-map { height: 430px; }
.top-map-panel > .panel-heading { position: absolute; inset: 0 0 auto; z-index: 3; border: 0; background: linear-gradient(180deg, rgba(4,21,31,.88), rgba(4,21,31,.42) 72%, transparent); color: #f3f7f5; pointer-events: none; }
.top-map-panel > .panel-heading .step { color: #9fdcd1; }
.top-map-panel > .panel-heading .chip { border-color: rgba(255,255,255,.2); background: rgba(4,21,31,.62); color: #d9f3ed; }
.top-figure-panel { min-width: 0; height: 430px; display: flex; flex-direction: column; }
.top-figure-panel #figure { min-height: 0; flex: 1; overflow: hidden; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(410px, .86fr); gap: 14px; }
.right-column { min-width: 0; }
.panel, .results-section { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: rgba(253,254,252,.88); box-shadow: var(--shadow); }

.panel-heading, .section-title {
  min-height: 57px;
  padding: 0 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.panel-heading > div, .section-title > div { display: flex; align-items: center; gap: 10px; }
.panel-heading h2, .section-title h2 { margin: 0; font: 400 16px var(--serif); }
.step { color: var(--warm); font: 600 8px var(--mono); letter-spacing: 1.2px; }
.chip { padding: 5px 8px; border: 1px solid #d9e5e1; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 8px; font-weight: 700; letter-spacing: .75px; text-transform: uppercase; }

.chat-panel { min-height: 600px; display: flex; flex-direction: column; }
.messages { min-height: 315px; max-height: 415px; padding: 26px 22px; overflow: auto; flex: 1; scroll-behavior: smooth; scrollbar-color: var(--line-strong) transparent; }
.message { display: flex; gap: 11px; margin-bottom: 22px; font-size: 13px; line-height: 1.62; }
.message p { margin: 0 0 8px; white-space: pre-wrap; }
.message .markdown-body { min-width: 0; max-width: 100%; }
.message.user { flex-direction: row-reverse; }
.message.user > div { max-width: 80%; padding: 10px 13px; border-radius: 12px 3px 12px 12px; background: var(--ink); color: white; }
.message.assistant > div { max-width: 89%; }
.avatar { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: white; font: italic 11px var(--serif); }
.muted { color: var(--muted); }
.message a { color: var(--accent); }

.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 18px 0 8px; font-family: var(--serif); font-weight: 400; line-height: 1.3; }
.markdown-body h3 { font-size: 18px; }
.markdown-body h4 { font-size: 15px; }
.markdown-body h5, .markdown-body h6 { font-size: 13px; }
.markdown-body p { white-space: normal; }
.markdown-body ul, .markdown-body ol { margin: 8px 0 13px; padding-left: 21px; }
.markdown-body li { margin: 4px 0; }
.markdown-body blockquote { margin: 11px 0; padding: 8px 12px; border-left: 2px solid var(--accent); background: var(--accent-soft); color: var(--ink-soft); }
.markdown-body code { padding: 2px 5px; border-radius: 3px; background: #e9eeeb; color: var(--accent-dark); font: 11px/1.45 var(--mono); }
.markdown-body pre { max-width: 100%; margin: 12px 0; padding: 14px; overflow: auto; border-radius: 4px; background: var(--code); color: #e0eae7; }
.markdown-body pre code { padding: 0; background: none; color: inherit; font-size: 10px; white-space: pre; }
.markdown-body a { color: var(--accent); text-decoration-color: rgba(17,108,104,.4); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.markdown-body hr { height: 1px; margin: 17px 0; border: 0; background: var(--line); }
.markdown-table-wrap { max-width: 100%; margin: 12px 0; overflow: auto; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: 10px; }
.markdown-body th, .markdown-body td { padding: 8px 9px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-body th { background: var(--accent-soft); color: var(--ink); }

.message.document { padding: 2px 0; }
.message.document > div { width: min(100%, 720px); overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.document-heading { padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: var(--accent-soft); color: var(--muted); font-size: 9px; }
.document-heading strong { color: var(--accent); font-family: var(--mono); }
.message.document .markdown-body { max-height: 430px; padding: 16px; overflow: auto; }

.workflow-progress { width: min(430px,100%); padding: 13px 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--accent-soft); }
.workflow-progress-row { display: flex; justify-content: space-between; gap: 15px; color: var(--ink-soft); font-size: 9px; }
.workflow-progress-row span { color: var(--accent); font-family: var(--mono); }
.workflow-track { height: 3px; margin-top: 10px; overflow: hidden; background: #d5e2dd; }
.workflow-track i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.message.workflow-message > .workflow-card { width: min(100%,720px); max-width: none; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.workflow-heading { padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.workflow-heading strong { color: var(--ink); font: 400 14px var(--serif); }
.workflow-heading span { color: var(--accent); font-size: 8px; letter-spacing: .75px; text-transform: uppercase; }
.workflow-card details { border-bottom: 1px solid var(--line); }
.workflow-card summary { padding: 10px 13px; color: var(--ink-soft); font-size: 9px; font-weight: 650; cursor: pointer; }
.workflow-card pre { max-height: 300px; margin: 0; padding: 14px; overflow: auto; background: var(--code); color: #e0eae7; }
.workflow-card pre code { white-space: pre; font: 10px/1.55 var(--mono); }
.workflow-warnings { padding: 12px 13px; background: #faf5eb; color: #755b49; font-size: 9px; }
.workflow-warnings ul { margin: 6px 0 0; padding-left: 18px; }
.workflow-provenance { margin: 0 !important; padding: 10px 13px; color: var(--muted); font-size: 8px; }

.skill-list { padding: 9px; display: grid; gap: 6px; }
.skills-panel { min-height: 0; }
.skill-list { max-height: 286px; overflow: auto; scrollbar-color: var(--line-strong) transparent; }
.skills-loading { margin: 8px; color: var(--muted); font-size: 9px; }
.skill-option {
  position: relative;
  width: 100%;
  padding: 11px 12px;
  display: grid;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.skill-option:hover { border-color: var(--line); background: var(--surface); }
.skill-option strong { padding-right: 66px; font: 400 13px var(--serif); }
.skill-option span { color: var(--muted); font-size: 8px; line-height: 1.45; }
.skill-option.recommended { border-color: #cfdfd9; background: var(--accent-soft); }
.skill-option.recommended::after {
  content: "Suggested";
  position: absolute;
  top: 11px;
  right: 11px;
  color: var(--accent);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .65px;
  text-transform: uppercase;
}
.variable-catalog { border-top: 1px solid var(--line); }
.variable-catalog summary { padding: 10px 13px; color: var(--ink-soft); font-size: 9px; cursor: pointer; }
.variable-catalog summary strong { color: var(--accent); font-weight: 650; }
.variable-list { max-height: 188px; padding: 8px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; overflow: auto; }
.variable-list > p { margin: 5px; grid-column: 1/-1; color: var(--muted); font-size: 8px; line-height: 1.5; }
.variable-option { min-width: 0; padding: 7px 8px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 3px; background: transparent; text-align: left; cursor: pointer; }
.variable-option:hover, .variable-option.selected { border-color: #b9d1c8; background: var(--accent-soft); }
.variable-option code { overflow: hidden; color: var(--accent-dark); font: 8px var(--mono); text-overflow: ellipsis; }
.variable-option span { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }

.suggestions { padding: 0 22px 15px; display: flex; gap: 7px; flex-wrap: wrap; }
.suggestions button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--ink-soft); font-size: 9px; cursor: pointer; transition: border-color .16s ease, color .16s ease, background .16s ease; }
.suggestions button:hover { border-color: var(--line-strong); background: var(--surface); color: var(--accent); }

.composer { margin: 0 18px 8px; padding: 9px; display: flex; align-items: flex-end; gap: 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); transition: border-color .16s ease, box-shadow .16s ease; }
.composer:focus-within { border-color: rgba(17,108,104,.55); box-shadow: 0 0 0 3px rgba(17,108,104,.07); }
.composer textarea { min-height: 46px; max-height: 130px; padding: 8px; flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; line-height: 1.5; }
.composer textarea::placeholder { color: #9aa6a3; }
.attach { width: 36px; height: 36px; margin-bottom: 4px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--accent); font: 650 9px var(--mono); cursor: pointer; }
.attach:hover { background: var(--accent-soft); }
.send, .login-button { border: 0; border-radius: 5px; background: var(--accent-dark); color: white; font-weight: 650; text-decoration: none; cursor: pointer; transition: background .16s ease, transform .16s ease; }
.send { min-width: 75px; height: 43px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px; }
.send:hover, .login-button:hover { background: var(--accent); }
.send:active, .login-button:active { transform: translateY(1px); }
.send:disabled { opacity: .48; cursor: wait; }
.disclosure { margin: 5px 15px 12px; color: #8c9996; font-size: 8px; text-align: center; }

.world-map { position: relative; height: 242px; }
.map-canvas { position: absolute; inset: 0; background: #061b29; }
.map-canvas .maplibregl-canvas { cursor: grab; }
.map-canvas .maplibregl-canvas:active { cursor: grabbing; }
.map-canvas.selecting .maplibregl-canvas { cursor: crosshair; }
.map-selection-draft { position: absolute; z-index: 5; border: 2px dashed #9ce6da; background: rgba(77,222,207,.13); box-shadow: 0 0 0 1px rgba(3,23,31,.45); pointer-events: none; }
.maplibregl-popup-content { padding: 8px 10px; border: 1px solid rgba(17,108,104,.25); border-radius: 4px; background: rgba(250,253,251,.96); color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.18); font: 9px/1.45 var(--mono); }
.maplibregl-popup-tip { border-top-color: rgba(250,253,251,.96) !important; }
.map-controls { position: absolute; top: 68px; left: 10px; z-index: 4; display: flex; gap: 4px; }
.map-controls button { min-width: 29px; height: 29px; padding: 0 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 3px; background: rgba(20,35,38,.78); color: #edf5f1; font-size: 9px; cursor: pointer; }
.map-controls button:first-child, .map-controls button:nth-child(2) { padding: 0; font-size: 16px; }
.map-controls button:hover, .map-controls button.active { border-color: #8bd4c8; background: rgba(17,108,104,.92); }
.map-hint { position: absolute; left: 11px; bottom: 8px; z-index: 2; margin: 0; padding: 5px 7px; border-radius: 3px; background: rgba(20,35,38,.7); color: #d8e7e2; font-size: 7px; pointer-events: none; }
.map-legend { position: absolute; right: 10px; bottom: 9px; padding: 5px 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 3px; background: rgba(20,35,38,.77); color: #e5ece9; font-size: 7px; }
.map-legend span { display: inline-block; width: 7px; height: 7px; margin: 0 5px 0 9px; }
.map-legend span:first-child { margin-left: 0; }
.map-legend .swath-key { background: #62dfd1; box-shadow: 0 0 6px rgba(98,223,209,.7); }
.map-legend .science-key { width: 22px; border-radius: 2px; background: linear-gradient(90deg, #126cc4, #eaf7f6 50%, #e36b20); }
.map-legend b { font-weight: 500; }
.map-legend .extent-key { border: 1px dashed #c48c73; background: rgba(196,140,115,.18); }
.map-credit { position: absolute; right: 10px; bottom: 39px; z-index: 2; color: rgba(235,244,241,.65); font-size: 7px; text-decoration: none; }
.map-credit:hover { color: white; }

.figure-empty { min-height: 200px; padding: 25px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.figure-empty p { max-width: 300px; font-size: 10px; line-height: 1.65; }
.data-required strong { margin-top: 10px; color: var(--ink); font: 500 15px var(--serif); }
.figure-connect { margin-top: 9px; padding: 9px 12px; border-radius: 4px; background: var(--accent); color: white; font-size: 9px; font-weight: 700; letter-spacing: .35px; text-decoration: none; }
.figure-connect:hover { background: var(--accent-dark); }
.figure-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-size: 20px; }
.plot { width: 100%; height: 100%; display: block; background: linear-gradient(#fff, #fafcf9); }
.swath-plot { width: 100%; height: 100%; display: block; background: #071f2d; }
.plot-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.plot-axis { stroke: #b8c3bf; stroke-width: 1; vector-effect: non-scaling-stroke; }
.stats { display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--line); }
.stats div { padding: 10px 12px; border-right: 1px solid var(--line); }
.stats div:last-child { border: 0; }
.stats small { display: block; color: var(--muted); font-size: 7px; letter-spacing: 1px; text-transform: uppercase; }
.stats strong { font: 500 12px var(--mono); }

.results-section { margin-top: 14px; background: rgba(253,254,252,.72); }
.section-title > span { color: var(--muted); font-size: 9px; }
.results { display: grid; grid-template-columns: repeat(3,1fr); }
.result-card { min-height: 200px; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background .16s ease; }
.result-card:nth-child(3n) { border-right: 0; }
.result-card:hover { background: var(--surface); }
.result-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--accent); font-size: 8px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.result-card h3 { margin: 14px 0 9px; font: 400 15px/1.3 var(--serif); }
.result-card p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.result-actions { margin-top: 15px; display: flex; align-items: center; gap: 7px; }
.result-actions button, .result-actions a { padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--accent); font-size: 8px; font-weight: 650; text-decoration: none; cursor: pointer; }
.result-actions button:hover, .result-actions a:hover { border-color: var(--line-strong); background: var(--accent-soft); }
.empty-row { min-height: 135px; grid-column: 1/-1; display: grid; place-items: center; color: var(--muted); font-size: 10px; }

.auth-gate { position: fixed; inset: 0; z-index: 20; padding: 20px; display: grid; place-items: center; background: #193338; }
.auth-gate[hidden] { display: none; }
.auth-card { width: min(420px,100%); padding: 43px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: var(--paper); box-shadow: 0 28px 80px rgba(0,0,0,.25); text-align: center; }
.auth-card h1 { margin: 13px 0; font: 400 34px var(--serif); }
.auth-card p:not(.eyebrow) { color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.auth-card small { display: block; margin-top: 18px; color: var(--muted); font-size: 8px; }
.login-button { margin-top: 24px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 360px; padding: 12px 15px; border: 1px solid rgba(255,255,255,.1); border-radius: 5px; background: var(--code); color: white; box-shadow: 0 14px 45px rgba(0,0,0,.15); font-size: 10px; opacity: 0; transform: translateY(90px); transition: .22s ease; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .top-visuals { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .orbit { position: absolute; right: -65px; opacity: .35; }
  .hero > div:first-child { z-index: 1; }
  .results { grid-template-columns: repeat(2,1fr); }
  .result-card:nth-child(3n) { border-right: 1px solid var(--line); }
  .result-card:nth-child(2n) { border-right: 0; }
}

@media (max-width: 650px) {
  .topbar { height: 66px; }
  .status { display: none; }
  .hero { min-height: 225px; }
  .hero h1 { font-size: 41px; letter-spacing: -1.8px; }
  .orbit { display: none; }
  .top-map-panel .world-map { height: 360px; }
  .top-figure-panel { height: 360px; }
  .chat-panel { min-height: 565px; }
  .messages { padding-inline: 17px; }
  .suggestions { padding-inline: 17px; }
  .composer { margin-inline: 13px; }
  .results { grid-template-columns: 1fr; }
  .result-card { border-right: 0 !important; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .auth-card { padding: 34px 23px; }
  .brand small { display: none; }
  .workflow-heading { align-items: flex-start; flex-direction: column; }
}

