/* LSR fit panel + passcode dialog. Reuses the Direction Lab palette variables. Overlay: adds no height when closed. */
.direction-lab-shell .lsr-panel{position:absolute;z-index:210;top:100%;left:8px;right:8px;max-width:1000px;max-height:min(70vh,640px);display:flex;flex-direction:column;background:var(--pn,#12102a);color:var(--tx,#d6d8ea);border:1px solid var(--bd,#2a2348);border-radius:6px;box-shadow:0 8px 24px rgba(0,0,0,.5);font-size:12px}
.direction-lab-shell .lsr-panel[hidden]{display:none!important}
.lsr-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 12px;border-bottom:1px solid var(--bd,#2a2348)}
.lsr-title{font-weight:700;color:var(--tb,#eef0fb)}
.lsr-body{box-sizing:border-box;width:100%;min-width:0;padding:8px 12px;overflow:auto;overscroll-behavior:contain;min-height:0}
.lsr-body>*{min-width:0;max-width:100%}
.lsr-results,.lsr-detail{min-width:0;max-width:100%;overflow:hidden}
.lsr-note{margin:0 0 8px;padding:5px 8px;border-left:3px solid #ffcf72;background:rgba(255,207,114,.08);color:#ffe5ad;line-height:1.4}
.lsr-section{margin:0 0 8px;min-width:0}
.lsr-h{margin:6px 0 4px;font-size:12px;font-weight:700;color:var(--tb,#eef0fb)}
.lsr-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:4px 0}
.lsr-btn{appearance:none;font:inherit;font-size:11px;min-height:27px;padding:3px 8px;border:1px solid var(--bd,#2a2348);border-radius:4px;background:transparent;color:var(--tx,#d6d8ea);cursor:pointer}
.lsr-btn:hover{border-color:var(--ac,#9d8cff);color:var(--tb,#eef0fb)}
.lsr-btn:disabled{opacity:.5;cursor:default}
.lsr-btn[aria-pressed=true],.lsr-btn.is-active{border-color:#071a27;background:#102f43;color:#fff;font-weight:800}
.lsr-fit{font-weight:700}
.lsr-panel :focus-visible,.lsr-modal :focus-visible{outline:2px solid var(--a2,#4fd8e8);outline-offset:2px}
.lsr-seg{display:inline-flex;align-items:center;gap:4px}
.lsr-research{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.lsr-death-field{width:11em}
.lsr-mode-note{width:100%;margin:0}
.lsr-calibration{margin:4px 0;padding:6px 8px;border-left:3px solid #4fd8e8;background:rgba(79,216,232,.09);color:#dffaff;line-height:1.45}
.lsr-seg-label{opacity:.8}
.lsr-unit,.lsr-inline,.lsr-status{font-size:11px;opacity:.85}
.lsr-in{font:inherit;font-size:11px;min-width:0;padding:3px 5px;background:var(--sf,#0e0c1c);color:var(--tx,#d6d8ea);border:1px solid var(--bd,#2a2348);border-radius:4px}
.lsr-in[aria-invalid=true]{border-color:#ff8a6a}
.lsr-num{width:6.5em}
.lsr-scroll{box-sizing:border-box;width:100%;min-width:0;max-width:100%;overflow-x:auto}
.lsr-table{border-collapse:collapse;width:max-content;min-width:100%;font-size:11px}
.lsr-table th,.lsr-table td{padding:2px 6px;border-bottom:1px solid var(--bd,#2a2348);text-align:left;white-space:nowrap}
.lsr-table td:nth-child(3){white-space:normal}
.lsr-table .lsr-n,.lsr-table .lsr-age{text-align:right;font-variant-numeric:tabular-nums}
.lsr-events td .lsr-in{width:100%}
.lsr-events .lsr-date{width:9.5em}
.lsr-table tr.is-active{background:rgba(79,216,232,.12)}
.lsr-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.lsr-textarea{display:block;width:100%;box-sizing:border-box;margin:4px 0;font:11px TopoGlyph,monospace;background:var(--sf,#0e0c1c);color:var(--tx,#d6d8ea);border:1px solid var(--bd,#2a2348);border-radius:4px}
.lsr-opt-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:4px 10px;padding:6px 0}
.lsr-field{display:flex;flex-direction:column;gap:2px}
.lsr-checks{border:1px solid var(--bd,#2a2348);border-radius:4px;margin:0;padding:2px 6px;display:flex;gap:10px;flex-wrap:wrap}
.lsr-check{display:inline-flex;gap:4px;align-items:center}
.lsr-error{padding:5px 8px;border-left:3px solid #ff8a6a;background:rgba(255,138,106,.1);color:#ffb38a;margin:4px 0}
.lsr-error[hidden]{display:none}
.lsr-warn{margin:2px 0;color:#ffe5ad}
.lsr-agree{margin:4px 0;color:var(--a2,#4fd8e8)}
.lsr-empty{opacity:.75;margin:4px 0}
.lsr-split{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:10px;align-items:start;min-width:0;max-width:100%}
.lsr-split>*{min-width:0;max-width:100%}
.lsr-curve{margin:0;min-width:0}
.lsr-curve svg{display:block;width:100%;height:110px;background:rgba(255,255,255,.03);border:1px solid var(--bd,#2a2348);border-radius:4px}
.lsr-curve-line{stroke:var(--a2,#4fd8e8);stroke-width:1.2;vector-effect:non-scaling-stroke}
.lsr-peak{stroke:#9d8cff;stroke-width:1;opacity:.5;vector-effect:non-scaling-stroke}
.lsr-peak.is-active{stroke:#ffcf72;opacity:1;stroke-width:2}
.lsr-cap{font-size:10.5px;opacity:.8;margin-top:2px}
.lsr-means,.lsr-sig p{margin:4px 0;line-height:1.4}
.lsr-harvey summary,.lsr-options summary,.lsr-paste summary{cursor:pointer;font-weight:600}
@media(max-width:900px){.lsr-split{grid-template-columns:1fr}.direction-lab-shell .lsr-panel{left:2px;right:2px}}
/* Passcode dialog (lives on <body>, outside the shell). */
.lsr-modal-back{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:rgba(4,3,12,.6)}
.lsr-modal{width:min(360px,92vw);box-sizing:border-box;padding:14px;background:var(--pn,#12102a);color:var(--tx,#d6d8ea);border:1px solid var(--ac,#9d8cff);border-radius:8px;font:13px/1.4 var(--text-font,monospace)}
.lsr-modal .lsr-in{display:block;width:100%;box-sizing:border-box;margin:8px 0;font-size:13px;padding:6px}
.lsr-modal-title{margin:0 0 6px;font-size:15px;color:var(--tb,#eef0fb)}
.lsr-modal-desc{margin:0;font-size:12px;opacity:.85}
@media(prefers-reduced-motion:reduce){.lsr-panel *{scroll-behavior:auto!important}}
/* Beat the sphere-transport generic control rules (id-level specificity). */
.direction-lab-shell .lsr-panel .lsr-btn[aria-pressed=true],.direction-lab-shell .lsr-panel .lsr-btn.is-active{border-color:#071a27!important;background:#102f43!important;color:#fff!important;text-shadow:0 1px 1px #02080c}
.direction-lab-shell .lsr-panel .lsr-btn{background:transparent;color:var(--tx,#d6d8ea)}
.direction-lab-shell .lsr-panel label,.direction-lab-shell .lsr-panel legend{display:flex;padding:0;margin:0;border:0;background:none;box-shadow:none;text-align:left;text-transform:none;letter-spacing:0;font-size:11px;min-height:0}
.direction-lab-shell .lsr-panel .lsr-field{flex-direction:column;align-items:stretch}
.direction-lab-shell .lsr-panel .lsr-check{flex-direction:row;align-items:center;gap:4px}
.direction-lab-shell .lsr-panel h3,.direction-lab-shell .lsr-panel p{text-align:left}
.direction-lab-shell .lsr-panel summary{padding:3px 8px;min-height:0}
.direction-lab-shell .lsr-panel fieldset.lsr-checks{border:1px solid var(--bd,#2a2348)!important;padding:2px 6px!important;gap:10px!important}
/* LSR owns a high-contrast surface even when a light chart theme supplies
   beige global variables. Inputs remain light and readable by design. */
.direction-lab-shell .lsr-panel{background:#111923;color:#f6f1e4;border-color:#6e7f91}
.direction-lab-shell .lsr-panel .lsr-title,.direction-lab-shell .lsr-panel .lsr-h{color:#fff8e8}
.direction-lab-shell .lsr-panel .lsr-note{background:#25313d;color:#fff1bd;border-left-color:#f1bd57}
.direction-lab-shell .lsr-panel .lsr-calibration{background:#17313c;color:#e8fbff}
.direction-lab-shell .lsr-panel .lsr-in,.direction-lab-shell .lsr-panel .lsr-textarea{background:#fffaf0;color:#1c242b;border-color:#91a0ad}
.direction-lab-shell .lsr-panel .lsr-btn{color:#fff8e8;border-color:#8294a4}
.lsr-modal{background:#111923!important;color:#fff8e8!important;border-color:#e0b85d!important;box-shadow:0 12px 38px rgba(0,0,0,.72)}
.lsr-modal .lsr-modal-title{color:#fff8e8!important}
.lsr-modal .lsr-in{background:#fffaf0!important;color:#1c242b!important;border-color:#d8b562!important}
.lsr-modal .lsr-btn{color:#fff8e8!important;border-color:#8294a4!important}
.direction-lab-shell .lsr-category{display:grid;gap:2px;min-width:12.5rem}
.direction-lab-shell .lsr-category .lsr-in{width:100%}
.direction-lab-shell .lsr-suggestion{display:block;font-size:10px;line-height:1.15;color:#d9e8f5;white-space:normal}
/* The panel must remain readable even under the site's light chart theme. */
.direction-lab-shell .lsr-panel{min-width:320px;min-height:240px;resize:both;overflow:auto}
.direction-lab-shell .lsr-head{cursor:move;touch-action:none;background:#17212c}
.direction-lab-shell .lsr-head button{cursor:pointer}
.direction-lab-shell .lsr-panel,.direction-lab-shell .lsr-panel p,.direction-lab-shell .lsr-panel span,.direction-lab-shell .lsr-panel label,.direction-lab-shell .lsr-panel legend,.direction-lab-shell .lsr-panel summary,.direction-lab-shell .lsr-panel th,.direction-lab-shell .lsr-panel td{color:#fff8e8}
.direction-lab-shell .lsr-panel .lsr-in,.direction-lab-shell .lsr-panel .lsr-textarea{color:#18222a!important;background:#fffaf0!important}
.direction-lab-shell .lsr-panel .lsr-in option{color:#18222a;background:#fffaf0}
.direction-lab-shell .lsr-panel .lsr-error{color:#fff0e8;background:#5b281f}
.direction-lab-shell .lsr-panel .lsr-warn{color:#fff1bd}
.direction-lab-shell .lsr-panel .lsr-inline,.direction-lab-shell .lsr-panel .lsr-status,.direction-lab-shell .lsr-panel .lsr-empty,.direction-lab-shell .lsr-panel .lsr-cap{color:#e6eef5;opacity:1}

/* Native popup menus need their own palette, including WebKit text fill.
   Keep both the closed selector and opened options on a light surface. */
.direction-lab-shell .lsr-panel select.lsr-in,
.direction-lab-shell .lsr-panel select.lsr-in option,
.direction-lab-shell .lsr-panel select.lsr-in optgroup{
  color-scheme:light!important;
  color:#18222a!important;
  -webkit-text-fill-color:#18222a!important;
  background:#fffaf0!important;
  text-shadow:none!important;
  opacity:1!important;
}

/* LSR surfaces are fixed dark/light pairs, independent of chart colors.
   Keep input text fill, native widgets and focus cues in that same palette. */
.direction-lab-shell .lsr-panel .lsr-in,
.direction-lab-shell .lsr-panel .lsr-textarea,
.lsr-modal .lsr-in{
  color-scheme:light;
  -webkit-text-fill-color:currentColor;
  text-shadow:none;
}
#sphere-transport .lsr-panel :is(button,input,select,textarea,summary):focus-visible,
.lsr-modal :is(button,input,select,textarea,summary):focus-visible{
  outline:2px solid #4fd8e8!important;
  outline-offset:3px;
}
.direction-lab-shell .lsr-panel .lsr-in:disabled,
.direction-lab-shell .lsr-panel .lsr-textarea:disabled,
.direction-lab-shell .lsr-panel select.lsr-in option:disabled,
.lsr-modal .lsr-in:disabled{
  color:#52606c!important;
  -webkit-text-fill-color:#52606c!important;
  background:#e1e5e8!important;
  opacity:1!important;
  cursor:not-allowed;
}
.direction-lab-shell .lsr-panel .lsr-btn:disabled,
.lsr-modal .lsr-btn:disabled{
  color:#bbc7d2!important;
  -webkit-text-fill-color:#bbc7d2!important;
  background:#263340!important;
  border-color:#5d6e7e!important;
  opacity:1;
  cursor:not-allowed;
}
/* Suggested meanings remain reviewable without forcing the event table wider. */
.direction-lab-shell .lsr-event-review,
.direction-lab-shell .lsr-weight-review{
  box-sizing:border-box;
  min-width:0;
  max-width:24rem;
  margin-top:4px;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.4;
  color:#e6eef5;
}
.direction-lab-shell .lsr-event-review summary{
  white-space:normal;
  padding:3px 0;
  cursor:pointer;
  color:#b6e6f5;
}
.direction-lab-shell .lsr-meaning-options{
  display:grid;
  gap:5px;
  min-width:0;
  padding:5px 0;
}
.direction-lab-shell .lsr-meaning-options label{
  display:flex;
  align-items:flex-start;
  gap:6px;
  min-width:0;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.4;
}
.direction-lab-shell .lsr-meaning-options input[type=checkbox]{
  flex:0 0 auto;
  margin-top:1px;
  accent-color:#4fd8e8;
}
