:root {
  color-scheme: dark;
  font-family: "Tektur", system-ui, sans-serif;
  background: #090b0d;
  color: #edf1f3;
  --surface: #0d1115;
  --surface-2: #14191e;
  --line: #30373d;
  --muted: #9aa5ad;
  --text: #edf1f3;
  --accent: #a9d8ff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body, #map, #map-3d {
  width: 100%;
  height: 100%;
  margin: 0;
}

body { overflow: hidden; }

button, select, a { font: inherit; }

button, select {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

button { cursor: pointer; }

#map { background: #090b0d; }

#map-3d {
  position: fixed;
  inset: 0;
  background: #090b0d;
}

.maplibregl-ctrl-bottom-right { bottom: 72px; }
.maplibregl-ctrl-attrib {
  color: #82909a;
  background: rgba(9, 11, 13, 0.82) !important;
}
.maplibregl-ctrl-attrib a { color: #a9d8ff; }

.leaflet-control-zoom a {
  color: var(--text) !important;
  background: var(--surface) !important;
  border-color: var(--line) !important;
}

.leaflet-control-attribution {
  color: #82909a;
  background: rgba(9, 11, 13, 0.82) !important;
}

.leaflet-control-attribution a { color: #a9d8ff; }
.leaflet-tooltip.domain-label {
  padding: 4px 7px;
  color: #d8dfe3;
  background: rgba(24, 29, 33, 0.9);
  border: 1px solid #89949a;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}
.leaflet-tooltip-top.domain-label::before { border-top-color: #89949a; }

.leaflet-radar-pane .leaflet-layer {
  transition: opacity 260ms linear;
}

.topbar {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  right: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(285px, auto) minmax(340px, 1fr) auto minmax(260px, auto);
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  background: rgba(9, 11, 13, 0.96);
  border-bottom: 1px solid var(--line);
}

.product-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow-x: auto;
}

.product-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.7rem;
}

.product-nav a:hover { color: var(--text); border-color: var(--line); }
.product-nav a[aria-current="page"] { color: #090b0d; background: #dce7ed; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #63717b;
  background: #000;
}

.brand h1 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}

.experimental-label {
  display: block;
  margin-top: 2px;
  color: #e8c66a;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.date-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 0.8rem;
}

.date-controls label { color: var(--muted); }

.date-controls select {
  min-height: 36px;
  padding: 0 30px 0 10px;
  border-radius: 3px;
}

#valid-period {
  max-width: 310px;
  color: #c9d0d5;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.mobile-actions-toggle { display: none; }

.view-switch {
  display: grid;
  grid-template-columns: repeat(2, 39px);
  min-height: 36px;
}

.view-button {
  padding: 0;
  color: var(--muted);
  background: #0d1115;
  border: 1px solid var(--line);
}

.view-button + .view-button { border-left: 0; }

.view-button.active {
  color: #090b0d;
  background: #dce7ed;
}

.text-button, .icon-button, .round-button {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
}

.text-button, .icon-button { padding: 0 12px; }

.round-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  font-size: 1rem;
}

.text-button:hover, .icon-button:hover, .round-button:hover, .panel-toggle:hover {
  border-color: #74828c;
}

.layer-panel {
  position: fixed;
  z-index: 900;
  top: 84px;
  left: 16px;
  width: 286px;
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  padding: 13px;
  background: rgba(9, 11, 13, 0.95);
  border: 1px solid var(--line);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: #c9d0d5;
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.panel-toggle {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
}

.product-options, .contour-options, .observation-options, .predictor-options { display: grid; gap: 5px; }

.layer-section {
  border-top: 1px solid var(--line);
}

.layer-section:last-of-type {
  border-bottom: 1px solid var(--line);
}

.layer-section summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #c9d0d5;
  cursor: pointer;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  list-style: none;
  text-transform: uppercase;
}

.layer-section summary::-webkit-details-marker { display: none; }

.layer-section summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1rem;
}

.layer-section[open] summary::after { content: "−"; }

.layer-section-content {
  padding: 2px 0 12px;
}

.layer-section.disabled-section {
  opacity: 0.42;
  pointer-events: none;
}

.layer-section.disabled-section summary {
  cursor: not-allowed;
}

.layer-section.disabled-section summary::after {
  content: "—";
}

