/* ==========================================================================
   stevennguyen — OCC SK-02: Ngăn Trượt "Chụp X-Quang 360° Một Chuyến Bay / Tàu Bay"
   Flight & Tail 360° Domino X-Ray Slide-Over Drawer (Zero-Idle-DOM Architecture)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Lean Launcher Strip in #occ-command-ribbon (8 DOM nodes total < 10!)
   -------------------------------------------------------------------------- */
.sk02-xray-bar {
  flex: 1 1 500px;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 7px 11px;
  border-radius: var(--radius-md);
  background: #071426;
  border: 1px solid #24466E;
  color: #F0F7FF;
  box-shadow: 0 6px 18px rgba(2, 8, 20, 0.22);
  box-sizing: border-box;
}

.sk02-bar-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #7DD3FC;
  margin-right: 2px;
  white-space: nowrap;
}

.sk02-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: #0C203B;
  border: 1px solid #2D5482;
  color: #F0F7FF;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  min-width: 0;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sk02-trigger-btn::before {
  content: "";
  width: 6.5px;
  height: 6.5px;
  border-radius: 999px;
  background: #38BDF8;
  flex-shrink: 0;
}

.sk02-trigger-btn[data-xray-tone="alert"]::before {
  background: #FB7185;
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.28);
}

.sk02-trigger-btn[data-xray-tone="warn"]::before {
  background: #FBBF24;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.26);
}

.sk02-trigger-btn[data-xray-tone="good"]::before {
  background: #34D399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25);
}

.sk02-trigger-btn:hover {
  background: #133058;
  border-color: #38BDF8;
  color: #FFFFFF;
}

.sk02-trigger-btn[aria-expanded="true"] {
  background: #0E3A5D;
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.sk02-trigger-btn:focus-visible,
.sk02-leg-xray-btn:focus-visible,
.sk02-close-btn:focus-visible,
.sk02-switch-btn:focus-visible,
.sk02-jump-btn:focus-visible,
.sk02-copy-btn:focus-visible {
  outline: 2px solid #38BDF8;
  outline-offset: 2px;
}

/* Desk 00 #occ-leg-inspector inline shortcut */
.sk02-leg-xray-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  background: #0C2544;
  border: 1px solid #38BDF8;
  color: #F0F7FF;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  white-space: normal;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sk02-leg-xray-btn:hover {
  background: #143763;
  border-color: #7DD3FC;
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   2. Zero-Idle-DOM Slide-Over Backdrop & Cockpit Drawer (#occ-xray-slot)
   -------------------------------------------------------------------------- */
#occ-xray-slot:empty {
  display: none;
}

.sk02-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--sidebar-w);
  z-index: 75;
  display: flex;
  justify-content: flex-end;
  background: rgba(3, 10, 22, 0.72);
  backdrop-filter: blur(5px);
  max-width: 100vw;
  overflow: hidden;
  animation: sk02FadeIn 0.16s ease-out;
}

@media (max-width: 820px) {
  .sk02-backdrop {
    left: 0;
  }
}

.sk02-drawer {
  width: min(630px, 100%);
  max-width: 100%;
  height: 100%;
  background: #06101E;
  border-left: 1px solid #24466E;
  color: #F0F7FF;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.62);
  box-sizing: border-box;
  animation: sk02SlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sk02FadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sk02SlideIn {
  from { transform: translateX(28px); opacity: 0.85; }
  to { transform: translateX(0); opacity: 1; }
}

.sk02-drawer-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #071426;
  border-bottom: 1px solid #1E3D63;
  padding: 14px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sk02-head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sk02-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: #7DD3FC;
  text-transform: uppercase;
}

.sk02-title {
  margin: 3px 0 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.28;
  color: #FFFFFF;
}

.sk02-subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #C4DCF4;
}

.sk02-close-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: #102642;
  border: 1px solid #365E8D;
  color: #F0F7FF;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sk02-close-btn:hover {
  background: #18375E;
  border-color: #7DD3FC;
  color: #FFFFFF;
}

/* Instant 6-Entity Switcher Strip inside Drawer Header */
.sk02-switcher-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sk02-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: #0B1D36;
  border: 1px solid #264872;
  color: #E6F2FF;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  min-width: 0;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.sk02-switch-btn:hover {
  border-color: #38BDF8;
  background: #122E52;
  color: #FFFFFF;
}

.sk02-switch-btn.active {
  background: #38BDF8;
  border-color: #7DD3FC;
  color: #04101F;
  font-weight: 800;
}

