/*
 * Panel de dev.orbitta.es: estilos comunes (Tema, Minificar, Generador CPT, Changelog, Webs, CDN y login).
 * Índice: 1. Tokens · 2. Base · 3. Layout (barra lateral) · 4. Cabecera de página ·
 * 5. Tarjetas · 6. Botones · 7. Formularios · 8. Tablas · 9. Estados (pill, tag,
 * avisos) · 10. Pestañas · 11. Diálogos · 12. Datos (stats, lista clave/valor) ·
 * 13. Changelog · 14. CDN · 15. Generador CPT · 16. Minificar código suelto ·
 * 17. Login · 18. Utilidades · 19. Responsive
 */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f8f8f7;
  --border: #e7e7e4;
  --border-strong: #d6d6d2;
  --text: #18181b;
  --text-2: #52525b;
  --muted: #8a8a93;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --accent-text: #3730a3;
  --ok: #15803d;      --ok-soft: #ecfdf3;    --ok-line: #bbf7d0;
  --warn: #b45309;    --warn-soft: #fffbeb;  --warn-line: #fde68a;
  --danger: #b91c1c;  --danger-soft: #fef2f2; --danger-line: #fecaca;
  --primary: #18181b; --primary-text: #ffffff; --primary-hover: #2e2e33;
  --shadow: 0 1px 2px rgba(16, 16, 20, .04), 0 1px 1px rgba(16, 16, 20, .03);
  --shadow-lg: 0 24px 60px rgba(16, 16, 20, .22);
  --radius: 14px;
  --radius-sm: 9px;
  --mono: 'SF Mono', ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --side: 232px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111113;
    --surface: #18181b;
    --surface-2: #1f1f23;
    --border: #2a2a2f;
    --border-strong: #3a3a41;
    --text: #f4f4f5;
    --text-2: #c4c4cc;
    --muted: #8b8b95;
    --accent: #818cf8;
    --accent-soft: #23234a;
    --accent-text: #c7d2fe;
    --ok: #4ade80;     --ok-soft: #0f2a1a;    --ok-line: #1f5a35;
    --warn: #fbbf24;   --warn-soft: #2a2110;  --warn-line: #5c4512;
    --danger: #f87171; --danger-soft: #2c1414; --danger-line: #5e2323;
    --primary: #f4f4f5; --primary-text: #18181b; --primary-hover: #d9d9de;
    --shadow: none;
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  }
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: .05em .35em; border-radius: 5px; }
b, strong { font-weight: 600; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 3. Layout (barra lateral) ------------------------------------------------ */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1.25rem;
  padding: 1.25rem .9rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-text); font-weight: 700; font-size: .95rem;
}
.brand-name { font-weight: 650; letter-spacing: -.01em; line-height: 1.15; }
.brand-name small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .65rem; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-text); }
/* Submenú: la línea, en el centro de los iconos del menú (relleno del enlace + medio
   icono) y el texto, algo más separado de la línea que el de los enlaces de su icono. */
