/* ==========================================================================
   stevennguyen — OCC-POLICY: Bộ Hiệu Chỉnh Ngưỡng Quản Trị OPCON & Đội Tàu
   Custom Fleet Governance & OPCON Threshold Calibration Studio
   Pluggable Zero-Idle-DOM Subview ('policy') inside #occ/exec (#dss-stage-slot)
   ========================================================================== */

.pol-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);
}

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

.pol-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;
}

.pol-title::before {
  content: "OCC-POLICY · FLEET GOVERNANCE & OPCON THRESHOLD CALIBRATION STUDIO";
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 10.6px;
  font-weight: 700;
  color: #7DD3FC;
  letter-spacing: 0.03em;
}

.pol-disclaimer {
  flex: 0 1 460px;
  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 Fleet Archetype Profile Cards
   -------------------------------------------------------------------------- */
.pol-profiles-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  min-width: 0;
}

.pol-profile-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;
}

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

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

.pol-prof-name {
  font-family: var(--font-sans);
  font-size: 12.2px;
  font-weight: 800;
  line-height: 1.35;
  color: #FFFFFF;
  overflow-wrap: anywhere;
}

.pol-prof-spec {
  font-family: var(--font-mono);
  font-size: 10.7px;
  font-weight: 600;
  line-height: 1.42;
  color: #B8D8F8;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   2. Main 2-Column Calibration Sliders & Sensitivity Matrix
   -------------------------------------------------------------------------- */
.pol-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.pol-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;
}

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

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

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

.pol-sliders-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
  min-width: 0;
}

.pol-slider-lbl {
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: #EAF4FF;
  overflow-wrap: anywhere;
}

.pol-slider-val {
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.8px;
  font-weight: 700;
  line-height: 1.3;
  background: #0C2542;
  border: 1px solid #38BDF8;
  color: #E0F2FE;
  overflow-wrap: anywhere;
}

.pol-slider-val[data-tone="tighter"] {
  background: #331B05;
  border-color: #FBBF24;
  color: #FEF3C7;
}

.pol-slider-val[data-tone="relaxed"] {
  background: #06291F;
  border-color: #34D399;
  color: #D1FAE5;
}

.pol-range {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 7px 0;
  accent-color: #38BDF8;
  cursor: pointer;
}

.pol-range:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   3. Before-vs-After OPCON Sensitivity SVG & 4-Scenario Matrix
   -------------------------------------------------------------------------- */
#pol-sensitivity-svg {
  margin-bottom: 8px;
  border-radius: 8px;
}

.pol-sim-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pol-sim-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) auto auto;
  align-items: center;
  gap: 6px 10px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: #0B1D35;
  border: 1px solid #1F4068;
  min-width: 0;
  box-sizing: border-box;
}

.pol-sim-row[data-delta="tighter"] {
  background: #281606;
  border-color: #D97706;
}

.pol-sim-row[data-delta="relaxed"] {
  background: #07261E;
  border-color: #10B981;
}

.pol-sim-name {
  min-width: 0;
  font-family: var(--font-sans);
  font-size: 11.7px;
  font-weight: 700;
  line-height: 1.35;
  color: #F0F7FF;
  overflow-wrap: anywhere;
}

.pol-sim-flow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  color: #7DD3FC;
  overflow-wrap: anywhere;
}

.pol-sim-row[data-delta="tighter"] .pol-sim-flow {
  color: #FDE68A;
}

.pol-sim-row[data-delta="relaxed"] .pol-sim-flow {
  color: #6EE7B7;
}

.pol-sim-badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.3;
  background: #0F2744;
  border: 1px solid #355D8A;
  color: #E2F0FF;
  overflow-wrap: anywhere;
}

.pol-sim-badge[data-tone="tighter"] {
  background: #3B1D06;
  border-color: #FBBF24;
  color: #FEF3C7;
}

.pol-sim-badge[data-tone="relaxed"] {
  background: #063226;
  border-color: #34D399;
  color: #D1FAE5;
}

/* --------------------------------------------------------------------------
   4. Human-in-the-Loop Governance Charter Gate
   -------------------------------------------------------------------------- */
.pol-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;
}

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

.pol-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;
}

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

.pol-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.2px;
  font-weight: 600;
  line-height: 1.4;
  color: #F0F7FF;
  cursor: pointer;
  overflow-wrap: anywhere;
}

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

.pol-btn-apply,
.pol-btn-goto,
.pol-btn-sec {
  min-width: 0;
  max-width: 100%;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12.2px;
  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;
}

.pol-btn-apply {
  flex: 1 1 240px;
  background: #064E3B;
  border: 1px solid #34D399;
  color: #ECFDF5;
}

.pol-btn-apply[data-pol-signed="true"] {
  background: #065F46;
  border-color: #6EE7B7;
  color: #FFFFFF;
}

.pol-btn-apply:disabled {
  background: #1B283B;
  border-color: #475569;
  color: #CBD5E1;
  opacity: 1;
  cursor: not-allowed;
}

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

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

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

.pol-profile-card:focus-visible,
.pol-range:focus-visible,
#pol-ack:focus-visible,
.pol-btn-apply:focus-visible,
.pol-btn-goto:focus-visible,
.pol-btn-sec:focus-visible {
  outline: 2px solid #38BDF8;
  outline-offset: 2px;
}

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

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

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

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

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

  .pol-slider-val {
    justify-self: start;
  }

  .pol-sim-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .pol-sim-badge {
    justify-self: start;
  }

  .pol-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

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