/* Axis. Biblia de Arte Trimex v3: un sistema, dos modos. La herramienta se mira
   en sala a oscuras, así que parte en modo oscuro. Carta negro, blanco y rojo,
   Urbanist en Light, Regular y Medium, sin Bold. El rojo marca estado, selección
   y el láser de los botones, y no pasa del 5 % del cuadro. */
@font-face { font-family: Urbanist; src: url(fuentes/urbanist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --fondo: #000000; --sup: #0A0A0A; --linea: #2C2C2C; --texto: #FFFFFF; --g1: #AAAAAA; --g2: #5A5A5A;
  --rj: #E0201A; --rjp: #FF4A3D; --tablero: #0A0A0A;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --fondo: #F0F0EE; --sup: #FFFFFF; --linea: #D6D6D3; --texto: #0A0A0A; --g1: #5A5A5A; --g2: #AAAAAA;
  --rj: #E0201A; --rjp: #E0201A; --tablero: #0A0A0A;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--fondo); color: var(--texto);
       font: 300 14px/1.45 Urbanist, 'Helvetica Neue', Helvetica, Arial, sans-serif;
       font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--rjp); outline-offset: 2px; }

/* ---------- barra superior ---------- */
.barra { display: flex; align-items: center; gap: 22px; padding: 0 20px; height: 60px; border-bottom: 1px solid var(--linea); }
.marca { display: flex; align-items: center; gap: 10px; color: var(--texto); text-decoration: none; }
.marca svg.logo { width: 28px; height: 25px; }
.marca span { font-weight: 500; font-size: 12px; letter-spacing: .04em; }
.app { display: flex; align-items: baseline; gap: 10px; padding-left: 22px; border-left: 1px solid var(--linea); }
.app h1 { margin: 0; font-weight: 300; font-size: 24px; letter-spacing: .02em; line-height: 1; }
.app small { font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--g1); font-weight: 400; }
.estados { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border: 1px solid var(--linea);
        font-size: 12px; color: var(--g1); background: none; cursor: pointer; white-space: nowrap; }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--g2); }
.chip.on { color: var(--texto); }
.chip.on i { background: var(--rjp); }
.chip:hover { border-color: var(--texto); }
.chip .nivel { width: 36px; height: 3px; background: var(--linea); position: relative; overflow: hidden; }
.chip .nivel b { position: absolute; inset: 0 auto 0 0; background: var(--texto); width: 0; }
.acciones { display: flex; gap: 8px; }

/* Botón del sitio: borde fino y láser rojo con punto que entra desde la izquierda. */
.bt { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 14px 9px 0;
      border: 1px solid var(--texto); background: none; cursor: pointer; font-weight: 500; font-size: 13px;
      letter-spacing: -.01em; line-height: 1; color: var(--texto); white-space: nowrap;
      transition: background-color .22s cubic-bezier(.16,1,.3,1), color .22s cubic-bezier(.16,1,.3,1); }
.bt .mail-l { position: relative; flex: none; width: 18px; height: 1px; background: var(--rj); transition: width .32s cubic-bezier(.16,1,.3,1); }
.bt .mail-l::after { content: ""; position: absolute; right: -2px; top: -1.5px; width: 4px; height: 4px; border-radius: 50%; background: var(--rj); }
.bt:hover, .bt:focus-visible { background: var(--texto); color: var(--fondo); }
.bt:hover .mail-l, .bt:focus-visible .mail-l { width: 28px; }
.bt.quieto { border-color: var(--linea); }
@media (prefers-reduced-motion: reduce) { .bt, .bt .mail-l { transition: none; } }

/* Botones chicos de las listas y del inspector. */
.mini { height: 28px; padding: 0 10px; border: 1px solid var(--linea); background: none; cursor: pointer; font-size: 12px; color: var(--texto); }
.mini:hover { border-color: var(--texto); }
.mini[aria-pressed="true"] { border-color: var(--rjp); color: var(--rjp); }
.mini.aprendiendo { border-color: var(--rjp); color: var(--rjp); animation: pulso 1s infinite; }
@keyframes pulso { 50% { opacity: .45; } }

/* ---------- grilla principal ---------- */
.grilla { display: grid; grid-template-columns: 270px minmax(0, 1fr) 320px; height: calc(100% - 60px); }
.col { overflow-y: auto; border-right: 1px solid var(--linea); }
.col.der { border-right: 0; border-left: 1px solid var(--linea); }
.bloque { padding: 18px 18px 20px; border-bottom: 1px solid var(--linea); }
.bloque h2 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px;
             font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--g1); }
.bloque h2 .mini { text-transform: none; letter-spacing: 0; font-weight: 400; }
.vacio { color: var(--g1); font-size: 13px; margin: 0; }

.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lista li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center;
            padding: 7px 8px; cursor: pointer; border: 1px solid transparent; }
