/* ==========================================================
   PUBLIC PYTHON CODE COMPANION
   ========================================================== */

.python-companion-button {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #cbd4db;
  border-radius: 9px;
  color: var(--navy);
  background: white;
  font-family: inherit;
  font-weight: 750;
  cursor: pointer;
}

.python-companion {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;

  width: min(460px, 92vw);
  height: 100vh;

  display: flex;
  flex-direction: column;

  color: var(--ink);
  background: #f8fafb;
  border-left: 1px solid var(--line);

  transform: translateX(101%);
  transition: transform 180ms ease;
}

.python-companion.open {
  transform: translateX(0);
}

.python-companion-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;

  padding: 20px;
  color: white;
  background: var(--navy);
}

.python-companion-header span,
.python-companion-header strong {
  display: block;
}

.python-companion-header span {
  color: #b8cad8;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.11em;
}

.python-companion-header strong {
  margin-top: 5px;
}

.python-companion-header button {
  width: 36px;
  height: 36px;

  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;

  color: white;
  background: transparent;

  font-size: 1.3rem;
  cursor: pointer;
}

.python-companion-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 28px;
}

.python-companion details {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.python-companion summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.python-companion-section {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.python-library-row {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 10px;

  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.python-library-row code {
  color: var(--teal);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.python-library-row span {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.python-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;

  margin-top: 12px;
}

.python-flow-step {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;

  font-size: 0.71rem;
  font-weight: 700;
}

.python-flow-arrow {
  color: var(--muted);
}

.python-dependency-tree,
.python-code-block {
  margin: 12px 0 0;
  padding: 14px;

  overflow-x: auto;

  border-radius: 9px;

  color: #e8edf2;
  background: #17212b;

  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;

  font-size: 0.73rem;
  line-height: 1.6;
  white-space: pre;
}

.python-code-block code {
  color: inherit;
}

.python-companion-why {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}


@media (max-width: 650px) {
  .python-library-row {
    grid-template-columns: 1fr;
  }
}

/* === DATA AI RESPONSIVE FOUNDATION V19.2 === */
/* Supervised ML Python companion: allow code/content to shrink within its owner. */
@media (max-width:820px){
  .python-companion,
  .python-panel,
  .python-card,
  .python-content{
    min-width:0 !important;
    max-width:100% !important;
  }

  .python-companion pre,
  .python-panel pre,
  .python-card pre{
    max-width:100% !important;
    overflow-x:auto !important;
    white-space:pre !important;
  }
}
/* === /DATA AI RESPONSIVE FOUNDATION V19.2 === */

/* === SUPERVISED ML COMPANION HIDDEN STATE v19.7.4 === */
.python-companion[aria-hidden="true"]{
  visibility:hidden !important;
  pointer-events:none !important;
}

.python-companion.open,
.python-companion[aria-hidden="false"]{
  visibility:visible !important;
  pointer-events:auto !important;
}

@media (max-width:620px){
  .python-companion{
    box-sizing:border-box !important;
    width:min(100vw,460px) !important;
    max-width:100vw !important;
  }

  .python-library-row{
    grid-template-columns:minmax(0,1fr) !important;
  }
}
/* === /SUPERVISED ML COMPANION HIDDEN STATE v19.7.4 === */
