/* The study uses the same graphite casting, recessed controls and restrained
   electric focus as the network console. Native engineering controls remain. */
body.study-active {
  --bg:#1d2327; --fg:#d2dfe8; --mut:#94a9b8; --dim:#78909f; --card:#293137; --card-2:#20282e;
  --line:#a6c2d21c; --line-soft:#a6c2d210; --accent:#77cfff; --accent-soft:#16b7ff12;
  --ring:transparent; --study-well:linear-gradient(180deg,#181d20,#202629);
  --study-cap:linear-gradient(155deg,#41484c,#30383d); --study-rim:inset 0 1px #dceaf026,inset -1px -1px #0007;
  --study-focus:inset 0 0 0 1px #16b7ffcc,inset 0 2px 4px #0008;
  --study-head-h:86px; --study-run-h:0px;
  overflow:hidden; background:#1b2023; color:var(--fg);
}
body.study-active main { position:fixed; inset:0; width:auto; max-width:none; padding:0; margin:0; overflow:hidden; }
body.study-active .topbar,body.study-active>.sidebar { display:none; }
body.study-active.study-menu-open>.sidebar { display:flex; position:fixed; inset:78px auto 16px 16px; width:260px; height:auto; z-index:1500; border:1px solid #101719; border-radius:16px; background:linear-gradient(145deg,#30383e,#242c31); box-shadow:0 4px 8px #0009,0 22px 48px #0008; }
body.study-active>.sidebar .brand { display:none; }
body.study-active>.sidebar nav { min-height:0; overflow:auto; padding:10px; }
body.study-active>.sidebar nav button { min-height:34px; font-size:12px; border-radius:9px; }
.study-console { position:fixed; inset:0 0 auto; height:86px; padding:0 18px; z-index:1100; display:grid; grid-template-columns:minmax(230px,1fr) auto minmax(220px,1fr); gap:18px; align-items:start; color:#d2e1ea; font-family:var(--sans); }
.study-console[hidden],.study-context-panel[hidden] { display:none!important; }
.study-console-shell { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible; filter:drop-shadow(0 5px 5px #0008) drop-shadow(0 14px 20px #0005); }
.study-console-start,.study-console-end { position:relative; display:flex; align-items:center; min-width:0; gap:12px; height:64px; }
.study-console-end { justify-content:flex-end; gap:7px; }
.study-icon { width:17px; height:17px; flex:none; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.study-console button { font-family:var(--sans); }
.study-brand { padding:0; width:54px; min-width:54px; height:44px; border:0; background:none; color:#e1e8ec; font:650 22px var(--sans)!important; letter-spacing:-.6px; text-shadow:0 1px #fff4,0 3px 3px #000a; }
.study-context-trigger { display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; height:46px; width:100%; max-width:260px; padding:6px 15px; border:1px solid #0c1115; border-radius:24px; background:var(--study-well,linear-gradient(#171d20,#242c31)); color:#ccdfe9; box-shadow:inset 0 2px 5px #0009,0 1px #d8e6ec1c; text-align:left; }
.study-context-trigger>span { display:flex; flex-direction:column; gap:2px; min-width:0; }
.study-context-trigger small { color:#91a9b9; font:9px/12px var(--sans); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.study-context-trigger strong { color:#d3e1e9; font:550 12px/16px var(--sans); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.study-context-trigger>.study-icon { width:12px; }
.study-workflow { position:relative; display:flex; flex-direction:row; align-items:center; align-self:start; height:48px; margin-top:22px; padding:5px; gap:3px; border:1px solid #0b1115; border-radius:26px; background:linear-gradient(#171c20,#232b30); box-shadow:inset 0 3px 6px #000a,0 1px #d4e5ed20; }
.study-step { position:relative; display:flex; gap:7px; align-items:center; justify-content:center; height:36px; min-height:36px; padding:0 12px; border:1px solid transparent; border-radius:21px; background:none; color:#8fa6b6; font:500 11px var(--sans); white-space:nowrap; }
.study-step>small { color:#5e788a; font:9px var(--sans); }
.study-step[aria-current=step] { color:var(--pra-selected-fg); border-color:var(--pra-selected-rim); background:var(--pra-selected-bg); box-shadow:var(--pra-selected-shadow); }
.study-step[aria-current=step]>small{color:var(--pra-selected-muted);}
.study-step:hover { color:#d2e6f4; }
.study-results-note { position:absolute; top:calc(100% + 8px); left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:9px; min-width:max-content; padding:6px 10px; border:1px solid #98bed02b; border-radius:8px; background:#273943; color:#a6c7dc; box-shadow:0 3px 8px #0005; font:10px var(--sans); }
.study-results-note[hidden] { display:none; }
.study-results-note button { min-height:22px; padding:3px 7px; border:1px solid #98bed03b; border-radius:5px; background:#456173; color:#cbe6f8; font:10px var(--sans); }
.study-step[data-state=stale]::after { content:''; position:absolute; bottom:4px; width:3px; height:3px; border-radius:50%; background:#e4b974; }
.study-step[data-state=done]::after { content:''; position:absolute; bottom:4px; width:3px; height:3px; border-radius:50%; background:#92bdab; }
.study-network-return,.study-settings-trigger { display:flex; align-items:center; justify-content:center; gap:6px; height:34px; min-height:34px; margin:0; padding:0 10px; border:1px solid #a6bdcb1d; border-radius:18px; background:linear-gradient(#333d44,#27323a); color:#a4becf; box-shadow:inset 0 1px #d4e5ef12,0 2px 4px #0005; font:11px var(--sans); }
.study-settings-trigger { width:34px; min-width:34px; padding:0; }
.study-network-return .study-icon { width:13px; }
.study-run-slot:empty { display:none; }
.study-run-slot>.ed-run { height:34px; min-height:34px; padding:0 17px; border:1px solid #a6d9f445; border-radius:19px; color:#e0f1fb; background:linear-gradient(155deg,#5e8299,#3d5d72); box-shadow:inset 0 1px #e3f5ff29,0 2px 3px #0008; font:550 11px var(--sans); }
.study-context-panel { position:fixed; z-index:1450; left:84px; top:73px; width:430px; max-width:calc(100vw - 28px); max-height:calc(100dvh - 95px); padding:18px; overflow:auto; border:1px solid #11191e; border-radius:16px; background:linear-gradient(145deg,#333d44,#242e35); color:#bfd4e2; box-shadow:inset 0 1px #d8e9f21c,0 8px 20px #0009,0 22px 44px #0007; }
.study-context-panel>h3 { margin:0 0 14px; font:550 14px var(--sans); }
.study-context-panel #scopebar { display:block; padding:0 0 12px; margin:0; }
.study-context-panel #scopebar ol { display:flex; flex-wrap:wrap; font-size:11px; }
.study-context-panel #stationbar { display:flex; flex-wrap:wrap; min-height:0; margin:0; padding:12px 0; background:none; border:0; border-top:1px solid #a9c7d21a; box-shadow:none; }
.study-context-panel #stationbar .field-label { padding:0; background:none; font:10px var(--sans); color:#8ea7b7; }
.study-context-panel #stationbar .sb-facts { font:11px/1.6 var(--sans); }
.study-context-panel #stationbar .sb-note { font-size:10px; }
.study-context-close { width:100%; margin:8px 0 0; padding:8px; border:1px solid #a6c5d32b; border-radius:8px; background:#3a4b56; color:#c6dfed; font:11px var(--sans); }
body.study-active #orgbar:not(.hidden) { display:none; }
body.study-active.study-settings-open #orgbar:not(.hidden) { display:flex; position:fixed; top:73px; right:16px; left:auto; width:430px; max-width:calc(100vw - 32px); max-height:calc(100dvh - 95px); overflow:auto; margin:0; padding:18px; z-index:1450; border:1px solid #11191e; border-radius:16px; background:linear-gradient(145deg,#333d44,#242e35); box-shadow:0 8px 20px #0009,0 22px 44px #0007; }
body.study-active #runstrip:not(.hidden):not(.offstage) { position:fixed; top:var(--study-head-h); left:16px; right:16px; z-index:1000; margin:0; padding:7px 12px; min-height:36px; max-height:30dvh; overflow:auto; border:1px solid #a6c5d328; border-radius:10px; background:#26333c; font-size:11px; }
body.study-active main>.wide:not(.hidden) { position:absolute; inset:calc(var(--study-head-h) + var(--study-run-h)) 0 0; width:auto; max-width:none; padding:12px 16px 16px; margin:0; overflow:auto; }
body.study-active :is(#view-edit,#view-assets):not(.hidden) { display:flex; flex-direction:column; overflow:hidden; gap:8px; }
body.study-active :is(#view-edit,#view-assets)>.pagehead { display:flex; align-items:center; justify-content:space-between; flex:none; min-height:26px; padding:0 2px; margin:0; border:0; gap:12px; }
body.study-active :is(#view-edit,#view-assets)>.pagehead .stepbadge { display:none; }
body.study-active :is(#view-edit,#view-assets)>.pagehead .ph-txt h2 { display:flex; align-items:center; gap:8px; margin:0; font:550 13px var(--sans); color:#a9c2d3; letter-spacing:0; }
body.study-active #view-assets>.pagehead .ph-txt>p { margin:2px 0 0; font:10px/1.5 var(--sans); color:#7f9bad; }
body.study-active :is(#view-edit,#view-assets)>.pagehead .ph-act { min-width:0; margin:0; display:flex; align-items:center; gap:12px; }
body.study-active #view-assets>.pagehead .ph-act>.go { font-size:10px; min-height:26px; padding:4px 10px; }
body.study-active [data-edmsg]:empty { display:none; }
/* Native editor notices share the study's matte casing and recessed indicator. */
body.study-active [data-edmsg].err.alert:not(:empty) { position:relative; flex:none; min-height:36px; max-height:96px; margin:0!important; padding:9px 13px 9px 42px; overflow:auto; border:1px solid #111a1f; border-radius:10px; background:linear-gradient(155deg,#333c41,#272f34); color:#becdd6; box-shadow:inset 0 1px #d7e5eb16,inset 0 -1px #060d133d,0 2px 4px #050b104d; font:11px/1.55 var(--sans); scrollbar-width:thin; scrollbar-color:#8296a444 transparent; }
body.study-active [data-edmsg].err.alert:not(:empty)::before { content:''; position:absolute; left:11px; top:9px; width:21px; height:21px; border-radius:6px; background-color:#202a30; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239cb8c9' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 11v6m0-10v1'/%3E%3C/svg%3E"); background-position:center; background-repeat:no-repeat; box-shadow:inset 0 2px 3px #060d1380,inset 0 -1px #c7d9e71c; }
body.study-active [data-edmsg].err.alert.bad:not(:empty)::before { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23d3ab88' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.4 4.8 2.8 18a1.8 1.8 0 0 0 1.6 2.7h15.2a1.8 1.8 0 0 0 1.6-2.7L13.6 4.8a1.8 1.8 0 0 0-3.2 0Z'/%3E%3Cpath d='M12 9v5m0 3v.1'/%3E%3C/svg%3E"); }
body.study-active #wb-stats { display:flex; flex-wrap:wrap; gap:4px 12px; color:#7895a7; font:10px var(--sans); }
body.study-active #wb-stats b { color:#a7bfce; font-weight:550; }
body.study-active #wb-stats .stat { padding:0; background:none; border:0; }
.study-model-summary { display:contents; }
.study-model-summary>summary { display:none; }
body.study-active #ed-ftbtn { min-height:25px; padding:3px 8px; border:1px solid #8eb7d023; border-radius:7px; background:#2c3942; color:#98b7cb; font:10px var(--sans); }
body.study-active #view-edit>.viewwrap { flex:1; min-height:0; display:flex; flex-direction:column; gap:10px; padding:0; }
body.study-active #view-edit .ed-lockbar { flex:none; margin:0; padding:7px 10px; border-radius:9px; font:10px/1.5 var(--sans); }
body.study-active .ed-toolbar { position:relative; z-index:30; display:flex; align-items:center; flex-wrap:wrap; gap:7px; flex:none; min-height:48px; padding:6px 9px; border:1px solid #10171b; border-radius:13px; background:linear-gradient(160deg,#373f44,#293137); box-shadow:var(--study-rim),0 3px 5px #0006; }
body.study-active .ed-toolbar>button,body.study-active .ed-toolbar .ed-menu>button { min-height:30px; height:30px; padding:0 9px; border:1px solid #a9c4d01a; border-radius:8px; background:linear-gradient(#35434c,#2a363f); color:#a3bacb; font:11px var(--sans); box-shadow:inset 0 1px #d8e9f00c,0 1px 2px #0005; }
body.study-active .ed-toolbar>button[aria-label] { width:30px; padding:0; }
body.study-active .ed-toolbar .ico { width:14px; height:14px; }
body.study-active .ed-tools { gap:2px; padding:3px; border:1px solid #121a20; border-radius:10px; background:var(--study-well); box-shadow:inset 0 2px 4px #0008,0 1px #e0e9ed0c; }
body.study-active .etool { height:29px; min-height:29px; padding:0 8px; border:1px solid transparent; border-radius:7px; gap:5px; color:#8fa7b9; background:none; font:10px var(--sans); }
body.study-active .etool.on { color:var(--pra-selected-fg); background:var(--pra-selected-bg); border-color:var(--pra-selected-rim); box-shadow:var(--pra-selected-shadow); }
body.study-active .ed-toolbar .ed-menu { margin-left:auto; }
body.study-active .ed-menu-pop { z-index:100; border-radius:13px; background:linear-gradient(#34424b,#242f37); border-color:#98bed039; box-shadow:0 8px 18px #0009,0 20px 40px #0006; }
body.study-active .ed-menu-pop,body.study-active .study-advanced-tools { scrollbar-width:thin; scrollbar-color:#7899aa66 transparent; overscroll-behavior:contain; }
body.study-active .ed-menu-item { color:#bad0df; font-size:12px; }
body.study-active .ed-menu-item .mi-sub { color:#7e9bae; font-size:10px; line-height:1.6; }
.study-tools-more { position:relative; flex:none; }
.study-tools-more>summary { display:flex; align-items:center; gap:9px; height:30px; min-height:30px; padding:0 10px; border:1px solid #a9c4d01a; border-radius:8px; background:linear-gradient(#35434c,#2a363f); color:#a3bacb; cursor:pointer; font:11px var(--sans); list-style:none; }
.study-tools-more>summary::before,.study-tools-more>summary::marker { display:none; content:''; }
.study-tools-more>summary::-webkit-details-marker { display:none; }
.study-advanced-tools { position:absolute; top:calc(100% + 8px); right:0; width:260px; padding:10px; border:1px solid #98bed039; border-radius:13px; background:linear-gradient(#34424b,#242f37); box-shadow:0 8px 18px #0009,0 20px 40px #0006; }
body.study-active .study-advanced-tools>.ed-tools { display:flex; justify-content:center; margin:0 0 9px; }
body.study-active .study-advanced-tools>button { width:100%; justify-content:flex-start; margin:3px 0; padding:8px 10px; border:0; border-radius:8px; background:#1b272e4d; color:#aec8d8; font:11px var(--sans); text-align:left; }
body.study-active .study-advanced-tools>button.danger { margin-top:10px; color:#bd9696; border-top:1px solid #bc787823; }
body.study-active #view-edit .split-main { flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) 316px; gap:12px; align-items:stretch; }
body.study-active #view-edit .ed-wrap { display:flex; flex-wrap:nowrap; min-width:0; min-height:0; height:100%; padding:0; margin:0; gap:10px; border:0; }
body.study-active #view-edit .ed-canvas { position:relative; container-type:inline-size; flex:1; min-width:0; min-height:0; border:1px solid #0d151a; border-radius:15px; overflow:hidden; background:#1b2328; box-shadow:inset 0 2px 7px #0008,0 1px #a7c6d319; }
body.study-active #ed-graphwrap { flex:1; height:100%; min-height:0; background:none; }
body.study-active #ed-svg { display:block; width:100%; height:calc(100% - 52px); min-height:0; background-color:#1b2227; background-image:radial-gradient(#8eacbd24 .65px,transparent .8px),radial-gradient(ellipse at 35% 40%,#34454e38,transparent 70%); background-size:18px 18px,100% 100%; }
body.study-active #ed-svg:is(:focus,:focus-visible) { outline:none; }
/* Conductors and symbol strokes stay legible when a whole station is fitted.
   The underlying geometry, routes, colors and every native label stay intact. */
body.study-active #ed-svg .ededge:not(.ebusrun) { vector-effect:non-scaling-stroke; stroke:#788d99; stroke-width:1.1px; }
body.study-active #ed-svg .ededge.sel:not(.ebusrun) { stroke:#34b7ff; stroke-width:1.7px; }
body.study-active #ed-svg .nglyph { vector-effect:non-scaling-stroke; stroke:#c5d5df; stroke-width:1px; }
body.study-active #ed-svg .edlbl { font-weight:500; stroke:#1b2227; stroke-width:calc(var(--edhalo,3.5) * .55); }
body.study-active #ed-drawing { display:flex; flex-direction:column; flex:0 1 46%; width:auto; min-width:200px; height:100%; min-height:0; border:1px solid #111b22; border-radius:14px; overflow:hidden; }
body.study-active #ed-drawing.hidden { display:none; }
body.study-active #ed-drawing-view { flex:1; height:auto; max-height:none; min-height:0; }
body.study-active #ed-dimension-toggle { top:12px; right:12px; z-index:10; padding:4px; border:1px solid #0e181f; border-radius:12px; background:var(--study-well); box-shadow:inset 0 2px 4px #0009,0 2px 4px #0005; }
body.study-active #ed-dimension-toggle button { height:29px; min-height:29px; padding:0 11px; border-radius:8px; color:#8ca6b9; font-size:11px; }
body.study-active #ed-dimension-toggle button[aria-pressed=true] { color:var(--pra-selected-fg); background:var(--pra-selected-bg); box-shadow:var(--pra-selected-shadow); }
.study-diagram-guide { position:absolute; left:12px; bottom:12px; z-index:20; max-width:min(390px,calc(100% - 24px)); }
.study-diagram-guide>summary { display:flex; align-items:center; width:max-content; min-height:29px; padding:6px 11px; border:1px solid #98bed02b; border-radius:9px; background:#29363eea; color:#90adbf; font:10px var(--sans); cursor:pointer; list-style:none; box-shadow:0 2px 5px #0006; }
.study-diagram-guide>summary::before { display:none; }
.study-diagram-guide[open] { padding:10px; border:1px solid #98bed030; border-radius:12px; background:#26333bf5; box-shadow:0 8px 20px #0008; }
body.study-active .study-diagram-guide .ed-legend { position:static; display:flex; flex-wrap:wrap; gap:8px 12px; max-height:180px; padding:12px 0 0; overflow:auto; border:0; background:none; color:#a2bdce; font:10px/1.6 var(--sans); }
body.study-active .study-diagram-guide .ed-legend .ed-keys { display:block; }
.study-diagram-guide>p { margin:12px 0 0; color:#829eaf; font:10px/1.6 var(--sans); }
body.study-active #view-edit #slot-edit,body.study-active #view-assets #slot-assets { position:relative; top:auto; display:flex; flex-direction:column; align-items:stretch; gap:0; height:100%; min-height:0; min-width:0; overflow:auto; overscroll-behavior:contain; border:1px solid #10191e; border-radius:15px; background:linear-gradient(145deg,#30383e,#252e35); box-shadow:var(--study-rim),0 3px 5px #0006,0 12px 26px #0005; scrollbar-width:thin; scrollbar-color:#57758766 transparent; }
.study-panel-head { position:sticky; top:0; z-index:5; flex:none; padding:13px 13px 10px; border-bottom:1px solid #0d171e; border-radius:14px 14px 10px 10px; background:var(--study-cap); box-shadow:inset 0 1px #dceaf01c,0 2px 4px #0005; }
.study-panel-title { display:flex; flex-direction:column; min-width:0; gap:4px; margin:0 0 12px; }
.study-panel-title strong { color:#d8e6ef; font:550 18px/1.2 var(--sans); letter-spacing:-.3px; overflow-wrap:anywhere; }
.study-panel-title small { color:#91a9b9; font:10px/1.5 var(--sans); }
.study-panel-tabs { display:flex; gap:3px; padding:4px; border:1px solid #121b22; border-radius:10px; background:var(--study-well); box-shadow:inset 0 2px 4px #0009,0 1px #dceaf00e; }
.study-panel-tabs>button { flex:1; min-width:0; min-height:29px; height:29px; padding:0 5px; border:1px solid transparent; border-radius:7px; background:none; color:#839eb1; font:10px var(--sans); }
.study-panel-tabs>button[aria-selected=true] { color:var(--pra-selected-fg); border-color:var(--pra-selected-rim); background:var(--pra-selected-bg); box-shadow:var(--pra-selected-shadow); }
body.study-active :is(#slot-edit,#slot-assets)>[data-panel] { display:none; padding:14px; margin:0; border:0; border-radius:0; background:none; box-shadow:none; font-size:12px; }
body.study-active[data-study-panel=inspect] :is(#slot-edit,#slot-assets)>[data-panel=inspect],body.study-active[data-study-panel=whatif] :is(#slot-edit,#slot-assets)>[data-panel=whatif],body.study-active[data-study-panel=modes] #slot-edit>[data-panel=modes] { display:block; }
body.study-active :is(#slot-edit,#slot-assets)>[data-panel]>h3 { position:absolute; width:1px; height:1px; margin:-1px!important; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
body.study-active :is(.study-view,#orgbar) :is(input,select,textarea) { max-width:100%; min-height:32px; padding:7px 10px; border:1px solid #101b22; border-radius:9px; background-color:#1c262d; color:#bfd3e1; box-shadow:inset 0 2px 4px #0007,0 1px #d9eaf012; font:11px/1.5 var(--sans); outline:none; }
body.study-active :is(.study-view,#orgbar) select { appearance:none; padding-right:28px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239bb9cd' stroke-width='1.4'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E"); background-position:right 10px center; background-repeat:no-repeat; }
body.study-active :is(.study-view,#orgbar) label { font:10px/1.5 var(--sans); color:#8faabc; margin-top:12px; }
body.study-active :is(.study-view,#orgbar) :is(input,select,textarea):is(:focus-visible,[aria-expanded=true]) { outline:none; box-shadow:var(--study-focus),0 1px #dceef519; border-color:#101b22; }
body.study-active :is(.study-view,#orgbar) input[type=checkbox] { appearance:none; display:inline-grid; place-items:center; width:15px; min-width:15px; height:15px; min-height:15px; margin:0; padding:0; border-radius:4px; }
body.study-active :is(.study-view,#orgbar) input[type=checkbox]:checked { background:#456b83; border-color:#91c9e04d; }
body.study-active :is(.study-view,#orgbar) input[type=checkbox]:checked::after { content:''; display:block; width:7px; height:4px; border-left:1.5px solid #cceaff; border-bottom:1.5px solid #cceaff; transform:translateY(-1px) rotate(-45deg); }
body.study-active :is(.study-view,#orgbar) button:focus-visible,body.study-active :is(.study-console,.study-diagram-guide,.study-tools-more,.study-panel-tabs) :is(button,summary):focus-visible { outline:none; box-shadow:var(--study-focus); }
body.study-active :is(#ed-inspector,#ed-whatif,#ed-failpanel) :is(input,select) { width:100%; }
body.study-active :is(#ed-inspector,#ed-whatif) label { display:block; }
body.study-active :is(#ed-inspector,#ed-whatif) .row { gap:9px; }
body.study-active :is(#ed-inspector,#ed-whatif,#ed-failpanel) :is(.hint,.dim) { color:#809daf; font-size:10px; line-height:1.65; }
body.study-active :is(#ed-inspector,#ed-whatif,#ed-failpanel) .seg { padding:3px; border:1px solid #111c24; border-radius:9px; background:var(--study-well); box-shadow:inset 0 2px 4px #0007; }
body.study-active :is(#ed-inspector,#ed-whatif,#ed-failpanel) .seg>button { flex:1; min-width:0; min-height:28px; padding:5px 3px; font-size:10px; color:#8ca8bb; border-radius:7px; }
body.study-active :is(#ed-inspector,#ed-whatif,#ed-failpanel) .seg>button.on { color:var(--pra-selected-fg); background:var(--pra-selected-bg); box-shadow:var(--pra-selected-shadow); }
body.study-active :is(#ed-inspector,#ed-whatif,#ed-failpanel) .ebtn { min-height:29px; padding:6px 10px; border:1px solid #93bbd12a; border-radius:8px; background:linear-gradient(#394a55,#2a3b46); color:#a5c4d8; font-size:10px; }
body.study-active :is(#ed-inspector,#ed-whatif,#ed-failpanel) .danger { color:#c69a9a; border-color:#b1767626; background:#65464614; }
body.study-active .site-inspect-action { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:5px 9px; padding:9px; margin:0 0 14px; border:1px solid #09131b; border-radius:11px; background:var(--study-well); box-shadow:inset 0 2px 5px #0008,0 1px #d4e6ef12; }
body.study-active .site-inspect-action>.field-label { margin:0; font:10px var(--sans); }
body.study-active .site-inspect-action>small { grid-column:1/-1; font:9px/1.5 var(--sans); }
body.study-active .site-inspect-action button { min-height:31px; border-radius:8px; background:linear-gradient(155deg,#506e82,#344f62); color:#d3edfc; border-color:#8eb9d733; font:550 11px var(--sans); box-shadow:inset 0 1px #d9eff51c,0 2px 3px #0008; }
.study-canvas-tools { position:absolute; left:50%; transform:translateX(-50%); bottom:12px; z-index:15; display:flex; align-items:center; gap:3px; padding:5px; border:1px solid #0d181f; border-radius:13px; background:linear-gradient(#3a454d,#29353e); box-shadow:inset 0 1px #d4e8f01a,0 3px 5px #0008,0 10px 20px #0004; }
.study-geo-navigation { display:flex; gap:3px; padding:3px; border:1px solid #101a20; border-radius:10px; background:linear-gradient(#192126,#242e35); box-shadow:inset 0 2px 4px #0008; }
.study-geo-navigation button,.study-geo-layers button { min-height:29px; padding:5px 10px; border:1px solid transparent; border-radius:7px; background:none; color:#8da9ba; font:11px var(--sans); }
:is(.study-geo-navigation,.study-geo-layers) button[aria-pressed=true] { color:var(--pra-selected-fg); border-color:var(--pra-selected-rim); background:var(--pra-selected-bg); box-shadow:var(--pra-selected-shadow); }
.study-geo-navigation[hidden],.study-geo-layers[hidden],.study-geo-empty[hidden],.study-geo-hint[hidden],body.study-active .ed-tools[hidden],body.study-active #ed-drawing-toggle[hidden] { display:none!important; }
.study-geo-hint { flex:none; margin:0; padding:0 4px; color:#829dac; font:10px/1.5 var(--sans); }
body.study-active [data-edmsg].study-source-notice { display:none!important; }
.study-context-source { color:#a7c0cf; font:11px/1.8 var(--sans); padding:12px 0; margin:0; border-top:1px solid #abc5d41c; }
.study-context-source[hidden] { display:none; }
body.study-geographic .ed-legend .sw-comp { background:#6babc6; }
.study-geo-layers { position:absolute; left:12px; top:12px; z-index:18; display:flex; align-items:center; gap:3px; padding:4px; border:1px solid #9eb6c024; border-radius:11px; background:linear-gradient(#333f46f5,#26323af5); box-shadow:inset 0 1px #d5e6ed15,0 4px 12px #0007; }
.study-geo-layers>span { padding:0 7px; color:#7f9bad; font:10px var(--sans); }
.study-geo-empty { display:flex; flex-direction:column; gap:11px; padding:2px 0 12px; }
.study-geo-empty>small { color:#7f9cab; font:10px/1.5 var(--sans); }
.study-geo-empty>strong { color:#c8dfe9; font:550 18px/1.3 var(--sans); }
.study-geo-empty dl { display:flex; flex-wrap:wrap; gap:14px 18px; padding:13px 0; margin:0; border-block:1px solid #a7c6d31a; }
.study-geo-empty dl div { display:flex; flex-direction:column-reverse; gap:4px; }.study-geo-empty dt { color:#7f9aaa; font:10px var(--sans); }.study-geo-empty dd { margin:0; color:#b9d5e5; font:550 17px var(--sans); }
.study-geo-empty p { margin:0; color:#8ca9b9; font:11px/1.8 var(--sans); }
.study-geo-empty button { align-self:flex-start; padding:8px 12px; border:1px solid #9bcfe22a; border-radius:9px; background:linear-gradient(#3f5969,#2e4656); color:#c7e7f7; font:11px var(--sans); }
.study-panel-title { position:relative; padding-right:28px; }
.study-selection-clear { position:absolute; right:0; top:0; display:grid; place-items:center; width:23px; height:23px; padding:0; border:1px solid #9fbdce1c; border-radius:7px; color:#8ca8ba; background:linear-gradient(#34424b,#28353e); font:17px var(--sans); }
.study-selection-clear[hidden] { display:none; }
body.study-geographic #ed-inspector:has(#ed-kv0) { display:none; }
body.study-geo-inspecting #ed-svg { cursor:grab; }body.study-geo-inspecting #ed-svg .ednode { cursor:pointer; }body.study-geo-inspecting #ed-svg:active { cursor:grabbing; }
body.study-geographic .geo-bg[data-base=plain] .geo-dim { opacity:.03; }
body.study-geographic #ed-svg.geo-on .ededge { stroke:#adc6d6a8; }
body.study-geographic #ed-svg.geo-on .ednode .nbody { stroke:#101d28; stroke-width:1px; }
body.study-geographic .geo-attr { bottom:6px; max-width:calc(100% - 18px); padding:2px 5px; border-radius:4px; background:#152029c9; color:#7693a6; font:8px/1.3 var(--sans); }
@media(max-width:700px){body.study-geographic #view-edit .split-main { grid-template-columns:minmax(0,1fr); }.study-geo-layers { left:8px; top:8px; }.study-geo-hint { font-size:9px; }}
.study-canvas-tools>button { min-width:32px; height:29px; min-height:29px; padding:0 10px; border:0; border-radius:8px; background:none; color:#a0bdcf; font:11px var(--sans); }
.study-canvas-tools>button:nth-child(-n+2) { font-size:17px; padding:0 7px; }
.study-canvas-tools>button:hover { background:#6ca4c31a; color:#d3eafb; }
.study-canvas-tools>button:focus-visible { outline:none; box-shadow:var(--study-focus); }
body.study-active #ed-graphwrap.is-3d>.study-canvas-tools { display:flex; }
/* Shared scene hosts are self-contained; the previous transition's flat grid
   must not show through the current world-space floor and contact shadows. */
.pra-station-transition { background:#101213; }
.pra-station-transition>:is(.one-line-ground,.one-line-paper) { display:none; }
.pra-station-transition>.ed-model-hint { display:none; }
.pra-station-transition>canvas { display:block; width:100%; height:100%; outline:none; }
.pra-station-transition .studio-scene-label { max-width:calc(100% - 32px); overflow:hidden; text-overflow:ellipsis; }
@container(max-width:600px) {
  .study-canvas-tools { left:auto; right:10px; transform:none; gap:0; padding:4px; }
  .study-canvas-tools>button { min-width:25px; padding:0 6px; font-size:10px; }
  .study-canvas-tools>button:nth-child(-n+2) { padding:0 6px; }
  .study-diagram-guide { left:10px; }
  .study-diagram-guide>summary { padding:6px 8px; font-size:9px; }
}
.study-model-definition { margin:16px 0 0; padding:0; border-top:1px solid #a6c2d21c; }
.study-model-definition>summary { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px 0; margin:0; color:#a0bdcf; cursor:pointer; font:11px/1.5 var(--sans); list-style:none; }
.study-model-definition>summary::before { display:none; }
.study-model-definition>summary::after { content:'+'; color:#6f9bb5; font-size:14px; }
.study-model-definition[open]>summary::after { content:'−'; }
body.study-active #view-assets>.viewwrap { flex:1; min-height:0; padding:0; display:grid; grid-template-columns:minmax(0,1fr) 316px; grid-template-rows:auto minmax(0,1fr); gap:10px 12px; }
body.study-active #view-assets #as-stats { grid-column:1; grid-row:1; display:flex; gap:0; margin:0; padding:8px 0; border:0; border-bottom:1px solid #8faabc1d; background:none; }
body.study-active #view-assets>.pagehead .ph-act { display:none; }
body.study-active #as-stats>.statcard { flex:1; min-width:0; padding:0 11px; margin:0; border:0; border-left:1px solid #8faabc1d; border-radius:0; background:none; box-shadow:none; }
body.study-active #as-stats>.statcard:first-child { padding-left:0; border-left:0; }
body.study-active #as-stats .k { font:9px/1.5 var(--sans); color:#8eaabb; }
body.study-active #as-stats .v { margin:4px 0 3px; color:#c4ddea; font:500 16px/1.2 var(--sans); letter-spacing:-.3px; }
body.study-active #as-stats .s { margin:0; font:8px/1.5 var(--sans); color:#718fa2; }
body.study-active #as-stats .trend { display:inline-block; margin:4px 0 0; padding:2px 4px; border-radius:4px; font:8px var(--sans); }
body.study-active #as-stats .metric { flex:1; min-width:0; padding:0 14px; margin:0; border:0; border-left:1px solid #8faabc1d; border-radius:0; box-shadow:none; background:none; }
body.study-active #as-stats .metric:first-child { padding-left:0; border-left:0; }
body.study-active #as-stats .metric b { color:#bed5e4; font:500 17px var(--sans); }
body.study-active #as-stats .metric span { font-size:9px; }
body.study-active #view-assets #slot-assets { grid-column:2; grid-row:1/3; }
body.study-active #ed-sheet { grid-column:1; grid-row:2; min-width:0; min-height:0; display:flex; flex-direction:column; margin:0; overflow:hidden; border:1px solid #0c171e; border-radius:14px; background:#252f37; box-shadow:inset 0 1px #d9eaf017,0 3px 5px #0005; }
body.study-active .sheet-bar { flex:none; gap:9px; padding:9px 12px; border-bottom:1px solid #0f1a22; background:linear-gradient(155deg,#35424b,#2a353d); }
body.study-active .sheet-bar .sheet-chk { min-height:32px; height:auto; margin:0; padding:0; gap:6px; border:0; background:none; font-size:10px; }
body.study-active #ed-sheet-body { flex:1; height:auto; max-height:none; min-height:0; overflow:auto; scrollbar-width:thin; scrollbar-color:#57758766 transparent; }
body.study-active #ed-sheet table { font-size:11px; }
body.study-active #ed-sheet th { color:#8facbf; background:#28343d; font:500 10px var(--sans); }
body.study-active #ed-sheet tbody tr { background:#242f37; }
body.study-active #ed-sheet tbody tr:hover { background:#304552; }
body.study-active #ed-sheet tbody tr.on { background:var(--pra-selected-bg);  color:var(--pra-selected-fg); box-shadow:var(--pra-selected-shadow);}
body.study-active #ed-sheet td { border-color:#8faabc10; }
body.study-active #ed-sheet :is(input,select) { min-height:27px; padding:4px 6px; border-radius:6px; font-size:11px; }
body.study-active #ed-sheet select { padding-right:20px; background-position:right 5px center; }
body.study-active #ed-sheet .sheet-foot { flex:none; gap:12px; min-height:35px; padding:6px 11px; border-top:1px solid #0e1a22; background:#27353e; }
body.study-active #ed-sheet .sheet-foot .hint { font:9px/1.6 var(--sans); }
body.study-active #ed-sheet #sheet-run { min-height:26px; padding:4px 12px; border-radius:7px; font-size:10px; }
body.study-active #ed-draft { flex:none; margin:0; padding:10px 14px; max-height:38dvh; overflow:auto; border:1px solid #8eb7d031; border-radius:12px; background:#293943; }
body.study-active #ed-vision:not(.hidden) { flex:none; max-height:50dvh; margin:0; padding:12px; overflow:auto; background:#293943; }
.study-select-menu { z-index:1900; padding:5px; }
.study-select-menu .studio-console-option { min-height:34px; padding:7px 10px; font:11px var(--sans); }
.study-select-menu .study-icon { width:14px; opacity:0; }
.study-select-menu [aria-selected=true] .study-icon { opacity:1; }
.study-select-menu [aria-disabled=true] { opacity:.4; cursor:default; }
.study-select-menu .is-active:not([aria-selected=true]) { background:#46637866; color:#d8edfa; }
body.study-active :is(#view-setup,#view-outputs,#view-decisions) { --r3:14px; --r2:11px; }
body.study-active :is(#view-setup,#view-outputs,#view-decisions) .card { border-color:#101b22; background:linear-gradient(145deg,#303a42,#252f37); box-shadow:inset 0 1px #d7e9f015,0 3px 5px #0005; }
body.study-active .site-loading { border-radius:13px; background:linear-gradient(150deg,#354651,#25353f); color:#c0deef; border-color:#a6c5d32b; }
@media(max-width:1150px) {
  .study-console { grid-template-columns:minmax(175px,1fr) auto minmax(140px,1fr); gap:12px; padding:0 12px; }
  .study-console-start { gap:6px; }
  .study-brand { width:46px; min-width:46px; font-size:20px!important; }
  .study-context-trigger { padding-inline:11px; }
  .study-step { padding-inline:9px; gap:4px; font-size:10px; }
  .study-step>small { display:none; }
  .study-network-return { padding-inline:8px; }
  .study-network-return>span { display:none; }
  .study-run-slot>.ed-run { padding-inline:12px; }
  body.study-active #view-edit .split-main,body.study-active #view-assets>.viewwrap { grid-template-columns:minmax(0,1fr) 290px; }
  body.study-active .ed-toolbar { gap:5px; }
  body.study-active .etool { padding-inline:6px; }
  body.study-active #wb-stats { gap:4px 8px; font-size:9px; }
}
@media(max-width:800px) {
  .study-console { height:122px; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:64px 52px; gap:0 10px; padding:0 12px; }
  .study-console-start { grid-column:1; grid-row:1; }
  .study-console-end { grid-column:2; grid-row:1; }
  .study-workflow { grid-column:1/-1; grid-row:2; align-self:start; justify-self:center; width:min(470px,100%); margin:0; height:44px; padding:4px; }
  .study-step { flex:1; min-width:0; height:34px; min-height:34px; padding:0 5px; font-size:10px; }
  .study-context-trigger { height:42px; }
  .study-settings-trigger,.study-network-return,.study-run-slot>.ed-run { height:31px; min-height:31px; }
  .study-console-end { gap:5px; }
  .study-context-panel { left:12px; top:64px; }
  body.study-active.study-settings-open #orgbar:not(.hidden) { top:64px; }
  body.study-active.study-menu-open>.sidebar { top:64px; }
  body.study-active main>.wide:not(.hidden) { padding:9px 10px 12px; }
  body.study-active #view-edit .split-main { grid-template-columns:minmax(0,1fr) 265px; }
  body.study-active #view-assets>.viewwrap { grid-template-columns:minmax(0,1fr); overflow:auto; }
  body.study-active #view-assets #slot-assets { grid-column:1; grid-row:3; height:auto; min-height:300px; }
  body.study-active #ed-sheet { min-height:400px; }
  .study-model-summary { display:block; position:relative; }
  .study-model-summary>summary { display:flex; min-height:26px; padding:5px 9px; border:1px solid #8eb7d023; border-radius:7px; background:#2c3942; color:#98b7cb; font:10px var(--sans); list-style:none; cursor:pointer; }
  .study-model-summary>summary::before { display:none; }
  .study-model-summary[open]>#wb-stats { position:absolute; top:calc(100% + 7px); right:0; z-index:40; display:flex; flex-direction:column; gap:10px; width:220px; padding:14px; border:1px solid #98bed039; border-radius:12px; background:#293943; box-shadow:0 8px 18px #0009; }
  body.study-active .ed-toolbar { gap:6px; }
  body.study-active .ed-toolbar .ed-tools[aria-label="Editing tool"] { flex:1; justify-content:space-between; }
}
@media(max-width:600px) {
  .study-brand { width:40px; min-width:40px; font-size:18px!important; }
  .study-context-trigger { padding-inline:10px; gap:5px; }
  .study-context-trigger strong { font-size:11px; }
  .study-context-trigger small { font-size:8px; }
  .study-context-trigger>.study-icon { width:10px; }
  .study-network-return { width:29px; min-width:29px; padding:0; }
  .study-settings-trigger { width:29px; min-width:29px; }
  .study-run-slot>.ed-run { padding-inline:10px; font-size:10px; }
  body.study-active #view-edit .split-main { grid-template-columns:1fr; grid-template-rows:minmax(240px,1fr) minmax(160px,.65fr); gap:10px; overflow:auto; }
  body.study-active #view-edit #slot-edit { min-height:160px; height:auto; }
  body.study-active #view-edit .ed-wrap { min-height:240px; }
  body.study-active #view-edit .ed-tools[aria-label="Editing tool"] { order:3; flex-basis:100%; }
  body.study-active .ed-tools[aria-label="Editing tool"] .etool { padding:0 4px; gap:3px; font-size:9px; }
  body.study-active .ed-tools[aria-label="Editing tool"] .ico { width:12px; height:12px; }
  body.study-active .ed-toolbar { padding:5px 7px; gap:6px; }
  body.study-active #ed-ftbtn { font-size:9px; }
  body.study-active #wb-stats { gap:3px 7px; }
  body.study-active #ed-drawing { min-width:130px; }
  .study-panel-head { padding:9px 11px; }
  .study-panel-title { flex-direction:row; align-items:baseline; gap:8px; margin:0 0 7px; }
  .study-panel-title strong { font-size:15px; }
  .study-panel-title small { font-size:9px; }
  .study-panel-tabs>button { height:27px; min-height:27px; }
  body.study-active #view-assets #as-stats { flex-wrap:wrap; gap:10px 0; }
  body.study-active #as-stats .metric { min-width:33%; }
  body.study-active #as-stats>.statcard { min-width:33%; padding:0 9px; }
  body.study-active .sheet-bar { flex-wrap:wrap; }
}
@media(prefers-reduced-motion:reduce) { .study-console,.study-step,.study-panel-tabs>button { transition:none; } }

/* Keep console actions on the same material through every interaction state. */
body.study-active .study-console-end :is(.study-network-return,.study-settings-trigger,.ed-run) {
  --study-action-depth:inset 0 1px #d4e5ef16,inset 0 -1px #080f1540,0 2px 4px #0005;
  box-shadow:var(--study-action-depth); filter:none; transform:none; cursor:pointer;
  transition:background .16s ease,color .16s ease,border-color .16s ease,box-shadow .16s ease;
}
body.study-active .study-console-end .ed-run {
  --study-action-depth:inset 0 1px #e3f5ff35,inset 0 -1px #233e5266,0 2px 4px #0006;
}
@media(hover:hover) and (pointer:fine) {
  body.study-active .study-console-end :is(.study-network-return,.study-settings-trigger):hover:not(:disabled):not([aria-busy=true]):not([aria-expanded=true]) {
    --study-action-depth:inset 0 2px 4px #0008,inset 0 -1px #d5e9f320,0 1px #d5e9f315;
    color:#d5e8f3; border-color:#14212a; background:linear-gradient(160deg,#22303a,#34434d); filter:none;
  }
  body.study-active .study-console-end .ed-run:hover:not(:disabled):not([aria-busy=true]) {
    --study-action-depth:inset 0 1px #e9f9ff5c,inset 0 -2px #20374688,0 3px 5px #0006;
    color:#f0faff; border-color:#9cd5ed66; background:linear-gradient(155deg,#7096ab,#52758d 48%,#3d5e75); filter:none;
  }
}
body.study-active .study-console-end .study-settings-trigger[aria-expanded=true] {
  --study-action-depth:inset 0 2px 5px #000a,inset 0 -1px #c8e9f22b,0 1px #d5e9f31a;
  color:#65ccff; border-color:#101b22; background:linear-gradient(160deg,#1c2c36,#2b3c47);
}
body.study-active .study-console-end :is(.study-network-return,.study-settings-trigger,.ed-run):active:not(:disabled):not([aria-busy=true]) {
  --study-action-depth:inset 0 2px 5px #000b,inset 0 -1px #d6f1ff26,0 1px #d5e9f315;
  border-color:#12212a; background:linear-gradient(160deg,#20313e,#344d5e); color:#dceefa; filter:none; transform:none;
}
body.study-active .study-console-end :is(.study-network-return,.study-settings-trigger,.ed-run):focus-visible {
  outline:none; box-shadow:var(--study-action-depth),inset 0 0 0 1px #47cfffaa;
}
body.study-active .study-console-end :is(.study-network-return,.study-settings-trigger,.ed-run):disabled {
  opacity:.55; cursor:default; filter:none;
}
body.study-active .study-console-end :is(.study-network-return,.study-settings-trigger,.ed-run)[aria-busy=true] { cursor:wait; }
@media(prefers-reduced-motion:reduce) {
  body.study-active .study-console-end :is(.study-network-return,.study-settings-trigger,.ed-run) { transition:none; }
}
