/* =========================================================================
   BİYOSERA // NEURO ONE — EEG ENSTRÜMAN VE 12 MODÜL KURS KOKPİTİ (V2)
   Mod A Kokpit Monokrom (#020202 / #050505 / #080909 / #111111 + #1F1F1F / #2E2E2E)
   Aktif sinyal: #2EA88D / #34D399 · Uyarı / Negatif / Clipping: #A62639 / #D9485B
   Sıfır altın/sarı/şampanya/kehribar, sıfır mavi/mor, sıfır emoji.
   ========================================================================= */

#maLabProView {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#maLabProView[hidden] {
  display: none !important;
}

.epl-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--f-sans);
  color: #e5e5e5;
}

/* ---------- Tek Satırlı Üst Enstrüman Kontrol Çubuğu ---------- */
.epl-bar {
  flex: 0 0 auto;
  height: 38px;
  min-height: 38px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: #080909;
  border: 1px solid #1f1f1f;
  border-radius: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  box-sizing: border-box;
}

.epl-bar::-webkit-scrollbar {
  display: none;
}

.epl-ctl {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 7px;
  background: #101111;
  border: 1px solid #242626;
  border-radius: 2px;
  font: 500 9.5px/1 var(--f-mono);
  color: #8f9694;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  box-sizing: border-box;
}

.epl-ctl select {
  background: transparent;
  border: 0;
  color: #ffffff;
  font: 500 11px/1.2 var(--f-sans);
  text-transform: none;
  outline: none;
  max-width: 148px;
  cursor: pointer;
}

.epl-ctl select option {
  background: #0b0c0c;
  color: #e5e5e5;
}

.epl-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border-radius: 2px;
  border: 1px solid #2b2e2d;
  background: #111212;
  color: #d4d6d5;
  font: 500 11px/1 var(--f-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  box-sizing: border-box;
}

.epl-btn:hover {
  border-color: #737a78;
  color: #ffffff;
}

.epl-btn[aria-pressed="true"],
.epl-btn.is-active {
  background: #ffffff;
  color: #050505;
  border-color: #ffffff;
  font-weight: 600;
}

.epl-btn--signal[aria-pressed="true"],
.epl-btn--signal.is-active {
  background: rgba(46, 168, 141, 0.16);
  border-color: #2ea88d;
  color: #6ec9b4;
}

.epl-btn--danger {
  border-color: #6e222d;
  color: #f3c1c8;
  background: rgba(166, 38, 57, 0.14);
}

.epl-btn--danger[aria-pressed="true"] {
  background: #a62639;
  color: #ffffff;
  border-color: #a62639;
}

.epl-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border-radius: 2px;
  border: 1px solid #242626;
  background: #0c0d0d;
  font: 500 10px/1 var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: #cccccc;
  white-space: nowrap;
  box-sizing: border-box;
}

.epl-badge--live {
  border-color: rgba(46, 168, 141, 0.42);
  color: #6ec9b4;
}

.epl-badge--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.epl-badge--frozen {
  border-color: #ffffff;
  color: #ffffff;
  background: #1b1d1c;
}

.epl-badge--alert {
  border-color: #a62639;
  color: #f3c1c8;
  background: rgba(166, 38, 57, 0.16);
}

.epl-sp {
  margin-left: auto;
}

/* ---------- 3 Sütunlu Kilitli Kokpit Alanı ---------- */
.epl-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr) 416px;
  gap: 8px;
  align-items: stretch;
  overflow: hidden;
}

.epl-wrap.is-wide .epl-workspace {
  grid-template-columns: 272px minmax(0, 1fr) 560px;
}

.epl-col-left,
.epl-col-center,
.epl-col-right {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  content-visibility: auto;
  contain-intrinsic-size: auto 320px auto 680px;
}

@supports not (content-visibility: auto) {
  .epl-col-left,
  .epl-col-center,
  .epl-col-right {
    contain: layout style paint;
  }
}