.lista li:hover { border-color: var(--linea); }
.lista li[aria-selected="true"] { background: var(--sup); border-color: var(--linea); }
.lista li[aria-selected="true"] .n { font-weight: 500; }
.lista .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .d { color: var(--g1); font-size: 12px; white-space: nowrap; }
.lista .ojo { width: 16px; height: 16px; padding: 0; border: 1px solid var(--g1); border-radius: 50%; background: none; cursor: pointer; }
.lista .ojo[aria-pressed="true"] { background: var(--texto); border-color: var(--texto); }
.lista .x { border: 0; background: none; color: var(--g1); cursor: pointer; padding: 0 2px; font-size: 15px; line-height: 1; }
.lista .x:hover { color: var(--texto); }
.lista li[aria-selected="true"]::before { content: none; }
.indic { width: 8px; height: 8px; border-radius: 50%; background: var(--rjp); justify-self: center; }

.botones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- escenario ---------- */
.escenario { display: flex; flex-direction: column; min-width: 0; background: var(--fondo); }
.marco { flex: 1; display: grid; place-items: center; padding: 24px; min-height: 0; position: relative; }
.lienzo { position: relative; background: #000; outline: 1px solid var(--linea); }
.lienzo canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lienzo svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; touch-action: none; }
.asa { fill: #000; stroke: #FFFFFF; stroke-width: 1.5; cursor: grab; }
.asa.sel { stroke: var(--rjp); fill: var(--rjp); }
.borde-sup { fill: transparent; stroke: rgba(255,255,255,.35); stroke-width: 1; cursor: pointer; }
.borde-sup.elegida { stroke: var(--rjp); cursor: move; }
.pie { display: flex; gap: 18px; padding: 10px 24px 14px; color: var(--g1); font-size: 12px; flex-wrap: wrap; border-top: 1px solid var(--linea); }
.pie kbd { font: 500 11px/1 Urbanist, 'Helvetica Neue', Helvetica, Arial, sans-serif; padding: 3px 5px; border: 1px solid var(--linea); color: var(--texto); }

/* ---------- inspector ---------- */
.campo { display: grid; gap: 6px; margin: 0 0 14px; }
.campo > span, .fila > span { font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--g1); font-weight: 400; }
.fila { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; margin: 0 0 12px; }
.fila .ctl { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 10px; align-items: center; }
.fila .ctl.solo { grid-template-columns: minmax(0, 1fr); }
.fila output { text-align: right; font-size: 12px; color: var(--g1); }
input[type="text"], input[type="number"], select { width: 100%; height: 32px; padding: 0 8px; background: var(--sup);
  border: 1px solid var(--linea); border-radius: 0; font-size: 13px; }
input[type="number"] { padding: 0 6px; }
select { appearance: none; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--g1) 50%), linear-gradient(135deg, var(--g1) 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--sup); color: var(--texto); }
input:focus, select:focus { outline: none; border-color: var(--rjp); }
input[type="range"] { width: 100%; height: 18px; margin: 0; background: none; appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--linea); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -5.5px; border-radius: 50%; background: var(--texto); }
input[type="range"]:focus-visible::-webkit-slider-thumb { background: var(--rjp); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--linea); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--texto); }
input[type="color"] { width: 46px; height: 28px; padding: 0; border: 1px solid var(--linea); background: none; cursor: pointer; }
.interruptor { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.interruptor input { width: 16px; height: 16px; margin: 0; accent-color: var(--rj); }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.esq { display: grid; grid-template-columns: 22px 1fr 1fr; gap: 6px; align-items: center; margin-bottom: 6px; font-size: 12px; color: var(--g1); }
.esq.sel { color: var(--rjp); }
.error { margin: 0 0 14px; padding: 8px 0 8px 12px; border-left: 2px solid var(--rj); font-size: 12px; line-height: 1.5;
         white-space: pre-wrap; word-break: break-word; color: var(--texto); }
.desc { margin: -4px 0 14px; color: var(--g1); font-size: 12.5px; line-height: 1.5; }
.monitor { margin: 8px 0 0; font-size: 12px; color: var(--g1); min-height: 18px; }

dialog { background: var(--sup); color: var(--texto); border: 1px solid var(--linea); padding: 22px; max-width: 460px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.7); }
dialog h2 { margin: 0 0 6px; font-weight: 400; font-size: 20px; }
dialog p { margin: 0 0 16px; color: var(--g1); font-size: 13px; }
.pantallas { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; }
.pantallas button { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px;
                    border: 1px solid var(--linea); background: none; cursor: pointer; text-align: left; }
.pantallas button:hover { border-color: var(--texto); }
.pantallas small { color: var(--g1); }
.guia { max-width: 560px; }
.guia ol { margin: 0 0 16px; padding-left: 20px; color: var(--texto); font-size: 13px; line-height: 1.55; }
.guia ol li { margin: 0 0 8px; }
.guia code { font-size: 12px; }

.soltar { position: fixed; inset: 0; display: none; place-items: center; background: rgba(0,0,0,.75); z-index: 50;
          font-size: 22px; font-weight: 300; color: #FFFFFF; border: 1px dashed var(--rjp); }
body.arrastrando .soltar { display: grid; }

@media (max-width: 1100px) {
  .grilla { grid-template-columns: 240px minmax(0, 1fr); }
  .col.der { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--linea); }
  .grilla { height: auto; }
  .marco { min-height: 60vh; }
}
@media (max-width: 720px) {
  .barra { height: auto; flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  .estados { margin-left: 0; }
  .grilla { grid-template-columns: minmax(0, 1fr); }
  .col { border-right: 0; }
  .marco { padding: 16px; min-height: 45vh; }
  .bloque { padding: 16px; }
}
