/* Feature: code highlight + codebox UX (C/C++) */

.cp-hl-kw{ font-weight:700; }
.cp-hl-ty{ font-weight:700; }
.cp-hl-num{ opacity:.95; }
.cp-hl-str{ opacity:.95; }
.cp-hl-com{ opacity:.75; font-style: italic; }
.cp-hl-pp{ opacity:.9; }
.cp-hl-fn{ text-decoration: none; text-decoration-thickness: 1px; }
.cp-hl-const{ font-weight:700; }
.cp-hl-cls{ font-weight:800; }

/* =========================================================
   Code Highlight – C / C++
   ========================================================= */

.cp-code {
  position: relative;
}

.cp-hl-kw,
.cp-hl-ty {
  color: #0047b3;
  font-weight: 800;
}

.cp-hl-fn {
  color: #b0005a;
  font-weight: 700;
}

.cp-hl-cls {
  color: #0f3d91;
  font-weight: 800;
}

.cp-hl-const,
.cp-hl-lit,
.cp-hl-num {
  color: #6d28d9;
  font-weight: 700;
}

.cp-hl-str {
  color: #047857;
}

.cp-hl-com {
  color: #667085;
  font-style: italic;
}

.cp-hl-pp {
  color: #9d174d;
  font-weight: 700;
}

/* ------------------------------------------------------------
   Code blocks: alineación consistente + sin offsets raros
   ------------------------------------------------------------ */
pre.cp-code{
  margin: 0;
  padding: 7px 7px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcff;
  overflow: auto;

  /* importante: que el pre no "interprete" whitespace raro por estilos de code */
  white-space: normal;
}

/* el code es el que preserva espacios/saltos */
pre.cp-code > code{
  display: block;
  white-space: pre-wrap;   /* o pre si prefieres NO wrap */
  word-break: normal;
  overflow-wrap: anywhere;


  /* evita cualquier sangría / padding heredado de reglas globales */
  padding-left: 10px !important;
  margin: 0 !important;
  text-indent: 0 !important;

  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.cp-table-wrap{ overflow:auto; }
.cp-md-table{ margin:10px 0 14px 0; }
.cp-codebox{ position:relative; }
.cp-codecopy{
  position:absolute; top:10px; right:10px;
  font-size:12px; padding:6px 10px;
  border:1px solid var(--border); border-radius:10px;
  background:#fff; cursor:pointer; opacity:.9;
}
.cp-codecopy:hover{ opacity:1; }

/* Botón copiar (derecha) */
.cp-codecopy{
  font: inherit;
  font-size: 12px;
  line-height: 1;

  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 10px;

  cursor: pointer;
  opacity: .85;
}
.cp-codecopy:hover{ opacity: 1; }

.cp-hl-lit{
  color: #7e00f3;
  font-weight: 600;
}

.cp-hl-var{
  color: #b42318;
  font-weight: 600;
}

.cp-hl-id{
  color: #0f3d91;
}

.cp-hl-key{
  color: #0f3d91;
  font-weight: 700;
}

/* =========================================================
   Generic tokens: Python / Bash
   Fondo claro, alto contraste
   ========================================================= */
/* Python / Bash / tokens genéricos */
.tok-keyword {
  color: #015ee9;
  font-weight: 800;
}

.tok-builtin {
  color: #6d28d9;
  font-weight: 700;
}

.tok-function {
  color: #d80568;
  font-weight: 700;
}

.tok-class {
  color: #0f3d91;
  font-weight: 800;
}

.tok-string {
  color: #f30404;
}

.tok-number {
  color: #07773a;
  font-weight: 650;
}

.tok-comment {
  color: #bbc1cf;
  font-style: italic;
}

.tok-variable {
  color: #c0a929;
  font-weight: 700;
}

.tok-operator {
  color: #0780a5;
}

.tok-punctuation {
  color: #344054;
}

pre.cp-code {
  background: #fbfcff;
  color: #101828;
}