.subnav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px calc(.65rem + 7.5px); border-left: 1px solid var(--border); }
.subnav a { margin-left: .35rem; padding: .35rem .65rem; font-size: .84rem; font-weight: 500; }
.subnav a.on { background: transparent; color: var(--accent-text); font-weight: 600; }
.nav .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  display: inline-grid; place-items: center; font-size: .7rem; font-weight: 600;
  background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line);
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; padding: 0 .5rem; font-size: .78rem; color: var(--muted); }
.side-foot a { color: var(--muted); display: inline-flex; align-items: center; gap: .45rem; }
.side-foot a:hover { color: var(--text); text-decoration: none; }
.main { min-width: 0; padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.page.narrow { max-width: 860px; }

/* 4. Cabecera de página ---------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1 1 420px; }
.page-head h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.page-head p { color: var(--muted); margin-top: .25rem; max-width: 70ch; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* 5. Tarjetas -------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 1rem; font-weight: 650; }
.card-head p { color: var(--muted); font-size: .84rem; margin-top: .15rem; max-width: 80ch; }
.card-body { padding: 1.25rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; align-items: stretch; }
.grid-3 > .card { display: flex; flex-direction: column; }
.grid-3 > .card > .card-body { flex: 1; }

/* 6. Botones --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 36px; padding: 0 .95rem; border-radius: var(--radius-sm);
  font: inherit; font-size: .86rem; font-weight: 550; white-space: nowrap; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { filter: brightness(1.08); background: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger-line); }
.btn-sm { height: 30px; padding: 0 .65rem; font-size: .8rem; border-radius: 8px; }
.btn-icon { width: 30px; padding: 0; }
.btn.done { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.btn-row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* 7. Formularios ----------------------------------------------------------- */
.input, .select, .textarea,
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  padding: .45rem .65rem; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
/* Flecha propia: la nativa queda pegada al borde derecho */
.select, select {
  appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
::placeholder { color: var(--muted); opacity: .8; }
:is(input, select, textarea):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { color: var(--muted); background: var(--surface-2); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field > span, .label { font-size: .78rem; font-weight: 600; color: var(--text-2); }
.field small, .hint { font-size: .78rem; color: var(--muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; align-items: end; }
.choice { display: flex; gap: .6rem; flex-wrap: wrap; }
.choice label {
  display: flex; align-items: flex-start; gap: .55rem; cursor: pointer;
  padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); flex: 1 1 200px;
}
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice label b { display: block; font-size: .86rem; }
.choice label small { display: block; color: var(--muted); font-size: .76rem; }

/* 8. Tablas ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th {
  text-align: left; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: .6rem .75rem; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
}
.table td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td.act { text-align: right; white-space: nowrap; width: 1%; }
.table td.center, .table th.center { text-align: center; }
.table .sub { display: block; color: var(--muted); font-size: .78rem; }
.table input[type=text] { padding: .35rem .5rem; }
.table .empty { color: var(--muted); padding: 1.25rem .75rem; text-align: center; }

/* 9. Estados (pill, tag, avisos) ------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: .4rem; height: 24px; padding: 0 .6rem; border-radius: 99px;
  font: inherit; font-size: .75rem; font-weight: 550; white-space: nowrap; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text-2); border-color: var(--border);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok     { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.pill.warn   { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.pill.info   { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
button.pill { cursor: pointer; }
button.pill:hover { filter: brightness(.97); }
.tag { display: inline-block; font-size: .72rem; font-weight: 550; padding: .1rem .5rem; border-radius: 99px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.tag.staging { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.tag.produccion { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.notice { display: flex; align-items: flex-start; gap: .6rem; padding: .75rem 1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.notice.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.notice.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.notice.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.notice .grow { flex: 1; }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-danger { color: var(--danger); } .t-muted { color: var(--muted); }
.key-chip { white-space: nowrap; font-family: var(--mono); font-size: .78rem; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: .15rem .45rem; border-radius: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.dot.ok { background: #22c55e; } .dot.danger { background: #ef4444; } .dot.warn { background: #f59e0b; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--border-strong); border-top-color: var(--muted); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 10. Pestañas ------------------------------------------------------------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); }
.tabs a { padding: .6rem .9rem; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
@media (min-width: 901px) { .webs-tabs { display: none; } }

/* 11. Diálogos ------------------------------------------------------------- */
dialog.dialog {
  margin: auto; width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px);
  padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.dialog::backdrop { background: rgba(10, 10, 14, .5); }
.dialog-head { padding: 1.1rem 1.25rem .25rem; }
.dialog-head h2 { font-size: 1.05rem; font-weight: 650; }
.dialog-head p { color: var(--muted); font-size: .84rem; margin-top: .2rem; }
.dialog-body { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .9rem; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: .9rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); }
.dialog-foot .status { margin-right: auto; font-size: .84rem; }

/* 12. Datos (stats, lista clave/valor) ------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat .k { font-size: .76rem; color: var(--muted); font-weight: 550; }
.stat .v { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: .8rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.25rem; font-size: .88rem; }
.kv dt { color: var(--muted); }
.kv dd { font-family: var(--mono); font-size: .84rem; text-align: right; }
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.links .btn { justify-content: flex-start; }
.links.one-col { grid-template-columns: 1fr; }

/* 13. Changelog ------------------------------------------------------------ */
.changelog { display: flex; flex-direction: column; gap: 1rem; }
.entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.35rem; box-shadow: var(--shadow); }
.entry h2 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.entry h2 small { font-size: .78rem; color: var(--muted); font-weight: 500; }
.entry h3 { font-size: .72rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 1rem 0 .4rem; }
.entry h2 + h3 { margin-top: .35rem; }
.entry ul { list-style: none; }
.entry li { position: relative; padding-left: 1.05rem; margin-bottom: .3rem; color: var(--text-2); }
.entry li::before { content: ""; position: absolute; left: .2rem; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); }
.entry strong { color: var(--text); }
.entry .empty { color: var(--muted); font-style: italic; }
.entry.compact { box-shadow: none; border: 0; padding: 0; background: transparent; }