.observation-choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  color: var(--text);
  font-size: 0.72rem;
}

.observation-choice input { accent-color: #c4d3dc; }

.observation-choice i {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border: 1px solid #080a0c;
  border-radius: 50%;
  background: var(--observation-color);
}

.lsr-options { display: grid; gap: 5px; }

.lsr-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: var(--text);
  font-size: 0.72rem;
}

.lsr-options input { accent-color: #c4d3dc; }

.lsr-options i {
  width: 10px;
  height: 10px;
  border: 2px solid #050607;
  border-radius: 50%;
  background: var(--lsr-color);
}

.rain-threshold {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.68rem;
}

.rain-threshold select {
  min-height: 29px;
  padding: 3px 6px;
  color: var(--text);
  background: #101419;
  border: 1px solid #252c32;
  font: inherit;
}

.lsr-popup { line-height: 1.35; }
.lsr-popup strong { display: block; margin-bottom: 4px; }

.flood-alert-options { display: grid; gap: 5px; }

.flood-alert-options label {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 0.72rem;
}

.flood-alert-options input { accent-color: #c4d3dc; }

.flood-alert-options i {
  width: 17px;
  height: 10px;
  border: 2px solid var(--alert-color);
  background: color-mix(in srgb, var(--alert-color) 16%, transparent);
}

.opacity-control {
  margin-top: 10px;
}

.opacity-control label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.opacity-control div {
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: center;
  gap: 9px;
}

.opacity-control input {
  width: 100%;
  accent-color: #b9c5cc;
}

.opacity-control output {
  color: var(--text);
  font-size: 0.76rem;
  text-align: right;
}

.point-gap-control {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  color: #cfd6da;
  font-size: 0.72rem;
}

.point-gap-control input { accent-color: #c4d3dc; }

.top-point-control {
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.mping-choice {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 0.72rem;
}

.mping-choice input { accent-color: #c4d3dc; }

.mping-choice i {
  width: 10px;
  height: 10px;
  border: 2px solid #050607;
  border-radius: 50%;
  background: var(--mping-color);
}

.radar-choice {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 0.72rem;
}

.radar-choice input { accent-color: #c4d3dc; }

.radar-choice i {
  width: 18px;
  height: 10px;
  border: 1px solid #050607;
  background: linear-gradient(90deg, transparent, #4fd8ff 28%, #63dd58 53%, #f0df35 75%, #e14b3f);
}

.radar-station-control {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.66rem;
}

.radar-station-control select {
  width: 100%;
  min-height: 32px;
  padding: 5px 7px;
  color: var(--text);
  background: #101419;
  border: 1px solid #30383f;
  font: inherit;
}

.radar-station-control select:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.radar-site-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.4;
}

.radar-site-hint i {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-top: 2px;
  border: 1px solid #eefaff;
  background: #38d9ff;
  box-shadow: 0 0 0 2px rgba(56, 217, 255, 0.2);
  transform: rotate(45deg);
}

.radar-site-icon {
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
}

.radar-site-symbol {
  width: 8px;
  height: 8px;
  display: block;
  border: 1px solid #eefaff;
  background: #38d9ff;
  box-shadow: 0 0 0 2px rgba(56, 217, 255, 0.22);
  transform: rotate(45deg);
}

.radar-site-symbol.active {
  width: 12px;
  height: 12px;
  border: 2px solid #fff4dd;
  background: #ffad33;
  box-shadow: 0 0 0 3px rgba(255, 173, 51, 0.28);
}

.single-radar-playback {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.single-radar-playback button {
  min-height: 30px;
  padding: 4px 7px;
  color: var(--text);
  background: #151c21;
  border: 1px solid #3b464d;
  font: inherit;
  font-size: 0.65rem;
}

.single-radar-playback button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.single-radar-playback span {
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

.expansion-ring-control {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  color: #cfd6da;
  font-size: 0.72rem;
}

.expansion-ring-control input { accent-color: #c4d3dc; }

.product-row, .contour-row {
  display: grid;
  grid-template-columns: 1fr 30px;
  align-items: stretch;
  gap: 5px;
}

.product-choice, .contour-choice {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  color: #cfd6da;
  background: #101419;
  border: 1px solid #252c32;
  text-align: left;
}

.product-choice.active {
  color: #fff;
  border-color: #b4c2cb;
  background: #1b2126;
}

.product-choice:disabled, .contour-choice:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.info-mini {
  padding: 0;
  font-size: 0.76rem;
  background: #101419;
  border: 1px solid #252c32;
}

.contour-choice input { accent-color: #c4d3dc; }

.section-label {
  margin: 17px 0 8px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.predictor-choice {
  display: grid;
  grid-template-columns: 19px 1fr;
  gap: 7px;
  padding: 7px;
  color: var(--text);
  background: #101419;
  border: 1px solid #252c32;
  font-size: 0.68rem;
  line-height: 1.35;
}

.predictor-radius {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.68rem;
}

.predictor-radius select {
  min-height: 29px;
  padding: 3px 24px 3px 7px;
  color: var(--text);
  background: #101419;
  border: 1px solid #252c32;
  font: inherit;
}

.predictor-choice input {
  margin-top: 2px;
  accent-color: #c4d3dc;
}

.predictor-choice strong,
.predictor-choice small {
  display: block;
}

.predictor-choice small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
}

.availability-note {
  margin: 13px 2px 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.legend {
  position: fixed;
  z-index: 800;
  right: 16px;
  bottom: 92px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  padding: 13px 16px;
  background: rgba(9, 11, 13, 0.9);
  border: 1px solid var(--line);
  font-size: 0.84rem;
}

.legend strong {
  color: #d7dee2;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.height-legend {
  position: fixed;
  z-index: 800;
  right: 16px;
  bottom: 151px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  color: #d7dee2;
  background: rgba(9, 11, 13, 0.9);
  border: 1px solid var(--line);
  font-size: 0.72rem;
}

.predictor-legend {
  position: fixed;
  z-index: 800;
  right: 16px;
  bottom: 151px;
  width: 250px;
  padding: 11px 13px;
  color: #d7dee2;
  background: rgba(9, 11, 13, 0.92);
  border: 1px solid var(--line);
  font-size: 0.68rem;
}

.predictor-legend strong {
  display: block;
  margin-bottom: 7px;
  font-weight: 500;
}

.predictor-gradient {
  height: 10px;
  display: block;
  background: linear-gradient(90deg, #233b8b, #3cb4c5, #f0df73, #d84a3f);
}

.predictor-legend div {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
}

.height-glyph {
  width: 24px;
  height: 22px;
  display: block;
  border-left: 2px solid #dce7ed;
  border-bottom: 2px solid #dce7ed;
  clip-path: polygon(0 100%, 0 70%, 35% 70%, 35% 45%, 68% 45%, 68% 15%, 100% 15%, 100% 100%);
  background: linear-gradient(135deg, #57c84d, #d94ad7);
}

.legend span { display: flex; align-items: center; gap: 5px; }

.legend i {
  width: 22px;
  height: 16px;
  display: inline-block;
  background: var(--swatch);
}

.product-message {
  position: fixed;
  z-index: 850;
  left: 50%;
  bottom: 15px;
  width: min(920px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 11px 16px;
  color: #d2d9dd;
  background: rgba(9, 11, 13, 0.93);
  border: 1px solid var(--line);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.4;
}

.loading {
  position: fixed;
  z-index: 1200;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 13px;
  color: #dce4e8;
  background: #101419;
  border: 1px solid var(--line);
  font-size: 0.74rem;
}

.loading[hidden] { display: none; }

.location-briefing {
  position: fixed;
  z-index: 920;
  top: 84px;
  right: 16px;
  bottom: 74px;
  width: min(390px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  background: rgba(9, 11, 13, 0.97);
  border: 1px solid #4a555d;
}

.briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
}

.briefing-header h2, .dashboard h2, .dashboard h3 { margin: 0; }
.briefing-header h2 { margin-top: 2px; font-size: 1.05rem; }
.eyebrow { color: #e8c66a; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; }

.briefing-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 15px 15px;
  font-size: 0.72rem;
  line-height: 1.5;
}

.briefing-content section { padding: 13px 0; border-top: 1px solid #262d32; }
.briefing-content h3 { margin: 0 0 8px; color: #fff; font-size: 0.76rem; }
.briefing-location { margin: 14px 0 2px; color: #fff; font-size: 0.78rem; }
.briefing-valid { margin: 0 0 12px; color: var(--muted); }
.briefing-note { margin: 8px 0 0; color: var(--muted); font-size: 0.65rem; }
.briefing-data-list { margin: 0; }
.briefing-data-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 10px;
  padding: 5px 0;
}
.briefing-data-list dt { color: #c7d0d5; }
.briefing-data-list dd { margin: 0; color: #fff; text-align: right; }
.briefing-data-list .active-product-row { margin: 0 -6px; padding: 6px; background: #182129; }
.briefing-actions { padding: 10px 15px 13px; border-top: 1px solid var(--line); }
.briefing-actions .primary-button { margin: 0 8px 0 0; }

body:has(.location-briefing:not([hidden])) .legend,
body:has(.location-briefing:not([hidden])) .height-legend,
body:has(.location-briefing:not([hidden])) .predictor-legend { right: 420px; }

.dashboard {
  position: fixed;
  z-index: 800;
  inset: 68px 0 0;
  overflow-y: auto;
  padding: 34px max(22px, calc((100vw - 1240px) / 2)) 70px;
  background:
    radial-gradient(circle at 80% 0%, rgba(62, 105, 132, 0.16), transparent 34%),
    #090b0d;
}

.dashboard-active #map,
.dashboard-active #map-3d,
.dashboard-active .layer-panel,
.dashboard-active .legend,
.dashboard-active .predictor-legend,
.dashboard-active .height-legend,
.dashboard-active .product-message,
.dashboard-active .loading,
.dashboard-active .date-controls,
.dashboard-active .top-actions { display: none !important; }

.dashboard-view { max-width: 1240px; margin: 0 auto; }
.dashboard-hero { max-width: 880px; margin-bottom: 26px; }
.dashboard-hero h2 { margin-top: 5px; font-size: clamp(1.55rem, 3vw, 2.7rem); }
.dashboard-hero p { color: #b7c1c7; line-height: 1.7; }
.dashboard-status { margin: 14px 0; color: var(--muted); font-size: 0.75rem; }
.figure-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }

.dashboard-figure {
  margin: 0;
  overflow: hidden;
  background: #0d1115;
  border: 1px solid var(--line);
}
.dashboard-figure img { width: 100%; height: auto; display: block; background: #fff; }
.dashboard-figure figcaption { display: grid; gap: 5px; padding: 13px 15px; color: #b7c1c7; font-size: 0.7rem; line-height: 1.45; }
.dashboard-figure figcaption strong { color: #fff; font-size: 0.78rem; }
.dashboard-figure figcaption a { color: #7fc9f3; width: fit-content; }
.full-resolution-image { display: block; }

.dashboard-card {
  margin-top: 20px;
  padding: 20px;
  background: #0d1115;
  border: 1px solid var(--line);
}
.dashboard-card > p { color: #b7c1c7; line-height: 1.6; }
.card-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.card-heading h3 { margin-top: 4px; }
.card-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.dashboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 18px 0;
  padding: 15px;
  background: #0d1115;
  border: 1px solid var(--line);
}
.dashboard label { display: grid; gap: 5px; color: var(--muted); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; }
.dashboard select { min-height: 38px; padding: 0 30px 0 9px; text-transform: none; letter-spacing: 0; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.summary-strip > div { display: grid; gap: 5px; padding: 13px; background: #0d1115; border: 1px solid var(--line); }
.summary-strip span { color: var(--muted); font-size: 0.66rem; text-transform: uppercase; }
.summary-strip strong { font-size: 0.9rem; }
.warning-callout, .callout { padding: 12px 14px; border: 1px solid #6e6032; background: rgba(110, 96, 50, 0.17); color: #eadca3; font-size: 0.72rem; line-height: 1.5; }
.warning-callout { margin: 12px 0; }
.callout { margin-top: 15px; }
.bar-chart { display: grid; gap: 14px; margin-top: 18px; }
.bar-group { display: grid; gap: 5px; padding: 7px; border: 1px solid transparent; }
.bar-group > strong { font-size: 0.72rem; }
.bar-row, .metric-bar-row { display: grid; grid-template-columns: 120px minmax(80px, 1fr) 75px; align-items: center; gap: 9px; font-size: 0.68rem; }
.bar-row i, .metric-bar-row i { height: 13px; display: block; background: linear-gradient(90deg, #427ca1 var(--bar-width), #1b2329 var(--bar-width)); }
.bar-row.hits i { background: linear-gradient(90deg, #4d9b68 var(--bar-width), #1b2329 var(--bar-width)); }
.bar-row.false-alarms i { background: linear-gradient(90deg, #b65a4c var(--bar-width), #1b2329 var(--bar-width)); }
.bar-row.misses i { background: linear-gradient(90deg, #d7c169 var(--bar-width), #1b2329 var(--bar-width)); }
.bar-row.correct-negatives i { background: linear-gradient(90deg, #818b91 var(--bar-width), #1b2329 var(--bar-width)); }
.risk-case-row i { background: linear-gradient(90deg, #7a5bc7 var(--bar-width), #1b2329 var(--bar-width)); }
.metric-bar-row i.signed-metric {
  position: relative;
  background: #1b2329;
}
.metric-bar-row i.signed-metric::after {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 50%;
  width: 1px;
  content: "";
  background: #9aa5ab;
}
.metric-bar-row i.signed-positive {
  background: linear-gradient(
    90deg,
    #1b2329 0 50%,
    #427ca1 50% calc(50% + var(--bar-half-width)),
    #1b2329 calc(50% + var(--bar-half-width)) 100%
  );
}
.metric-bar-row i.signed-negative {
  background: linear-gradient(
    90deg,
    #1b2329 0 calc(50% - var(--bar-half-width)),
    #b65a4c calc(50% - var(--bar-half-width)) 50%,
    #1b2329 50% 100%
  );
}
.bar-row b, .metric-bar-row b { text-align: right; }
.best-performing {
  border-color: #65c987;
  background: rgba(77, 155, 104, 0.12);
}
.metric-bar-row.best-performing { padding: 7px; }
tr.best-performing td {
  color: #e7fff0;
  background: rgba(77, 155, 104, 0.13);
}
.chart-heading { color: #fff; font-size: 0.78rem; }
.metric-chart { margin-bottom: 22px; }
.table-wrap { overflow-x: auto; }
.caveat-grid, .about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.caveat-grid p { margin: 0; padding: 15px; color: #bbc5ca; background: #0d1115; border: 1px solid var(--line); font-size: 0.72rem; line-height: 1.55; }
.about-grid .dashboard-card { margin-top: 0; }

.creator-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(110deg, rgba(35, 75, 100, 0.34), transparent 56%),
    #0d1115;
  border-color: #42657b;
}
.creator-invite::after {
  position: absolute;
  right: -65px;
  width: 210px;
  height: 210px;
  content: "";
  border: 1px solid rgba(169, 216, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgba(169, 216, 255, 0.035), 0 0 0 55px rgba(169, 216, 255, 0.025);
}
.creator-invite > * { position: relative; z-index: 1; }
.creator-invite h3 { margin: 5px 0; font-size: 1.25rem; }
.creator-invite p { max-width: 760px; margin-bottom: 0; }

.dashboard-link,
.secondary-dashboard-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid #9bc7e4;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
}
.dashboard-link { color: #090b0d; background: #dce7ed; }
.dashboard-link:hover { background: #fff; }
.secondary-dashboard-link { color: #c6d1d7; border-color: var(--line); }
.secondary-dashboard-link:hover { color: #fff; border-color: #77848c; }

.creator-view { padding-bottom: 30px; }
.creator-hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(250px, 0.75fr) minmax(480px, 1.65fr);
  align-items: center;
  gap: clamp(34px, 7vw, 100px);
  padding: clamp(24px, 5vw, 58px);
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 12% 82%, rgba(87, 200, 77, 0.09), transparent 24%),
    radial-gradient(circle at 75% 0%, rgba(63, 125, 162, 0.2), transparent 38%),
    linear-gradient(130deg, #101820, #0b0f13 62%);
  border: 1px solid #35444e;
}
.creator-hero::after {
  position: absolute;
  right: 6%;
  bottom: -52px;
  width: 420px;
  height: 100px;
  content: "";
  border-top: 1px solid rgba(169, 216, 255, 0.12);
  border-radius: 50%;
  transform: rotate(-8deg);
}
.creator-monogram {
  aspect-ratio: 1;
  width: min(100%, 290px);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  color: #f4f8fa;
  background: #080b0e;
  border: 1px solid #637682;
  border-radius: 34% 46% 38% 48%;
  box-shadow: 22px 24px 0 rgba(80, 123, 148, 0.1);
}
.creator-monogram::before {
  position: absolute;
  inset: 12%;
  content: "";
  border: 1px dashed rgba(220, 231, 237, 0.24);
  border-radius: 50%;
}
.creator-monogram span { z-index: 2; font-size: clamp(3.2rem, 8vw, 6rem); font-weight: 600; letter-spacing: -0.08em; }
.creator-monogram i {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 28%;
  border-top: 2px solid rgba(169, 216, 255, 0.42);
  border-radius: 50%;
  transform: rotate(-8deg);
}
.creator-monogram i:nth-of-type(1) { bottom: 2%; }
.creator-monogram i:nth-of-type(2) { bottom: -5%; left: 0; border-color: rgba(87, 200, 77, 0.38); }
.creator-monogram i:nth-of-type(3) { bottom: -12%; left: -2%; border-color: rgba(240, 223, 53, 0.28); }
.creator-intro { position: relative; z-index: 1; }
.creator-intro h2 { margin: 6px 0 2px; font-size: clamp(2.1rem, 5vw, 4.6rem); line-height: 1; letter-spacing: -0.045em; }
.creator-title { margin: 12px 0 20px; color: #8fc8ed; font-size: clamp(0.78rem, 1.5vw, 1.02rem); line-height: 1.5; }
.creator-intro > p:last-of-type { max-width: 760px; color: #bac5cb; line-height: 1.75; }
.creator-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.creator-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-top: 0;
}
.creator-stat-strip div { min-height: 105px; display: grid; align-content: center; gap: 6px; padding: 18px 22px; background: #0d1115; border-right: 1px solid var(--line); }
.creator-stat-strip div:last-child { border-right: 0; }
.creator-stat-strip strong { color: #fff; font-size: clamp(1.55rem, 3vw, 2.35rem); font-weight: 500; }
.creator-stat-strip span { color: var(--muted); font-size: 0.64rem; line-height: 1.35; text-transform: uppercase; letter-spacing: 0.07em; }

.creator-section { margin-top: 50px; }
.creator-section-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; }
.creator-section-heading.compact { margin-bottom: 22px; }
.creator-section-heading h3 { margin: 3px 0 0; font-size: clamp(1.12rem, 2.3vw, 1.65rem); }
.section-index { min-width: 52px; color: #67879b; font-size: 0.78rem; }

.achievement-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.achievement-card {
  min-height: 220px;
  padding: 24px;
  position: relative;
  background: #0d1115;
  border: 1px solid var(--line);
}
.achievement-card::before { position: absolute; top: -1px; left: -1px; width: 84px; height: 3px; content: ""; background: var(--card-accent); }
.achievement-card > span { color: var(--card-accent); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.09em; }
.achievement-card h4 { max-width: 500px; margin: 34px 0 10px; font-size: 1rem; }
.achievement-card p { margin: 0; color: #aeb9bf; font-size: 0.75rem; line-height: 1.7; }
.accent-blue { --card-accent: #73bee9; }
.accent-green { --card-accent: #69bd78; }
.accent-yellow { --card-accent: #d6c667; }
.accent-magenta { --card-accent: #cc72c9; }

.career-timeline { border-top: 1px solid var(--line); }
.career-timeline article { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 23px 6px; border-bottom: 1px solid var(--line); }
.career-timeline time { color: #7fc9f3; font-size: 0.7rem; }
.career-timeline h4 { margin: 0 0 8px; font-size: 0.88rem; }
.career-timeline p { max-width: 850px; margin: 0; color: #aeb9bf; font-size: 0.73rem; line-height: 1.65; }

.creator-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.creator-panel { padding: 24px; background: #0d1115; border: 1px solid var(--line); }
.education-list { display: grid; gap: 10px; }
.education-list article { display: grid; gap: 5px; padding: 16px; background: #10161b; border-left: 2px solid #5f96b8; }
.education-list span { color: #fff; font-size: 0.82rem; }
.education-list strong { color: #a9d8ff; font-size: 0.72rem; font-weight: 500; }
.education-list small { color: var(--muted); font-size: 0.64rem; line-height: 1.4; }
.skill-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-cloud span { padding: 8px 10px; color: #bcc7cd; background: #10161b; border: 1px solid #2e3940; font-size: 0.63rem; }

.publication-list { display: grid; gap: 8px; }
.publication-list article { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: start; padding: 18px; background: #0d1115; border: 1px solid var(--line); }
.publication-list p { margin: 0; color: #c2ccd1; font-size: 0.73rem; line-height: 1.65; }
.publication-list a { color: #a9d8ff; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.publication-list a:hover { color: #fff; }
.publication-list cite { color: #8fa0a9; }
.publication-status { width: fit-content; padding: 5px 7px; border: 1px solid currentColor; font-size: 0.57rem; text-transform: uppercase; letter-spacing: 0.06em; }
.publication-status.published { color: #72c789; }
.publication-status.review { color: #7fc9f3; }
.publication-status.preparation { color: #d7c169; }

.presentation-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.presentation-list article { min-height: 135px; display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding: 17px; background: #0d1115; border: 1px solid var(--line); }
.presentation-list time { color: #7fc9f3; font-size: 0.61rem; }
.presentation-list div { display: grid; align-content: start; gap: 10px; }
.presentation-list strong { font-size: 0.7rem; line-height: 1.55; }
.presentation-list span { color: var(--muted); font-size: 0.62rem; line-height: 1.45; }

.creator-footer-card { display: grid; grid-template-columns: 0.55fr 1fr; gap: 30px; align-items: center; margin-top: 50px; padding: 28px; background: linear-gradient(120deg, rgba(57, 101, 129, 0.25), #0d1115 62%); border: 1px solid #3c5869; }
.creator-footer-card h3 { margin: 5px 0; font-size: 1.25rem; }
.creator-footer-card p { margin: 0; color: #b4c0c6; font-size: 0.72rem; line-height: 1.65; }

.site-dialog {
  width: min(680px, calc(100% - 28px));
  max-height: min(780px, calc(100% - 28px));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid #414a51;
  border-radius: 0;
}

.site-dialog::backdrop { background: rgba(0, 0, 0, 0.78); }

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
  font-weight: 600;
}

.dialog-content {
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 22px;
  color: #c8d0d5;
  font-size: 0.82rem;
  line-height: 1.65;
}

.dialog-content h2 {
  margin: 22px 0 5px;
  color: #f2f5f6;
  font-size: 0.88rem;
}

.dialog-content p { margin: 7px 0; }
.dialog-content .lead { color: #eef2f4; font-size: 0.92rem; }
.compact-dialog { width: min(520px, calc(100% - 28px)); }
.archive-dialog { width: min(900px, calc(100% - 28px)); }

.primary-button {
  min-height: 40px;
  margin-top: 20px;
  padding: 0 15px;
  color: #090b0d;
  background: #dce7ed;
  border: 0;
}

.archive-table-wrap { overflow-x: auto; }

.pending-cell { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid #2a3137; text-align: left; }
th { color: #fff; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
td { font-size: 0.74rem; }
td a, .archive-load { color: var(--accent); background: none; border: 0; padding: 0; text-decoration: none; }

noscript {
  position: fixed;
  z-index: 2000;
  inset: 0;
  padding: 40px;
  background: #090b0d;
}

@media (min-width: 901px) and (max-width: 1200px) {
  .topbar { grid-template-columns: minmax(220px, auto) 1fr auto; }
  .date-controls { display: none; }
  .top-actions .text-button { display: none; }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 62px;
  }
  .product-nav {
    position: fixed;
    z-index: 1000;
    top: 107px;
    left: 0;
    right: 0;
    min-height: 42px;
    justify-content: flex-start;
    padding: 3px 8px;
    background: rgba(9, 11, 13, 0.98);
    border-bottom: 1px solid var(--line);
  }
  .brand h1 { font-size: 0.82rem; }
  .brand-mark { width: 34px; height: 34px; }
  .date-controls {
    display: flex;
    position: fixed;
    top: 62px;
    left: 0;
    right: 0;
    min-height: 45px;
    padding: 5px 10px;
    background: rgba(9, 11, 13, 0.96);
    border-bottom: 1px solid var(--line);
  }
  .date-controls label { display: none; }
  #valid-period { font-size: 0.66rem; }
  .top-actions > :not(.mobile-actions-toggle) { display: none; }
  .top-actions .mobile-actions-toggle { display: inline-grid; }
  .top-actions.mobile-open {
    position: fixed;
    z-index: 1100;
    top: 8px;
    right: 8px;
    width: min(260px, calc(100% - 16px));
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 8px;
    background: rgba(9, 11, 13, 0.98);
    border: 1px solid var(--line);
  }
  .top-actions.mobile-open > * { display: flex; }
  .top-actions.mobile-open .view-switch { display: grid; }
  .top-actions.mobile-open .round-button { display: grid; }
  .top-actions.mobile-open .mobile-actions-toggle { order: -1; }
  .layer-panel {
    top: auto;
    left: 10px;
    bottom: 52px;
    width: min(286px, calc(100% - 20px));
    max-height: 48vh;
    padding: 10px 12px;
  }
  .layer-panel .panel-heading { margin-bottom: 0; }
  .layer-panel .panel-heading:has(+ #layer-panel-content:not([hidden])) { margin-bottom: 10px; }
  .legend { right: 10px; bottom: 100px; flex-wrap: wrap; max-width: 190px; }
  .height-legend { right: 10px; bottom: 174px; max-width: 190px; }
  .predictor-legend { right: 10px; bottom: 174px; width: 220px; }
  .product-message { bottom: 8px; font-size: 0.78rem; }
  .dashboard { inset: 149px 0 0; padding: 22px 14px 55px; }
  .dashboard-active .product-nav { top: 62px; }
  .dashboard-active .dashboard { inset: 104px 0 0; }
  .location-briefing {
    top: auto;
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    height: min(68vh, 650px);
  }
  body:has(.location-briefing:not([hidden])) .legend,
  body:has(.location-briefing:not([hidden])) .height-legend,
  body:has(.location-briefing:not([hidden])) .predictor-legend { right: 10px; visibility: hidden; }
  .figure-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .caveat-grid, .about-grid { grid-template-columns: 1fr; }
  .creator-hero { grid-template-columns: 190px 1fr; gap: 28px; padding: 28px; }
  .creator-stat-strip { grid-template-columns: repeat(2, 1fr); }
  .creator-stat-strip div:nth-child(2) { border-right: 0; }
  .creator-stat-strip div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .creator-two-column { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand h1 { max-width: 170px; white-space: normal; line-height: 1.1; }
  .icon-button { padding: 0 8px; font-size: 0.7rem; }
  #valid-period { display: none; }
  .legend {
    right: 8px;
    bottom: 108px;
    display: grid;
    grid-template-columns: 1fr;
    max-width: 210px;
    gap: 5px;
    padding: 7px 9px;
    font-size: 0.62rem;
  }
  .legend strong { font-size: 0.58rem; }
  .legend i { width: 15px; height: 11px; }
  .product-nav a { padding: 0 8px; font-size: 0.62rem; }
  .summary-strip { grid-template-columns: 1fr; }
  .card-heading { align-items: flex-start; flex-direction: column; }
  .bar-row, .metric-bar-row { grid-template-columns: 92px minmax(60px, 1fr) 70px; }
  .creator-invite { align-items: flex-start; flex-direction: column; }
  .creator-invite .dashboard-link { width: 100%; }
  .creator-hero { grid-template-columns: 1fr; padding: 22px; }
  .creator-monogram { width: 155px; border-radius: 32% 45% 35% 46%; }
  .creator-monogram span { font-size: 3.3rem; }
  .creator-intro h2 { font-size: 2.25rem; }
  .creator-actions { display: grid; }
  .creator-actions a { width: 100%; white-space: normal; text-align: center; }
  .creator-stat-strip div { min-height: 92px; padding: 14px; }
  .creator-stat-strip div:nth-child(2n) { border-right: 0; }
  .achievement-grid, .presentation-list { grid-template-columns: 1fr; }
  .achievement-card { min-height: 0; }
  .career-timeline article { grid-template-columns: 1fr; gap: 8px; }
  .publication-list article { grid-template-columns: 1fr; gap: 12px; }
  .creator-footer-card { grid-template-columns: 1fr; }
}
