/* ==========================================================
   XX孪界 · 零碳电厂数字孪生中枢
   ========================================================== */
:root {
  --bg: #03080f;
  --bg-2: #06111c;
  --panel: rgba(7, 19, 31, .78);
  --panel-2: rgba(8, 24, 38, .62);
  --line: rgba(103, 222, 255, .15);
  --line-2: rgba(103, 222, 255, .28);
  --cyan: #39e6ff;
  --cyan-soft: #7ff2ff;
  --mint: #52ffd4;
  --amber: #ffbf5a;
  --red: #ff6b8a;
  --violet: #b28cff;
  --text: #e8f7ff;
  --muted: #7d9ab2;
  --dim: #4c6980;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
  --sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { -webkit-font-smoothing: antialiased; }
button, input, select { font-family: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }
#app { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(ellipse at 58% 38%, #0a2234 0%, #050e18 38%, #02070d 72%); }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
#stage.dragging { cursor: grabbing; }
.scene-tint { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 55% 42%, rgba(36,220,255,.08), transparent 38%), linear-gradient(180deg, rgba(1,7,12,.4), transparent 22%, transparent 72%, rgba(1,6,10,.7)); mix-blend-mode: screen; }
.vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 240px 70px rgba(0,2,5,.92); }
.grain { position: absolute; inset: 0; pointer-events: none; opacity: .2; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"); mix-blend-mode: overlay; }
::selection { background: rgba(57,230,255,.25); }

/* boot */
.boot { position: absolute; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #03080f; transition: opacity .8s ease, visibility .8s; }
.boot.done { opacity: 0; visibility: hidden; }
.boot-mark { width: 64px; height: 64px; color: var(--cyan); filter: drop-shadow(0 0 18px rgba(57,230,255,.55)); animation: bootspin 9s linear infinite; }
.boot-mark svg { width: 100%; height: 100%; }
@keyframes bootspin { to { transform: rotate(360deg); } }
.boot-title { margin-top: 18px; font-size: 24px; letter-spacing: 5px; font-weight: 300; }
.boot-title span { color: var(--cyan); }
.boot-sub { margin-top: 5px; font-family: var(--mono); font-size: 8px; letter-spacing: 5px; color: var(--dim); }
.boot-bar { width: 260px; height: 1px; background: rgba(57,230,255,.12); margin-top: 28px; overflow: hidden; }
.boot-bar i { display: block; width: 0%; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--mint)); box-shadow: 0 0 12px var(--cyan); transition: width .25s; }
.boot-status { margin-top: 12px; font-family: var(--mono); font-size: 9px; color: var(--muted); letter-spacing: 1px; }

