:root {
  --fondo: #f6f3ee; --tarjeta: #ffffff; --borde: #e6dfd3; --texto: #23201b; --suave: #6f675b;
  --acento: #ffb432; --acento-fuerte: #e8920a; --acento-texto: #2a1a00;
  --ok: #1f8a4c; --mal: #c0392b; --alerta: #b7791f; --codigo: #faf7f1;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #141210; --tarjeta: #1d1a17; --borde: #332d26; --texto: #eee8de; --suave: #a59a8a;
    --acento: #ffb432; --acento-fuerte: #ffc65a; --acento-texto: #2a1a00;
    --ok: #4cc27f; --mal: #ff6b5b; --alerta: #f0b54a; --codigo: #171512;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--texto);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
h2 { font-size: 1.05rem; margin: 0 0 .4rem; }
a { color: var(--acento-fuerte); }
.suave { color: var(--suave); margin: .2rem 0 .6rem; }
.error { color: var(--mal); }
.aviso { padding: .6rem .8rem; border-radius: 8px; background: var(--codigo); border: 1px solid var(--borde); }
.aviso.ok { border-color: var(--ok); } .aviso.mal { border-color: var(--mal); } .aviso.alerta { border-color: var(--alerta); }

button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--borde);
  background: var(--tarjeta); color: var(--texto); padding: .55rem 1rem; }
button:hover { border-color: var(--acento); }
button:disabled { opacity: .5; cursor: default; }
button.primario { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); font-weight: 600; }
button.primario:hover { background: var(--acento-fuerte); }
button.chico { padding: .3rem .7rem; font-size: .9rem; }
input, select, textarea { font: inherit; color: var(--texto); background: var(--fondo); border: 1px solid var(--borde);
  border-radius: 8px; padding: .5rem .7rem; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acento); outline-offset: 0; }

.marca { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; }
.logo { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 8px;
  background: var(--acento); color: var(--acento-texto); font-weight: 800; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-caja { width: 100%; max-width: 360px; display: grid; gap: .7rem; }
.login-caja label { display: grid; gap: .25rem; font-size: .9rem; color: var(--suave); }

.barra { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  padding: .6rem 16px; background: var(--tarjeta); border-bottom: 1px solid var(--borde); }
.pestanias { display: flex; gap: .25rem; overflow-x: auto; flex: 1 1 auto; order: 3; width: 100%; }
@media (min-width: 860px) { .pestanias { order: 0; width: auto; } }
.pestanias button { border: 0; background: none; padding: .45rem .8rem; white-space: nowrap; color: var(--suave); }
.pestanias button.activa { background: var(--fondo); color: var(--texto); font-weight: 600; box-shadow: inset 0 -2px 0 var(--acento); }
.derecha { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.chip { display: inline-block; font-size: .8rem; padding: .1rem .55rem; border-radius: 999px; background: var(--fondo);
  border: 1px solid var(--borde); color: var(--suave); white-space: nowrap; }
.chip.cpu { color: var(--texto); } .chip.gpu { border-color: var(--ok); color: var(--ok); }

main { max-width: 980px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.tab { display: grid; gap: 16px; }
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px; padding: 16px; min-width: 0; }
.fila { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .6rem; }
.fila.buscar input { flex: 1 1 220px; width: auto; } .fila.buscar select { flex: 0 1 200px; width: auto; }

.respuesta .preg { font-weight: 600; margin-bottom: .4rem; }
.respuesta .texto { white-space: pre-wrap; overflow-wrap: anywhere; }
.fuentes { margin-top: .8rem; border-top: 1px solid var(--borde); padding-top: .6rem; display: grid; gap: .35rem; }
.fuente { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; text-align: left; width: 100%;
  border: 1px solid var(--borde); background: var(--fondo); padding: .4rem .6rem; }
.fuente .tit { flex: 1 1 200px; overflow-wrap: anywhere; }
.fuente .punt { color: var(--suave); font-size: .8rem; font-variant-numeric: tabular-nums; }

.grilla-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.tipo { text-align: left; display: grid; gap: .1rem; padding: .7rem; }
.tipo .n { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tipo .d { color: var(--suave); font-size: .82rem; }

.resultado { display: block; width: 100%; text-align: left; margin-top: .5rem; padding: .6rem .7rem; }
.resultado .cab { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.resultado .t { font-weight: 600; overflow-wrap: anywhere; }
.resultado .trozo { color: var(--suave); font-size: .9rem; overflow-wrap: anywhere; margin-top: .2rem; }
.resultado mark { background: color-mix(in srgb, var(--acento) 40%, transparent); color: inherit; border-radius: 3px; }

.lista-sitios { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem; }
.sitio { display: flex; justify-content: space-between; gap: .5rem; text-align: left; padding: .45rem .65rem; }
.sitio span:first-child { overflow-wrap: anywhere; }
.sitio .n { color: var(--suave); font-variant-numeric: tabular-nums; }

.cambio { border: 1px solid var(--borde); border-radius: 10px; padding: .7rem; margin-top: .6rem; overflow-wrap: anywhere; }

.motor-modos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; }
.modo { border: 2px solid var(--borde); border-radius: 12px; padding: .8rem; display: grid; gap: .2rem; }
.modo.activo { border-color: var(--acento); }
.modo-icono { font-size: 1.5rem; }
.grilla-datos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-bottom: .6rem; }
.dato { background: var(--fondo); border-radius: 8px; padding: .5rem .7rem; }
.dato .v { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dato .v.mal { color: var(--mal); } .dato .k { color: var(--suave); font-size: .8rem; }
.xid { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--mal); overflow-wrap: anywhere; }

dialog { width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 1px solid var(--borde);
  border-radius: 12px; background: var(--tarjeta); color: var(--texto); padding: 16px; }
dialog::backdrop { background: rgb(0 0 0 / .5); }
.visor-cab { display: flex; justify-content: space-between; gap: .6rem; align-items: start; }
.visor-cab b { overflow-wrap: anywhere; }
.origen { margin: .6rem 0; font-size: .88rem; color: var(--suave); overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--codigo); border: 1px solid var(--borde);
  border-radius: 8px; padding: .8rem; font: .85rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0; }
