:root {
  --ink: #e9edf4; --dim: #8a94a6; --faint: #5b6475; --line: rgba(255,255,255,.09);
  --glass: rgba(9,11,16,.58); --amber: #ffb04a; --hot: #ff6a2a; --cool: #6fb4ff; --green: #6fd3a5;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #04050a; color: var(--ink); font-family: var(--sans); overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, rgba(0,0,0,0) 42%, rgba(0,0,0,.34) 78%, rgba(0,0,0,.72) 100%); }
button { font: inherit; color: inherit; }
kbd { font-family: var(--mono); font-size: .85em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: rgba(255,255,255,.05); }

/* top bar */
#top { position: fixed; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 26px; pointer-events: none; gap: 16px; }
#top > * { pointer-events: auto; }
#title { font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--amber); }
#elabel { font-size: 26px; font-weight: 600; letter-spacing: .01em; margin-top: 6px; text-shadow: 0 2px 18px rgba(0,0,0,.8); }
#espec { font-family: var(--mono); font-size: 12.5px; color: var(--dim); margin-top: 4px; }
#evehicle { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 3px; max-width: 66ch; }
#evehicle[hidden] { display: none; }
#topright { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chips { display: flex; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 3px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.chips button { border: 0; background: none; padding: 6px 13px; border-radius: 999px; font-size: 12.5px; color: var(--dim); cursor: pointer; }
.chips button.on { background: rgba(255,255,255,.12); color: var(--ink); }
.pill { display: flex; align-items: center; gap: 8px; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 12.5px; color: var(--dim); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pill b { font-family: var(--mono); color: var(--ink); font-weight: 500; min-width: 3.2ch; text-align: right; }
.pill i { font-style: normal; font-family: var(--mono); color: var(--faint); }
.btn { cursor: pointer; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--ink); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.btn:hover { border-color: rgba(255,255,255,.22); }
.btn.on { border-color: rgba(255,176,74,.6); color: var(--amber); box-shadow: 0 0 18px rgba(255,150,40,.16) inset; }
.btn.wide { width: 100%; }
.pill.ico svg { width: 14px; height: 14px; display: none; }
.pill.btn { border-radius: 999px; padding: 7px 14px; font-size: 12.5px; color: var(--ink); }

/* side panels */
.tab { position: fixed; top: 142px; z-index: 3; cursor: pointer; background: var(--glass); border: 1px solid var(--line); color: var(--dim); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; padding: 9px 12px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tab.left { left: 0; border-left: 0; border-radius: 0 10px 10px 0; }
.tab.right { right: 0; border-right: 0; border-radius: 10px 0 0 10px; }
.tab[aria-expanded="true"] { color: var(--amber); }
.panel { position: fixed; top: 186px; bottom: 318px; width: 268px; z-index: 3; overflow-y: auto; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 14px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s; scrollbar-width: thin; scrollbar-color: #2a303c transparent; }
.panel.left { left: 18px; transform: translateX(-112%); opacity: 0; }
.panel.right { right: 18px; transform: translateX(112%); opacity: 0; bottom: auto; max-height: calc(100% - 490px); min-height: 200px; }
.panel.open { transform: none; opacity: 1; }
.panel h2 { margin: 2px 2px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }
.eng { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; width: 100%; text-align: left; cursor: pointer; background: rgba(255,255,255,.025); border: 1px solid transparent; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.eng:hover { background: rgba(255,255,255,.06); }
.eng.on { border-color: rgba(255,176,74,.55); background: rgba(255,150,40,.08); }
.eng .n { font-family: var(--mono); font-size: 20px; color: var(--amber); text-align: center; line-height: 1; }
.eng .n small { display: block; font-size: 9px; letter-spacing: .14em; color: var(--faint); margin-top: 3px; text-transform: uppercase; }
.eng .l { font-size: 13px; line-height: 1.25; }
.eng .s { font-family: var(--mono); font-size: 10.5px; color: var(--dim); margin-top: 2px; }
.row { margin: 12px 2px; }
.row label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink); margin-bottom: 6px; }
.row output { font-family: var(--mono); color: var(--amber); }
.row.check label { justify-content: flex-start; gap: 8px; align-items: center; }
.hint { font-size: 11.5px; color: var(--dim); margin: 0 2px 6px; line-height: 1.4; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: #2a303c; border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); margin-top: -6.5px; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
input[type=range]::-moz-range-track { height: 3px; background: #2a303c; border-radius: 2px; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--ink); }
input:disabled { opacity: .35; }
.segs { display: flex; gap: 6px; }
.segs button { flex: 1; cursor: pointer; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px; padding: 7px 4px; font-size: 12px; color: var(--dim); }
.segs button.on { color: var(--amber); border-color: rgba(255,176,74,.6); }

/* dashboard */
#dash { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 18px; align-items: end; padding: 0 22px 20px; pointer-events: none; }
#dash > * { pointer-events: auto; }
#cluster { position: relative; width: 300px; justify-self: start; }
#tach { width: 280px; height: 280px; display: block; filter: drop-shadow(0 8px 30px rgba(0,0,0,.6)); }
#readouts { position: absolute; left: 248px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; white-space: nowrap; }
#readouts div { font-family: var(--mono); font-size: 12px; color: var(--dim); }
#readouts b { display: inline-block; min-width: 4.2ch; text-align: right; font-size: 19px; font-weight: 500; color: var(--ink); margin-right: 6px; font-variant-numeric: tabular-nums; }
#center { min-width: 0; justify-self: end; width: min(100%, 420px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
#lamprow { display: flex; align-items: center; gap: 12px; }
.cap { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
#lamps { display: flex; gap: 7px; }
#lamps i { width: 15px; height: 15px; border-radius: 50%; border: 1px solid #3a4150; display: block; }
#lamps i.g { margin-left: 10px; }
#cut { font-family: var(--mono); font-size: 11.5px; color: var(--amber); letter-spacing: .1em; visibility: hidden; }
#scope, #spec { width: 100%; height: 68px; display: block; border: 1px solid var(--line); border-radius: 10px; background: rgba(6,8,12,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
#legend i { font-style: normal; }
#legendbar { width: 150px; height: 6px; border-radius: 3px; }
#lgcharge { display: flex; align-items: center; gap: 8px; flex-basis: 100%; }
#lgcharge[hidden] { display: none; }
#legendbar2 { width: 105px; height: 6px; border-radius: 3px; }
#legend .cap { flex-basis: 100%; letter-spacing: .04em; text-transform: none; font-family: var(--sans); font-size: 10.5px; }
#banner { z-index: 13; position: fixed; left: 50%; top: 58px; transform: translateX(-50%); font-size: 12px; color: var(--amber); background: var(--glass); border: 1px solid rgba(255,176,74,.35); border-radius: 999px; padding: 6px 14px; }
/* too-heavy notice */
.notice { position: fixed; z-index: 9; left: 50%; bottom: 168px; transform: translateX(-50%); width: min(520px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255,138,106,.5); background: rgba(24,12,10,.94); box-shadow: 0 18px 60px rgba(0,0,0,.55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.notice p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: #e8d6d0; }
.notice b { color: #ffb39a; }
.notice-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notice-actions .btn { padding: 9px 14px; }
#err { position: fixed; left: 16px; bottom: 16px; color: #ff8a8a; font: 12px var(--mono); white-space: pre-wrap; z-index: 20; max-width: 80vw; }

/* modal + start */
.modal { position: fixed; inset: 0; z-index: 14; display: grid; place-items: center; background: rgba(2,3,6,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 18px; }
.modal[hidden], #banner[hidden], [hidden] { display: none !important; }
.card { max-width: 560px; max-height: 88vh; overflow-y: auto; background: rgba(12,14,20,.92); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; -webkit-user-select: text; user-select: text; }
.card h2 { margin: 0 0 8px; font-size: 18px; }
.card h3 { margin: 16px 0 6px; font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--amber); }
.card p, .card li { font-size: 13.5px; line-height: 1.5; color: #c9d0dc; }
.card ul { margin: 0 0 12px; padding-left: 18px; }
.card a { color: #9fc4ff; }
.card h2.second { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .panel { transition: none; } }
.startmsg { margin: 0 auto 22px; max-width: 520px; padding: 14px 18px; border: 1px solid rgba(255,138,106,.45); border-radius: 12px; background: rgba(40,14,8,.55); font-size: 14.5px; line-height: 1.5; color: #f1d6cc; text-align: left; -webkit-user-select: text; user-select: text; }
.startmsg b { color: #ffb39a; }
.linkbtn { background: none; border: 0; padding: 6px 8px; color: var(--dim); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }
.nojs { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: #04050a; color: var(--ink); font: 16px var(--sans); }

/* ---- engine button in the title block */
.engbtn { display: block; text-align: left; background: none; border: 0; padding: 0; margin: 6px 0 0; cursor: pointer; color: var(--ink); max-width: min(62vw, 760px); }
.engbtn #elabel { display: block; margin-top: 0; }
.engbtn-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; border: 1px solid rgba(255,176,74,.45); background: rgba(255,150,40,.10); font-size: 13px; letter-spacing: .08em; color: var(--amber); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.engbtn-go b { font-family: var(--mono); font-weight: 500; color: var(--ink); opacity: .8; }
.engbtn-go i { font-style: normal; font-size: 10px; transition: transform .2s; }
.engbtn[aria-expanded="true"] .engbtn-go i { transform: rotate(180deg); }
.engbtn:hover .engbtn-go, .engbtn:focus-visible .engbtn-go { background: rgba(255,150,40,.2); border-color: rgba(255,176,74,.8); }
.engbtn:focus-visible { outline: none; }
.tag { display: inline-block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; white-space: nowrap; }
.tag.real { background: var(--amber); color: #1a0f04; font-weight: 600; }
.tag.gen { border: 1px solid #4a5263; color: var(--dim); }
.tag:empty { display: none; }
.tag.slow { border: 1px solid rgba(255,138,106,.55); color: #ff9c80; }
.br-detail .loadline { margin-top: 12px; font-size: 12px; color: var(--dim); }
.br-detail .loadline.warn { color: #ff9c80; }
.br-detail .vnotes { margin-top: 8px; }
#fuel h2.sub { margin: 18px 2px 4px; padding-top: 14px; border-top: 1px solid var(--line); }
#fuel .hint { margin: 4px 0 0; }
.segs + .hint { margin-top: 6px; }
#espec { margin-top: 8px; }

/* ---- engine library */
#brScrim { position: fixed; inset: 0; z-index: 6; background: rgba(2,3,6,.28); }
.browser { position: fixed; z-index: 7; left: 18px; top: 182px; bottom: 18px; width: min(900px, calc(100vw - 36px)); display: grid; grid-template-columns: minmax(0, 1fr) 310px; background: rgba(9,11,16,.95); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); box-shadow: 0 30px 90px rgba(0,0,0,.6); -webkit-user-select: text; user-select: text; }
.br-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.br-head { display: flex; gap: 8px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
#brSearch { flex: 1; min-width: 0; font: 14px var(--sans); color: var(--ink); background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: none; -webkit-appearance: none; appearance: none; }
#brSearch:focus { border-color: rgba(255,176,74,.7); }
#brSearch::placeholder { color: var(--faint); }
.br-head .chips { backdrop-filter: none; -webkit-backdrop-filter: none; flex: none; }
.br-list { flex: 1; overflow-y: auto; padding: 4px 12px 14px; scrollbar-width: thin; scrollbar-color: #2a303c transparent; -webkit-overflow-scrolling: touch; }
.br-list h3 { position: sticky; top: 0; z-index: 1; margin: 0 -12px; padding: 12px 14px 7px; font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); background: linear-gradient(rgba(10,12,17,.98) 70%, rgba(10,12,17,0)); }
.br-list h3 span { font-family: var(--mono); color: var(--faint); margin-left: 6px; letter-spacing: 0; }
.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 6px; }
.eng { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; cursor: pointer; background: rgba(255,255,255,.035); border: 1px solid transparent; border-radius: 10px; padding: 8px 8px 8px 10px; margin: 0; min-height: 54px; color: var(--ink); }
.eng:hover { background: rgba(255,255,255,.07); }
.eng.active { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); }
.eng.on { border-color: rgba(255,176,74,.7); background: rgba(255,150,40,.10); }
.eng .n { font-family: var(--mono); font-size: 19px; color: var(--amber); text-align: center; line-height: 1; }
.eng .n small { display: block; font-size: 8.5px; letter-spacing: .12em; color: var(--faint); margin-top: 3px; text-transform: uppercase; }
.eng .l { font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.eng .s { font-size: 11px; color: var(--dim); margin-top: 2px; line-height: 1.3; overflow-wrap: anywhere; }
.eng .side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.eng .info { display: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--dim); font: 600 13px var(--mono); cursor: pointer; }
#brFoot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }
.br-detail { border-left: 1px solid var(--line); overflow-y: auto; padding: 16px 16px 18px; background: rgba(255,255,255,.02); scrollbar-width: thin; scrollbar-color: #2a303c transparent; }
.br-detail h2 { margin: 8px 0 4px; font-size: 17px; line-height: 1.25; font-weight: 600; }
.br-detail .based { font-size: 12.5px; color: var(--dim); margin-bottom: 10px; line-height: 1.4; }
.br-detail h4 { margin: 16px 0 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--amber); }
.br-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 10px 0 0; font-size: 12.5px; }
.br-detail dt { color: var(--dim); }
.br-detail dd { margin: 0; font-family: var(--mono); font-size: 12px; text-align: right; }
.br-detail p { margin: 0; font-size: 12.5px; line-height: 1.5; color: #c2c9d6; }
.br-detail ul { margin: 0; padding: 0; list-style: none; }
.br-detail li { margin: 0 0 7px; font-size: 12.5px; line-height: 1.4; }
.br-detail a { color: #9fc4ff; text-decoration: none; overflow-wrap: anywhere; }
.br-detail a:hover { text-decoration: underline; }
.br-detail li small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.br-detail .actions { display: flex; gap: 8px; margin-top: 16px; }
.br-detail .back { display: none; }
#cam { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; color: var(--faint); border: 1px solid #333a47; border-radius: 4px; padding: 1px 6px; }
#cam.on { color: #1a0f04; background: var(--amber); border-color: var(--amber); box-shadow: 0 0 14px rgba(255,160,60,.6); }

/* narrow screens */
@media (max-width: 900px) {
  #espec, #evehicle, #load, #readouts, #scope, #legend .cap { display: none; }
  #topright { flex-wrap: nowrap; gap: 6px; }
  #topright .pill.btn { padding: 6px 10px; font-size: 11.5px; flex: none; }
  #topright .pill.ico { width: 31px; height: 31px; padding: 0; justify-content: center; }
  .pill.ico svg { display: block; }
  .pill.ico span { display: none; }
  #views { flex: 0 1 auto; min-width: 0; }
  .card { max-height: 82vh; padding: 18px; }
  .notice { bottom: 250px; }
  #top { padding: 12px 12px 0; flex-direction: column; gap: 8px; }
  #title { font-size: 10px; }
  #elabel { font-size: 18px; margin-top: 3px; }
  #topright { width: 100%; justify-content: flex-start; }
  #views { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  #views button { padding: 6px 8px; font-size: 11.5px; white-space: nowrap; }
  .tab { top: 104px; }
  #spec { height: 40px; }
  .engbtn { max-width: 100%; }
  .engbtn-go { margin-top: 5px; }
  .browser { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: min(76vh, 640px); grid-template-columns: 1fr; border-radius: 18px 18px 0 0; border-bottom: 0; background: #0a0c11; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .br-list h3 { background: #0a0c11; }
  .tab { top: 150px !important; }
  .br-head { flex-wrap: wrap; }
  #brSearch { flex: 1 1 100%; order: -1; font-size: 16px; }
  .br-head .chips { flex: 1; }
  .brkeys { display: none; }
  .eng .info { display: grid; place-items: center; line-height: 1; }
  .br-detail { display: none; position: absolute; inset: 0; border-left: 0; background: rgba(9,11,16,.98); z-index: 3; }
  .browser.detail .br-detail { display: block; }
  .br-detail .back { display: inline-block; }
  .panel { top: auto !important; bottom: 0 !important; left: 0 !important; right: 0 !important; width: auto; max-height: 58vh !important; min-height: 0 !important; border-radius: 16px 16px 0 0; z-index: 8; }
  .panel.left, .panel.right { transform: translateY(105%); }
  .panel.open { transform: none; }
}
@media (max-height: 620px) and (min-width: 901px) {
  #tach { width: 210px; height: 210px; }
  #readouts { left: 188px; }
  .panel { bottom: 250px; }
}