/* Drawer Scrollable Body */
.sk02-drawer-body {
  padding: 14px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.sk02-disclaimer {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #291805;
  border: 1px solid #F59E0B;
  color: #FEF3C7;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sk02-summary-box {
  padding: 10px 13px;
  border-radius: var(--radius-md);
  background: #09192F;
  border: 1px solid #1E3A5F;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sk02-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sk02-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: #0D2544;
  border: 1px solid #2B507C;
  color: #E6F2FF;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.sk02-meta-pill.tone-alert {
  background: #3B0D1D;
  border-color: #FB7185;
  color: #FFE4E8;
}

.sk02-meta-pill.tone-warn {
  background: #3A2206;
  border-color: #FBBF24;
  color: #FEF3C7;
}

.sk02-meta-pill.tone-good {
  background: #072B22;
  border-color: #34D399;
  color: #D1FAE5;
}

.sk02-summary-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #DCEBFA;
}

/* 5-Node Domino Chain SVG Container */
.sk02-svg-wrap {
  padding: 10px 10px 8px;
  border-radius: var(--radius-md);
  background: #040C17;
  border: 1px solid #1A3558;
  min-width: 0;
  max-width: 100%;
}

#sk02-domino-svg [data-xray-domino-node] {
  cursor: pointer;
}

#sk02-domino-svg [data-xray-domino-node]:focus-visible {
  outline: 2px solid #38BDF8;
  outline-offset: 2px;
}

/* 5 Domino Detail Cards */
.sk02-cards-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.sk02-card {
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: #09182C;
  border: 1px solid #1E3A5F;
  border-left: 4px solid #38BDF8;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.sk02-card.tone-alert {
  border-left-color: #F43F5E;
  background: #121528;
  border-color: rgba(251, 113, 133, 0.45);
}

.sk02-card.tone-warn {
  border-left-color: #F59E0B;
  border-color: rgba(251, 191, 36, 0.42);
}

.sk02-card.tone-good {
  border-left-color: #10B981;
  border-color: rgba(52, 211, 153, 0.4);
}

.sk02-card.focused-card {
  box-shadow: 0 0 0 2px #38BDF8;
}

.sk02-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

.sk02-card-title-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.sk02-card-step {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  color: #FFFFFF;
}

.sk02-card-desk {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: #0D2544;
  border: 1px solid #294E7A;
  color: #7DD3FC;
}

.sk02-card-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.sk02-card-badge.tone-alert {
  background: #3B0D1D;
  border: 1px solid #FB7185;
  color: #FFE4E8;
}

.sk02-card-badge.tone-warn {
  background: #3A2206;
  border: 1px solid #FBBF24;
  color: #FEF3C7;
}

.sk02-card-badge.tone-good {
  background: #072B22;
  border: 1px solid #34D399;
  color: #D1FAE5;
}

.sk02-card-headline {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: #F0F7FF;
  overflow-wrap: anywhere;
}

.sk02-card-detail {
  margin: 0;
  font-size: 12.2px;
  line-height: 1.48;
  color: #C4DCF4;
  overflow-wrap: anywhere;
}

.sk02-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.sk02-card-gate {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #9CC2E6;
}

.sk02-jump-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sk02-jump-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: #0F294A;
  border: 1px solid #38BDF8;
  color: #F0F7FF;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sk02-jump-btn:hover {
  background: #173B69;
  border-color: #7DD3FC;
  color: #FFFFFF;
}

/* Footer Action & Human-in-the-loop Gate Note */
.sk02-drawer-footer {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #08182E;
  border: 1px solid #24466E;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sk02-hitl-note {
  flex: 1 1 260px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #C4DCF4;
}

.sk02-hitl-note strong {
  color: #7DD3FC;
}

.sk02-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  background: #38BDF8;
  border: 1px solid #7DD3FC;
  color: #04101F;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.sk02-copy-btn:hover {
  background: #7DD3FC;
}

/* --------------------------------------------------------------------------
   3. Responsive Collapse (980px / 640px / 390px Zero Overflow)
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .sk02-xray-bar {
    flex-basis: 100%;
  }
}

@media (max-width: 640px) {
  .sk02-xray-bar {
    padding: 8px 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .sk02-bar-label {
    grid-column: 1 / -1;
    margin-bottom: 1px;
  }

  .sk02-trigger-btn {
    width: 100%;
    padding: 5px 6px;
    font-size: 11px;
  }

  .sk02-leg-xray-btn {
    width: 100%;
  }

  .sk02-drawer-head {
    padding: 12px 12px 10px;
  }

  .sk02-drawer-body {
    padding: 12px 12px 20px;
  }

  .sk02-switcher-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .sk02-switch-btn {
    width: 100%;
    padding: 5px 6px;
    font-size: 11px;
  }

  .sk02-card-foot,
  .sk02-drawer-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .sk02-jump-group {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .sk02-jump-btn,
  .sk02-copy-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sk02-backdrop,
  .sk02-drawer,
  .sk02-trigger-btn,
  .sk02-switch-btn,
  .sk02-jump-btn,
  .sk02-copy-btn,
  .sk02-card {
    animation: none !important;
    transition: none !important;
  }
}
