/* Scoped to the v2 shell; reuse the application's active day/night palette. */
.direction-lab-shell{position:relative;z-index:110;isolation:isolate;color:var(--tx,#d6d8ea);background:var(--sf,#0e0c1c);border-block:1px solid var(--bd,#2a2348);font:13px/1.35 var(--text-font,monospace);width:100%;min-width:0}
.direction-lab-shell [hidden]{display:none!important}
.direction-lab-shell .dlab-row{display:flex;align-items:center;gap:4px;padding:3px 8px;min-width:0}
.direction-lab-shell .dlab-presets{border-bottom:1px solid var(--bd,#2a2348)}
.direction-lab-shell .dlab-enable{order:0}
.direction-lab-shell .dlab-time-scales{order:1}
.direction-lab-shell .dlab-preset-strip{order:2;display:flex;gap:4px;flex:1;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;padding:2px}
.direction-lab-shell .dlab-status{order:3}
.direction-lab-shell .dlab-presets>.dlab-button:not(.dlab-enable):not(.dlab-time-scales){order:4}
.direction-lab-shell .dlab-actions{overflow-x:auto;overscroll-behavior-x:contain}
.direction-lab-shell .dlab-button{appearance:none;flex:none;font:inherit;font-size:11px;line-height:1.2;min-height:27px;padding:4px 7px;border:1px solid var(--bd,#2a2348);border-radius:4px;color:var(--tx,#d6d8ea);background:var(--pn,#13111f);white-space:nowrap;cursor:pointer;touch-action:manipulation}
.direction-lab-shell .dlab-button:hover{border-color:var(--ac,#9d8cff);color:var(--tb,#eef0fb)}
.direction-lab-shell .dlab-button:focus-visible{outline:2px solid var(--a2,#4fd8e8);outline-offset:2px}
.direction-lab-shell .dlab-button:not(:disabled).is-active,
.direction-lab-shell .dlab-button:not(:disabled)[aria-pressed=true],
.direction-lab-shell .dlab-button:not(:disabled)[aria-expanded=true]{border-color:#000!important;background:#000!important;color:#fff!important;text-shadow:none;font-weight:800;box-shadow:inset 0 0 0 1px rgba(255,255,255,.3),0 1px 2px rgba(0,0,0,.45)}
.direction-lab-shell .dlab-button:not(:disabled).is-active:hover,
.direction-lab-shell .dlab-button:not(:disabled)[aria-pressed=true]:hover,
.direction-lab-shell .dlab-button:not(:disabled)[aria-expanded=true]:hover{background:#000!important;color:#fff!important}
.direction-lab-shell .dlab-button:disabled{opacity:.5;cursor:default}
.direction-lab-shell .dlab-enable{font-weight:700}
.direction-lab-shell .dlab-status{font-size:11px;color:var(--a2,#4fd8e8);white-space:nowrap}
.direction-lab-shell .dlab-status:empty{display:none}
.direction-lab-shell .dlab-recipes{display:flex;gap:4px;margin-left:auto;padding-left:10px;border-left:1px solid var(--bd,#2a2348)}
.direction-lab-shell .dlab-panel{position:absolute;z-index:200;top:100%;left:8px;right:8px;width:auto;max-width:900px;max-height:min(46vh,420px);display:flex;flex-direction:column;background:var(--pn,#13111f);border:1px solid var(--bd,#2a2348);border-radius:0 0 8px 8px;box-shadow:0 8px 20px #0005;overflow:hidden}
.direction-lab-shell .dlab-panel-heading{position:relative;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;border-bottom:1px solid var(--bd,#2a2348);flex:none}
.direction-lab-shell .dlab-panel-title{font-weight:700;color:var(--tb,#eef0fb)}
.direction-lab-shell .dlab-panel-body{position:relative;z-index:1;padding:10px 12px;overflow:auto;overscroll-behavior:contain;min-height:0;max-height:inherit}
.direction-lab-shell .dlab-panel-body>section,.direction-lab-shell .dlab-panel-body>div{max-width:100%}
@media(max-width:700px){.direction-lab-shell .dlab-row{gap:4px;padding:4px}.direction-lab-shell .dlab-button{min-height:36px;padding:6px;font-size:11px}.direction-lab-shell .dlab-panel{left:2px;right:2px;max-height:44vh}.direction-lab-shell .dlab-status{max-width:65px;white-space:normal}}
@media(prefers-reduced-motion:reduce){.direction-lab-shell *{scroll-behavior:auto!important}}

/* Profile controls: one compact recipe chip row, wrapping core row, collapsed advanced groups. */
.direction-lab-shell .dlab-profile{display:flex;flex-direction:column;min-width:0}
.direction-lab-shell .dlab-profile-chip{flex-wrap:wrap;font-size:11px}
.direction-lab-shell .dlab-recipe-badge{padding:1px 6px;border:1px solid var(--bd,#3a4a5a);border-radius:8px;white-space:nowrap}
.direction-lab-shell .dlab-recipe-badge.is-custom{color:var(--a2,#4fd8e8);border-color:var(--a2,#4fd8e8)}
.direction-lab-shell .dlab-tuple{font-family:TopoGlyph,monospace;min-width:0;overflow-wrap:anywhere}
.direction-lab-shell .dlab-provenance{opacity:.75;min-width:0}
.direction-lab-shell .dlab-profile-core{flex-wrap:wrap}
.direction-lab-shell .dlab-core-field{display:inline-flex;align-items:center;gap:4px}
.direction-lab-shell .dlab-core-select{min-width:0;max-width:150px;font-size:11px}
.direction-lab-shell .dlab-profile-advanced{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:2px 8px;padding:3px 8px;font-size:11px}
.direction-lab-shell .dlab-profile-advanced[hidden]{display:none}
.direction-lab-shell .dlab-profile-group{display:flex;gap:6px;align-items:center;min-width:0}
.direction-lab-shell .dlab-profile-group-label{font-weight:600;white-space:nowrap}
.direction-lab-shell .dlab-profile-group-value{opacity:.8;min-width:0;overflow-wrap:anywhere;flex:1}
.direction-lab-shell .dlab-profile-group.is-custom .dlab-profile-group-value{color:var(--a2,#4fd8e8);opacity:1}
@media(max-width:900px){.direction-lab-shell .dlab-profile-advanced{grid-template-columns:1fr}}

/* Named recipes belong only to their active parent system. */
.dlab-recipe-presets[hidden], .dlab-recipe-presets button[hidden] { display:none !important; }

.dlab-playback-controls{display:inline-flex;align-items:center;gap:5px;flex-wrap:wrap}
.dlab-playback-controls .dlab-segmented{display:inline-flex;align-items:center;gap:3px}
.dlab-playback-controls .dlab-segmented-label{display:none}
#sphere-transport .dlab-playback-controls button[aria-pressed=true]{background:#080a0e;color:#fff;font-weight:700}
.dlab-intelligence{display:flex;gap:6px;flex-wrap:wrap}
.dlab-planet-master{margin-bottom:8px}

.dlab-systems-label{align-self:center;white-space:nowrap;font-size:11px;margin-right:3px}

#sphere-transport .dlab-playback-controls button[data-spin]{min-width:28px;padding:3px 7px;border-radius:7px}
#sph-nav-dates{display:inline-flex;flex-direction:column;gap:2px;font-size:11px;line-height:1.3;font-variant-numeric:tabular-nums;padding:2px 6px}
#sph-nav-dates span{white-space:nowrap}

#sph-nav-time-controls{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
#sph-nav-time-controls #sph-nav-advance-date{display:inline-flex;align-items:center;gap:4px;border:0;margin:0;padding:0}
#sph-nav-time-controls #sph-nav-advance-date legend{display:none}
#sph-nav-time-controls #sph-nav-advance-date input{width:195px;min-width:0}
#sph-nav-time-controls [hidden]{display:none!important}

/* Explicit transport states, including when controls live outside the Lab shell. */
#sphere-transport #sph-nav-time-controls :is(#sph-nav-play,button[data-spin])[aria-pressed=false]{background:var(--bg,#f4f1e9);color:#111}
#sphere-transport #sph-nav-time-controls :is(#sph-nav-play,button[data-spin])[aria-pressed=true]{background:#000;color:#fff;border-color:#000;font-weight:700}

.sphere-date-picker{position:relative}
.sphere-date-picker>summary{list-style:none;cursor:pointer;border:1px solid var(--bd);border-radius:8px;padding:5px 9px;white-space:nowrap}
.sphere-date-picker-body{position:absolute;top:calc(100% + 6px);left:0;z-index:1200;width:330px;max-width:calc(100vw - 24px);max-height:70vh;overflow:auto;padding:12px;border-radius:14px;border:1px solid var(--bd);background:var(--pn,#f4f1e9);color:var(--tx,#111);box-shadow:0 12px 36px #0005}
#sphere-transport .sphere-date-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0}
#sphere-transport .sphere-date-fields label{display:flex;flex-direction:column;align-items:stretch;gap:3px;font-size:11px}
#sphere-transport #sph-nav-advance-date .sphere-date-fields input{width:100%;min-width:0}
.sphere-date-month,.sphere-date-footer{display:flex;align-items:center;justify-content:space-between;gap:5px;margin:8px 0}
.sphere-date-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}
#sphere-transport .sphere-date-grid button{padding:4px;min-height:30px}
#sphere-transport .sphere-date-grid button[aria-pressed=true]{background:#000;color:#fff}
.sphere-date-note,.sphere-date-picker-body small{font-size:11px;line-height:1.4}

/* Promissor sources remain compact and independently scrollable. */
#sph-promissor-sources fieldset,#sph-nav-bounds{min-width:0;margin:8px 0;padding:9px;border:1px solid var(--bd);border-radius:12px}
#sph-promissor-sources legend,#sph-nav-bounds legend{font-weight:650;padding:0 5px}
#sph-promissor-sources label,#sph-nav-bounds label{display:inline-flex;align-items:center;gap:4px;margin:3px 5px 3px 0;font-variant-emoji:text}
#sph-promissor-sources p,#sph-nav-bounds p{font-size:12px;line-height:1.45;max-width:58em;white-space:normal;overflow-wrap:anywhere;margin:7px 0;color:var(--tx)}
#sph-promissor-sources input[type=search]{display:block;width:min(100%,360px);box-sizing:border-box;margin:8px 0;padding:7px 10px;border-radius:9px;background:var(--pn);color:var(--tx)}
.sph-promissor-star-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));max-height:180px;overflow:auto;overscroll-behavior:contain;gap:2px 8px;margin-top:6px}
.sph-promissor-star-list:empty{display:none}
#sph-promissor-ray-settings{margin-top:10px;padding:9px;border:1px solid var(--bd);border-radius:12px}
#sph-promissor-ray-settings>summary{cursor:pointer;font-weight:650}

#sph-promissor-sources fieldset, #sph-nav-bounds { display:block!important; }
#sph-promissor-sources .sph-promissor-star-list { display:grid!important; width:100%; margin-top:8px; }
#sph-promissor-sources .sph-promissor-star-list label { margin:0; min-width:0; overflow-wrap:anywhere; }
#sph-promissor-sources [data-star-status] { clear:both; }
/* Fixed-star chooser: one star per row, with independently combinable groups. */
#sph-promissor-sources .sph-star-filters { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
#sph-promissor-sources .sph-star-filters label { display:flex; flex-direction:column; align-items:stretch; flex:1 1 145px; min-width:0; }
#sph-promissor-sources .sph-star-filters select { width:100%; min-width:0; max-width:100%; }
#sph-promissor-sources .sph-star-bulk { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:8px; }
#sph-promissor-sources .sph-promissor-star-list { display:block!important; max-height:280px; overflow:auto; }
#sph-promissor-sources .sph-promissor-star-list table { width:100%; table-layout:fixed; border-collapse:collapse; font-size:12px; color:var(--tx); }
#sph-promissor-sources .sph-promissor-star-list th { position:sticky; top:0; z-index:1; background:var(--pn); text-align:left; }
#sph-promissor-sources .sph-promissor-star-list th,
#sph-promissor-sources .sph-promissor-star-list td { padding:8px 6px; white-space:normal; overflow-wrap:anywhere; border-bottom:1px solid color-mix(in srgb,var(--tx) 18%,transparent); }
#sph-promissor-sources .sph-promissor-star-list th:first-child { width:30%; }
#sph-promissor-sources .sph-promissor-star-list th:last-child { width:15%; }
#sph-promissor-sources .sph-promissor-star-list td:last-child { text-align:right; font-variant-numeric:tabular-nums; }
#sph-promissor-sources .sph-promissor-star-list label { display:flex; align-items:center; gap:6px; padding:0; background:transparent; }
#sph-promissor-sources .sph-promissor-star-list input { flex:none; }

/* Floating options retain the Lab palette without the toolbar's clipping context. */
.direction-lab-shell.dlab-window-host{position:static!important;isolation:auto;z-index:auto;width:0;height:0;padding:0;border:0;background:none!important;backdrop-filter:none!important;transform:none!important;pointer-events:none}
.dlab-window-host>[data-sphere-tool-window]{pointer-events:auto}
.dlab-window-host .dlab-panel{max-width:none;max-height:none;border-radius:14px}
.dlab-window-host .dlab-panel-body{flex:1;max-height:none;padding-bottom:38px}
.dlab-window-host .sph-nav-tool-content{position:static!important;box-shadow:none!important;background:transparent!important;width:auto!important;max-width:100%!important;max-height:none!important}
.dlab-window-host .dlab-panel-title{min-width:0;white-space:normal}
.sph-star-constellation-group button{width:100%;text-align:left;white-space:normal}

#sph-promissor-sources .sph-star-constellation-group th{position:static;width:auto}

.dlab-window-host #sphere-rectification-panel{flex-direction:column;overflow:hidden}
.dlab-research-window-body{flex:1;min-height:0;overflow:auto;padding:12px 14px 38px}
.dlab-window-host .lsr-body{flex:1;padding-bottom:38px}

/* Full-label toggles: retain native checkbox keyboard/state semantics while
   presenting a generous button surface instead of a tiny square. */
:is(#dlab-content-promissors,#dlab-content-significators) label:has(>input[type=checkbox]){
 position:relative;display:inline-flex!important;align-items:center;justify-content:center;
 box-sizing:border-box;min-height:38px;min-width:64px;padding:8px 12px!important;
 margin:4px 5px 4px 0;border:1px solid var(--bd,#928d83);border-radius:10px;
 background:var(--pn,#eee9dd)!important;color:var(--tx,#242424)!important;
 font:600 13px/1.35 TopoGlyph,system-ui,sans-serif;white-space:normal;cursor:pointer;
 transition:background-color .12s,border-color .12s;
}
:is(#dlab-content-promissors,#dlab-content-significators) label:has(>input[type=checkbox])>input[type=checkbox]{
 position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;
}
:is(#dlab-content-promissors,#dlab-content-significators) label:has(>input[type=checkbox]:checked){
 background:#000!important;color:#fff!important;border-color:#000!important;
 box-shadow:inset 0 0 0 1px #ffffff30;
}
:is(#dlab-content-promissors,#dlab-content-significators) label:has(>input[type=checkbox]):hover{
 border-color:var(--ac,#287697)!important;
}
:is(#dlab-content-promissors,#dlab-content-significators) label:has(>input[type=checkbox]:focus-visible){
 outline:2px solid var(--a2,#287697);outline-offset:3px;
}
:is(#dlab-content-promissors,#dlab-content-significators) label:has(>input[type=checkbox]:disabled){opacity:.5;cursor:not-allowed}
:is(#dlab-content-promissors,#dlab-content-significators) input[type=checkbox]:disabled{cursor:not-allowed!important}
#sph-promissor-sources .sph-promissor-star-list label:has(>input[type=checkbox]){width:100%;margin:0;justify-content:flex-start}