.epl-card {
  background: #080909;
  border: 1px solid #1e2020;
  border-radius: 2px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}

.epl-head-card {
  flex: 1.42;
  min-height: 240px;
}

.epl-psd-card {
  flex: 0.92;
  min-height: 170px;
}

.epl-trace-card {
  flex: 1;
  min-height: 0;
}

.epl-card-hd {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font: 600 9.5px/1.2 var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8c9290;
}

.epl-card-hd b {
  color: #ffffff;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: none;
}

#eplPsdSub {
  text-transform: none;
  color: #6ec9b4;
  font-weight: 500;
}

.epl-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
}

.epl-seg button {
  padding: 3px 6px;
  border-radius: 2px;
  border: 1px solid #242626;
  background: #101111;
  color: #9ea4a2;
  font: 500 9.5px/1.2 var(--f-mono);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.epl-seg button:hover {
  color: #ffffff;
  border-color: #555a59;
}

.epl-seg button[aria-pressed="true"] {
  background: rgba(46, 168, 141, 0.18);
  border-color: #2ea88d;
  color: #ffffff;
}

/* 3B Kafa & Şeffaf 2B HUD Katman Alanı */
.epl-head-stage {
  position: relative;
  flex: 1;
  min-height: 165px;
  width: 100%;
  background:
    radial-gradient(circle at 50% 48%, rgba(46, 168, 141, 0.08), rgba(4, 5, 5, 0.96) 72%),
    #040505;
  border: 1px solid #191b1a;
  border-radius: 2px;
  overflow: hidden;
}

#eplHead3D,
#eplHeadCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#eplHead3D {
  z-index: 1;
  pointer-events: none;
}

#eplHeadCanvas {
  z-index: 2;
  cursor: grab;
  touch-action: none;
}

#eplHeadCanvas:active {
  cursor: grabbing;
}

#eplPsdCanvas {
  flex: 1;
  min-height: 86px;
  width: 100%;
  display: block;
  background: #040505;
  border: 1px solid #181a19;
  border-radius: 2px;
}

.epl-bands {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.epl-band-pill {
  position: relative;
  overflow: hidden;
  background: #0d0e0e;
  border: 1px solid #1e2020;
  border-radius: 2px;
  padding: 4px 4px 5px;
  text-align: center;
  font: 600 10px/1.2 var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: #e5e5e5;
}

.epl-band-pill span {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: #7b8280;
  margin-bottom: 1px;
}

.epl-band-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: #2ea88d;
  transition: width 0.2s ease;
}

/* Orta Sütun: Tam Boyutlu 19-Kanal EEG & Tanık Şeridi */
#eplTraceCanvas {
  flex: 1;
  min-height: 240px;
  width: 100%;
  display: block;
  background: #040505;
  border: 1px solid #181a19;
  border-radius: 2px;
  cursor: crosshair;
}

.epl-cursor-bar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  font: 500 10px/1.25 var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: #b7bdbb;
}

#eplAuxCanvas {
  flex: 0 0 auto;
  width: 100%;
  height: 76px;
  display: block;
  background: #040505;
  border: 1px solid #181a19;
  border-radius: 2px;
}

/* ---------- Sağ Denetçi / Rehberli Kurs Paneli ---------- */
.epl-bench-shell {
  flex: 1;
  min-height: 0;
  background: #080909;
  border: 1px solid #1f2120;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.epl-insp-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  background: #0c0d0d;
  border-bottom: 1px solid #1a1c1b;
}

.epl-cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.epl-cat-bar button {
  padding: 4px 7px;
  border-radius: 2px;
  border: 1px solid #242626;
  background: #111212;
  color: #9ea4a2;
  font: 600 10px/1.2 var(--f-mono);
  cursor: pointer;
}

.epl-cat-bar button:hover {
  color: #ffffff;
  border-color: #555a59;
}

.epl-cat-bar button[aria-selected="true"] {
  background: #ffffff;
  color: #050505;
  border-color: #ffffff;
}

