/* ── LSK Studio WebAssembly: Real-time Compiler, 365d Oscilloscope & Optimizer ── */
.lsk-studio {
  margin-top: 1.75rem;
  padding: 1.5rem 1.6rem;
  border-radius: 18px;
  border: 1px solid rgba(77, 225, 193, 0.36);
  background: radial-gradient(circle at top right, rgba(32, 92, 65, 0.38), transparent 55%),
              linear-gradient(160deg, rgba(9, 26, 18, 0.96), rgba(4, 13, 9, 0.98));
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(145, 242, 196, 0.14);
}

.lsk-studio-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.4rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(114, 198, 145, 0.2);
}

.lsk-studio-title-wrap h3 {
  margin: 0.25rem 0 0.35rem;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  letter-spacing: -0.02em;
  color: #f2fff6;
}

.lsk-studio-title-wrap p {
  margin: 0;
  font-size: 0.9rem;
  color: #b5d2bf;
  max-width: 44rem;
}

.lsk-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.lsk-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.24rem 0.68rem;
  border-radius: 999px;
  font: 700 0.74rem/1.3 ui-monospace, "SF Mono", Consolas, monospace;
  border: 1px solid rgba(114, 198, 145, 0.3);
  background: rgba(14, 40, 28, 0.85);
  color: #bdf2d4;
}

.lsk-pill[data-state="ready"] {
  border-color: rgba(77, 225, 193, 0.5);
  background: rgba(20, 68, 52, 0.65);
  color: #8cfbe2;
}

.lsk-pill[data-state="busy"] {
  border-color: rgba(238, 198, 98, 0.55);
  background: rgba(72, 54, 16, 0.65);
  color: #ffe294;
}

.lsk-pill[data-state="error"] {
  border-color: rgba(235, 106, 90, 0.6);
  background: rgba(74, 22, 18, 0.7);
  color: #ffb8ae;
}

.lsk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.lsk-btn-wasm {
  padding: 0.58rem 1.05rem;
  border-radius: 10px;
  border: 1px solid rgba(77, 225, 193, 0.55);
  background: linear-gradient(135deg, #1d6e53, #114636);
  color: #ecfff6;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}

.lsk-btn-wasm:hover:not(:disabled) {
  border-color: #8cfbe2;
  box-shadow: 0 0 18px rgba(77, 225, 193, 0.28);
  transform: translateY(-1px);
}

.lsk-btn-tune {
  padding: 0.58rem 1.05rem;
  border-radius: 10px;
  border: 1px solid rgba(236, 197, 96, 0.58);
  background: linear-gradient(135deg, rgba(96, 72, 18, 0.88), rgba(48, 35, 9, 0.92));
  color: #ffe8a3;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}

.lsk-btn-tune:hover:not(:disabled) {
  border-color: #ffe28a;
  box-shadow: 0 0 18px rgba(236, 197, 96, 0.25);
  transform: translateY(-1px);
}

.lsk-btn-ghost {
  padding: 0.52rem 0.88rem;
  border-radius: 10px;
  border: 1px solid rgba(114, 198, 145, 0.28);
  background: rgba(12, 32, 22, 0.8);
  color: #d6efe0;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
}

.lsk-btn-ghost:hover:not(:disabled) {
  border-color: #7ee39b;
  color: #ffffff;
}

.lsk-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0 auto !important;
  font-size: 0.84rem;
  font-weight: 600 !important;
  color: #c8e4d2;
  cursor: pointer;
}

.lsk-toggle input[type="checkbox"] {
  width: 1.05rem !important;
  height: 1.05rem;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: #4de1c1;
}

/* Verdict & KPI Strip */
.lsk-verdict-banner {
  margin-top: 1.1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  border: 1px solid rgba(114, 198, 145, 0.28);
  background: rgba(14, 38, 27, 0.72);
}

.lsk-verdict-banner[data-outcome="ahead"] {
  border-color: rgba(82, 229, 150, 0.55);
  background: linear-gradient(90deg, rgba(20, 74, 46, 0.78), rgba(10, 34, 23, 0.85));
}

.lsk-verdict-banner[data-outcome="tie"] {
  border-color: rgba(236, 197, 96, 0.5);
  background: linear-gradient(90deg, rgba(68, 54, 16, 0.72), rgba(24, 24, 14, 0.85));
}

.lsk-verdict-banner[data-outcome="behind"],
.lsk-verdict-banner[data-outcome="not_rankable"] {
  border-color: rgba(235, 112, 88, 0.55);
  background: linear-gradient(90deg, rgba(74, 25, 19, 0.78), rgba(26, 14, 12, 0.88));
}

.lsk-verdict-BannerTitle {
  font-weight: 800;
  font-size: 1rem;
  color: #f4fff7;
}

.lsk-verdict-sub {
  font-size: 0.83rem;
  color: #c7e2d0;
}

.lsk-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.lsk-kpi {
  padding: 0.7rem 0.75rem;
  border-radius: 11px;
  background: rgba(7, 20, 14, 0.86);
  border: 1px solid rgba(114, 198, 145, 0.2);
  min-width: 0;
}

.lsk-kpi[data-decisive="true"] {
  border-color: #55e6a5;
  box-shadow: inset 0 0 0 1px rgba(85, 230, 165, 0.28);
}

.lsk-kpi-label {
  display: block;
  font-size: 0.72rem;
  color: #a6c4b1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lsk-kpi-val {
  display: block;
  margin-top: 0.2rem;
  font: 800 1.18rem/1.15 ui-monospace, "SF Mono", Consolas, monospace;
  color: #f3fff6;
  font-variant-numeric: tabular-nums;
}

.lsk-kpi-delta {
  display: block;
  margin-top: 0.22rem;
  font: 600 0.72rem/1.2 ui-monospace, "SF Mono", Consolas, monospace;
  color: #9ab8a5;
}

.lsk-kpi-delta[data-good="true"] { color: #6bf0b3; }
.lsk-kpi-delta[data-bad="true"] { color: #ff9c8a; }

/* Oscilloscope Canvas & Day Controls */
.lsk-scope-box {
  margin-top: 1.1rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(114, 198, 145, 0.24);
  background: #040d08;
}

.lsk-scope-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.8rem;
  margin-bottom: 0.7rem;
}

.lsk-scope-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  align-items: center;
}

.lsk-chip {
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(114, 198, 145, 0.26);
  background: rgba(15, 38, 26, 0.8);
  color: #cfead8;
  font: 600 0.75rem/1.2 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.lsk-chip:hover,
.lsk-chip[aria-pressed="true"] {
  border-color: #4de1c1;
  background: rgba(77, 225, 193, 0.18);
  color: #9efce7;
}

.lsk-oscilloscope-canvas {
  display: block;
  width: 100%;
  height: 340px;
  border-radius: 10px;
  background: #030a06;
  cursor: crosshair;
  touch-action: none;
}

.lsk-scope-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: #9cb9a7;
}

.lsk-legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.32rem;
  vertical-align: middle;
}

/* Dual Underground Cross-Section Radar & VM Day Inspector */
.lsk-dual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.lsk-panel-card {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(114, 198, 145, 0.22);
  background: rgba(6, 18, 12, 0.9);
  min-width: 0;
}

.lsk-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.lsk-panel-head h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #e9fbf0;
}

