:root {
  --bg: #061016;
  --panel: rgba(10, 23, 30, 0.86);
  --panel-strong: #0b1921;
  --line: rgba(153, 190, 198, 0.13);
  --line-bright: rgba(152, 226, 232, 0.27);
  --text: #e8f2f1;
  --muted: #789097;
  --cyan: #4fe4e4;
  --cyan-soft: #a2f4ef;
  --lime: #b8e66b;
  --amber: #f6b85e;
  --red: #f07364;
  --mono: 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono', Menlo, Consolas, monospace;
  --sans: Inter, Avenir, 'Segoe UI', Helvetica, Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 44% 35%, rgba(20, 104, 113, .12), transparent 28%),
    linear-gradient(145deg, #071218 0%, #040b10 58%, #061117 100%);
  font-family: var(--sans);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(147, 191, 198, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 191, 198, .025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  width: 460px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: .06;
}
.ambient-one { background: var(--cyan); top: 16%; left: 34%; }
.ambient-two { background: var(--lime); right: -220px; bottom: -180px; }

.shell {
  position: relative;
  min-height: 100vh;
  padding: 0 20px 18px;
}

.topbar {
  height: 82px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand-mark {
  width: 33px;
  height: 33px;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(79, 228, 228, .35);
  transform: rotate(45deg);
}

.brand-mark::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.brand-mark i {
  position: absolute;
  width: 2px;
  height: 12px;
  background: var(--cyan);
  transform-origin: center bottom;
  bottom: 50%;
  left: calc(50% - 1px);
}
.brand-mark i:nth-child(1) { transform: rotate(0deg); }
.brand-mark i:nth-child(2) { transform: rotate(120deg); }
.brand-mark i:nth-child(3) { transform: rotate(240deg); }

.brand b { display: block; font-size: 15px; letter-spacing: .2em; }
.brand small { display: block; color: var(--muted); font: 400 10px/1.5 var(--mono); letter-spacing: .2em; }

.asset-path {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #60767c;
  font: 400 11px var(--mono);
  letter-spacing: .11em;
}
.asset-path i { font-style: normal; color: #30444a; }
.asset-path strong { color: var(--cyan-soft); font-weight: 500; }
.design-credit { color: #86a0a6; text-decoration: none; transition: color .2s ease; }
.design-credit:hover { color: var(--cyan-soft); }

.header-status { justify-self: end; display: flex; align-items: center; gap: 22px; }
.live-badge {
  padding: 8px 11px;
  border: 1px solid rgba(184, 230, 107, .18);
  background: rgba(184, 230, 107, .045);
  color: var(--lime);
  font: 500 11px var(--mono);
  letter-spacing: .1em;
}
.live-badge i, .component-state > span i {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(184, 230, 107, .09), 0 0 12px var(--lime);
  animation: livePulse 2s infinite;
}
@keyframes livePulse { 50% { opacity: .55; box-shadow: 0 0 0 7px transparent; } }

.system-time { display: flex; align-items: baseline; gap: 7px; font: 400 12px var(--mono); }
.system-time small { color: var(--muted); font-size: 9px; letter-spacing: .12em; }

.icon-button {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { border-color: var(--line-bright); }
.sound-bars { height: 12px; display: flex; justify-content: center; align-items: end; gap: 2px; }
.sound-bars i { width: 2px; height: 5px; background: #698189; transition: .2s; }
.sound-bars i:nth-child(2) { height: 9px; }
.sound-bars i:nth-child(3) { height: 12px; }
.sound-bars i:nth-child(4) { height: 7px; }
.icon-button[aria-pressed="true"] .sound-bars i { background: var(--cyan); animation: bars .7s ease-in-out infinite alternate; }
.icon-button[aria-pressed="true"] .sound-bars i:nth-child(2) { animation-delay: -.3s; }
.icon-button[aria-pressed="true"] .sound-bars i:nth-child(3) { animation-delay: -.5s; }
@keyframes bars { to { height: 3px; } }

.workspace {
  display: grid;
  grid-template-columns: 304px minmax(540px, 1fr) 330px;
  min-height: calc(100vh - 224px);
}

.panel { min-width: 0; }
.overview-panel, .inspector-panel { padding: 28px 24px 24px; }
.overview-panel { border-right: 1px solid var(--line); }
.inspector-panel { border-left: 1px solid var(--line); }

.eyebrow { display: flex; align-items: center; justify-content: space-between; color: #78949b; font: 500 11px var(--mono); letter-spacing: .1em; }
.eyebrow b { color: #4d646b; font-weight: 400; }

.overview-panel h1 {
  margin: 24px 0 7px;
  font-size: clamp(38px, 3vw, 48px);
  line-height: .84;
  letter-spacing: -.065em;
  font-weight: 500;
}
.overview-panel h1 em { color: var(--cyan); font-style: normal; font-weight: 300; }
.asset-copy { margin: 15px 0 0; color: #86a0a6; font: 300 11px/1.7 var(--mono); letter-spacing: .03em; }

.health-block {
  margin: 27px 0;
  padding: 17px 0;
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.health-ring {
  width: 64px; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--lime) calc(var(--value) * 1%), rgba(184,230,107,.08) 0);
  position: relative;
  box-shadow: 0 0 28px rgba(184, 230, 107, .05);
}
.health-ring::before { content:''; position:absolute; inset: 4px; border-radius:50%; background: #0a171e; border: 1px solid rgba(184,230,107,.08); }
.health-ring span { z-index: 1; font: 400 14px var(--mono); }
.health-ring small { color: var(--muted); font-size: 9px; margin-left: 1px; }
.health-block > div:last-child > small { color: #829aa0; font: 500 10px var(--mono); letter-spacing: .08em; }
.health-block > div:last-child > strong { color: var(--lime); display: block; margin-top: 4px; font-size: 15px; font-weight: 500; }
.health-block p { color: #70888f; font-size: 11px; line-height: 1.5; margin: 5px 0 0; }

.section-label { margin: 0 0 11px; color: #7d979e; font: 500 11px var(--mono); letter-spacing: .08em; }
.section-label span { float: right; color: var(--amber); }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric-card { position: relative; min-height: 88px; padding: 12px; background: rgba(13, 30, 38, .7); border: 1px solid var(--line); overflow: hidden; }
.metric-card::before { content: ''; position: absolute; inset: 0 auto auto 0; height: 1px; width: 33%; background: #6a858d; }
.metric-card.accent-cyan::before { background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.metric-card.accent-lime::before { background: var(--lime); box-shadow: 0 0 14px var(--lime); }
.metric-card > div { display: flex; justify-content: space-between; }
.metric-card div span { color: #789199; font: 500 10px var(--mono); letter-spacing: .05em; }
.trend { font: 400 12px var(--mono); font-style: normal; }
.trend.up { color: var(--lime); }
.trend.calm { color: #657a80; }
.trend.warning { color: var(--amber); }
.metric-card > strong { display: inline-block; margin-top: 10px; font: 400 24px var(--mono); letter-spacing: -.06em; }
.metric-card > small { color: #789199; font: 400 10px var(--mono); margin-left: 4px; }
.sparkline { display: block; width: calc(100% + 24px); height: 28px; margin: -4px -12px -12px; opacity: .8; }

.wind-control { display: block; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.wind-control > span:first-child { display: flex; justify-content: space-between; }
.wind-control b, .wind-control output { font: 500 10px var(--mono); letter-spacing: .07em; }
.wind-control b { color: #647d84; }
.wind-control output { color: var(--cyan-soft); }
.wind-control input { width: 100%; margin: 14px 0 6px; height: 2px; appearance: none; outline: none; background: linear-gradient(90deg, var(--cyan) var(--range, 42%), #1d3036 var(--range, 42%)); }
.wind-control input::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #0c1a20; background: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 13px rgba(79,228,228,.5); cursor: pointer; }
.wind-control input:disabled { opacity: .48; cursor: not-allowed; }
.wind-control input:disabled::-webkit-slider-thumb { cursor: not-allowed; box-shadow: 0 0 0 1px #71898f; background: #71898f; }
.range-labels { display: flex; justify-content: space-between; color: #40565d; }
.range-labels i { font: 400 9px var(--mono); font-style: normal; letter-spacing: .06em; }

.twin-stage { position: relative; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; }
.stage-header { height: 84px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); }
.stage-kicker { color: #789097; font: 500 10px var(--mono); letter-spacing: .08em; }
.stage-header h2 { margin: 5px 0 0; font-size: 19px; font-weight: 500; letter-spacing: -.025em; }
.mode-switcher { display: flex; background: rgba(3, 12, 17, .5); padding: 3px; border: 1px solid var(--line); }
.mode { min-height: 36px; border: 0; padding: 9px 12px; background: transparent; color: #6f898f; font: 500 10px var(--mono); letter-spacing: .06em; cursor: pointer; }
.mode:hover { color: var(--text); }
.mode.active { color: var(--cyan-soft); background: rgba(79, 228, 228, .09); box-shadow: inset 0 -1px var(--cyan); }

.scene-wrap { position: relative; min-height: 590px; overflow: hidden; cursor: grab; background: radial-gradient(circle at 50% 37%, rgba(35, 117, 122, .09), transparent 37%); }
.scene-wrap:active { cursor: grabbing; }
#turbineCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 100px rgba(0,0,0,.25); }
.scan-line { position: absolute; inset: -50% 0 auto; height: 42%; pointer-events: none; opacity: .12; background: linear-gradient(transparent, rgba(79,228,228,.18), transparent); animation: scan 8s linear infinite; }
@keyframes scan { to { transform: translateY(350%); } }

.sensor { position: absolute; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; transform: translate(-16px, -16px); cursor: pointer; z-index: 5; transition: opacity .2s; }
.sensor > i { position: relative; display: block; width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(79,228,228,.65); background: rgba(5,17,22,.85); box-shadow: 0 0 0 4px rgba(79,228,228,.06); }
.sensor > i::after { content: ''; position: absolute; width: 3px; height: 3px; left: 5px; top: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.sensor > span { display: none; position: absolute; left: 28px; top: 2px; min-width: 96px; padding: 7px 9px; text-align: left; background: rgba(6,17,23,.9); border-left: 1px solid var(--cyan); }
.sensor > span b, .sensor > span small { display: block; font: 500 10px var(--mono); white-space: nowrap; }
.sensor > span b { color: var(--cyan-soft); }
.sensor > span small { color: #71898f; font-size: 9px; letter-spacing: .06em; margin-top: 3px; }
.sensor:hover > span, .sensor.active > span { display: block; }
.sensor.active > i { background: var(--cyan); box-shadow: 0 0 0 5px rgba(79,228,228,.08), 0 0 16px rgba(79,228,228,.5); }
.scene-wrap.is-focused .sensor:not(.active) { filter: saturate(.25); opacity: .28 !important; }

.wind-vector { position: absolute; top: 24px; left: 25px; color: #718b92; font: 400 10px var(--mono); letter-spacing: .07em; }
.wind-vector i { position: relative; display: block; width: 78px; height: 1px; margin-top: 8px; background: linear-gradient(90deg, var(--cyan), transparent); transform: rotate(8deg); transform-origin: left; }
.wind-vector i::before { content: ''; position: absolute; left: 0; top: -3px; border: 3px solid transparent; border-right: 7px solid var(--cyan); transform: translateX(-8px); }

.depth-scale { position: absolute; top: 24%; right: 20px; height: 52%; display: flex; flex-direction: column; align-items: end; justify-content: space-between; color: #667f86; font: 400 9px var(--mono); letter-spacing: .05em; }
.depth-scale i { height: 1px; width: 27px; background: #263c43; }

.focus-status {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 6;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 16px;
  min-width: 245px;
  padding: 11px 12px 11px 14px;
  border: 1px solid rgba(79, 228, 228, .28);
  border-left: 2px solid var(--cyan);
  background: rgba(5, 17, 22, .9);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24), inset 0 0 24px rgba(79, 228, 228, .035);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: opacity .28s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
.focus-status.active { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.focus-status > span { color: var(--cyan); font: 500 9px var(--mono); letter-spacing: .08em; }
.focus-status > strong { grid-column: 1; margin-top: 3px; font-size: 12px; font-weight: 500; }
.focus-status button { grid-column: 2; grid-row: 1 / span 2; min-height: 32px; padding: 0 10px; color: #89a0a5; border: 1px solid var(--line); background: rgba(18, 37, 44, .7); font: 500 9px var(--mono); cursor: pointer; }
.focus-status button:hover { color: var(--text); border-color: var(--line-bright); }

.scene-instruction { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; color: #718a91; font: 400 9px var(--mono); letter-spacing: .06em; white-space: nowrap; }
.scene-instruction b { font-weight: 400; }
.scene-instruction > i { font-style: normal; color: #263b42; }
.mouse-glyph { width: 12px; height: 16px; border: 1px solid #486168; border-radius: 7px; display: inline-flex; justify-content: center; }
.mouse-glyph i { width: 1px; height: 4px; margin-top: 3px; background: var(--cyan); }

.stage-footer { height: 56px; padding: 0 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.view-actions { display: flex; gap: 7px; }
.action-button { min-height: 36px; border: 1px solid var(--line); background: rgba(12, 28, 35, .7); color: #789198; padding: 8px 10px; cursor: pointer; font: 500 10px var(--mono); letter-spacing: .06em; }
.action-button:hover { color: var(--text); border-color: var(--line-bright); }
.action-button i { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #3e565d; }
.action-button.full-view i { width: 8px; height: 8px; border: 1px solid #6c898f; border-radius: 0; background: transparent; box-shadow: inset 0 0 0 2px rgba(6,16,22,.9); vertical-align: -1px; }
.action-button.full-view:hover i { border-color: var(--cyan); }
.action-button.active { color: var(--cyan-soft); }
.action-button.active i { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.model-fidelity { display: flex; align-items: center; gap: 10px; color: #6e878e; font: 400 9px var(--mono); letter-spacing: .06em; }
.model-fidelity > div { display: flex; gap: 2px; }
.model-fidelity i { display: block; width: 10px; height: 3px; background: var(--cyan); }
.model-fidelity b { color: var(--cyan-soft); font-weight: 400; }

.component-head { display: grid; grid-template-columns: 46px 1fr; gap: 12px; margin-top: 26px; align-items: center; }
.component-code { width: 50px; aspect-ratio: 1; display: grid; place-items: center; color: var(--cyan); background: rgba(79,228,228,.05); border: 1px solid rgba(79,228,228,.2); font: 400 15px var(--mono); }
.component-head span { color: #789198; font: 500 10px var(--mono); letter-spacing: .07em; }
.component-head h2 { font-size: 16px; line-height: 1.3; font-weight: 500; margin: 5px 0 0; }
.component-state { margin-top: 19px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.component-state > span { color: var(--lime); font: 500 10px var(--mono); letter-spacing: .07em; }
.component-state > span i { width: 5px; height: 5px; margin-right: 5px; box-shadow: 0 0 8px var(--lime); }
.component-state small { color: #71888e; font: 400 9px var(--mono); }

.radial-readout { width: 202px; height: 148px; margin: 16px auto 3px; position: relative; display: grid; place-items: center; overflow: hidden; }
.radial-readout canvas { position: absolute; width: 190px; height: 190px; top: -18px; }
.radial-readout > div { position: relative; text-align: center; margin-top: 20px; }
.radial-readout span { display: block; color: #718a91; font: 500 9px var(--mono); letter-spacing: .06em; }
.radial-readout strong { display: inline-block; margin-top: 6px; font: 300 29px var(--mono); letter-spacing: -.07em; }
.radial-readout small { color: #789198; font: 400 10px var(--mono); margin-left: 4px; }

.telemetry-list { border-top: 1px solid var(--line); }
.telemetry-list > div { position: relative; padding: 11px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); overflow: hidden; }
.telemetry-list span { color: #789198; font: 500 10px var(--mono); letter-spacing: .05em; }
.telemetry-list strong { font: 400 13px var(--mono); }
.telemetry-list strong small { color: #718a91; font-size: 9px; }
.telemetry-list i { position: absolute; bottom: 0; left: 0; width: var(--meter); height: 1px; background: linear-gradient(90deg, var(--cyan), transparent); }

.component-analysis { margin-top: 16px; padding: 13px; border: 1px solid var(--line); background: rgba(8, 23, 29, .58); }
.component-analysis canvas { display: block; width: 100%; height: 68px; margin-top: 8px; }
.limit-copy { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; color: #718b92; font: 500 9px var(--mono); letter-spacing: .05em; }
.limit-copy b { color: #a5b9bd; font-weight: 400; }
.limit-track { position: relative; height: 4px; margin-top: 10px; background: linear-gradient(90deg, rgba(79,228,228,.12) 0 65%, rgba(246,184,94,.18) 65% 84%, rgba(240,115,100,.2) 84%); }
.limit-track i { position: absolute; inset: 0 auto 0 0; width: var(--limit, 72%); background: linear-gradient(90deg, var(--cyan), var(--lime)); box-shadow: 0 0 8px rgba(79,228,228,.25); transition: width .35s ease; }
.limit-track em { position: absolute; left: var(--limit, 72%); top: -4px; width: 2px; height: 12px; background: white; box-shadow: 0 0 7px var(--cyan); transform: translateX(-1px); transition: left .35s ease; }
.limit-track b { position: absolute; left: 84%; top: -3px; width: 1px; height: 10px; background: var(--amber); }
.limit-labels { display: flex; justify-content: space-between; margin-top: 6px; color: #526b72; font: 400 8px var(--mono); letter-spacing: .05em; }

.pitch-module { margin-top: 16px; padding: 13px; min-height: 95px; border: 1px solid var(--line); background: rgba(15,31,38,.5); position: relative; overflow: hidden; }
.module-head { display: flex; justify-content: space-between; color: #789198; font: 500 10px var(--mono); letter-spacing: .06em; }
.module-head b { color: var(--cyan); font-size: 9px; font-weight: 400; }
.pitch-value { margin-top: 13px; display: flex; align-items: center; gap: 10px; }
.pitch-value strong { font: 300 24px var(--mono); }
.pitch-value span { color: #70888f; font: 400 9px/1.5 var(--mono); letter-spacing: .05em; }
.pitch-diagram { position: absolute; width: 72px; height: 72px; right: -3px; bottom: -14px; border: 1px solid rgba(79,228,228,.08); border-radius: 50%; }
.pitch-diagram b { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); left: calc(50% - 3px); top: calc(50% - 3px); }
.pitch-diagram i { position: absolute; width: 2px; height: 28px; background: linear-gradient(var(--cyan), transparent); left: calc(50% - 1px); bottom: 50%; transform-origin: bottom; }
.pitch-diagram i:nth-child(2) { transform: rotate(120deg); }
.pitch-diagram i:nth-child(3) { transform: rotate(240deg); }

.alerts { margin-top: 20px; }
.alert { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.alert-icon { width: 24px; height: 24px; border: 1px solid currentColor; display: grid; place-items: center; font: 500 10px var(--mono); font-style: normal; }
.alert.warning .alert-icon { color: var(--amber); }
.alert.info .alert-icon { color: #6c9ba2; }
.alert strong { font-size: 11px; font-weight: 600; }
.alert p { color: #70888f; margin: 3px 0 0; font-size: 10px; line-height: 1.45; }
.alert p b { color: #859ca1; font-weight: 500; }
.alert > span { color: #7a9197; font: 500 9px var(--mono); }
.alert.warning > span { color: var(--amber); }

.timeline-bar {
  min-height: 142px;
  display: grid;
  grid-template-columns: 190px minmax(420px, 1fr) 310px;
  align-items: stretch;
  gap: 22px;
  padding: 15px 8px 13px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,25,32,.38), rgba(4,13,18,.16));
}
.history-header { display: flex; flex-direction: column; justify-content: space-between; padding-left: 4px; }
.event-title { color: #91a8ad; font: 500 10px var(--mono); letter-spacing: .07em; display: flex; align-items: center; gap: 9px; }
.event-title i { display:block; width: 5px; height: 5px; flex: 0 0 auto; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 9px var(--cyan); }
.history-header p { margin: 7px 0 10px; color: #688188; font-size: 10px; line-height: 1.45; }
.history-actions { display: flex; gap: 6px; }
.history-button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); background: rgba(12,30,37,.75); color: #7f989e; font: 500 9px var(--mono); letter-spacing: .05em; cursor: pointer; }
.history-button:hover { color: var(--text); border-color: var(--line-bright); }
.history-button[aria-pressed="true"] { color: var(--cyan-soft); border-color: rgba(79,228,228,.35); background: rgba(79,228,228,.08); }
.history-button.play { min-width: 68px; }
.history-button.play i { display: inline-block; width: 0; height: 0; margin-right: 7px; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 6px solid var(--cyan); }
.history-button.play[aria-pressed="true"] i { width: 6px; height: 8px; border: 0; border-left: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }
.history-button.live i { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 7px var(--lime); }
.history-button.live:disabled { opacity: .35; cursor: default; }

.history-track-wrap { position: relative; min-width: 0; min-height: 108px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.history-track-wrap::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(90deg, transparent 24.8%, var(--line) 25%, transparent 25.2%, transparent 49.8%, var(--line) 50%, transparent 50.2%, transparent 74.8%, var(--line) 75%, transparent 75.2%); }
#historyCanvas { position: absolute; inset: 4px 0 23px; width: 100%; height: 78px; }
#historyInput { position: absolute; z-index: 4; left: 0; right: 0; bottom: 18px; width: 100%; height: 18px; margin: 0; appearance: none; background: transparent; cursor: ew-resize; }
#historyInput::-webkit-slider-runnable-track { height: 1px; background: rgba(126,164,170,.35); }
#historyInput::-webkit-slider-thumb { appearance: none; width: 12px; height: 24px; margin-top: -12px; border: 0; border-radius: 0; background: linear-gradient(90deg, transparent 5px, var(--cyan) 5px 7px, transparent 7px); filter: drop-shadow(0 0 5px var(--cyan)); }
#historyInput::-moz-range-track { height: 1px; background: rgba(126,164,170,.35); }
#historyInput::-moz-range-thumb { width: 2px; height: 24px; border: 0; border-radius: 0; background: var(--cyan); box-shadow: 0 0 5px var(--cyan); }
.history-marker { position: absolute; z-index: 5; top: 2px; left: var(--position); width: 16px; height: 74px; padding: 0; border: 0; background: transparent; transform: translateX(-8px); cursor: pointer; }
.history-marker::before { content: ''; position: absolute; top: 16px; bottom: 0; left: 7px; width: 1px; background: rgba(246,184,94,.32); }
.history-marker i { position: absolute; top: 12px; left: 4px; width: 7px; height: 7px; border: 1px solid var(--amber); background: #0a171e; transform: rotate(45deg); }
.history-marker span { position: absolute; top: 0; left: 10px; color: #a78d67; font: 500 8px var(--mono); letter-spacing: .05em; white-space: nowrap; opacity: .72; }
.history-marker:hover span, .history-marker.active span { color: var(--amber); opacity: 1; }
.history-marker.active i { background: var(--amber); box-shadow: 0 0 10px rgba(246,184,94,.65); }
.history-marker.gust { --position: 23.7%; }
.history-marker.curtailment { --position: 58.5%; }
.history-marker.maintenance { --position: 80.1%; }
.history-ticks { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; color: #587178; font: 400 8px var(--mono); }

.history-side { min-width: 0; display: grid; grid-template-columns: 86px 1fr; grid-template-rows: auto auto; gap: 8px 12px; }
.history-moment { grid-row: 1 / span 2; padding-right: 12px; border-right: 1px solid var(--line); }
.history-moment span, .history-moment small { display: block; color: #658087; font: 500 8px var(--mono); letter-spacing: .06em; }
.history-moment strong { display: block; margin: 5px 0; font: 400 22px var(--mono); letter-spacing: -.06em; }
.history-moment small { width: max-content; padding: 4px 6px; color: var(--lime); border: 1px solid rgba(184,230,107,.18); }
.history-moment small.replay { color: var(--cyan); border-color: rgba(79,228,228,.22); }
.history-event { min-width: 0; display: grid; grid-template-columns: 8px 1fr; gap: 7px; align-items: start; }
.history-event > i { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 7px var(--lime); }
.history-event.event > i { background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.history-event span { display: block; color: #9aafb3; font: 500 9px var(--mono); letter-spacing: .04em; }
.history-event p { margin: 3px 0 0; color: #6d858b; font-size: 9px; line-height: 1.35; }
.history-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.history-legend > span { color: #6e878e; font: 500 8px var(--mono); white-space: nowrap; }
.history-legend > span > i { display: inline-block; width: 10px; height: 2px; margin-right: 5px; vertical-align: 2px; background: currentColor; }
.history-legend b { float: right; color: #afc0c3; font-weight: 400; }
.history-legend .wind { color: var(--cyan); }
.history-legend .power { color: var(--lime); }
.history-legend .pitch { color: var(--amber); }
.history-legend .stress { color: var(--red); }

@media (max-width: 1240px) {
  .workspace { grid-template-columns: 274px minmax(460px, 1fr) 292px; }
  .overview-panel, .inspector-panel { padding-left: 17px; padding-right: 17px; }
  .scene-wrap { min-height: 560px; }
  .asset-path { display: none; }
  .topbar { grid-template-columns: 1fr 1fr; }
  .timeline-bar { grid-template-columns: 165px minmax(380px, 1fr) 280px; gap: 14px; }
  .history-header p { display: none; }
}

@media (max-width: 1080px) {
  .shell { padding: 0 14px 14px; }
  .topbar { height: 70px; }
  .workspace { grid-template-columns: 1fr; }
  .twin-stage { grid-row: 1; border-bottom: 1px solid var(--line); }
  .overview-panel { grid-row: 2; border-right: 0; border-bottom: 1px solid var(--line); }
  .inspector-panel { grid-row: 3; border-left: 0; }
  .overview-panel, .inspector-panel { padding: 24px; }
  .metric-grid { grid-template-columns: repeat(4, 1fr); }
  .health-block { grid-template-columns: 68px minmax(140px, 1fr); max-width: 380px; }
  .inspector-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .inspector-panel > .eyebrow, .inspector-panel > .component-head, .inspector-panel > .component-state { grid-column: 1; }
  .radial-readout, .telemetry-list { grid-column: 1; }
  .pitch-module, .alerts { grid-column: 2; }
  .pitch-module { grid-row: 2 / span 2; margin-top: 26px; align-self: start; }
  .component-analysis { grid-column: 2; grid-row: 4; margin-top: 16px; }
  .alerts { grid-row: 5 / span 2; margin-top: 16px; }
  .timeline-bar { grid-template-columns: 150px minmax(360px, 1fr); }
  .history-side { grid-column: 1 / -1; grid-template-columns: 100px minmax(220px, 1fr) minmax(250px, 1fr); grid-template-rows: auto; }
  .history-moment { grid-row: auto; }
  .history-legend { align-self: center; }
}

@media (max-width: 640px) {
  .brand small, .system-time { display: none; }
  .header-status { gap: 10px; }
  .live-badge { padding: 7px 8px; }
  .scene-wrap { min-height: 540px; }
  .stage-header { height: auto; min-height: 98px; padding: 16px; align-items: flex-start; flex-direction: column; gap: 13px; }
  .mode-switcher { width: 100%; }
  .mode { flex: 1; }
  .sensor > span { display: none !important; }
  .depth-scale { display: none; }
  .stage-footer { padding: 0 12px; }
  .model-fidelity span, .model-fidelity > div { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .inspector-panel { display: block; }
  .pitch-module, .component-analysis, .alerts { margin-top: 18px; }
  .focus-status { top: 12px; min-width: 220px; }
  .timeline-bar { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .history-header { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 0; }
  .history-header .event-title { grid-column: 1; }
  .history-actions { grid-column: 2; grid-row: 1; }
  .history-button.live { font-size: 0; width: 34px; padding: 0; }
  .history-button.live i { margin: 0; }
  .history-track-wrap { min-height: 112px; border: 1px solid var(--line); border-width: 0 1px; }
  .history-marker span { display: none; }
  .history-side { grid-column: auto; grid-template-columns: 86px 1fr; grid-template-rows: auto auto; }
  .history-moment { grid-row: 1 / span 2; }
  .history-legend { grid-column: 2; }
}

@media (max-width: 420px) {
  .shell { padding-inline: 8px; }
  .overview-panel, .inspector-panel { padding: 22px 16px; }
  .stage-header { padding-inline: 14px; }
  .stage-footer { height: 62px; }
  .action-button { padding-inline: 8px; font-size: 9px; }
  .scene-instruction { font-size: 9px; gap: 5px; }
  .metric-card { padding: 11px 10px; }
  .metric-card div span { font-size: 10px; }
  .history-side { grid-template-columns: 76px 1fr; gap: 8px; }
  .history-moment strong { font-size: 19px; }
  .history-legend > span { font-size: 8px; }
  .history-event p { font-size: 9px; }
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
