:root {
  --background: #f3f4f2;
  --surface: #ffffff;
  --text: #202522;
  --muted: #66706a;
  --border: #cbd0cc;
  --accent: #b84322;
  --header: #26312c;
}

* { box-sizing: border-box; }
html { background: var(--background); color: var(--text); }
body { margin: 0; min-width: 320px; font-family: "Arial Narrow", "Aptos", sans-serif; font-size: 14px; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px 28px;
  color: white;
  background: var(--header);
  border-bottom: 4px solid var(--accent);
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 20px; line-height: 1.2; }
header p { margin-bottom: 0; color: #cbd3cf; font-size: 12px; }
.badge, .record-flags span { padding: 5px 8px; border: 1px solid currentColor; font: 700 11px/1 monospace; text-transform: uppercase; }

main { width: min(1500px, 100%); margin: 0 auto; padding: 24px 28px 40px; }
.record-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.record-header h2 { margin: 5px 0 0; font: 600 22px/1.2 monospace; }
.record-flags { display: flex; flex-wrap: wrap; gap: 6px; color: var(--accent); }
.label { display: block; color: var(--muted); font: 700 10px/1.2 monospace; letter-spacing: .06em; text-transform: uppercase; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; border: 1px solid var(--border); background: var(--surface); }
.metrics > div { min-height: 88px; padding: 18px; border-right: 1px solid var(--border); }
.metrics > div:last-child { border-right: 0; }
.metrics strong { display: block; margin-top: 10px; font-size: 18px; font-weight: 600; }

.primary-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr); gap: 18px; margin-bottom: 18px; }
.panel { border: 1px solid var(--border); background: var(--surface); }
.panel-title { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel-title h3 { margin: 0; font-size: 14px; }
.panel-title span { color: var(--muted); font: 10px/1.2 monospace; text-transform: uppercase; }
.globe-panel { min-height: 620px; }
#cesiumContainer { height: 565px; background: #111713; }

.details-panel dl { margin: 0; padding: 0 16px; }
.details-panel dl div { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid #e4e7e5; }
.details-panel dt { color: var(--muted); }
.details-panel dd { margin: 0; font-weight: 600; text-align: right; }
.caveat { margin: 18px 16px; padding: 14px; border-left: 4px solid var(--accent); background: #f4ebe7; }
.caveat strong { font-size: 12px; text-transform: uppercase; }
.caveat p { margin: 8px 0 0; font-size: 12px; line-height: 1.5; }

.view-switch { display: flex; }
.view-switch button { padding: 7px 10px; border: 1px solid var(--border); background: white; color: var(--text); font: 700 10px/1 monospace; cursor: pointer; }
.view-switch button + button { border-left: 0; }
.view-switch button.active { background: var(--header); color: white; }
.quicklook-body { min-height: 280px; display: grid; grid-template-columns: 260px 1fr; align-items: center; gap: 28px; padding: 22px; background: #151b18; color: white; }
.quicklook-body img { width: 240px; height: 240px; object-fit: contain; background: black; }
.quicklook-body p { max-width: 580px; margin: 0; color: #d5dbd7; line-height: 1.6; }

footer { display: flex; justify-content: space-between; padding: 18px 28px; border-top: 1px solid var(--border); color: var(--muted); font: 11px/1.2 monospace; text-transform: uppercase; }
footer a { color: var(--text); }
.cesium-viewer-bottom { font-size: 10px; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics > div:nth-child(2) { border-right: 0; }
  .metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .primary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  header, .record-header, footer { align-items: flex-start; flex-direction: column; }
  main { padding: 18px 12px 30px; }
  .metrics { grid-template-columns: 1fr; }
  .metrics > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .quicklook-body { grid-template-columns: 1fr; }
  .quicklook-body img { width: min(240px, 100%); height: auto; }
  .globe-panel { min-height: 500px; }
  #cesiumContainer { height: 445px; }
}

.sample-switch {
  display: flex;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.sample-switch button {
  flex: 1;
  padding: 13px 16px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.sample-switch button:last-child { border-right: 0; }
.sample-switch button.active { box-shadow: inset 0 -4px var(--accent); background: #eef0ee; }
.sample-switch span, .sample-switch strong { display: block; }
.sample-switch span { margin-bottom: 5px; color: var(--muted); font: 10px/1.2 monospace; text-transform: uppercase; }
.sample-switch strong { font-size: 14px; }
[hidden] { display: none !important; }

@media (max-width: 560px) {
  .sample-switch { flex-direction: column; }
  .sample-switch button { border-right: 0; border-bottom: 1px solid var(--border); }
  .sample-switch button:last-child { border-bottom: 0; }
}

.primary-grid { grid-template-columns: 280px minmax(420px, 1fr) 300px; }
.sample-browser { min-width: 0; }
.sample-controls { display: grid; gap: 7px; padding: 14px; border-bottom: 1px solid var(--border); }
.sample-controls label { color: var(--muted); font: 700 10px/1.2 monospace; text-transform: uppercase; }
.sample-controls input, .sample-controls select, .sample-controls button {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: white;
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
}
.sample-controls button { margin-top: 5px; background: var(--header); color: white; cursor: pointer; }
.sample-list { min-height: 178px; margin: 0; padding: 0; list-style: none; }
.sample-list li { border-bottom: 1px solid var(--border); }
.sample-list button { width: 100%; padding: 14px; border: 0; background: white; color: var(--text); text-align: left; cursor: pointer; }
.sample-list button.active { box-shadow: inset 4px 0 var(--accent); background: #eef0ee; }
.sample-list strong, .sample-list span { display: block; }
.sample-list strong { margin-bottom: 6px; font-size: 13px; }
.sample-list span { color: var(--muted); font: 10px/1.3 monospace; text-transform: uppercase; }
.sample-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px; }
.sample-pagination button { min-height: 32px; border: 1px solid var(--border); background: white; cursor: pointer; }
.sample-pagination button:disabled { color: #999; cursor: default; }
.sample-pagination span { font: 10px/1 monospace; }
.image-with-scale { position: relative; width: 240px; height: 240px; background: black; }
.image-with-scale img { display: block; width: 100%; height: 100%; }
.plume-scale { position: absolute; left: 16px; bottom: 14px; width: 29.2205%; color: white; filter: drop-shadow(0 1px 1px black); }
.plume-scale span { position: relative; display: block; height: 8px; border-bottom: 3px solid currentColor; }
.plume-scale span::before, .plume-scale span::after { position: absolute; bottom: -3px; width: 3px; height: 9px; background: currentColor; content: ""; }
.plume-scale span::before { left: 0; }
.plume-scale span::after { right: 0; }
.plume-scale b { display: block; margin-top: 5px; font: 700 11px/1 monospace; text-align: center; }

@media (max-width: 1200px) {
  .primary-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .details-panel { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .primary-grid { grid-template-columns: 1fr; }
  .details-panel { grid-column: auto; }
}
@media (max-width: 560px) {
  .image-with-scale { width: min(240px, 100%); height: auto; aspect-ratio: 1; }
}