.lsk-radar-canvas {
  display: block;
  width: 100%;
  height: 235px;
  border-radius: 10px;
  background: #030906;
  border: 1px solid rgba(114, 198, 145, 0.18);
}

.lsk-day-channels {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.55rem;
}

.lsk-channel-row {
  display: grid;
  grid-template-columns: 6.2rem 1fr auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.38rem 0.55rem;
  border-radius: 8px;
  background: rgba(14, 36, 25, 0.66);
  border: 1px solid rgba(114, 198, 145, 0.15);
  font-size: 0.79rem;
}

.lsk-channel-row[data-diff="true"] {
  border-color: rgba(236, 197, 96, 0.46);
  background: rgba(52, 42, 14, 0.48);
}

.lsk-channel-name {
  font: 700 0.73rem/1.2 ui-monospace, "SF Mono", Consolas, monospace;
  color: #9fd8b5;
  text-transform: uppercase;
}

.lsk-channel-act {
  color: #eefcf2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lsk-channel-branch {
  font: 600 0.71rem/1.2 ui-monospace, "SF Mono", Consolas, monospace;
  color: #f2d583;
}

.lsk-day-snapshot-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.65rem;
  font: 600 0.74rem/1.35 ui-monospace, "SF Mono", Consolas, monospace;
  color: #bad8c5;
}

.lsk-day-snapshot-mini span {
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  background: rgba(11, 28, 19, 0.8);
}

/* Interactive Parametric Sliders */
.lsk-sliders-details {
  margin-top: 1rem !important;
  background: rgba(7, 21, 14, 0.84) !important;
}

.lsk-sliders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.lsk-slider-card {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: rgba(14, 37, 25, 0.72);
  border: 1px solid rgba(114, 198, 145, 0.2);
}

.lsk-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font: 600 0.74rem/1.3 ui-monospace, "SF Mono", Consolas, monospace;
  color: #cbe7d5;
  margin-bottom: 0.35rem;
}

.lsk-slider-head strong {
  color: #8cfbe2;
  white-space: nowrap;
}

.lsk-slider-card input[type="range"] {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  accent-color: #4de1c1;
  cursor: ew-resize;
}

/* Auto-Tune Report Drawer */
.lsk-tune-drawer {
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(236, 197, 96, 0.48);
  background: linear-gradient(145deg, rgba(46, 36, 12, 0.72), rgba(11, 24, 16, 0.94));
}

.lsk-tune-steps {
  margin: 0.75rem 0;
  padding-left: 1.2rem;
  font: 500 0.8rem/1.55 ui-monospace, "SF Mono", Consolas, monospace;
  color: #e8f6ec;
}

.lsk-studio-footnote {
  margin-top: 0.9rem !important;
  font-size: 0.79rem;
  color: #95b5a2;
}

@media (max-width: 920px) {
  .lsk-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lsk-dual-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .lsk-studio { padding: 1.05rem; }
  .lsk-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lsk-oscilloscope-canvas { height: 290px; }
  .lsk-toggle { margin-left: 0 !important; }
}
