/* ==========================================================================
   stevennguyen — OCC-DEBRIEF: Hậu Kiểm Quyết Định Sau Ca Trực & Tua Lại T+24h
   Post-IROPS Counterfactual Replay & Weekly Continuous-Improvement Studio
   Pluggable Zero-Idle-DOM Subview ('debrief', order: 40) inside #occ/exec
   ========================================================================== */

.deb-studio {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: var(--radius-lg, 14px);
  background: #06101E;
  border: 1px solid #1E3A5F;
  color: #F0F7FF;
  box-shadow: 0 14px 34px rgba(2, 8, 20, 0.36);
}

.deb-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 12px;
  min-width: 0;
}

.deb-title {
  flex: 1 1 320px;
  min-width: 0;
  margin: 0;
  font-size: 17.5px;
  font-weight: 800;
  line-height: 1.32;
  color: #FFFFFF;
  overflow-wrap: anywhere;
}

.deb-title::before {
  content: "OCC-DEBRIEF · POST-IROPS T+24H COUNTERFACTUAL REPLAY & CONTINUOUS IMPROVEMENT";
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 10.6px;
  font-weight: 700;
  color: #7DD3FC;
  letter-spacing: 0.03em;
}

.deb-disclaimer {
  flex: 0 1 480px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #231405;
  border: 1px solid #B45309;
  color: #FDE68A;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   1. 4 Shift Case Selector Cards (3 Historical Shifts + Live Session Capture)
   -------------------------------------------------------------------------- */
.deb-cases-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  min-width: 0;
}

.deb-case-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  background: #0A1B31;
  border: 1px solid #23466E;
  color: #EAF4FF;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.deb-case-card:hover {
  background: #0F2644;
  border-color: #38BDF8;
}

.deb-case-card[data-live-captured="true"] {
  background: #07241D;
  border-color: #10B981;
}

.deb-case-card.active {
  background: #0D3357;
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.44);
}

.deb-case-card.active[data-live-captured="true"] {
  background: #06382B;
  border-color: #34D399;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.48);
}

.deb-case-title {
  font-family: var(--font-sans);
  font-size: 12.1px;
  font-weight: 800;
  line-height: 1.35;
  color: #FFFFFF;
  overflow-wrap: anywhere;
}

.deb-case-sub {
  font-family: var(--font-mono);
  font-size: 10.6px;
  font-weight: 600;
  line-height: 1.42;
  color: #C2DDF8;
  overflow-wrap: anywhere;
}

.deb-case-card[data-live-captured="true"] .deb-case-sub {
  color: #A7F3D0;
}

/* --------------------------------------------------------------------------
   2. Main 2-Column Counterfactual Controls & Replay Trajectory SVG
   -------------------------------------------------------------------------- */
.deb-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.deb-panel {
  min-width: 0;
  max-width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: #081629;
  border: 1px solid #1E3D63;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.deb-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  min-width: 0;
}

.deb-panel-lbl {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.8px;
  font-weight: 800;
  line-height: 1.35;
  color: #7DD3FC;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.deb-panel-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: #0C2542;
  border: 1px solid #2A5282;
  color: #E0F2FE;
  font-family: var(--font-mono);
  font-size: 10.4px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Actual Signed Shift Record Box */
.deb-actual-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #1B1508;
  border: 1px solid #B45309;
  min-width: 0;
  box-sizing: border-box;
}

.deb-actual-headline {
  font-family: var(--font-sans);
  font-size: 11.9px;
  font-weight: 800;
  line-height: 1.35;
  color: #FEF3C7;
  overflow-wrap: anywhere;
}

.deb-actual-kpis {
  font-family: var(--font-mono);
  font-size: 10.7px;
  font-weight: 600;
  line-height: 1.4;
  color: #FDE68A;
  overflow-wrap: anywhere;
}

/* 4 Counterfactual Strategy Option Pills */
.deb-cf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.deb-cf-btn {
  min-width: 0;
  max-width: 100%;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: #0B1E36;
  border: 1px solid #284E7A;
  color: #EAF4FF;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.deb-cf-btn:hover {
  background: #102A4B;
  border-color: #38BDF8;
}

.deb-cf-btn.active {
  background: #064E3B;
  border-color: #34D399;
  color: #ECFDF5;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.38);
}

/* Lead-Time Scrubber (-60p to +180p) */
.deb-scrubber-box {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #0A1B31;
  border: 1px solid #204269;
  min-width: 0;
  box-sizing: border-box;
}

.deb-scrub-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px 8px;
  margin-bottom: 5px;
  min-width: 0;
}

.deb-scrub-lbl {
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 11.8px;
  font-weight: 700;
  line-height: 1.35;
  color: #F0F7FF;
  overflow-wrap: anywhere;
}

.deb-scrub-val {
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.7px;
  font-weight: 800;
  line-height: 1.3;
  background: #0C2542;
  border: 1px solid #38BDF8;
  color: #E0F2FE;
  overflow-wrap: anywhere;
}

.deb-scrub-val[data-tone="good"] {
  background: #063226;
  border-color: #34D399;
  color: #D1FAE5;
}

.deb-scrub-val[data-tone="alert"] {
  background: #3B0D1D;
  border-color: #FB7185;
  color: #FFE4E6;
}