.epl-bench-tabs {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 9px;
  background: #0a0b0b;
  border-bottom: 1px solid #1a1c1b;
}

.epl-bench-tabs button {
  padding: 4px 8px;
  border-radius: 2px;
  border: 1px solid #242626;
  background: #101111;
  color: #a6acab;
  font: 500 11px/1.2 var(--f-sans);
  cursor: pointer;
}

.epl-bench-tabs button:hover {
  color: #ffffff;
  border-color: #555a59;
}

.epl-bench-tabs button[aria-selected="true"] {
  background: rgba(46, 168, 141, 0.16);
  border-color: #2ea88d;
  color: #ffffff;
  font-weight: 600;
}

#eplBenchBody,
#eplCourseBody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
  scrollbar-color: #2d302f transparent;
}

.epl-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.epl-wrap.is-wide .epl-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.epl-art-grid-ui {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.epl-art-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 2px;
  border: 1px solid #232625;
  background: #0e100f;
  color: #e5e5e5;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.epl-art-btn:hover {
  border-color: #2ea88d;
  background: rgba(46, 168, 141, 0.08);
}

.epl-art-btn strong {
  font: 600 11px/1.25 var(--f-sans);
  color: #ffffff;
}

.epl-art-btn small {
  font: 500 9.5px/1.2 var(--f-mono);
  color: #6ec9b4;
}

.epl-box {
  background: #0c0d0d;
  border: 1px solid #1d1f1e;
  border-radius: 2px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.epl-box h4 {
  margin: 0;
  font: 600 12px/1.3 var(--f-sans);
  color: #ffffff;
}

.epl-box p {
  margin: 0;
  font-size: 12px;
  line-height: 1.48;
  color: #b4bab8;
}

/* İnce Enstrüman Sürgüleri */
.epl-slider {
  display: grid;
  grid-template-columns: 126px 1fr 52px;
  align-items: center;
  gap: 8px;
  font: 500 10.5px/1.2 var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: #cccccc;
}

.epl-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #1f2221;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.epl-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #34d399;
  border: 1px solid #ffffff;
  cursor: pointer;
}

.epl-slider input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #34d399;
  border: 1px solid #ffffff;
  cursor: pointer;
}

.epl-canvas-sm {
  width: 100%;
  height: 152px;
  display: block;
  background: #040505;
  border: 1px solid #1a1c1b;
  border-radius: 2px;
}

.epl-canvas-md {
  width: 100%;
  height: 204px;
  display: block;
  background: #040505;
  border: 1px solid #1a1c1b;
  border-radius: 2px;
}

.epl-canvas-lg {
  width: 100%;
  height: 224px;
  display: block;
  background: #040505;
  border: 1px solid #1a1c1b;
  border-radius: 2px;
}

/* 19-Kanal Empedans & Klinik Telemetri Izgaraları */
.epl-imp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.epl-imp-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  border-radius: 2px;
  border: 1px solid #1e2120;
  background: #101211;
  font: 500 10px/1.2 var(--f-mono);
  font-variant-numeric: tabular-nums;
}

.epl-imp-cell.is-bad {
  border-color: #a62639;
  background: rgba(166, 38, 57, 0.16);
  color: #f3c1c8;
}

.epl-imp-cell.is-warn {
  border-color: #e5e5e5;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.epl-imp-cell span {
  color: #6ec9b4;
}

.epl-imp-cell.is-bad span {
  color: #f3c1c8;
}

.epl-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.epl-stat-tile {
  padding: 6px 8px;
  background: #101211;
  border: 1px solid #1e2120;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.epl-stat-tile small {
  font: 500 9px/1.2 var(--f-mono);
  text-transform: uppercase;
  color: #828886;
}

.epl-stat-tile b {
  font: 600 12.5px/1.2 var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.epl-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 210px;
  overflow-y: auto;
}

.epl-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #202322;
  background: #0f1110;
  border-radius: 2px;
  font-size: 11.5px;
  text-align: left;
  color: #e5e5e5;
  cursor: pointer;
}