/* 14. CDN ------------------------------------------------------------------ */
.cdn-drop { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1.75rem 1rem; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); text-align: center; cursor: pointer; }
.cdn-drop:hover, .cdn-drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.cdn-drop .i { width: 22px; height: 22px; }
.cdn-combo { position: relative; max-width: 280px; }
.cdn-combo-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); }
.cdn-combo-list li { padding: .45rem .6rem; border-radius: 6px; cursor: pointer; }
.cdn-combo-list li.active { background: var(--accent-soft); }
.cdn-combo-list li.new { color: var(--accent); }
.cdn-combo-list li.none { color: var(--muted); cursor: default; }
.cdn-queue { display: flex; flex-direction: column; gap: .5rem; }
.cdn-queue:empty { display: none; }
.cdn-qitem { display: flex; flex-direction: column; gap: .45rem; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 10px; }
.cdn-qitem .input { flex: 1; min-width: 0; }
.cdn-bar { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.cdn-bar i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s; }
.cdn-row { display: flex; align-items: center; gap: .75rem; }
.cdn-row > .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdn-group + .cdn-group { border-top: 1px solid var(--border); }
.cdn-head { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.25rem; cursor: pointer; }
.cdn-head:hover { background: var(--surface-2); }
.cdn-caret { color: var(--muted); transition: transform .15s; }
.cdn-group.open .cdn-caret { transform: rotate(90deg); }
.cdn-files { display: none; padding: 0 1.25rem .6rem 2.4rem; }
.cdn-group.open .cdn-files { display: block; }
.cdn-list .empty { color: var(--muted); padding: 1rem 1.25rem; }
.cdn-files .empty { padding: .4rem 0; }
.cdn-files .cdn-row { padding: .4rem 0; border-top: 1px solid var(--border); }