.deb-range {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 2px 0 5px 0;
  accent-color: #38BDF8;
  cursor: pointer;
}

.deb-lead-note {
  font-family: var(--font-mono);
  font-size: 10.6px;
  font-weight: 600;
  line-height: 1.42;
  color: #CBE4FD;
  overflow-wrap: anywhere;
}

/* Closed-Loop Policy Insight & Rule Calibration Box */
.deb-insight-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: #0B1E35;
  border: 1px solid #27507E;
  min-width: 0;
  box-sizing: border-box;
}

.deb-insight-title {
  font-family: var(--font-mono);
  font-size: 10.9px;
  font-weight: 800;
  line-height: 1.38;
  color: #7DD3FC;
  overflow-wrap: anywhere;
}

.deb-insight-body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 11.6px;
  font-weight: 600;
  line-height: 1.42;
  color: #EAF4FF;
  overflow-wrap: anywhere;
}

.deb-rule-chip {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: #071628;
  border: 1px solid #38BDF8;
  color: #BAE6FD;
  font-family: var(--font-mono);
  font-size: 10.6px;
  font-weight: 700;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.deb-btn-policy {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  background: #0C365A;
  border: 1px solid #38BDF8;
  color: #F0F9FF;
  font-family: var(--font-sans);
  font-size: 11.8px;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-sizing: border-box;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.deb-btn-policy[data-policy-pushed="true"] {
  background: #064E3B;
  border-color: #34D399;
  color: #ECFDF5;
}

.deb-btn-policy:hover {
  filter: brightness(1.12);
}

/* --------------------------------------------------------------------------
   3. Dual Vector Counterfactual SVG & Net Comparison Strip
   -------------------------------------------------------------------------- */
#debrief-replay-svg {
  border-radius: 8px;
}

.deb-compare-strip {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #0A1C33;
  border: 1px solid #21446D;
  color: #EAF4FF;
  font-family: var(--font-mono);
  font-size: 10.9px;
  font-weight: 700;
  line-height: 1.44;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.deb-compare-strip[data-tone="good"] {
  background: #06291F;
  border-color: #10B981;
  color: #ECFDF5;
}

.deb-compare-strip[data-tone="alert"] {
  background: #2C0B17;
  border-color: #F43F5E;
  color: #FFE4E6;
}

/* --------------------------------------------------------------------------
   4. Human-in-the-Loop Weekly Debrief Sign-Off Gate
   -------------------------------------------------------------------------- */
.deb-gate-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #08182C;
  border: 1px solid #234975;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.deb-gate-bar[data-debrief-signed="true"] {
  background: #06241B;
  border-color: #34D399;
}

.deb-verdict-strip {
  flex: 1 1 100%;
  min-width: 0;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.2px;
  font-weight: 700;
  line-height: 1.4;
  background: #2C1805;
  border: 1px solid #D97706;
  color: #FEF3C7;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.deb-verdict-strip[data-tone="good"] {
  background: #062B21;
  border-color: #10B981;
  color: #ECFDF5;
}

.deb-ack-label {
  flex: 1 1 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 12.1px;
  font-weight: 600;
  line-height: 1.4;
  color: #F0F7FF;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.deb-ack-label input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #38BDF8;
  cursor: pointer;
}

.deb-btn-sign,
.deb-btn-goto,
.deb-btn-sec {
  min-width: 0;
  max-width: 100%;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12.1px;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-sizing: border-box;
  transition: filter 0.15s ease, border-color 0.15s ease;
}

.deb-btn-sign {
  flex: 1 1 260px;
  background: #064E3B;
  border: 1px solid #34D399;
  color: #ECFDF5;
}

.deb-btn-sign[data-debrief-signed="true"] {
  background: #065F46;
  border: 1px solid #6EE7B7;
  color: #FFFFFF;
}

.deb-btn-sign:disabled {
  background: #1B283B;
  border: 1px solid #475569;
  color: #CBD5E1;
  opacity: 1;
  cursor: not-allowed;
}

.deb-btn-goto {
  flex: 1 1 220px;
  background: #0C365A;
  border: 1px solid #38BDF8;
  color: #F0F9FF;
}

.deb-btn-sec {
  flex: 0 1 auto;
  background: #0E223D;
  border: 1px solid #365B87;
  color: #E6F2FF;
}

.deb-btn-sign:not(:disabled):hover,
.deb-btn-goto:hover,
.deb-btn-sec:hover {
  filter: brightness(1.12);
}

.deb-case-card:focus-visible,
.deb-cf-btn:focus-visible,
.deb-range:focus-visible,
.deb-btn-policy:focus-visible,
#debrief-act-sop:focus-visible,
#debrief-act-owner:focus-visible,
.deb-btn-sign:focus-visible,
.deb-btn-goto:focus-visible,
.deb-btn-sec:focus-visible {
  outline: 2px solid #38BDF8;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   5. Responsive Collapse (<= 1120px & <= 680px -> 390px Zero Overflow)
   -------------------------------------------------------------------------- */
@media (max-width: 1120px) {
  .deb-cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deb-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .deb-studio {
    padding: 11px 10px;
  }

  .deb-cases-grid,
  .deb-cf-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .deb-btn-sign,
  .deb-btn-goto,
  .deb-btn-sec {
    flex: 1 1 auto;
    width: 100%;
  }
}