.epl-list-item:hover {
  border-color: #555a59;
}

.epl-list-item[aria-current="true"] {
  border-color: #2ea88d;
  background: rgba(46, 168, 141, 0.14);
}

.epl-choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid #222524;
  background: #101111;
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: #e5e5e5;
  cursor: pointer;
}

.epl-choice input {
  margin-top: 2px;
  accent-color: #2ea88d;
}

.epl-feedback {
  padding: 8px 10px;
  border-radius: 2px;
  border: 1px solid #2b2e2d;
  background: #101111;
  font-size: 11.5px;
  line-height: 1.48;
  color: #e5e5e5;
}

.epl-feedback--ok {
  border-color: #2ea88d;
  background: rgba(46, 168, 141, 0.12);
}

.epl-feedback--err {
  border-color: #a62639;
  background: rgba(166, 38, 57, 0.14);
}

.epl-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 58px;
  padding: 7px 8px;
  background: #060707;
  border: 1px solid #272a29;
  border-radius: 2px;
  color: #ffffff;
  font: 400 12px/1.45 var(--f-sans);
  resize: vertical;
}

.epl-note-foot {
  font: 500 10px/1.45 var(--f-mono);
  color: #828886;
  border-top: 1px solid #1b1d1c;
  padding-top: 6px;
}

/* 12 Modül Kurs Düzeni (Sağ Panelde Sabit Eğitmen) */
.epl-prog-bar {
  width: 100%;
  height: 4px;
  background: #181a19;
  border-radius: 2px;
  overflow: hidden;
}

.epl-prog-bar > i {
  display: block;
  height: 100%;
  background: #2ea88d;
  transition: width 0.25s ease;
}

.epl-mod-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.epl-mod-card {
  padding: 5px 6px;
  border: 1px solid #202322;
  background: #0e100f;
  border-radius: 2px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.epl-mod-card:hover {
  border-color: #555a59;
}

.epl-mod-card[aria-current="true"] {
  border-color: #2ea88d;
  background: rgba(46, 168, 141, 0.14);
}

.epl-mod-card small {
  font: 600 9px/1 var(--f-mono);
  color: #7d8582;
}

.epl-mod-card b {
  font-size: 10.5px;
  line-height: 1.22;
  color: #ffffff;
}

.epl-mod-card span {
  font: 500 9px/1.2 var(--f-mono);
  color: #6ec9b4;
}

/* Eski #maLabStage içindeki dosya aksiyonları için dönüş butonu desteği */
.ma-sim-return {
  border-color: #2ea88d !important;
  color: #6ec9b4 !important;
}

@media (max-width: 1180px) {
  #maLabProView {
    overflow-y: auto;
    overflow-x: hidden;
  }
  .epl-wrap,
  .epl-workspace {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .epl-bar {
    height: auto;
    flex-wrap: wrap;
    overflow: visible;
  }
  .epl-head-card {
    min-height: 290px;
  }
  .epl-psd-card {
    min-height: 180px;
  }
  #eplTraceCanvas {
    flex: none;
    height: 310px;
  }
  .epl-bench-shell {
    flex: none;
    overflow: visible;
  }
  #eplBenchBody,
  #eplCourseBody {
    overflow: visible;
  }
}

@media (max-width: 760px) {
  body[data-ch="eeglab"] #maLabStage {
    top: calc(96px + env(safe-area-inset-top, 0px));
    bottom: calc(98px + env(safe-area-inset-bottom, 0px));
    left: 6px;
    right: 6px;
    padding: 8px;
  }
  .epl-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    height: auto;
    -webkit-overflow-scrolling: touch;
  }
  .epl-bar::-webkit-scrollbar { display: none; }
  #eplTraceCanvas {
    height: 265px;
  }
  .epl-art-grid-ui {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .epl-imp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .epl-mod-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .epl-slider {
    grid-template-columns: 102px 1fr 44px;
    font-size: 9.5px;
  }
  .epl-ctl select {
    max-width: 115px;
  }
}