/* 15. Generador CPT ---------------------------------------------------------- */
.cpt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.cpt .form-col, .cpt .output-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.cpt .output-col { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; }
.cpt .card-head h2 { display: flex; align-items: center; gap: .4rem; }
.cpt label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: .3rem; }
.cpt .row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .75rem; }
.cpt .row:last-child { margin-bottom: 0; }
.cpt .toggle { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .84rem; font-weight: 500; cursor: pointer; }
.cpt .checks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem .9rem; margin-top: .3rem; }
.cpt .checks-detail { display: flex; flex-direction: column; gap: .6rem; }
.cpt .card-body > .btn, .cpt .mb-add-field { margin-top: .5rem; }
.cpt .hint { margin-top: .4rem; }
.cpt textarea { min-height: 0; }
.cpt textarea.mono { font-size: .8rem; font-variant-ligatures: none; }
/* Ayuda ⓘ con tooltip */
.cpt .help {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 16px; height: 16px; margin-left: .35rem; border-radius: 50%; vertical-align: middle;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: .66rem; font-weight: 700; line-height: 1; cursor: help;
}
.cpt .help:hover { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.cpt .help::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 30;
  width: 240px; padding: .5rem .7rem; border-radius: 8px; background: var(--text); color: var(--surface);
  font-size: .75rem; font-weight: 500; line-height: 1.5; text-align: left; white-space: normal; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.cpt .help:hover::after { opacity: 1; }
/* Bloques repetibles: taxonomías, idiomas, metaboxes y campos */
.cpt .tax-block, .cpt .mb-field { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem; margin-bottom: .6rem; }
.cpt .tax-toggles { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--border); }
.cpt .tax-trash, .cpt .mb-trash, .cpt .mb-field-trash {
  display: flex; align-items: center; justify-content: center; margin-left: auto; width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--muted); cursor: pointer;
}
.cpt .tax-trash:hover, .cpt .mb-trash:hover, .cpt .mb-field-trash:hover { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.cpt .mb-block { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: .9rem; }
.cpt .mb-block-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.cpt .mb-block-title { font-size: .86rem; font-weight: 650; }
.cpt .mb-block-counter, .cpt .mb-field-num { font-size: .72rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: .05rem .45rem; border-radius: 99px; }
.cpt .mb-field-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.cpt .mb-field-extras { display: none; margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--border); }
.cpt .mb-field-extras.show { display: block; }
.cpt .mb-toggle-extras { margin-top: .5rem; padding: 0; border: 0; background: none; font: inherit; font-size: .78rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.cpt .mb-toggle-extras:hover { color: var(--accent-text); }
.cpt .cpt-sub { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--border); }
.cpt .cpt-sub-title { font-size: .72rem; color: var(--muted); }
/* Salida */
.cpt .output-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.cpt .output-head h3 { font-size: .86rem; font-weight: 650; }
.cpt .actions { display: flex; gap: .4rem; }
.cpt pre { margin: 0; padding: 1rem 1.1rem; border-radius: var(--radius-sm); background: #1e1e22; color: #e8e8ea; font-family: var(--mono); font-size: .8rem; line-height: 1.65; font-variant-ligatures: none; overflow-x: auto; overflow-y: hidden; white-space: pre; }

/* 16. Minificar código suelto ------------------------------------------------ */
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.seg button { padding: .35rem .8rem; border: 0; border-radius: 7px; background: transparent; font: inherit; font-size: .84rem; font-weight: 550; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.mcode-opts > span { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.mcode-opts label { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--text-2); cursor: pointer; }
.mcode-opts .select { width: auto; padding-top: .3rem; padding-bottom: .3rem; font-size: .82rem; }
.mcode-panes { display: grid; grid-template-columns: 1fr 1fr; }
.mcode-pane { display: flex; flex-direction: column; min-width: 0; padding: 1rem 1.25rem; }
.mcode-pane + .mcode-pane { border-left: 1px solid var(--border); }
.mcode-pane.drag { background: var(--accent-soft); }
.mcode-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .5rem; font-size: .86rem; }
.mcode-pane .textarea { min-height: 420px; font-size: .8rem; line-height: 1.55; font-variant-ligatures: none; white-space: pre; overflow: auto; }
.mcode-err { margin: 0 1.25rem 1rem; }

/* 17. Login ---------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.login-box { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1rem; }
.login-box .brand { justify-content: center; margin-bottom: .5rem; }
.login-box .btn { width: 100%; height: 40px; }

/* 18. Utilidades ----------------------------------------------------------- */
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.nowrap { white-space: nowrap; }
.right { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.inline { display: inline; }
[hidden] { display: none !important; }

/* 19. Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: .5rem;
    padding: .6rem .75rem; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto;
  }
  .brand-name small, .side-foot .ver { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav a { padding: .45rem .6rem; white-space: nowrap; }
  .nav a span.lbl { display: none; }
  .nav a.on span.lbl { display: inline; }
  .subnav { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; padding: 0; }
  .side-foot a span { display: none; }
  .main { padding: 1.25rem 1rem 2.5rem; }
  .page-head h1 { font-size: 1.25rem; }
  .cpt { grid-template-columns: 1fr; }
  .cpt .output-col { position: static; max-height: none; }
  .cpt .checks-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hide-mob { display: none; }
  .cdn-row { flex-wrap: wrap; }
  .cdn-files { padding-left: 1rem; padding-right: 1rem; }
  .cpt .row { grid-template-columns: 1fr; }
  .mcode-panes { grid-template-columns: 1fr; }
  .mcode-pane + .mcode-pane { border-left: 0; border-top: 1px solid var(--border); }
  .mcode-pane .textarea { min-height: 240px; }
  .card-head, .card-body, .card-foot { padding-left: 1rem; padding-right: 1rem; }
}
