/* Greenwave Junction — scoped traffic-control console. */
body.gj{--ink:#e8f4f1;--muted:#8faeb3;--line:#31535d;--panel:#102630;--panel-2:#142f3a;--accent:#52d8db;--gold:#f4ca65;--good:#68dfa2;--bad:#ff6970;background:radial-gradient(circle at 50% -20%,#214b55 0,#0a1c28 48%,#06121b 100%);color:var(--ink);min-height:100dvh}
body.gj #app{max-width:1440px;margin:0 auto;padding-bottom:20px}
body.gj #hud{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 22px;background:rgba(5,18,27,.9);border-bottom:1px solid #2a4d58;position:relative;z-index:20}
body.gj #hud[hidden],body.gj #gj-main[hidden]{display:none}
body.gj .brand{font-weight:900;letter-spacing:.8px;text-transform:uppercase;color:#e9f8f2;white-space:nowrap}
body.gj .brand:before{content:'▶';display:inline-grid;place-items:center;width:26px;height:26px;margin-right:9px;border-radius:6px;background:var(--gold);color:#10212a;box-shadow:0 3px 0 #8e7036}
body.gj .hud-buttons{display:flex;gap:7px;flex-wrap:wrap}
body.gj button{font:inherit;color:var(--ink);background:#17323e;border:1px solid #42636c;border-bottom-width:3px;border-radius:6px;padding:8px 13px;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
body.gj button:hover:not(:disabled){border-color:var(--accent);background:#1d424e}body.gj button:active:not(:disabled){transform:translateY(1px);border-bottom-width:1px}body.gj button:focus-visible{outline:3px solid var(--gold);outline-offset:2px}body.gj button:disabled{opacity:.42;cursor:not-allowed}
body.gj button.primary{background:var(--gold);color:#10212a;border-color:#ffe49a;font-weight:900}body.gj button.danger{color:#ff9ca0}body.gj kbd{font-size:10px;color:var(--muted)}
#gj-main{padding:16px 20px 0;max-width:1250px;margin:auto}
.gj-stats{display:grid;grid-template-columns:repeat(4,minmax(90px,1fr)) minmax(180px,1.5fr);gap:8px;margin-bottom:12px}
.gj-stats>div{background:linear-gradient(180deg,#15313d,#0e2530);border:1px solid #2b505b;border-radius:7px;padding:9px 13px;min-height:62px}
.gj-stats small{display:block;font-size:10px;letter-spacing:1px;color:#8eabb2;font-weight:700}.gj-stats b{display:block;font-family:"Courier New",monospace;font-size:25px;line-height:1.1;margin-top:4px;color:#f0f8ef}.gj-stats>div:first-child b{color:var(--gold)}
.gj-meter{height:7px;background:#07151d;border-radius:4px;margin-top:6px;overflow:hidden}.gj-meter i{display:block;height:100%;width:8%;background:linear-gradient(90deg,var(--good),var(--gold),var(--bad));transition:width .2s}
.gj-layout{display:grid;grid-template-columns:minmax(0,1fr) 236px;gap:12px;align-items:stretch}
.gj-stage{min-width:0;background:#081720;border:1px solid #3c616a;border-radius:10px;overflow:hidden;box-shadow:0 18px 45px rgba(0,0,0,.28)}
#canvas-wrap{width:100%;aspect-ratio:16/9;background:#142c3b;overflow:hidden}#junction{display:block;width:100%;height:100%;touch-action:manipulation;cursor:pointer;outline:none}
.gj-stage-caption{display:flex;align-items:center;gap:12px;padding:9px 13px;border-top:1px solid #2b4a55;font-size:12px;min-height:39px}.gj-stage-caption>span:first-child{font-family:"Courier New",monospace;color:var(--accent);font-weight:900;white-space:nowrap}.gj-stage-caption>span:last-child{color:#b5c8ca}
.gj-dispatch{background:linear-gradient(180deg,#122b36,#0b202b);border:1px solid #345560;border-radius:9px;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.gj-dispatch-head{padding:13px 13px 10px;font-size:11px;font-weight:900;letter-spacing:1px;color:#9fc2c5;display:flex;justify-content:space-between}.gj-dispatch-head i{width:8px;height:8px;border-radius:50%;background:var(--good);box-shadow:0 0 12px var(--good)}
.gj-alerts{padding:0 10px;display:flex;flex-direction:column;gap:6px;min-height:180px;max-height:310px;overflow:auto;flex:1}
.gj-alert{padding:8px 9px;border-left:3px solid #4b707a;background:rgba(255,255,255,.025);font-size:11px;line-height:1.35;color:#b7cacd}.gj-alert b{display:block;font-size:9px;color:#6f929a;letter-spacing:.6px;margin-bottom:2px}.gj-alert.emergency{border-color:#5ed9ee}.gj-alert.accident,.gj-alert.warning{border-color:var(--bad)}.gj-alert.good{border-color:var(--good)}.gj-alert.walk{border-color:var(--gold)}
.gj-mini{display:flex;justify-content:space-between;gap:8px;padding:9px 13px;border-top:1px solid #29434d;font-size:11px;color:#8faeb3}.gj-mini b{color:var(--ink);text-align:right}
.gj-controls{display:grid;grid-template-columns:1fr 1.25fr 1fr 1fr 1.15fr 1fr;gap:8px;margin-top:12px}
.gj-controls button{position:relative;min-height:64px;text-align:left;padding:9px 8px 8px 39px;display:flex;flex-direction:column;justify-content:center;background:linear-gradient(180deg,#193743,#102934)}
.gj-controls button b{font-size:11px;letter-spacing:.3px}.gj-controls button small{font-size:9px;color:#91adb3;margin-top:3px;line-height:1.2}.gj-key{position:absolute;left:7px;top:10px;display:grid;place-items:center;min-width:24px;height:24px;padding:0 3px;background:#294a55;border-radius:4px;color:#d9f0ec;font-size:10px;font-weight:900}
.gj-controls .gj-change{background:linear-gradient(180deg,#b78e38,#715827);border-color:#f0ca72}.gj-controls .gj-change small{color:#fff0c2}.gj-controls .gj-change .gj-key{background:#f0ca72;color:#19252a;min-width:40px}.gj-controls .gj-change{padding-left:58px}@media(max-width:700px){.gj-controls .gj-change{padding-left:50px}}
.gj-controls .walk .gj-key{background:var(--good);color:#10251d}.gj-controls .priority .gj-key{background:var(--accent);color:#10252d}.gj-controls .tow .gj-key{background:#e88d57;color:#281810}
.gj-controls button.attention{animation:gjPulse .8s infinite alternate;border-color:var(--gold)}@keyframes gjPulse{to{box-shadow:0 0 18px rgba(244,202,101,.45)}}
.gj-tip{text-align:center;color:#87a7ad;font-size:11px;margin:10px 0 0}
body.gj #overlay{position:fixed;inset:0;z-index:100;background:radial-gradient(circle at 50% 20%,rgba(40,99,105,.6),rgba(3,11,17,.94));display:flex;align-items:center;justify-content:center;padding:20px}body.gj #overlay[hidden]{display:none}
.gj-panel{width:min(680px,100%);max-height:calc(100dvh - 40px);overflow:auto;background:linear-gradient(145deg,#15333f,#0b202c);border:1px solid #4b747c;border-radius:13px;box-shadow:0 25px 80px rgba(0,0,0,.6);padding:28px;outline:none}
.gj-panel h2{font-size:38px;line-height:1;margin:0 0 12px;text-transform:uppercase;letter-spacing:-1px;color:#f1f7ed}.gj-panel h3{color:var(--accent);font-size:14px;margin:20px 0 7px}.gj-panel p{color:#b5c9cb;line-height:1.55}.gj-panel .gj-kicker{font-size:10px;letter-spacing:2px;color:var(--gold);font-weight:900;margin-bottom:12px}.gj-panel .gj-lead{font-size:18px;color:#e4f0ed;max-width:570px}.gj-panel .actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:22px}.gj-panel .actions button{min-height:44px}.gj-feature-chips{display:flex;gap:6px;flex-wrap:wrap;margin:18px 0}.gj-feature-chips span{font-size:10px;font-weight:900;letter-spacing:.6px;padding:6px 8px;border:1px solid #3b626c;border-radius:4px;color:#a8ccce;background:#0b222c}
.gj-best{display:flex;gap:10px;margin:18px 0}.gj-best>div{flex:1;background:#091c26;border:1px solid #2d505b;border-radius:7px;padding:12px}.gj-best small{display:block;color:#83a2a9;font-size:9px;letter-spacing:1px}.gj-best b{display:block;font-family:"Courier New",monospace;color:var(--gold);font-size:25px;margin-top:4px}
.gj-result-hero{display:grid;grid-template-columns:120px 1fr 1fr;gap:9px;margin:17px 0}.gj-result-hero>div{background:#0a1e28;border:1px solid #365863;border-radius:7px;padding:14px;text-align:center}.gj-result-hero small{display:block;font-size:9px;color:#8ba9af;letter-spacing:1px}.gj-result-hero b{display:block;font-family:"Courier New",monospace;font-size:28px;color:var(--gold);margin-top:5px}.gj-result-hero .gj-grade b{font-size:42px;color:var(--good)}
.gj-result-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.gj-result-grid div{display:flex;justify-content:space-between;padding:8px 10px;background:rgba(255,255,255,.025);font-size:12px;color:#9db8bc}.gj-result-grid b{color:#e9f4ef}
body.gj #toast{position:fixed;left:50%;bottom:22px;transform:translate(-50%,15px);z-index:90;max-width:min(90vw,600px);padding:10px 16px;border:1px solid var(--accent);border-radius:6px;background:#102d38;color:#e9f7f2;font-weight:700;font-size:12px;opacity:0;pointer-events:none;transition:.15s}body.gj #toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:1050px){.gj-layout{grid-template-columns:1fr}.gj-dispatch{display:grid;grid-template-columns:1fr repeat(3,150px);align-items:stretch}.gj-dispatch-head{grid-column:1/-1}.gj-alerts{min-height:70px;max-height:100px;flex-direction:row}.gj-alert{min-width:190px}.gj-mini{border-top:0;border-left:1px solid #29434d;flex-direction:column;justify-content:center}.gj-controls{grid-template-columns:repeat(3,1fr)}body.gj .hud-buttons{flex-wrap:nowrap;overflow:auto}.gj-stats{grid-template-columns:repeat(5,1fr)}}
@media(max-width:700px),(max-height:500px){body.gj #hud{padding:8px 10px;gap:8px}body.gj .brand{font-size:12px}body.gj .brand:before{width:22px;height:22px;margin-right:5px}body.gj .hud-buttons button{font-size:11px;padding:7px 9px;min-height:40px}body.gj .hud-buttons kbd{display:none}#gj-main{padding:8px 8px 0}.gj-stats{grid-template-columns:repeat(4,1fr);gap:4px;margin-bottom:7px}.gj-stats>div{padding:6px;min-height:48px}.gj-stats small{font-size:7px;letter-spacing:.4px}.gj-stats b{font-size:18px}.gj-stats .gj-jam{grid-column:1/-1;min-height:34px;display:grid;grid-template-columns:1fr auto;align-items:center}.gj-jam .gj-meter{grid-column:1/-1;width:100%;margin-top:3px}.gj-jam b{margin:0}.gj-stage-caption{font-size:10px;padding:6px 8px;min-height:33px}.gj-dispatch{grid-template-columns:repeat(3,1fr)}.gj-alerts{display:none}.gj-dispatch-head{padding:7px 9px}.gj-mini{padding:7px;font-size:9px}.gj-controls{grid-template-columns:repeat(3,1fr);gap:5px;margin-top:7px}.gj-controls button{min-height:56px;padding:6px 4px 6px 32px}.gj-controls button b{font-size:9px}.gj-controls button small{font-size:8px}.gj-key{left:5px;top:8px;min-width:21px;height:21px;font-size:8px}.gj-tip{font-size:9px;margin:7px 0}.gj-panel{padding:20px;max-height:calc(100dvh - 20px)}.gj-panel h2{font-size:30px}.gj-panel .gj-lead{font-size:15px}body.gj #overlay{padding:10px}.gj-result-hero{grid-template-columns:90px 1fr 1fr}.gj-result-hero b{font-size:22px}}
@media(max-width:390px){.gj-controls{grid-template-columns:repeat(2,1fr)}.gj-result-grid{grid-template-columns:1fr}.gj-best{flex-direction:column}.gj-panel h2{font-size:26px}}
@media(prefers-reduced-motion:reduce){body.gj *{animation:none!important;transition:none!important}}
