:root {
  color-scheme: light;
  font: 14px/1.5 "Geist", "Microsoft YaHei", system-ui, sans-serif;
  color: #142833;
  background: #101b25;
  --ink: #142833;
  --muted: #576975;
  --accent: #087c69;
  --border: #dce4e6;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 2px solid #1da48a; outline-offset: 3px; }
[hidden] { display: none !important; }
.app-header { display: flex; align-items: center; gap: 22px; height: 64px; padding: 0 25px; color: #ecf5f6; border-bottom: 1px solid #2b3a47; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; color: #112522; background: #6de2c4; border-radius: 8px; font-size: 25px; line-height: 1; }
h1 { margin: 0; padding-left: 22px; border-left: 1px solid #40535e; font-size: 15px; font-weight: 500; }
main { display: grid; grid-template-columns: minmax(292px, 340px) minmax(0, 1fr); min-height: 100dvh; }
main.sidebar-hidden { grid-template-columns: minmax(0, 1fr); }
.settings { display: flex; flex-direction: column; gap: 18px; height: 100dvh; overflow: auto; padding: 22px 21px; background: #f7f9f9; }
.settings section + section { padding-top: 15px; border-top: 1px solid var(--border); }
h2 { font-size: 15px; margin: 0 0 11px; }
.drop { position: relative; display: grid; justify-items: center; gap: 3px; padding: 13px 8px; text-align: center; background: #edf6f3; border: 1px dashed #83aaa3; border-radius: 9px; cursor: pointer; }
.drop:hover, .drop.dragging { background: #dff2eb; border-color: var(--accent); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop input { position: absolute; width: 100%; height: 100%; inset: 0; opacity: 0; cursor: pointer; }
.drop span, .hint { font-size: 12px; color: var(--muted); }
.drop .upload-icon { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 2px; border-radius: 8px; background: #d5ece5; color: #087260; font-size: 19px; }
.hint { margin: 6px 0; }
.link-button { padding: 1px 0; background: none; border: 0; color: var(--accent); font-weight: 650; }
#status { margin: 7px 0 0; color: var(--muted); overflow-wrap: anywhere; font-size: 12px; }
#status.error { color: #9d352e; }
.metrics { margin: 9px 0 0; font-size: 12px; }
.metrics div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 2px 0; }
dt { color: var(--muted); flex-shrink: 0; }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
form > label, #model-orientation > label { display: block; margin: 10px 0 4px; font-size: 13px; }
.input-unit, select { width: 100%; background: #fff; border: 1px solid #cbd7db; border-radius: 6px; }
.input-unit { display: flex; align-items: center; padding-right: 10px; }
.input-unit input, select { padding: 7px 9px; color: var(--ink); }
.input-unit input { width: 100%; min-width: 0; border: 0; border-radius: inherit; background: none; }
.input-unit span { flex-shrink: 0; color: var(--muted); font-size: 12px; }
input[type="range"] { display: block; width: 100%; margin: 9px 0 0; accent-color: var(--accent); }
.profile { margin: 12px 0 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.profile figcaption { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px; font-size: 12px; font-weight: 700; }
.profile span, .profile p, .units { color: var(--muted); font-size: 11px; font-weight: 400; }
.profile p { margin: 0; }
#profile { display: block; width: 100%; height: 94px; }
.domain-info { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.run { margin-top: auto; }
#calculate { width: 100%; padding: 9px; border: 0; border-radius: 7px; color: white; background: #087864; font-weight: 700; }
#run-status { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.frequency-info dd { white-space: nowrap; }
.refinement-option { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
#slice-controls { position: absolute; z-index: 1; top: 62px; right: 22px; display: grid; gap: 10px; width: min(300px, calc(100% - 44px)); padding: 10px; background: #122331f5; border: 1px solid #405563; border-radius: 9px; font-size: 12px; }
.slice-control { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; }
.slice-control label { grid-column: 1 / -1; }
.slice-control select { grid-column: 1 / -1; padding: 4px 6px; border-color: #405563; background: #192a38; color: #ecf5f6; }
.slice-control [role="status"] { grid-column: 1 / -1; margin: 0; color: #aac3cc; }
.slice-control input[type="range"], .slice-opacity input { margin: 0; }
.slice-control input[type="number"] { width: 8ch; min-width: 0; padding: 3px 4px; border: 1px solid #405563; border-radius: 5px; background: #192a38; color: #ecf5f6; text-align: right; }
.speed-legend { position: relative; grid-column: 2; grid-row: 1; justify-self: center; width: min(540px, 100%); padding: 5px 10px; background: #122331ee; border: 1px solid #405563; border-radius: 8px 8px 0 0; color: #ecf5f6; font-size: 12px; pointer-events: auto; }
.legend-settings { position: absolute; bottom: calc(100% + 8px); inset-inline: 0; display: grid; gap: 10px; max-height: min(55dvh, calc(100dvh - 160px)); overflow: auto; padding: 10px; background: #122331fa; border: 1px solid #405563; border-radius: 8px; }
.speed-legend button:is([aria-pressed="true"], [aria-expanded="true"]) { border-color: #82cbbf; background: #234c4b; }
.speed-scale, .speed-controls, .slice-opacity, .legend-display-controls { display: flex; align-items: center; gap: 6px; }
.speed-scale { white-space: nowrap; }
.speed-controls, .legend-display-controls { flex-wrap: wrap; }
.legend-display-controls { justify-content: space-between; }
.speed-ramp { flex: 1; min-width: 40px; height: 16px; border-radius: 3px; }
.speed-controls input, .speed-legend button { padding: 3px 6px; border: 1px solid #405563; border-radius: 5px; background: #192a38; color: #ecf5f6; }
.speed-controls input { width: 5em; }
.slice-opacity { flex-wrap: wrap; }
.slice-opacity input { width: min(110px, 42%); }
.slice-opacity output { min-width: 4ch; text-align: right; }
.palette-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.palette-options button { display: grid; gap: 4px; }
.palette-swatch { height: 14px; border-radius: 3px; }
#slice-range-message { margin: 0; color: #ffd575; }
.viewport { position: relative; container-type: inline-size; min-width: 0; height: 100dvh; overflow: hidden; background: radial-gradient(ellipse at 50% 25%, #1c3040, #101b25 75%); color: #eaf3f5; }
#scene { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#scene:active { cursor: grabbing; }
#scene.probing { cursor: crosshair; }
#wind-probe-marker { position: absolute; z-index: 1; width: 10px; height: 10px; translate: -50% -50%; border: 2px solid #fff; border-radius: 50%; background: #087864; box-shadow: 0 0 0 1px #122331; pointer-events: none; }
#wind-probe-value { position: absolute; left: 12px; top: 50%; translate: 0 -50%; padding: 3px 6px; background: #122331f5; border: 1px solid #405563; border-radius: 5px; color: #fff; white-space: nowrap; font-size: 12px; }
#wind-probe-marker.probe-label-left output { left: auto; right: 12px; }
#wind-probe-status { position: absolute; top: 102px; inset-inline: 12px; width: fit-content; margin: 0 auto; padding: 3px 8px; background: #122331ee; border-radius: 5px; color: #ecf5f6; font-size: 12px; pointer-events: none; }
.viewport-header { position: absolute; left: 22px; right: 22px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.viewport-header { top: 18px; }
.viewport-header h2 { margin: 0 0 4px; }
.viewport-title { display: flex; align-items: flex-start; gap: 9px; }
#toggle-sidebar { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; pointer-events: auto; }
.sidebar-icon { position: relative; width: 16px; height: 13px; border: 1px solid currentColor; border-radius: 2px; }
.sidebar-icon::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; border-right: 1px solid currentColor; }
#toggle-sidebar[aria-expanded="true"] .sidebar-icon::before { background: #6de2c4; }
#wind-readout { color: #a8c0c9; font-size: 12px; }
.view-controls { display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; }
.volume-settings { display: grid; gap: 6px; border-top: 1px solid #405563; padding-top: 8px; }
#volume-status { color: #ffd88a; }
.view-controls button, #toggle-sidebar { background: #192a38; border: 1px solid #405563; border-radius: 6px; padding: 5px 8px; color: #e1edf0; font-size: 12px; }
.view-controls button:hover:enabled, .view-controls button[aria-pressed="true"], #toggle-sidebar:hover { border-color: #6de2c4; }
.viewport-footer { position: absolute; inset-inline: 12px; bottom: 0; z-index: 2; display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: end; gap: 4px 12px; color: #a8c0c9; font-size: 11px; pointer-events: none; }
.legend { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; gap: 2px 10px; padding-bottom: 4px; }
.legend span { white-space: nowrap; }
.gestures { grid-column: 3; grid-row: 1; justify-self: end; padding-bottom: 4px; text-align: right; }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; }
.model-key::before { background: #bed4e8; }
.domain-key::before { background: #6599bb; }
.wind-key::before { background: #6de2c4; }
.empty { position: absolute; display: grid; gap: 6px; left: 50%; top: 45%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; width: 80%; }
.empty strong { font-size: 21px; }
.empty span { color: #b8ccd3; font-size: 12px; }
#labels { position: absolute; inset: 0; pointer-events: none; }
#labels span { position: absolute; white-space: nowrap; padding: 1px 4px; border-radius: 3px; background: #142633; color: #c4d9e5; font-size: 11px; transform: translate(-50%, -115%); }
#labels #inlet { color: #6de2c4; }
#view-axes { position: absolute; right: 12px; bottom: 46px; z-index: 1; width: 106px; height: 106px; pointer-events: none; }
.axis-ew { --axis-color: #f59887; }
.axis-ns { --axis-color: #80dbac; }
.axis-ud { --axis-color: #89bfff; }
.axis-line { position: absolute; left: 50%; top: 50%; height: 1px; translate: -50% -50%; background: var(--axis-color); opacity: .62; }
#view-axes button { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 1px solid var(--axis-color); border-radius: 50%; background: #182b39; color: var(--axis-color); font-size: 12px; line-height: 1; pointer-events: auto; }
#view-axes button.axis-far { opacity: .68; }
#view-axes button:hover, #view-axes button:focus-visible, #view-axes button[aria-pressed="true"] { opacity: 1; background: var(--axis-color); color: #122331; }
@container (max-width: 760px) {
  .viewport-footer { grid-template-columns: auto minmax(0, 1fr); }
  .speed-legend { grid-column: 1 / -1; }
  .legend { grid-row: 2; }
  .gestures { grid-column: 2; grid-row: 2; }
  .viewport:has(.speed-legend:not([hidden])) #view-axes { bottom: 86px; }
}
@media (max-width: 760px) {
  .app-header { position: sticky; top: 0; z-index: 2; gap: 8px; padding: 0 12px; background: #101b25; }
  .app-header h1 { padding-left: 8px; font-size: 13px; }
  main { display: flex; flex-direction: column; }
  .viewport { order: -1; }
  .settings { height: auto; overflow: visible; }
  .viewport-header { left: 13px; right: 13px; }
}