/* rail */
.rail { position: absolute; left: 0; top: 0; bottom: 0; width: 218px; z-index: 20; display: flex; flex-direction: column; padding: 22px 17px 18px; background: linear-gradient(180deg, rgba(4,13,22,.94), rgba(3,10,17,.82) 55%, rgba(3,10,17,.92)); border-right: 1px solid var(--line); backdrop-filter: blur(18px); }
.rail::after { content: ""; position: absolute; right: -1px; top: 12%; width: 1px; height: 30%; background: linear-gradient(180deg, transparent, var(--cyan), transparent); opacity: .5; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 4px 22px; }
.brand-mark { width: 35px; height: 35px; color: var(--cyan); filter: drop-shadow(0 0 8px rgba(57,230,255,.4)); flex: 0 0 35px; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-cn { font-size: 18px; font-weight: 300; letter-spacing: 2px; color: #ecfbff; line-height: 1.1; }
.brand-cn span { color: var(--cyan); font-weight: 500; }
.brand-en { margin-top: 4px; font-family: var(--mono); font-size: 6.5px; letter-spacing: 2.2px; color: var(--dim); }
.rail-caption { padding: 0 5px 8px; font-family: var(--mono); font-size: 7px; letter-spacing: 2.5px; color: #36576d; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-btn { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 49px; padding: 8px 10px; border: 1px solid transparent; background: transparent; color: var(--muted); text-align: left; transition: .25s; overflow: hidden; }
.nav-btn::before { content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 2px; background: var(--cyan); opacity: 0; box-shadow: 0 0 12px var(--cyan); }
.nav-btn:hover { color: #cfe9f5; background: rgba(57,230,255,.035); }
.nav-btn.active { color: #f0fdff; background: linear-gradient(90deg, rgba(57,230,255,.13), rgba(57,230,255,.02)); border-color: rgba(57,230,255,.14); }
.nav-btn.active::before { opacity: 1; }
.nav-ico { width: 17px; font-size: 16px; color: var(--cyan); opacity: .75; text-align: center; }
.nav-btn b { display: block; font-size: 12px; font-weight: 500; letter-spacing: .5px; }
.nav-btn small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 6.5px; letter-spacing: 1.4px; color: #486b81; }
.nav-btn i { margin-left: auto; font-family: var(--mono); font-style: normal; font-size: 7px; color: #2f5268; }
.nav-btn em { position: absolute; right: 10px; bottom: 8px; font-style: normal; font-family: var(--mono); font-size: 7px; color: var(--amber); background: rgba(255,191,90,.08); border: 1px solid rgba(255,191,90,.2); padding: 1px 4px; }
.rail-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 5px 0; }
.sys-line { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 7.5px; color: #3f6178; margin-bottom: 6px; }
.sys-line b { color: #85aac0; font-weight: 400; }
.rail-pulse { margin-top: 13px; display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 7.5px; color: var(--mint); letter-spacing: 1.5px; }
.rail-pulse i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); animation: blink 2s infinite; }
.rail-pulse small { margin-left: auto; color: #36576d; font-size: 6.5px; letter-spacing: 0; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }

/* topbar */
.topbar { position: absolute; left: 218px; right: 0; top: 0; height: 65px; z-index: 18; display: flex; align-items: center; gap: 18px; padding: 0 24px 0 34px; border-bottom: 1px solid rgba(103,222,255,.1); background: linear-gradient(180deg, rgba(4,12,20,.7), rgba(4,12,20,.12)); backdrop-filter: blur(8px); }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 9px; color: #58778c; white-space: nowrap; }
.crumb b { color: #a7c8d9; font-weight: 400; }
.crumb em { font-style: normal; color: var(--cyan); }
.crumb i { color: #28485c; font-style: normal; }
.top-status { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border: 1px solid rgba(82,255,212,.2); background: rgba(82,255,212,.04); color: #8ff5d9; font-family: var(--mono); font-size: 7px; letter-spacing: 1px; }
.status-pill.ghost { border-color: rgba(103,222,255,.12); color: #61859b; background: transparent; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 6px var(--mint); animation: blink 2.4s infinite; }
.top-right { display: flex; align-items: center; gap: 13px; padding-left: 15px; border-left: 1px solid var(--line); }
.role-pick { display: flex; align-items: center; gap: 5px; font-size: 8px; color: #54768c; }
.role-pick select { background: transparent; border: 0; color: #b8dcea; font-size: 9px; appearance: none; padding-right: 8px; cursor: pointer; }
.role-pick select option { background: #06131e; color: #cfeaf3; }
.clock { font-family: var(--mono); font-size: 9px; color: #7ea6ba; letter-spacing: .5px; }
.avatar { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid rgba(57,230,255,.3); border-radius: 50%; color: var(--cyan); font-size: 10px; background: radial-gradient(circle, rgba(57,230,255,.13), transparent); }

/* stage heading */
.stage-head { position: absolute; left: 252px; top: 91px; z-index: 12; width: 510px; pointer-events: none; }
.stage-head::before { content: ""; position: absolute; left: -48px; top: -30px; width: 590px; height: 185px; z-index: -1; background: radial-gradient(ellipse at 40% 42%, rgba(1,7,12,.66), rgba(1,7,12,.18) 52%, transparent 73%); filter: blur(9px); }
.eyebrow { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 7px; letter-spacing: 2.2px; color: #4d7d93; }
.eyebrow i { width: 20px; height: 1px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.stage-head h1 { margin: 7px 0 5px; font-size: 43px; line-height: .98; letter-spacing: -.5px; font-weight: 200; color: #effcff; text-shadow: 0 0 35px rgba(57,230,255,.25); }
.stage-head h1 span { display: inline-block; color: var(--cyan); font-weight: 300; text-shadow: 0 0 28px rgba(57,230,255,.5); }
.stage-head p { margin: 0; width: 385px; font-size: 9.5px; line-height: 1.8; color: #6b8ea2; }
.stage-actions { display: flex; gap: 6px; margin-top: 15px; pointer-events: auto; }
.ghost-btn { height: 27px; padding: 0 10px; border: 1px solid var(--line); background: rgba(6,20,31,.5); color: #9ec5d6; font-size: 8px; letter-spacing: .5px; backdrop-filter: blur(5px); transition: .2s; }
.ghost-btn:hover { border-color: var(--line-2); color: var(--cyan); background: rgba(57,230,255,.07); }
.ghost-btn i { font-style: normal; color: var(--cyan); font-family: var(--mono); margin-left: 4px; }
.pulse-dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 7px var(--cyan); margin-right: 6px; animation: blink 1.6s infinite; }

/* labels */
.labels { position: absolute; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.asset-tag { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; transition: opacity .2s; }
.asset-tag::after { content: ""; width: 1px; height: 18px; background: linear-gradient(180deg, rgba(57,230,255,.7), transparent); }
.asset-tag .tag-dot { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--cyan); background: rgba(5,16,26,.9); box-shadow: 0 0 0 3px rgba(57,230,255,.12), 0 0 12px rgba(57,230,255,.6); }
.asset-tag .tag-box { order: -1; margin-bottom: 5px; padding: 4px 7px 3px; border: 1px solid rgba(57,230,255,.2); background: rgba(4,14,23,.8); backdrop-filter: blur(8px); white-space: nowrap; }
.asset-tag .tag-box b { display: block; font-size: 7.5px; font-weight: 500; color: #c9ecf7; letter-spacing: .5px; }
.asset-tag .tag-box span { display: block; font-family: var(--mono); font-size: 6px; color: #4f7a8f; margin-top: 1px; }
.asset-tag:hover .tag-box, .asset-tag.active .tag-box { border-color: var(--cyan); background: rgba(8,35,48,.9); }
.asset-tag.active .tag-dot { background: var(--cyan); box-shadow: 0 0 0 4px rgba(57,230,255,.2), 0 0 16px var(--cyan); }
.asset-tag.hot .tag-dot { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(255,191,90,.15), 0 0 14px var(--amber); }
.asset-tag.hot .tag-box { border-color: rgba(255,191,90,.35); }
.asset-tag.hidden { opacity: 0; pointer-events: none; }

/* layer menu */
.layer-menu { position: absolute; right: 386px; top: 84px; width: 178px; z-index: 30; padding: 10px 11px; border: 1px solid var(--line-2); background: rgba(5,17,27,.94); backdrop-filter: blur(18px); box-shadow: 0 18px 50px rgba(0,0,0,.5); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .2s; }
.layer-menu.show { opacity: 1; visibility: visible; transform: none; }
.layer-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 6.5px; letter-spacing: 1.6px; color: var(--dim); padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.layer-head button { border: 0; background: transparent; color: var(--muted); font-size: 13px; line-height: 1; }
.layer-row { display: flex; align-items: center; gap: 7px; padding: 7px 0; font-size: 9px; color: #a3c4d3; cursor: pointer; }
.layer-row input { accent-color: var(--cyan); width: 10px; height: 10px; }
.layer-row b { margin-left: auto; font-family: var(--mono); font-size: 6.5px; color: var(--dim); font-weight: 400; }
.layer-tip { margin-top: 5px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 7px; line-height: 1.6; color: #3f6176; }

/* panel */
.panel { position: absolute; right: 22px; top: 82px; bottom: 174px; width: 346px; z-index: 15; padding: 17px 17px 13px; overflow-y: auto; overflow-x: hidden; border: 1px solid rgba(103,222,255,.16); background: linear-gradient(160deg, rgba(8,24,37,.9), rgba(4,13,22,.8)); backdrop-filter: blur(20px); box-shadow: 0 25px 80px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.03); scrollbar-width: thin; scrollbar-color: rgba(57,230,255,.2) transparent; }
.panel::-webkit-scrollbar { width: 3px; }
.panel::-webkit-scrollbar-thumb { background: rgba(57,230,255,.2); }
.panel::before { content: ""; position: absolute; left: 0; top: 0; width: 28px; height: 1px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.panel-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel-kicker { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 6.5px; letter-spacing: 1.7px; color: #496c81; }
.panel-kicker b { color: var(--cyan); font-weight: 400; }
.panel h2 { margin: 6px 0 4px; font-size: 19px; font-weight: 300; letter-spacing: .5px; color: #effcff; }
.panel-head p { margin: 0; font-size: 8.5px; line-height: 1.65; color: #68889b; }
.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 15px 0 8px; font-family: var(--mono); font-size: 7px; letter-spacing: 1.4px; color: #5d8297; }
.sec-title span { display: flex; align-items: center; gap: 6px; }
.sec-title span::before { content: ""; width: 3px; height: 3px; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.sec-title b { font-weight: 400; color: #34596c; font-size: 6.5px; }
.sec-title button { border: 0; background: transparent; color: var(--cyan); font-size: 7px; font-family: var(--mono); }

.panel .metric-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.metric-cell { padding: 9px 10px; border: 1px solid rgba(103,222,255,.1); background: rgba(57,230,255,.025); }
.metric-cell span { display: block; font-size: 7.5px; color: #598095; }
.metric-cell b { display: block; margin-top: 3px; font-family: var(--mono); font-size: 18px; font-weight: 300; color: #eafaff; letter-spacing: -.5px; }
.metric-cell b small { font-size: 7px; color: #6f93a7; margin-left: 2px; }
.metric-cell em { display: block; margin-top: 1px; font-style: normal; font-family: var(--mono); font-size: 6.5px; color: var(--mint); }
.metric-cell.warn em { color: var(--amber); }
.metric-cell.bad b { color: #ffc0cb; }

.asset-row { display: flex; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid rgba(103,222,255,.06); cursor: pointer; transition: .18s; }
.asset-row:hover { background: rgba(57,230,255,.04); padding-left: 5px; }
.asset-row.active { background: rgba(57,230,255,.06); border-left: 1px solid var(--cyan); padding-left: 6px; }
.asset-row .ico { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgba(103,222,255,.14); color: var(--cyan); font-size: 10px; flex: 0 0 24px; }
.asset-row .txt { min-width: 0; }
.asset-row .txt b { display: block; font-size: 9px; font-weight: 400; color: #c3e1ec; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-row .txt span { display: block; margin-top: 2px; font-family: var(--mono); font-size: 6px; color: #476b80; letter-spacing: .4px; }
.asset-row .health { margin-left: auto; text-align: right; flex: 0 0 58px; }
.asset-row .health b { display: block; font-family: var(--mono); font-size: 9px; font-weight: 400; color: #9fdfd2; }
.asset-row .health i { display: block; width: 58px; height: 2px; margin-top: 3px; background: rgba(82,255,212,.1); }
.asset-row .health i em { display: block; height: 100%; background: var(--mint); }
.asset-row.warn .health b { color: var(--amber); }
.asset-row.warn .health i em { background: var(--amber); }
.asset-row.bad .health b { color: var(--red); }
.asset-row.bad .health i em { background: var(--red); }

.event-row { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(103,222,255,.06); }
.event-time { font-family: var(--mono); font-size: 6.5px; color: #3f657a; flex: 0 0 34px; padding-top: 2px; }
.event-main { min-width: 0; }
.event-main b { display: block; font-size: 8.5px; font-weight: 400; color: #b9d9e5; line-height: 1.4; }
.event-main span { display: block; margin-top: 2px; font-size: 7px; color: #4e7387; line-height: 1.5; }
.event-tag { margin-left: auto; align-self: flex-start; font-family: var(--mono); font-size: 6px; padding: 2px 4px; border: 1px solid rgba(255,191,90,.25); color: var(--amber); white-space: nowrap; }
.event-tag.green { border-color: rgba(82,255,212,.25); color: var(--mint); }
.event-tag.red { border-color: rgba(255,107,138,.3); color: var(--red); }

.ai-card { margin-top: 12px; padding: 10px 11px; border: 1px solid rgba(57,230,255,.18); background: linear-gradient(135deg, rgba(57,230,255,.07), rgba(82,255,212,.015)); position: relative; overflow: hidden; }
.ai-card::before { content: ""; position: absolute; top: 0; left: 0; width: 44px; height: 1px; background: var(--mint); box-shadow: 0 0 9px var(--mint); }
.ai-card-hd { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 6.5px; letter-spacing: 1.2px; color: var(--mint); }
.ai-card-hd i { width: 5px; height: 5px; border: 1px solid var(--mint); transform: rotate(45deg); }
.ai-card p { margin: 7px 0 0; font-size: 8.5px; line-height: 1.65; color: #a2c6d5; }
.ai-card p b { color: #e9fbff; font-weight: 500; }
.ai-cite { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.ai-cite span { font-family: var(--mono); font-size: 6px; color: #5d91a5; padding: 2px 4px; border: 1px solid rgba(103,222,255,.12); }
.ai-meter { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-family: var(--mono); font-size: 6px; color: #476d81; }
.ai-meter i { flex: 1; height: 2px; background: rgba(103,222,255,.1); }
.ai-meter i b { display: block; height: 100%; background: var(--mint); }

.slider-row { margin: 11px 0; }
.slider-row label { display: flex; justify-content: space-between; font-size: 8px; color: #7396a9; }
.slider-row output { font-family: var(--mono); font-size: 8.5px; color: var(--cyan); }
.slider-row input[type=range] { width: 100%; height: 15px; margin-top: 3px; appearance: none; background: transparent; cursor: pointer; }
.slider-row input[type=range]::-webkit-slider-runnable-track { height: 1px; background: rgba(103,222,255,.18); }
.slider-row input[type=range]::-webkit-slider-thumb { appearance: none; width: 8px; height: 8px; margin-top: -3.5px; border-radius: 50%; background: var(--cyan); border: 1px solid #06131d; box-shadow: 0 0 0 1px var(--cyan), 0 0 9px rgba(57,230,255,.7); }
.slider-row input[type=range]::-moz-range-track { height: 1px; background: rgba(103,222,255,.18); }
.slider-row input[type=range]::-moz-range-thumb { width: 7px; height: 7px; border: 1px solid #06131d; border-radius: 50%; background: var(--cyan); }

.result-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 10px; background: rgba(103,222,255,.1); border: 1px solid rgba(103,222,255,.1); }
.result-strip div { padding: 8px 9px; background: rgba(4,14,23,.8); }
.result-strip span { display: block; font-size: 6.5px; color: #51768b; }
.result-strip b { display: block; margin-top: 2px; font-family: var(--mono); font-size: 13px; font-weight: 300; color: #e4f9ff; }
.result-strip b small { font-size: 6.5px; color: #62869a; }
.result-strip em { display: block; margin-top: 1px; font-style: normal; font-size: 6px; color: var(--mint); }
.cost-bar { display: flex; height: 5px; margin-top: 10px; gap: 1px; }
.cost-bar i { display: block; height: 100%; }
.legend-inline { display: flex; gap: 10px; margin-top: 5px; font-family: var(--mono); font-size: 5.8px; color: #4f758a; }
.legend-inline span { display: flex; align-items: center; gap: 3px; }
.legend-inline i { width: 3px; height: 3px; }
.panel-actions { display: flex; gap: 6px; margin-top: 12px; }
.btn { flex: 1; height: 29px; border: 1px solid var(--line-2); background: rgba(57,230,255,.05); color: #b7e0ec; font-size: 8px; letter-spacing: .4px; transition: .2s; }
.btn:hover { background: rgba(57,230,255,.12); border-color: var(--cyan); }
.btn.solid { background: linear-gradient(90deg, rgba(57,230,255,.25), rgba(82,255,212,.15)); border-color: rgba(57,230,255,.5); color: #eaffff; }
.btn.danger { border-color: rgba(255,107,138,.35); color: #ffaabb; background: rgba(255,107,138,.05); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.alert-card { padding: 9px 10px; margin-bottom: 7px; border: 1px solid rgba(103,222,255,.1); background: rgba(57,230,255,.025); }
.alert-card.high { border-color: rgba(255,107,138,.25); background: linear-gradient(90deg, rgba(255,107,138,.07), rgba(57,230,255,.02)); }
.alert-card.mid { border-color: rgba(255,191,90,.2); }
.alert-top { display: flex; align-items: center; gap: 6px; }
.alert-top b { font-size: 8.5px; font-weight: 500; color: #dcf4fb; }
.alert-top span { margin-left: auto; font-family: var(--mono); font-size: 6px; color: var(--amber); }
.alert-card p { margin: 5px 0 7px; font-size: 7.5px; line-height: 1.55; color: #668b9f; }
.alert-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; font-family: var(--mono); font-size: 6px; color: #42677c; }
.alert-meta span { padding: 2px 4px; border: 1px solid rgba(103,222,255,.1); }
.alert-actions { display: flex; gap: 5px; }
.alert-actions button { height: 23px; flex: 1; border: 1px solid var(--line); background: transparent; color: #83a9bb; font-size: 7px; }
.alert-actions button:hover { color: var(--cyan); border-color: var(--line-2); }
.alert-actions button.primary { background: rgba(57,230,255,.08); color: var(--cyan); border-color: rgba(57,230,255,.25); }
.alert-actions button:disabled { opacity: .35; cursor: not-allowed; }

.audit-mini { margin-top: 4px; }
.audit-row { display: flex; gap: 7px; padding: 6px 0; border-bottom: 1px solid rgba(103,222,255,.055); }
.audit-row time { font-family: var(--mono); font-size: 6px; color: #3e6378; flex: 0 0 32px; }
.audit-row b { display: block; font-size: 7.5px; font-weight: 400; color: #a9cbd9; }
.audit-row span { display: block; margin-top: 1px; font-size: 6.5px; color: #4c7084; }
.audit-row em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 5.8px; color: var(--mint); align-self: flex-start; }

.trace-step { display: flex; gap: 8px; padding: 7px 0; position: relative; }
.trace-step:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 21px; bottom: -3px; width: 1px; background: rgba(57,230,255,.13); }
.trace-num { width: 17px; height: 17px; flex: 0 0 17px; display: grid; place-items: center; border: 1px solid rgba(57,230,255,.25); border-radius: 50%; font-family: var(--mono); font-size: 5.5px; color: var(--cyan); background: rgba(57,230,255,.04); }
.trace-step b { display: block; font-size: 8px; font-weight: 400; color: #b6d7e3; }
.trace-step span { display: block; margin-top: 2px; font-size: 7px; line-height: 1.5; color: #567b8e; }
.trace-step em { display: block; margin-top: 2px; font-family: var(--mono); font-style: normal; font-size: 5.8px; color: #3e687c; }
.ai-big { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid rgba(82,255,212,.16); background: radial-gradient(circle at 30% 50%, rgba(82,255,212,.08), transparent 65%); }
.ai-orb-big { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border: 1px solid var(--mint); border-radius: 50%; color: var(--mint); font-size: 15px; box-shadow: 0 0 18px rgba(82,255,212,.15); animation: orb 4s ease-in-out infinite; }
@keyframes orb { 0%,100%{transform:scale(1);opacity:.8} 50%{transform:scale(1.05);opacity:1} }
.ai-big b { display: block; font-size: 10px; font-weight: 400; color: #cef7ed; }
.ai-big span { display: block; margin-top: 3px; font-size: 7px; line-height: 1.5; color: #5d8c8b; }

/* dock */
.dock { position: absolute; left: 246px; right: 386px; bottom: 17px; height: 88px; z-index: 14; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; border: 1px solid rgba(103,222,255,.13); background: rgba(103,222,255,.08); backdrop-filter: blur(14px); }
.dock-cell { position: relative; padding: 12px 11px 8px; background: linear-gradient(180deg, rgba(6,19,30,.9), rgba(4,12,20,.8)); overflow: hidden; }
.dock-cell::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(57,230,255,.35), transparent); opacity: .4; }
.dock-cell span { display: block; font-size: 6.5px; letter-spacing: .3px; color: #54798f; white-space: nowrap; }
.dock-cell b { display: block; margin-top: 3px; font-family: var(--mono); font-size: 17px; font-weight: 300; color: #e6faff; letter-spacing: -.5px; white-space: nowrap; }
.dock-cell b small { font-size: 6.5px; color: #63879b; margin-left: 2px; }
.dock-cell em { display: block; margin-top: 1px; font-style: normal; font-family: var(--mono); font-size: 6px; color: var(--mint); }
.dock-cell em.warn { color: var(--amber); }
.dock-cell .spark { position: absolute; right: 8px; bottom: 9px; opacity: .6; }

.orbit-hint { position: absolute; left: 248px; bottom: 118px; z-index: 13; font-family: var(--mono); font-size: 6px; letter-spacing: 1px; color: #365a6e; pointer-events: none; }
/* command */
.command { position: absolute; left: 50%; bottom: 119px; transform: translateX(-50%); z-index: 16; width: 565px; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 9px 0 11px; border: 1px solid rgba(57,230,255,.2); background: rgba(5,16,26,.78); backdrop-filter: blur(14px); box-shadow: 0 5px 30px rgba(0,0,0,.4); }
.cmd-orb { color: var(--mint); font-size: 10px; }
.command input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #d8f3fb; font-size: 8.5px; }
.command input::placeholder { color: #466a7e; }
.cmd-send { width: 23px; height: 23px; border: 1px solid rgba(57,230,255,.2); background: rgba(57,230,255,.08); color: var(--cyan); font-size: 11px; line-height: 1; }
.cmd-chips { position: absolute; left: 0; right: 0; top: -22px; display: flex; gap: 5px; justify-content: center; pointer-events: auto; }
.cmd-chips button { border: 0; background: transparent; padding: 0; font-family: var(--mono); font-size: 5.8px; color: #3e687c; letter-spacing: .2px; }
.cmd-chips button:hover { color: var(--cyan); }

/* toast */
.toast { position: absolute; left: 50%; bottom: 218px; transform: translate(-50%, 10px); z-index: 60; display: flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid rgba(82,255,212,.3); background: rgba(4,20,22,.94); color: #a9f5df; font-size: 8px; opacity: 0; visibility: hidden; transition: .25s; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }

/* drawer */
.drawer-mask { position: absolute; inset: 0; z-index: 40; background: rgba(1,5,9,.5); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: .25s; }
.drawer-mask.show { opacity: 1; visibility: visible; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 390px; z-index: 45; padding: 24px 20px; border-left: 1px solid var(--line-2); background: rgba(4,14,23,.97); backdrop-filter: blur(24px); transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.8,.2,1); overflow-y: auto; }
.drawer.show { transform: none; }
.drawer-close { position: absolute; top: 16px; right: 16px; border: 0; background: transparent; color: var(--muted); font-size: 18px; }
.drawer h3 { margin: 0 0 5px; font-size: 18px; font-weight: 300; color: #ecfbff; }
.drawer-sub { font-family: var(--mono); font-size: 7px; color: #4d7186; letter-spacing: 1px; }
.drawer-body { margin-top: 18px; }
.drawer .metric-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.drawer .kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(103,222,255,.08); font-size: 8px; color: #6e93a8; }
.drawer .kv b { color: #c6e5ef; font-weight: 400; }
.drawer .reason { margin-top: 12px; padding: 10px; border-left: 2px solid var(--mint); background: rgba(82,255,212,.04); font-size: 8px; line-height: 1.7; color: #82aab7; }

/* small screens */
.stage-stats { display: flex; gap: 12px; margin-top: 10px; font-family: var(--mono); font-size: 6px; letter-spacing: .7px; color: #476c80; }
.stage-stats span { display: flex; align-items: baseline; gap: 3px; }
.stage-stats b { font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--cyan); letter-spacing: 0; }
#app.subview .stage-stats { display: none; }

/* ==========================================================
   FLEET-SPECIFIC PANELS
   ========================================================== */
.tag { display: inline-flex; align-items: center; height: 15px; padding: 0 5px; font-family: var(--mono); font-size: 6px; border: 1px solid rgba(103,222,255,.16); color: #6d9aae; white-space: nowrap; }
.tag.cyan { color: var(--cyan); border-color: rgba(57,230,255,.25); background: rgba(57,230,255,.04); }
.tag.mint { color: var(--mint); border-color: rgba(82,255,212,.25); background: rgba(82,255,212,.04); }
.tag.amber { color: var(--amber); border-color: rgba(255,191,90,.28); background: rgba(255,191,90,.04); }
.tag.red { color: var(--red); border-color: rgba(255,107,138,.28); background: rgba(255,107,138,.04); }
.tag.violet { color: var(--violet); border-color: rgba(178,140,255,.25); background: rgba(178,140,255,.04); }

.scope-strip { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding: 6px 7px; border: 1px solid rgba(103,222,255,.1); background: rgba(57,230,255,.025); font-family: var(--mono); font-size: 6px; color: #51788d; }
.scope-strip b { color: #b9e2ed; font-weight: 400; }
.scope-strip i { width: 4px; height: 4px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 7px var(--mint); }

.category-bars { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.category-row { display: grid; grid-template-columns: 58px 1fr 32px; gap: 7px; align-items: center; }
.category-row span { font-size: 7.5px; color: #7397aa; }
.category-row i { display: block; height: 4px; background: rgba(103,222,255,.08); }
.category-row i b { display: block; height: 100%; }
.category-row em { font-family: var(--mono); font-style: normal; font-size: 6.5px; color: #5d8398; text-align: right; }

.vehicle-detail { margin-top: 8px; padding: 9px 10px; border: 1px solid rgba(57,230,255,.16); background: linear-gradient(120deg, rgba(57,230,255,.06), rgba(82,255,212,.015)); }
.vehicle-detail .plate { display: flex; align-items: center; gap: 7px; }
.vehicle-detail .plate b { font-family: var(--mono); font-size: 14px; font-weight: 500; color: #effcff; letter-spacing: 1px; }
.vehicle-detail .plate span { margin-left: auto; font-family: var(--mono); font-size: 6px; color: #5a8094; }
.vehicle-detail p { margin: 5px 0 0; font-size: 7px; line-height: 1.55; color: #64899d; }
.vehicle-detail .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.vehicle-detail .detail-grid div { border-top: 1px solid rgba(103,222,255,.08); padding-top: 5px; }
.vehicle-detail .detail-grid span { display: block; font-size: 6.5px; color: #4e7287; }
.vehicle-detail .detail-grid b { display: block; font-family: var(--mono); font-size: 11px; font-weight: 300; color: #d7f4fc; margin-top: 1px; }
.vehicle-detail .detail-grid b small { font-size: 6px; color: #5b8195; }

.process-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 4px; background: rgba(103,222,255,.09); border: 1px solid rgba(103,222,255,.1); }
.process-step { position: relative; padding: 7px 7px 6px; background: rgba(4,14,23,.8); }
.process-step i { font-family: var(--mono); font-style: normal; font-size: 5.5px; color: #365d72; }
.process-step b { display: block; font-size: 7px; font-weight: 400; color: #a6c8d5; margin-top: 1px; }
.process-step.done b { color: var(--mint); }
.process-step.done::after { content: ""; position: absolute; right: 6px; top: 7px; width: 3px; height: 3px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 5px var(--mint); }

.request-card { padding: 8px 9px; margin-bottom: 7px; border: 1px solid rgba(103,222,255,.11); background: rgba(57,230,255,.02); }
.request-card.risk { border-color: rgba(255,191,90,.2); background: linear-gradient(90deg, rgba(255,191,90,.05), rgba(57,230,255,.015)); }
.request-top { display: flex; align-items: center; gap: 6px; }
.request-top b { font-size: 8px; font-weight: 500; color: #d4edf5; }
.request-top span { margin-left: auto; font-family: var(--mono); font-size: 6px; color: #486f84; }
.request-card p { margin: 4px 0 6px; font-size: 7px; line-height: 1.55; color: #64899c; }
.request-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.request-meta span { font-family: var(--mono); font-size: 5.8px; color: #547d91; padding: 2px 4px; border: 1px solid rgba(103,222,255,.1); }
.request-actions { display: flex; gap: 5px; }
.request-actions button { flex: 1; height: 23px; border: 1px solid var(--line); background: transparent; color: #8aadbd; font-size: 7px; }
.request-actions button.primary { border-color: rgba(57,230,255,.28); background: rgba(57,230,255,.07); color: var(--cyan); }
.request-actions button.danger { border-color: rgba(255,107,138,.25); color: #ffa8b8; }
.request-actions button:disabled { opacity: .35; cursor: not-allowed; }

.task-card { padding: 8px 9px; margin-bottom: 7px; border: 1px solid rgba(103,222,255,.1); background: rgba(57,230,255,.025); cursor: pointer; transition: .2s; }
.task-card:hover { border-color: rgba(57,230,255,.25); }
.task-card.active { border-color: rgba(57,230,255,.4); background: rgba(57,230,255,.07); }
.task-top { display: flex; gap: 6px; align-items: center; }
.task-top b { font-size: 8px; color: #ceeef7; font-weight: 500; }
.task-top span { margin-left: auto; font-family: var(--mono); font-size: 5.8px; color: var(--amber); }
.task-card p { margin: 4px 0 6px; font-size: 6.8px; color: #5d8397; line-height: 1.5; }
.task-meta { display: flex; gap: 4px; flex-wrap: wrap; }
.task-meta span { font-family: var(--mono); font-size: 5.6px; color: #4d7488; }
.task-actions { display: flex; gap: 5px; margin-top: 7px; }
.task-actions button { flex: 1; height: 22px; border: 1px solid rgba(57,230,255,.18); background: rgba(57,230,255,.04); color: #8eb5c4; font-size: 6.5px; }
.task-actions button:hover { color: var(--cyan); }

.route-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 7px; }
.route-metric { padding: 7px 8px; border: 1px solid rgba(103,222,255,.1); background: rgba(57,230,255,.02); }
.route-metric span { display: block; font-size: 6.3px; color: #51758a; }
.route-metric b { display: block; font-family: var(--mono); font-size: 12px; font-weight: 300; color: #dff7ff; margin-top: 2px; }
.route-metric b small { font-size: 6px; color: #63899b; }
.route-metric em { display: block; font-style: normal; font-family: var(--mono); font-size: 5.8px; color: var(--amber); margin-top: 1px; }
.route-bar { display: flex; gap: 1px; height: 5px; margin-top: 8px; }
.route-bar i { display: block; height: 100%; }

.idle-row { display: flex; align-items: center; gap: 7px; padding: 6px 0; border-bottom: 1px solid rgba(103,222,255,.06); }
.idle-row b { font-family: var(--mono); font-size: 7.5px; font-weight: 400; color: #a9ccd8; }
.idle-row span { font-size: 6.5px; color: #4e7588; }
.idle-row em { margin-left: auto; font-family: var(--mono); font-style: normal; font-size: 6px; color: var(--amber); }

.alert-card.high { border-color: rgba(255,107,138,.25); }
.driver-row { display: flex; align-items: center; gap: 7px; padding: 6px 0; border-bottom: 1px solid rgba(103,222,255,.06); }
.driver-row .dr { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(103,222,255,.16); font-size: 7px; color: var(--cyan); }
.driver-row .dn { font-size: 7.5px; color: #a9cad7; }
.driver-row .dn span { display: block; font-size: 5.7px; color: #4d7186; margin-top: 1px; }
.driver-row em { margin-left: auto; font-family: var(--mono); font-style: normal; font-size: 7px; color: var(--amber); }
.driver-bars { display: flex; gap: 3px; margin-top: 4px; }
.driver-bars i { flex: 1; height: 3px; background: rgba(103,222,255,.1); }
.driver-bars i b { display: block; height: 100%; background: var(--cyan); }

.cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 4px; background: rgba(103,222,255,.1); border: 1px solid rgba(103,222,255,.1); }
.cost-cell { padding: 7px 8px; background: rgba(4,14,23,.82); }
.cost-cell span { display: block; font-size: 6.3px; color: #51758a; }
.cost-cell b { display: block; font-family: var(--mono); font-size: 12px; font-weight: 300; color: #e4f9ff; margin-top: 2px; }
.cost-cell b small { font-size: 6px; color: #63899b; }
.cost-cell em { display: block; font-style: normal; font-family: var(--mono); font-size: 5.6px; color: var(--mint); margin-top: 1px; }
.cost-cell.warn em { color: var(--amber); }

.zone-chip { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 5.8px; color: #5b8297; }
.zone-chip i { width: 4px; height: 4px; border-radius: 50%; }

.event-tag.violet { border-color: rgba(178,140,255,.25); color: var(--violet); }
.event-tag.cyan { border-color: rgba(57,230,255,.25); color: var(--cyan); }

/* clean stage for drill-down views */
#app.subview .stage-head { top: 78px; width: auto; }
#app.subview .stage-head .eyebrow { opacity: .55; }
#app.subview .stage-head h1, #app.subview .stage-head p { display: none; }
#app.subview .stage-head .stage-actions { margin-top: 9px; }

@media (max-width: 1450px) {
  .rail { width: 198px; }
  .brand-cn { font-size: 16px; }
  .topbar { left: 198px; }
  .stage-head { left: 230px; }
  .stage-head h1 { font-size: 37px; }
  .dock { left: 222px; right: 362px; }
  .panel { width: 326px; right: 18px; }
  .command { width: 520px; }
  .layer-menu { right: 354px; }
}
@media (max-width: 1220px) {
  .panel { width: 300px; }
  .stage-head h1 { font-size: 32px; }
  .stage-head p { width: 330px; }
  .dock { grid-template-columns: repeat(3, 1fr); height: 132px; }
  .dock-cell:nth-child(n+4) { display: none; }
  .command { width: 470px; bottom: 166px; }
  .cmd-chips { display: none; }
  .layer-menu { right: 326px; }
}
