/* App NorTuner. Tema oscuro unico, mismos tokens que la web (rojo, ambar). Sin fuentes ni CDN de terceros.
   Motivo recurrente: las tres barras inclinadas del logo (separador, cargando, progreso, medidores). */
@font-face { font-family: "Oswald"; font-weight: 500; font-display: swap; src: url("/app/assets/oswald-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url("/app/assets/oswald-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("/app/assets/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url("/app/assets/jetbrains-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #0d0e10; --bg-2: #151619; --panel: #1a1c1f; --panel-2: #1f2124; --line: #2b2d31; --line-2: #3a3d42;
  --ink: #f4f2ec; --ink-dim: #a4a6ab; --ink-mute: #8a8c91;
  --red: #e5202e; --red-dim: #7d1218; --red-text: #ff8a92; --amber: #f2a71b; --ok: #4ade80; --bad: #ff6b6b;
  --font-display: "Oswald", "Arial Narrow", "Segoe UI", sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "SF Mono", monospace;
  --rail: 244px; --radius: 4px; --ease: cubic-bezier(.2, .7, .2, 1);
  --skew: skewX(-12deg);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
body { min-height: 100vh; background-image: radial-gradient(ellipse 900px 500px at 82% -10%, rgba(229, 32, 46, .13), transparent 60%); background-attachment: fixed; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .03em; margin: 0; font-weight: 700; }
h1 { font-size: 32px; line-height: 1.1; overflow-wrap: anywhere; }
h2 { font-size: 18px; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
h2::before { content: ""; flex: none; width: 22px; height: 11px; transform: var(--skew); background:
  linear-gradient(var(--red), var(--red)) 0 0 / 100% 3px no-repeat,
  linear-gradient(var(--red), var(--red)) 0 4px / 76% 3px no-repeat,
  linear-gradient(var(--red), var(--red)) 0 8px / 52% 3px no-repeat; }
h3 { font-size: 17px; }
.mono { font-family: var(--font-mono); font-size: 13px; }
.mut { color: var(--ink-dim); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* arranque y carga de pagina: barras del logo */
.boot-msg { padding: 38vh 0 0; text-align: center; color: var(--ink-dim); font-family: var(--font-display); letter-spacing: .14em; text-transform: uppercase; }
.boot-msg::after, .btn.busy::after { content: ""; display: block; width: 48px; height: 13px; margin: 16px auto 0; transform: var(--skew); background:
  linear-gradient(var(--red), var(--red)) 0 0 / 100% 3px no-repeat,
  linear-gradient(var(--red), var(--red)) 0 5px / 79% 3px no-repeat,
  linear-gradient(var(--red), var(--red)) 0 10px / 58% 3px no-repeat; animation: nt-pulse 1.2s ease-in-out infinite; }
.wait .main { opacity: .55; transition: opacity .15s .12s; }
.wait::before { content: ""; position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: 3px; background: repeating-linear-gradient(115deg, var(--red) 0 22px, transparent 22px 34px); background-size: 68px 100%; animation: nt-slide .7s linear infinite; }
@keyframes nt-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes nt-slide { to { background-position: 68px 0; } }
@keyframes nt-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes nt-bar { 0%, 100% { transform: skewX(-12deg) scaleX(.22); opacity: .45; } 50% { transform: skewX(-12deg) scaleX(1); opacity: 1; } }
@keyframes nt-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ---------- estructura ---------- */
.layout { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.side { position: sticky; z-index: 30; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px 14px; background: linear-gradient(180deg, #181a1d, var(--bg-2) 40%); border-right: 1px solid var(--line); overflow: visible; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 6px 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line); border-radius: 2px; }
.brand img { border-radius: 9px; transition: transform .25s var(--ease); }
.brand:hover img { transform: rotate(-6deg) scale(1.05); }
.brand .word { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .06em; display: flex; align-items: baseline; gap: 0; }
.brand .word b { color: var(--red); }
.brand .word em { font-style: normal; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; margin-left: 8px; padding: 1px 6px; border: 1px solid var(--line-2); color: var(--ink-dim); border-radius: 2px; }
.rail { display: flex; flex-direction: column; gap: 0; }
.rail-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.rail-label { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-mute); }
.rail-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rail-end { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.rail-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius); color: var(--ink-dim); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; width: 100%; transition: background .15s, color .15s; }
.rail-item::before { content: ""; position: absolute; left: -12px; top: 18%; bottom: 18%; width: 4px; border-radius: 0 3px 3px 0; background: var(--red); box-shadow: 0 0 14px rgba(229, 32, 46, .8); transform: scaleY(0); transition: transform .2s var(--ease); }
.rail-item:hover { background: rgba(255, 255, 255, .045); color: var(--ink); }
.rail-item:focus-visible { outline-offset: -2px; }
.rail-item.on { background: linear-gradient(90deg, rgba(229, 32, 46, .18), rgba(229, 32, 46, .03)); color: var(--ink); }
.rail-item.on::before { transform: scaleY(1); }
.rail-item.off { color: var(--ink-mute); cursor: not-allowed; } /* sin opacity: el texto bloqueado mantiene contraste AA */
.rail-item.off:hover { background: none; color: var(--ink-mute); }
.rail-item .ico { flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease), stroke .15s; }
.rail-item:hover:not(.off) .ico { transform: translateX(2px); }
.rail-item.on .ico { stroke: var(--red); }
.rail-item .lk { margin-left: auto; opacity: .8; }
.lang-ico { flex: none; width: 20px; font-family: var(--font-mono); font-size: 10px; text-align: center; border: 1px solid var(--line-2); border-radius: 3px; padding: 2px 0; line-height: 1; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-width: 0; }
.who .av { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 4px; background: linear-gradient(135deg, var(--red), var(--red-dim)); color: #fff; font: 700 14px var(--font-display); letter-spacing: .04em; }
.who .wt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who .wn { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .wr { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
/* tooltips de la barra lateral (solo en modo compacto o para opciones bloqueadas) */
.rail-item[data-tip]::after { content: attr(data-tip); position: absolute; z-index: 5; left: calc(100% + 14px); top: 50%; transform: translate(-4px, -50%); padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); font: 500 12px var(--font-body); white-space: nowrap; box-shadow: 0 8px 22px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s var(--ease); }
.rail-item[data-tip]:hover::after, .rail-item[data-tip]:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.rail-item:not(.off)[data-tip]::after { display: none; }

.main { padding: 30px clamp(16px, 3vw, 44px) 70px; max-width: 1180px; width: 100%; outline: none; min-width: 0; }
.main.enter > * { animation: nt-rise .38s var(--ease) backwards; }
.main.enter > :nth-child(2) { animation-delay: .04s; } .main.enter > :nth-child(3) { animation-delay: .08s; }
.main.enter > :nth-child(4) { animation-delay: .12s; } .main.enter > :nth-child(n+5) { animation-delay: .16s; }

.phead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.ph-main { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.ph-ico { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--radius); background: linear-gradient(160deg, var(--panel-2), var(--panel)); }
.ph-ico .ico { fill: none; stroke: var(--amber); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.phead h1::after { content: ""; display: block; width: 46px; height: 11px; margin: 9px 0 2px; transform: var(--skew); transform-origin: left; background:
  linear-gradient(var(--red), var(--red)) 0 0 / 100% 3px no-repeat,
  linear-gradient(var(--red), var(--red)) 0 4px / 78% 3px no-repeat,
  linear-gradient(var(--red), var(--red)) 0 8px / 56% 3px no-repeat; }
.lead { margin: 6px 0 0; color: var(--ink-dim); max-width: 62ch; }
.pact { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.crumb { margin: 0 0 12px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }
.crumb a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; } .crumb a::before { content: "\2039"; font-size: 16px; line-height: 1; } .crumb a:hover { color: var(--amber); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.empty { color: var(--ink-dim); padding: 22px 18px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: var(--radius); background: var(--panel); }
.bars { display: inline-flex; flex-direction: column; gap: 3px; margin: 10px 0 18px; }
.bars i { display: block; height: 3px; background: var(--red); transform: var(--skew); }
.bars i:nth-child(1) { width: 48px; } .bars i:nth-child(2) { width: 38px; } .bars i:nth-child(3) { width: 28px; }
/* indicador de progreso: las tres barras en marcha */
.bars.moving { margin: 2px 0; }
.bars.moving i { transform-origin: left; animation: nt-bar 1.4s ease-in-out infinite; }
.bars.moving.lg i { height: 4px; } .bars.moving.lg i:nth-child(1) { width: 132px; } .bars.moving.lg i:nth-child(2) { width: 104px; } .bars.moving.lg i:nth-child(3) { width: 76px; }

/* ---------- botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 2px; border: 1px solid transparent; font: 700 13px var(--font-body); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer; color: #fff; list-style: none; transition: background .15s, border-color .15s, box-shadow .2s, transform .15s var(--ease), color .15s; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.wide { width: 100%; padding: 13px; }
.btn.primary { background: var(--red); }
.btn.primary:hover { background: #d11a28; box-shadow: 0 6px 22px rgba(229, 32, 46, .38); transform: translateY(-1px); }
.btn.ghost { border-color: var(--line-2); background: transparent; } .btn.ghost:hover { border-color: var(--ink-dim); background: rgba(255, 255, 255, .04); }
.btn.danger { border-color: var(--red-dim); color: var(--red-text); background: transparent; } .btn.danger:hover { background: var(--red-dim); color: #fff; }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn.busy { flex-direction: row; }
.btn.busy::after { display: inline-block; width: 22px; height: 11px; margin: 0; background-size: 100% 2px, 79% 2px, 58% 2px; background-position: 0 0, 0 4px, 0 8px; background-image: linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff); }
.btn .ico, .ib .ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
summary.btn::-webkit-details-marker { display: none; }
.ib { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--line); background: transparent; color: var(--ink-dim); cursor: pointer; text-decoration: none; transition: color .15s, border-color .15s, background .15s, transform .15s var(--ease); }
.ib:hover { color: var(--amber); border-color: var(--amber); background: rgba(242, 167, 27, .08); transform: translateY(-1px); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; min-width: 0; }
.field .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.field:focus-within .lbl { color: var(--amber); }
.field .hint { font-size: 12px; color: var(--ink-mute); }
input, select, textarea { width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 12px; font: inherit; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--ink-mute); }
input:hover, select:hover, textarea:hover { border-color: #55585e; }
input:focus, select:focus, textarea:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px rgba(242, 167, 27, .22); }
input:user-invalid, textarea:user-invalid { border-color: var(--bad); }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px var(--bg) inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
select { appearance: none; padding-right: 36px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%), linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select option { background: var(--panel); color: var(--ink); }
textarea { resize: vertical; min-height: 84px; }
input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--red); flex: none; }
.chk { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 12px; cursor: pointer; }
.chk em { display: block; font-style: normal; color: var(--ink-mute); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-err { color: var(--bad); margin: 6px 0 10px; min-height: 0; }
.form-err:empty { display: none; }
.warn { color: var(--amber); margin: 8px 0 0; font-size: 14px; padding-left: 12px; border-left: 2px solid var(--amber); }
.bench { display: flex; gap: 12px; align-items: center; border: 1px solid #6a4a0d; background: repeating-linear-gradient(-45deg, rgba(242, 167, 27, .1) 0 10px, rgba(242, 167, 27, .04) 10px 20px); color: #ffd98a; padding: 12px 14px; border-radius: var(--radius); font-weight: 600; }
details.new, details.edit { position: relative; }
details.new[open] > form, details.edit[open] > form { margin-top: 14px; background: var(--bg-2); border: 1px solid var(--line); padding: 20px; border-radius: var(--radius); animation: nt-rise .25s var(--ease); }
details.new[open] { flex-basis: 100%; width: 100%; }
/* el formulario desplegado baja a su propia fila bajo el titulo (antes quedaba a la derecha, a la altura del titulo) */
.pact:has(details.new[open]) { flex-basis: 100%; width: 100%; }
.phead:has(details.new[open]) { align-items: stretch; }
details.edit[open] > summary { border-color: var(--amber); }
.toolopts { margin: 14px 0 18px; }
.toolopts summary { cursor: pointer; color: var(--ink-dim); margin-bottom: 8px; padding: 4px 0; }
.toolopts summary:hover { color: var(--ink); }
.toolopts details { margin: 4px 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }

/* ---------- tarjetas ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card { position: relative; overflow: hidden; background: linear-gradient(170deg, var(--panel-2), var(--panel) 60%); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; display: flex; flex-direction: column; transition: border-color .18s, transform .22s var(--ease), box-shadow .22s; }
.card::before { content: ""; position: absolute; top: 0; left: 0; height: 3px; width: 36px; background: var(--red); transform: var(--skew); transform-origin: left; transition: width .35s var(--ease); }
a.card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }
a.card:hover::before { width: 100%; }
a.card:focus-visible { outline-offset: 3px; }
.card .sub { margin: 4px 0 0; color: var(--ink-dim); font-size: 14px; }
.card-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.card-top h3 { overflow-wrap: anywhere; }
.tile { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line-2); }
.tile .ico { fill: none; stroke: var(--amber); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; }
.card-foot .go { margin-left: auto; fill: none; stroke: var(--ink-mute); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease), stroke .2s; }
a.card:hover .go { transform: translateX(4px); stroke: var(--red); }
.card.tool .tile { margin-bottom: 14px; }
.card.tool .sub { margin: 6px 0 16px; flex: 1; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card .row { margin-top: 14px; }
.chip { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink-dim); white-space: nowrap; }
.chip.kind-original { color: var(--ok); border-color: #1f5a37; background: rgba(74, 222, 128, .06); }
.chip.kind-multimapa, .chip.kind-nls { color: var(--amber); border-color: #6a4a0d; background: rgba(242, 167, 27, .06); }
.chip.kind-importada { color: #9dc4ff; border-color: #2c4670; background: rgba(120, 170, 255, .06); }
.chip.st::before { content: ""; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: currentColor; }
.info { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0 0 16px; }
.info dt { color: var(--ink-dim); font-size: 12px; font-family: var(--font-mono); letter-spacing: .04em; padding-top: 2px; } .info dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 1100px) { .info { grid-template-columns: max-content 1fr max-content 1fr; gap: 10px 22px; } .info dd { padding-right: 24px; } }

/* ---------- tablas ---------- */
.tablewrap { overflow-x: auto; margin: 12px 0 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: var(--panel); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .035); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr td:first-child { box-shadow: inset 3px 0 0 var(--line-2); }
.tbl tbody tr.k-original td:first-child { box-shadow: inset 3px 0 0 #2f8f58; }
.tbl tbody tr.k-multimapa td:first-child, .tbl tbody tr.k-nls td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.tbl .hx { word-break: break-all; max-width: 300px; font-size: 12px; }
.tbl .hx.bef { color: var(--red-text); } .tbl .hx.aft { color: var(--ok); }
.tbl td a { color: var(--amber); text-decoration: none; font-weight: 600; } .tbl td a:hover { text-decoration: underline; }
.acts { white-space: nowrap; text-align: right; } .acts .ib { margin-left: 4px; }
.tbl:not(.mono) th:last-child { text-align: right; }
.sha { color: var(--ink-dim); }
.runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.run { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: var(--radius); padding: 13px 16px; background: var(--bg-2); }
.run > p { flex-basis: 100%; margin: 4px 0 0; }
.run.st-done { border-left-color: #2f8f58; } .run.st-error { border-left-color: var(--bad); }
.run.st-processing, .run.st-queued { border-left-color: var(--amber); }
.run.st-done .chip.st { color: var(--ok); border-color: #1f5a37; } .run.st-error .chip.st { color: var(--bad); border-color: var(--red-dim); }
.run.st-processing .chip.st, .run.st-queued .chip.st { color: var(--amber); border-color: #6a4a0d; }
.run.st-processing .chip.st::before, .run.st-queued .chip.st::before { animation: nt-pulse 1s ease-in-out infinite; }
.run > .btn { margin-left: auto; }
.run-prog { flex-basis: 100%; display: flex; align-items: center; gap: 16px; padding: 10px 0 4px; }
.out { margin-top: 16px; display: grid; gap: 12px; }

/* ---------- subida ---------- */
.upload { display: grid; gap: 12px; margin-top: 10px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 10px; justify-content: center; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 30px 16px; color: var(--ink-dim); cursor: pointer; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .018) 0 12px, transparent 12px 24px), var(--bg-2); transition: border-color .15s, background-color .15s, color .15s; }
.drop:hover, .drop.over { border-color: var(--red); color: var(--ink); }
.drop.over { border-style: solid; background-color: rgba(229, 32, 46, .08); }
.drop.busy { opacity: .6; cursor: progress; }
.drop .ico { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.drop:hover .ico, .drop.over .ico { transform: translateY(-4px); stroke: var(--red); }
.drop:focus-visible { outline-offset: 3px; }
.upmsg { display: flex; align-items: center; gap: 14px; min-height: 0; }
.upmsg:empty { display: none; }

/* ---------- visor hexadecimal ---------- */
.vbar { display: grid; grid-template-columns: 230px 1fr auto 1fr; gap: 0 16px; align-items: end; padding: 16px 18px 6px; margin-bottom: 14px; }
.vbar .field { margin-bottom: 10px; }
.vbar input, .vbar select { font-size: 14px; height: 42px; }
.vsearch { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.hexbox { position: relative; overflow: auto; padding-bottom: 28px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font-mono); font-size: 13px; scrollbar-color: var(--line-2) var(--bg-2); }
.hexbox:focus-visible { outline-offset: 3px; }
.hexspacer { width: 1px; }
.hexwin { position: absolute; top: 28px; left: 0; width: 100%; min-width: 760px; }
.hexrow { position: absolute; left: 0; right: 0; height: 20px; display: flex; gap: 18px; padding: 0 12px; line-height: 20px; white-space: pre; }
.hexrow:hover { background: rgba(255, 255, 255, .04); }
.hexrow .ad { color: var(--amber); min-width: 6ch; }
.hexrow .hb { display: flex; gap: 6px; color: var(--ink); }
.hexrow .hb i { font-style: normal; width: 20px; text-align: center; }
.hexrow .hb i:nth-child(8) { margin-right: 8px; }
.hexrow .hb i.z { color: #80838a; }
.hexrow .asc { color: var(--ink-dim); letter-spacing: .1em; }
.hexrow i.chg { background: rgba(242, 167, 27, .25); color: var(--amber); }
.hexrow i.hit { background: var(--red); color: #fff; }
.hexrow.hexhead { position: sticky; top: 0; z-index: 3; height: 28px; line-height: 28px; margin-bottom: -28px; min-width: 760px; background: var(--panel); border-bottom: 1px solid var(--line-2); color: var(--ink-dim); }
.hexrow.hexhead .hb i, .hexrow.hexhead .asc { font-size: 11px; } /* la columna de direcciones conserva el cuerpo de 13 px para que las cifras alineen con las filas */
.hexrow.hexhead:hover { background: var(--panel); }
.hexrow.hexhead .hb i, .hexrow.hexhead .asc { color: var(--ink-dim); }
.hexrow.hexhead .asc { text-transform: uppercase; letter-spacing: .12em; }

/* ---------- comparador ---------- */
.cmpgrid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0 14px; align-items: end; }
.cmp-arrow { display: grid; place-items: center; width: 38px; height: 42px; margin-bottom: 14px; color: var(--amber); }
.cmp-arrow .ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; }
.stat { flex: 1 1 150px; max-width: 240px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); border-top: 3px solid var(--red); }
.stat b { display: block; font: 600 30px/1.1 var(--font-mono); color: var(--amber); }
.stat span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.stats .btn { align-self: center; margin-left: auto; }

/* ---------- ajustes ---------- */
.meter { margin: 0 0 18px; }
.meter .mt { display: flex; justify-content: space-between; margin-bottom: 6px; gap: 12px; }
.bar { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red-dim), var(--red)); clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%); transition: width .7s var(--ease); }
.bar i.warm { background: linear-gradient(90deg, #7a560e, var(--amber)); }
.bar i.hot { background: repeating-linear-gradient(115deg, var(--bad) 0 8px, #b83a3a 8px 14px); }

/* ---------- login ---------- */
.login { position: relative; overflow: hidden; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login::before { content: ""; position: absolute; inset: auto -4% -10% auto; width: min(620px, 80vw); height: 420px; transform: var(--skew); opacity: .06; pointer-events: none; background:
  linear-gradient(#fff, #fff) 0 0 / 100% 70px no-repeat,
  linear-gradient(#fff, #fff) 0 110px / 82% 70px no-repeat,
  linear-gradient(#fff, #fff) 0 220px / 64% 70px no-repeat; }
.login-card { position: relative; width: min(410px, 100%); background: linear-gradient(170deg, var(--panel-2), var(--panel) 55%); border: 1px solid var(--line-2); border-radius: 6px; padding: 34px 30px 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); animation: nt-rise .5s var(--ease) backwards; }
.login-card::before { content: ""; position: absolute; top: 0; left: 30px; width: 64px; height: 4px; background: var(--red); transform: var(--skew); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.login-brand .word { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: .06em; display: flex; align-items: baseline; }
.login-brand .word b { color: var(--red); }
.login-brand .word em { font-style: normal; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; margin-left: 10px; padding: 1px 7px; border: 1px solid var(--line-2); color: var(--ink-dim); border-radius: 2px; }
.login-logo { border-radius: 14px; }
.login-card h1 { font-size: 26px; }
.login-card .bars { margin: 12px 0 20px; }
.login-card .foot { color: var(--ink-mute); font-size: 13px; margin: 20px 0 0; padding-top: 16px; border-top: 1px dashed var(--line); }
.login-card .foot-multi { color: var(--ink-mute); font-size: 13px; margin: 10px 0 0; }
.login-card .foot-multi a { color: var(--amber); }
.login-card .langsw { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--ink-dim); }
.login-card .langsw:hover { color: var(--amber); }

/* ---------- estados vacios (ilustracion CSS) ---------- */
.empty-state { display: grid; justify-items: center; gap: 16px; text-align: center; padding: 40px 18px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: rgba(255, 255, 255, .012); color: var(--ink-dim); }
.empty-state p { margin: 0; max-width: 46ch; }
.ill { position: relative; width: 116px; height: 84px; padding: 16px 16px; display: flex; flex-direction: column; justify-content: center; gap: 8px; border: 1.5px solid var(--line-2); border-radius: 8px; background: linear-gradient(160deg, var(--panel-2), var(--panel)); box-shadow: 0 14px 28px rgba(0, 0, 0, .35); animation: nt-float 4.5s ease-in-out infinite; }
.ill::after { content: ""; position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--bg), 0 0 18px rgba(242, 167, 27, .55); }
.ill i { display: block; height: 7px; border-radius: 1px; background: var(--line-2); transform: var(--skew); transform-origin: left; }
.ill i:nth-child(1) { width: 100%; background: var(--red); } .ill i:nth-child(2) { width: 78%; } .ill i:nth-child(3) { width: 54%; }
.ill-grid { flex-direction: row; flex-wrap: wrap; align-content: center; gap: 6px; }
.ill-grid i { width: 22px !important; height: 14px; transform: none; background: var(--line-2) !important; }
.ill-grid i:nth-child(2) { background: var(--red) !important; } .ill-grid i:nth-child(5) { background: var(--amber) !important; }
.ill-trash { border-style: dashed; box-shadow: none; }
.ill-trash i { background: var(--line-2) !important; opacity: .7; }
.ill-trash::after { background: var(--ink-mute); box-shadow: 0 0 0 4px var(--bg); }

/* ---------- avisos ---------- */
.toast { position: fixed; z-index: 50; bottom: 22px; right: 22px; max-width: min(420px, calc(100vw - 32px)); display: flex; align-items: center; gap: 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--ok); padding: 13px 18px; border-radius: var(--radius); box-shadow: 0 12px 34px rgba(0, 0, 0, .55); transition: opacity .25s, transform .25s var(--ease); animation: nt-rise .3s var(--ease); }
.toast::before { content: ""; flex: none; width: 16px; height: 11px; transform: var(--skew); background:
  linear-gradient(var(--ok), var(--ok)) 0 0 / 100% 3px no-repeat,
  linear-gradient(var(--ok), var(--ok)) 0 4px / 76% 3px no-repeat,
  linear-gradient(var(--ok), var(--ok)) 0 8px / 52% 3px no-repeat; }
.toast.bad { border-left-color: var(--bad); }
.toast.bad::before { background:
  linear-gradient(var(--bad), var(--bad)) 0 0 / 100% 3px no-repeat,
  linear-gradient(var(--bad), var(--bad)) 0 4px / 76% 3px no-repeat,
  linear-gradient(var(--bad), var(--bad)) 0 8px / 52% 3px no-repeat; }
.toast.hide { opacity: 0; transform: translateY(8px); pointer-events: none; }

/* ---------- adaptable ---------- */
@media (max-width: 1000px) {
  :root { --rail: 68px; }
  .side { padding: 14px 8px; align-items: stretch; }
  .who .wt, .rail-item .lk { display: none; }
  .rail-item span, .rail-label, .brand .word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; }
  .rail-label::after { display: none; }
  .rail-group { gap: 2px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .brand { justify-content: center; padding: 0 0 14px; }
  .who { justify-content: center; padding: 6px; border: 0; background: none; }
  .rail-item { justify-content: center; padding: 12px 0; }
  .rail-item::before { left: -8px; }
  .rail-item[data-tip]::after, .rail-item:not(.off)[data-tip]::after { display: block; }
  .vbar { grid-template-columns: 1fr 1fr; }
  .ph-ico { display: none; }
}
@media (max-height: 640px) and (min-width: 641px) {
  .rail-item { padding-block: 7px; } .brand { padding-bottom: 8px; } .rail-group { margin-bottom: 6px; } .who { display: none; }
}
@media (max-width: 640px) {
  .layout { grid-template-columns: 1fr; padding-bottom: 68px; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line-2); background: rgba(21, 22, 25, .97); gap: 0; }
  .brand, .who, .rail-label, .rail-item[data-tip]::after, .rail-item:not(.off)[data-tip]::after, .rail-end .lang { display: none; }
  .rail, .rail-end { flex-direction: row; border: 0; padding: 0; margin: 0; gap: 0; overflow: visible; }
  .rail { flex: 6 1 0; } .rail-end { flex: 2 1 0; }
  .rail-group { display: contents; }
  .rail-item { padding: 12px 0; flex: 1; width: auto; min-width: 0; min-height: 46px; }
  .rail-item::before { left: 25%; right: 25%; top: -4px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; transform: scaleX(0); }
  .rail-item.on::before { transform: scaleX(1); }
  .main { padding: 20px 14px 40px; }
  h1 { font-size: 25px; }
  .panel { padding: 16px; }
  .grid2, .vbar { grid-template-columns: 1fr; }
  .cmpgrid { grid-template-columns: 1fr; }
  .cmp-arrow { display: none; }
  .vbar { padding: 14px 14px 4px; }
  .info { grid-template-columns: 1fr; gap: 0; } .info dd { margin-bottom: 10px; }
  .hexbox { font-size: 12px; }
  .hide-sm { display: none; }
  .stats .btn { margin-left: 0; }
  .toast { bottom: 82px; right: 12px; left: 12px; max-width: none; }
  .empty-state { padding: 30px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* version recien generada, resaltada en el historial */
.tbl tr.hl td { background: rgba(229, 32, 46, .12); }
.tbl tbody tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--red); } /* mas especifico que .k-multimapa td:first-child */
.uses { display: grid; gap: 4px; align-content: start; }
.uses .chk { margin: 2px 0 8px; }
.run-acts { margin-top: 10px; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; }
/* zona de peligro y cuadro de confirmacion */
.danger-zone { border-color: var(--red-dim); }
dialog.confirm { background: var(--panel); color: var(--ink); border: 1px solid var(--red-dim); border-radius: 6px; padding: 22px 24px; max-width: min(440px, calc(100vw - 32px)); }
dialog.confirm::backdrop { background: rgba(0, 0, 0, .6); }
dialog.confirm p { margin: 0 0 18px; line-height: 1.5; }

/* ---------- ECU y soluciones ---------- */
.chip.ecu { color: var(--ink); border-color: var(--line-2); background: rgba(255, 255, 255, .04); }
.chip.ecu.none { color: var(--amber); border-color: #6a4a0d; background: rgba(242, 167, 27, .06); }
.form-sec { margin: 4px 0 14px; padding: 14px 16px 2px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.form-sec legend { padding: 0 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.form-sec > p { margin: 0 0 12px; }
.ecu-warn { border-left: 3px solid var(--amber); }
.ecu-warn p { margin: 0 0 14px; max-width: 62ch; }
/* tarjeta bloqueada: sin opacity (rompe el contraste); borde discontinuo, trama diagonal y candado */
.card.tool.off { cursor: not-allowed; border-style: dashed; border-color: var(--line-2); background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .02) 0 10px, transparent 10px 20px), var(--panel); }
.card.tool.off::before { background: var(--line-2); width: 36px; }
.card.tool.off h3 { color: var(--ink-dim); }
.card.tool.off .sub { color: var(--ink-mute); }
.card.tool.off .tile .ico { stroke: var(--ink-mute); }
.card.tool.off .card-foot .ico { margin-left: auto; fill: none; stroke: var(--ink-dim); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lock-chip { color: var(--amber); border-color: #6a4a0d; background: rgba(242, 167, 27, .08); }
.lock-note { color: var(--ink-dim); font-size: 13px; }
.open-lbl { color: var(--ink-dim); font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
a.card.tool:hover .open-lbl { color: var(--ink); }
select:disabled { opacity: .55; cursor: not-allowed; }

/* =====================================================================
   Pulido de diseno (ficha de proyecto, soluciones, administracion, ajustes)
   ===================================================================== */
.lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
p.lbl { margin: 14px 0 6px; }
.info { grid-template-columns: minmax(8rem, max-content) 1fr; }
@media (min-width: 1100px) { .info { grid-template-columns: minmax(8rem, max-content) 1fr minmax(8rem, max-content) 1fr; } }
@media (max-width: 640px) { .info { grid-template-columns: 1fr; } }

/* ECU: marca apagada, modelo destacado, familia como etiqueta */
.chip.ecu { gap: 7px; }
.chip.ecu .eb { color: var(--ink-dim); }
.chip.ecu .em { color: var(--ink); font-weight: 600; }
.chip.ecu .ef { color: var(--amber); font-size: 10px; letter-spacing: .1em; padding-left: 7px; border-left: 1px solid var(--line-2); }
.ecu-badge { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 5px 12px; border: 1px solid var(--line-2); border-left: 3px solid var(--red); border-radius: 2px; background: var(--bg); font-family: var(--font-mono); }
.ecu-badge .eb { color: var(--ink-dim); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.ecu-badge .em { color: var(--amber); font-size: 15px; font-weight: 600; }
.ecu-badge .ef { color: var(--ink-dim); font-size: 11px; letter-spacing: .1em; padding-left: 12px; border-left: 1px solid var(--line-2); }
.card.proj .foot-chips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.card.proj .upd { font-size: 12px; color: var(--ink-dim); }

/* avisos: caja con signo, no solo color */
.warn { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 0; padding: 9px 12px; font-size: 14px; color: #ffd98a; border: 1px solid #6a4a0d; border-left: 3px solid var(--amber); border-radius: 2px; background: rgba(242, 167, 27, .07); }
.warn::before { content: "!"; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--amber); color: var(--bg); font: 700 12px/18px var(--font-mono); text-align: center; }
.warn:empty { display: none; }

/* historial: version recien generada */
.tbl tbody tr.hl td { background: rgba(229, 32, 46, .14); border-top: 1px solid var(--red); border-bottom: 1px solid var(--red); animation: nt-flash 1.4s ease-out 2; }
.tbl tbody tr.hl td:last-child { box-shadow: inset -1px 0 0 var(--red); }
@keyframes nt-flash { from { background: rgba(229, 32, 46, .5); } to { background: rgba(229, 32, 46, .14); } }

/* ejecuciones */
.run-acts { align-items: stretch; width: 100%; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.run-acts .btn { margin-left: 0; }
.run .form-err { margin: 6px 0 0; }

/* upload y zona de peligro */
.upload > input { max-width: 420px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; border-left: 3px solid var(--red); background: linear-gradient(90deg, rgba(229, 32, 46, .07), transparent 55%), var(--panel); }
.dz-text h2 { margin-bottom: 6px; } .dz-text p { margin: 0; max-width: 60ch; }

/* pantalla de solucion */
.sol-layout { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.sol-form { flex: 1 1 420px; min-width: 0; margin-bottom: 0; }
.sol-runs { flex: 1 1 380px; min-width: 0; margin-bottom: 0; }
.sol-runs:has(.out:empty) { display: none; }
.sol-runs .out { margin-top: 0; }
.sol-go { margin: 8px 0 4px; }
.sol-form .toolopts { margin: 10px 0 12px; }

/* ajustes */
.chip.role { color: var(--ink); border-color: var(--line-2); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.use-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 6px 0 18px; }
.use-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: var(--radius); background: var(--bg-2); }
.use-tile b { font: 600 32px/1.1 var(--font-mono); color: var(--amber); }
.use-tile .ut { font-weight: 600; }
.use-tile em { font: normal 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.use-tile.zero b { color: var(--bad); }
.use-tile.inf b { font-size: 20px; color: var(--ok); }

/* administracion */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.form-sec > .row, .form-sec > .perm-grid { padding-bottom: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 14px; }
.perm-grid .chk { margin: 4px 0; } .perm-grid .chk span { font-size: 12px; }
.adm-tbl th, .adm-tbl td { vertical-align: middle; }
.ucell b, .ucell span { display: block; }
.acts-row { display: flex; gap: 6px; justify-content: flex-end; }
.acts .btn.open { border-color: var(--amber); color: var(--amber); }
.uses-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.uses-chip { gap: 7px; }
.uses-chip .ut { color: var(--ink-dim); } .uses-chip b { font-weight: 600; color: var(--ink); }
.chip.st.u-active { color: var(--ok); border-color: #1f5a37; }
.chip.st.u-suspended { color: var(--bad); border-color: var(--red-dim); }
.chip.st.u-invited { color: var(--amber); border-color: #6a4a0d; }
.urow.st-suspended td { color: var(--ink-dim); }
.urow:has(+ tr.adm-edit:not([hidden])) td { background: rgba(242, 167, 27, .05); }
.adm-tbl tbody tr.adm-edit:hover { background: none; }
.adm-tbl tbody tr.adm-edit td { padding: 18px; background: var(--panel); }
.adm-tbl tbody tr.adm-edit td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.adm-form .form-sec { background: var(--bg-2); }
.lock-hint { margin: 0 0 12px; padding-left: 12px; border-left: 2px solid var(--amber); }
.role-list { display: grid; gap: 10px; }
.role-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.role-box[open] { border-color: var(--line-2); }
.role-box > summary { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; list-style: none; border-radius: var(--radius); }
.role-box > summary::-webkit-details-marker { display: none; }
.role-box > summary:hover { background: rgba(255, 255, 255, .03); }
.role-box > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-dim); border-bottom: 2px solid var(--ink-dim); transform: rotate(45deg); transition: transform .2s var(--ease); }
.role-box[open] > summary::after { transform: rotate(-135deg); }
.role-box[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.role-box .rn { font: 700 16px var(--font-display); letter-spacing: .04em; text-transform: uppercase; }
.role-box .rid { color: var(--ink-mute); font-size: 11px; }
.role-body { padding: 16px; }
.role-body .form-sec { background: var(--panel); }

@media (max-width: 1000px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-tbl th:nth-child(4), .adm-tbl th:nth-child(5), .adm-tbl tr.urow td:nth-child(4), .adm-tbl tr.urow td:nth-child(5) { display: none; }
}
@media (max-width: 640px) {
  .grid3 { grid-template-columns: 1fr; }
  .acts-row { flex-wrap: wrap; }
  .danger-zone .btn { width: 100%; }
  .run-acts .btn { flex: 1 1 auto; }
  .use-tile b { font-size: 26px; }
}
/* dedos: objetivos tactiles de 44 px */
@media (pointer: coarse) {
  .ib { width: 44px; height: 44px; }
  .btn.sm { min-height: 40px; }
  input[type=checkbox] { width: 22px; height: 22px; }
}

/* =====================================================================
   RESERVADO PARA EL FUTURO VISOR DE MAPAS 2D Y 3D (no se usa todavia, no hay marcado ni JS)
   Reglas de uso: el color nunca es el unico canal (cada celda lleva su cifra); el valor se
   convierte en una clase .hc-N (0 a 8) desde JS, nunca en un atributo de estilo en linea.
   ===================================================================== */
:root {
  /* escala de calor, de valor bajo a alto: frio apagado, ambar de marca, rojo de marca */
  --heat-0: #12263a; --heat-1: #17415a; --heat-2: #1f6a7a; --heat-3: #3c8f7a; --heat-4: #9bb04a;
  --heat-5: #f2a71b; --heat-6: #ee7a1c; --heat-7: #e5202e; --heat-8: #ff6a74;
  --heat-ink-dark: #0d0e10; --heat-ink-light: #f4f2ec;
  /* divergente para "cambio respecto al original": azul (baja) frente a naranja (sube), apto para daltonismo; el gris es "sin cambio" */
  --diff-neg-3: #2d7dd2; --diff-neg-2: #4da3ff; --diff-neg-1: #1f4a7a; --diff-zero: #2b2d31;
  --diff-pos-1: #7a3f12; --diff-pos-2: #ff8a3d; --diff-pos-3: #ffc27a;
  --map-axis: var(--ink-dim); --map-grid: #2b2d31; --map-cursor: var(--amber);
}
.hc-0 { background: var(--heat-0); color: var(--heat-ink-light); } .hc-1 { background: var(--heat-1); color: var(--heat-ink-light); }
.hc-2 { background: var(--heat-2); color: var(--heat-ink-light); } .hc-3 { background: var(--heat-3); color: var(--heat-ink-dark); }
.hc-4 { background: var(--heat-4); color: var(--heat-ink-dark); } .hc-5 { background: var(--heat-5); color: var(--heat-ink-dark); }
.hc-6 { background: var(--heat-6); color: var(--heat-ink-dark); } .hc-7 { background: var(--heat-7); color: #fff; }
.hc-8 { background: var(--heat-8); color: var(--heat-ink-dark); }
.mapcard { background: linear-gradient(170deg, var(--panel-2), var(--panel) 60%); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mapcard-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px dashed var(--line); }
.mapcard-head::before { content: ""; flex: none; width: 22px; height: 11px; transform: var(--skew); background: linear-gradient(var(--red), var(--red)) 0 0 / 100% 3px no-repeat, linear-gradient(var(--red), var(--red)) 0 4px / 76% 3px no-repeat, linear-gradient(var(--red), var(--red)) 0 8px / 52% 3px no-repeat; }
.mapcard-head h3 { font-size: 15px; }
.mapcard-head .unit { margin-left: auto; font: 12px var(--font-mono); color: var(--ink-dim); }
/* lienzo: rejilla con canal para el eje Y a la izquierda y el eje X debajo; sirve para una tabla 2D o para un canvas 3D */
.map-canvas { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 30px; min-height: 260px; background: var(--bg); }
.map-canvas .map-plot { grid-column: 2; grid-row: 1; overflow: auto; }
.map-canvas .map-axis-y { grid-column: 1; grid-row: 1; padding: 6px 8px; text-align: right; font: 11px var(--font-mono); color: var(--map-axis); border-right: 1px solid var(--line-2); }
.map-canvas .map-axis-x { grid-column: 2; grid-row: 2; padding: 6px 8px; font: 11px var(--font-mono); color: var(--map-axis); border-top: 1px solid var(--line-2); }
.map-canvas.is3d { min-height: 360px; background: radial-gradient(ellipse at 50% 90%, rgba(229, 32, 46, .08), transparent 70%), var(--bg); }
.map-cell { min-width: 44px; padding: 4px 6px; text-align: center; font: 11px var(--font-mono); border: 1px solid var(--map-grid); }
.map-cell:focus-visible, .map-cell.cur { outline: 2px solid var(--map-cursor); outline-offset: -2px; }
.map-legend { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px dashed var(--line); font: 11px var(--font-mono); color: var(--ink-dim); }
.map-legend .ramp { flex: 1; height: 8px; border-radius: 1px; background: linear-gradient(90deg, var(--heat-0), var(--heat-1), var(--heat-2), var(--heat-3), var(--heat-4), var(--heat-5), var(--heat-6), var(--heat-7), var(--heat-8)); }
.map-legend .ramp.diff { background: linear-gradient(90deg, var(--diff-neg-3), var(--diff-neg-1), var(--diff-zero), var(--diff-pos-1), var(--diff-pos-3)); }
.sol-runs .run-acts .btn.primary { flex-basis: 100%; }
@media (max-width: 1320px) { .adm-tbl th:nth-child(5), .adm-tbl tr.urow td:nth-child(5) { display: none; } }
.adm-form > .grid2 { margin-bottom: 4px; }
.info.one { grid-template-columns: minmax(8rem, max-content) 1fr; }
.pform.pw { max-width: 460px; }
dialog.confirm { position: fixed; overflow: visible; padding: 26px 26px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
dialog.confirm::before { content: ""; position: absolute; top: 0; left: 26px; width: 56px; height: 4px; background: var(--red); transform: var(--skew); }
dialog.confirm[open] { animation: nt-rise .25s var(--ease); }
dialog.confirm .btn.danger { background: var(--red-dim); color: #fff; }
dialog.confirm .btn.danger:hover { background: var(--red); }

/* movil: historial y usuarios pasan de tabla a filas apiladas (sin scroll horizontal) */
@media (max-width: 640px) {
  .vt .tablewrap { overflow-x: visible; border: 0; background: none; }
  .vt .tbl, .vt .tbl tbody { display: block; }
  .vt .tbl thead { display: none; }
  .vt .tbl tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 10px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); }
  .vt .tbl tbody tr td { padding: 0; border: 0; box-shadow: none; background: none; }
  .vt .tbl tbody tr.k-original { border-left-color: #2f8f58; }
  .vt .tbl tbody tr.k-multimapa, .vt .tbl tbody tr.k-nls { border-left-color: var(--amber); }
  .vt .tbl tbody tr.hl { border-color: var(--red); border-left-color: var(--red); background: rgba(229, 32, 46, .14); }
  .vt .tbl tbody tr.hl td { border: 0; animation: none; background: none; }
  .vt .tbl td.mono { white-space: nowrap; text-align: right; }
  .vt .tbl td.acts { grid-column: 1 / -1; text-align: left; }
  .vt .tbl td.acts .ib { margin: 0 8px 0 0; }

  .adm-tbl, .adm-tbl tbody { display: block; }
  .tablewrap:has(.adm-tbl) { overflow-x: visible; }
  .adm-tbl thead { display: none; }
  .adm-tbl tr.urow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  .adm-tbl tr.urow td { padding: 0; border: 0; box-shadow: none; background: none; }
  .adm-tbl tr.urow td:nth-child(1), .adm-tbl tr.urow td:nth-child(6), .adm-tbl tr.urow td:nth-child(7) { grid-column: 1 / -1; }
  .adm-tbl tr.urow td:nth-child(2) { grid-column: 1; }
  .adm-tbl tr.urow td:nth-child(3) { grid-column: 2; }
  .adm-tbl tr.urow td:nth-child(6) { order: 1; }
  .adm-tbl tr.urow .acts-row { justify-content: flex-start; }
  .adm-tbl tr.adm-edit:not([hidden]) { display: block; }
  .adm-tbl tbody tr.adm-edit td { display: block; padding: 12px; }
  .form-sec { padding: 12px 12px 2px; }
}
@media (max-width: 640px) {
  .vt .tbl tbody tr td, .vt .tbl tbody tr td:first-child, .vt .tbl tbody tr td:last-child { box-shadow: none !important; }
  .adm-tbl tr.urow td { background: none !important; }
  .adm-tbl tr.urow:has(+ tr.adm-edit:not([hidden])) { background: rgba(242, 167, 27, .06); }
}

/* visor de mapas (mini WinOLS) */
.mv { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.mv-side { position: sticky; top: 12px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; gap: 8px; }
.mv-list { overflow: auto; display: grid; gap: 2px; max-height: 60vh; }
.mv-item { display: flex; justify-content: space-between; gap: 8px; text-align: left; background: transparent; border: 1px solid transparent; color: var(--ink); padding: 6px 8px; border-radius: var(--radius); cursor: pointer; font: 12px var(--font-mono); }
.mv-item:hover { background: var(--panel-2); }
.mv-desc { margin: 0 0 6px; font-size: 12px; color: var(--muted, #9aa); line-height: 1.35; }
.mv-item { flex-wrap: wrap; }
.mv-item .mv-d { display: none; flex: 1 0 100%; font-size: 11px; font-weight: 400; color: var(--muted, #9aa); line-height: 1.3; text-align: left; }
.mv-item.on .mv-d { display: block; }
.mv-chg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 6px; font-size: 12px; }
.mv-chg-bar select { flex: 1 1 130px; min-width: 0; max-width: 100%; padding: 3px 6px; font-size: 12px; }
.mv-chg-bar .btn.sm { padding: 2px 7px; min-height: 0; line-height: 1.2; }
.mv-chg-only { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.mv-chg-n { color: var(--amber); font-weight: 600; white-space: nowrap; }
.mv-chg { margin-left: 6px; font: 600 11px var(--mono, monospace); padding: 1px 6px; border-radius: 9px; background: var(--amber); color: #111; flex: none; }
.mv-item.chg b { color: var(--amber); }
.mv-qa { margin-left: 6px; font: 700 11px var(--mono, monospace); border-radius: 50%; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mv-qa.e { background: var(--red); color: #fff; }
.mv-qa.w { border: 1px solid var(--amber); color: var(--amber); }
.mv-item.on { border-color: var(--red); background: var(--panel-2); }
.mv-ctl { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0 12px; align-items: end; }
.mv-tabs { display: flex; gap: 6px; margin: 4px 0 12px; }
.mv-tabs button[aria-selected="true"] { border-color: var(--red); color: var(--ink); }
.mv-scroll { overflow: auto; max-width: 100%; }
.mtab { border-collapse: collapse; }
.mtab th { font: 11px var(--font-mono); color: var(--ink-dim); padding: 3px 6px; text-align: right; white-space: nowrap; }
.mtab .map-cell.dz { color: var(--ink-mute); background: var(--panel); }
.mv-stats { margin-bottom: 8px; }
.mv-3d { width: 100%; max-width: 760px; height: auto; background: radial-gradient(ellipse at 50% 90%, rgba(229, 32, 46, .08), transparent 70%), var(--bg); border: 1px solid var(--line); border-radius: var(--radius); touch-action: none; cursor: grab; }
@media (max-width: 900px) { .mv { grid-template-columns: 1fr; } .mv-side { position: static; max-height: none; } .mv-list { max-height: 220px; } }

.mv-pack { margin-top: 16px; }
.mv-ops { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.mv-ops li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px; }
.mv-packres { margin-top: 12px; display: grid; gap: 10px; }

.mv-folder { border-top: 1px solid var(--line); padding: 4px 0; }
.mv-folder > summary { cursor: pointer; font: 600 12px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); padding: 4px 2px; }
.mv-folder[open] > summary { color: var(--ink); }
.mv-name { margin-top: 14px; }
.btn.on { border-color: var(--red); color: var(--ink); background: var(--red-dim); }

dialog.mv-cfg { width: min(560px, calc(100vw - 32px)); max-width: none; }
dialog.mv-cfg .grid2 { margin: 12px 0; }


/* tabla de mapas moderna: celdas separadas, esquinas redondeadas, cabeceras fijas y zoom al pasar el raton */
.mv-scroll { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 6px; max-height: 70vh; }
.mtab { border-collapse: separate; border-spacing: 2px; }
.mtab .map-cell { border: 0; border-radius: 4px; min-width: 52px; padding: 6px 8px; font: 600 12px var(--font-mono); transition: transform .08s ease, box-shadow .08s ease; }
.mtab .map-cell:hover { transform: scale(1.08); box-shadow: 0 0 0 2px var(--ink); position: relative; z-index: 1; }
.mtab thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); border-radius: 4px; padding: 6px 8px; color: var(--amber); }
.mtab tbody th { position: sticky; left: 0; z-index: 1; background: var(--panel); border-radius: 4px; padding: 6px 8px; color: var(--amber); }
.map-legend .ramp { height: 10px; border-radius: 5px; }
@media (prefers-reduced-motion: reduce) { .mtab .map-cell { transition: none; } .mtab .map-cell:hover { transform: none; } }

.mtab thead th.mv-corner { font: 600 11px var(--font-body, inherit); text-align: left; white-space: nowrap; line-height: 1.5; }

details.mv-cb > summary { font-weight: 700; color: var(--amber); padding: 6px 0; cursor: pointer; }
details.mv-cb { border-left: 2px solid var(--line); padding-left: 8px; margin-bottom: 10px; }

/* barra de herramientas del visor (estilo WinOLS / StageX): grupos compactos */
.mv-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 8px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.mv-grp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mv-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.mv-seg-b { background: transparent; color: var(--ink-soft, inherit); border: 0; padding: 5px 10px; font: inherit; cursor: pointer; }
.mv-seg-b + .mv-seg-b { border-left: 1px solid var(--line); }
.mv-seg-b[aria-pressed="true"] { background: var(--amber); color: #0d0e10; font-weight: 700; }
.mv-pop { position: relative; }
.mv-pop > summary { list-style: none; cursor: pointer; }
.mv-pop > summary::-webkit-details-marker { display: none; }
.mv-popbody { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 240px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); display: grid; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.mv-edit { padding-left: 14px; border-left: 1px solid var(--line); }
.mv-amt { width: 90px; }
.mv-warn { margin: 0 0 10px; padding: 8px 12px; border-radius: 6px; background: rgba(224,160,48,.15); border: 1px solid var(--amber); }
.mv-status { margin-top: 8px; padding: 6px 10px; border-radius: 6px; background: var(--panel); min-height: 1.6em; }
.mtab .map-cell { cursor: cell; user-select: none; }
.mtab .map-cell.sel { outline: 2px solid var(--ink); outline-offset: -2px; }
.mtab .map-cell.cur { outline: 3px solid var(--amber); outline-offset: -3px; z-index: 1; position: relative; }
.mtab .map-cell.dirty { box-shadow: inset 0 0 0 2px #e5484d; }

.mv-checks { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.mv-checks li { padding: 6px 10px; border-radius: 6px; background: var(--panel); border-left: 3px solid var(--line); font-size: .92rem; }
.mv-checks .chk-ok { border-left-color: #3fb27f; } .mv-checks .chk-warn { border-left-color: var(--amber); } .mv-checks .chk-fail { border-left-color: #e5484d; }
.mx-supported { color: #3fb27f; font-weight: 600; } .mx-beta { color: var(--amber); font-weight: 600; } .mx-experimental { color: var(--amber); }
.mx-planned { color: var(--ink-mute, #8b8f98); font-style: italic; } .mx-none { color: var(--ink-mute, #8b8f98); }

.chip.pw { margin-left: 8px; background: transparent; border: 1px solid var(--amber); color: var(--amber); font-variant-numeric: tabular-nums; }

.mv-s1status { margin: 12px 0; padding: 10px 14px; border-radius: 8px; background: var(--panel); border-left: 4px solid var(--line); }
.mv-s1status.ok { border-left-color: #3fb27f; } .mv-s1status.bad { border-left-color: #e5484d; }
.mv-s1 details { margin-top: 12px; } .mv-s1 .row { margin-top: 8px; }

.ib.off { opacity: .4; filter: grayscale(1); cursor: pointer; }
.ib.off:hover { opacity: .75; }

.chip.ck { margin-left: 8px; background: transparent; border: 1px solid var(--line); }
.chip.ck-ok { border-color: #3fb27f; color: #3fb27f; } .chip.ck-fail { border-color: #e5484d; color: #e5484d; }
.chip.ck-unknown, .chip.ck-off { color: var(--ink-mute, #8b8f98); }

button.chip.ck-fail { cursor: pointer; font: inherit; } button.chip.ck-fail:hover { background: rgba(229,72,77,.12); }

/* Modo Sencillo: lo tecnico se oculta (se marca con .adv en la interfaz) */
html[data-mode="simple"] .adv { display: none !important; }

/* ---- Visor con ventanas (PC): espacio de trabajo con mapas flotantes que se mueven y cambian de tamano, como WinOLS y ZedSuite ---- */
.mv-multi .mv-main { display: flex; flex-direction: column; min-width: 0; }
.mv-ws-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.mv-ws-tabs { display: flex; gap: 4px; flex: 1 1 240px; min-width: 0; overflow-x: auto; }
.mv-ws-tab { border: 1px solid var(--line, #3a3d44); background: transparent; color: inherit; padding: 4px 10px; border-radius: 6px 6px 0 0; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.mv-ws-tab[aria-selected="true"] { background: var(--accent-soft, rgba(255, 90, 31, .18)); border-color: var(--accent, #ff5a1f); }
.mv-ws-btns { display: flex; gap: 6px; }
.mv-ws-area { position: relative; flex: 1 1 auto; height: calc(100vh - 290px); min-height: 440px; overflow: hidden; border: 1px solid var(--line, #3a3d44); border-radius: 8px;
  background: repeating-linear-gradient(45deg, transparent 0 14px, rgba(128, 128, 140, .05) 14px 28px); }
.mv-win { position: absolute; display: flex; flex-direction: column; min-width: 280px; min-height: 140px; resize: both; overflow: hidden; background: var(--panel, #1a1c20);
  border: 1px solid var(--line, #3a3d44); border-radius: 8px; box-shadow: 0 6px 22px rgba(0, 0, 0, .35); }
.mv-win.on { border-color: var(--accent, #ff5a1f); }
.mv-win.min { height: 34px !important; min-height: 0; resize: none; }
.mv-win.min .mv-win-b { display: none; }
.mv-win-h { display: flex; align-items: center; gap: 6px; padding: 5px 8px; cursor: move; user-select: none; background: rgba(128, 128, 140, .14); flex: 0 0 auto; touch-action: none; }
.mv-win.on .mv-win-h { background: var(--accent-soft, rgba(255, 90, 31, .22)); }
.mv-win-t { flex: 1; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-win-b { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.mv-win-b .mv-view { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.mv-win-b .mv-bar { flex: 0 0 auto; max-height: 92px; overflow: auto; }
.mv-win-b .mv-out { flex: 1 1 auto; min-height: 0; overflow: auto; }
.mv-win-b .mv-scroll { max-height: none; overflow: visible; }
.mv-win-b .mv-3d { max-width: none; }
@media (max-width: 820px) { .mv-ws-bar, .mv-ws-tabs { display: none; } }

/* ---- Espacio de trabajo mas grande, herramientas pequenas, menu de configuracion y menu contextual de ventanas ---- */
.main:has(.mv) { max-width: none; padding-top: 18px; padding-left: clamp(10px, 1.4vw, 22px); padding-right: clamp(10px, 1.4vw, 22px); }
.mv.mv-multi { grid-template-columns: 230px minmax(0, 1fr); gap: 10px; }
.mv-ws-area { height: calc(100vh - 215px); min-height: 460px; }
.mv-tools { display: inline-flex; align-items: center; gap: 4px; }
.mv-tool, .mv-win-h .mv-tools .btn { padding: 2px 8px; font-size: 12px; min-height: 0; line-height: 1.5; }
.mv-win-h .mv-tools { margin-left: auto; }
.mv-win-h .mv-win-s { display: none; }
.mv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 3px 6px; max-height: none; overflow: visible; }
.mv-slot:empty { display: none; }
.mv-win-b .mv-bar { max-height: none; overflow: visible; }
.mv-cfgpop { position: relative; }
.mv-cfgpop > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.mv-cfgpop .mv-cfgbody { position: fixed; z-index: 70; min-width: 300px; max-width: 360px; max-height: 70vh; overflow: auto; display: grid; gap: 8px; padding: 12px; background: var(--panel, #1a1c20);
  border: 1px solid var(--line, #3a3d44); border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
.mv-ctx { position: fixed; z-index: 80; min-width: 210px; display: grid; background: var(--panel, #1a1c20); border: 1px solid var(--line, #3a3d44); border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, .45); padding: 4px; }
.mv-ctx button { text-align: left; background: transparent; color: inherit; border: 0; padding: 7px 10px; border-radius: 5px; font: inherit; font-size: 13px; cursor: pointer; }
.mv-ctx button:hover, .mv-ctx button:focus-visible { background: var(--accent-soft, rgba(255, 90, 31, .22)); outline: none; }
.mv-mode { margin-left: auto; }
.mv-single .mv-bar { padding: 4px 0; }

/* La tabla de datos se adapta al tamano de la ventana (variable --fs calculada en maps.js) antes de dar scroll */
.mtab { width: 100%; }
.mtab .map-cell, .mtab th { font-size: var(--fs, 12px); }
.mtab .map-cell { min-width: 0; padding: calc(var(--fs, 12px) * .42) calc(var(--fs, 12px) * .5); text-align: center; }
.mtab thead th, .mtab tbody th { padding: calc(var(--fs, 12px) * .42) calc(var(--fs, 12px) * .5); }

.cov-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin: .8rem 0; } .cov-tile { background: var(--panel-2, rgba(255,255,255,.04)); border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 8px; padding: .6rem .7rem; display: flex; flex-direction: column; gap: .15rem; } .cov-tile b { font-size: 1.6rem; font-family: var(--mono, 'JetBrains Mono', monospace); }
.cov-log { margin-top: 1rem; } .cov-log ul { margin: .4rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; }

/* Panel de cobertura por ECU: tabla con scroll horizontal y primera columna fija en escritorio; en movil, una tarjeta por ECU */
.cov-tbl { min-width: 640px; } .cov-tbl th, .cov-tbl td { white-space: nowrap; text-align: left; } .cov-tbl th:last-child { text-align: left; }
.cov-tbl tbody th[scope=row] { position: sticky; left: 0; background: var(--bg-2); font-weight: 600; z-index: 1; }
.cov-tbl td.mx-none { text-align: center; }
@media (max-width: 640px) {
  .cov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cov-tile b { font-size: 1.35rem; }
  .cov-log li { overflow-wrap: anywhere; }
  .tablewrap:has(.cov-tbl) { overflow-x: visible; border: 0; background: none; }
  .cov-tbl { min-width: 0; display: block; } .cov-tbl thead { display: none; } .cov-tbl tbody { display: grid; gap: 10px; }
  .cov-tbl tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
  .cov-tbl tbody th[scope=row] { grid-column: 1 / -1; position: static; padding: 0 0 6px; border-bottom: 1px solid var(--line); background: none; }
  .cov-tbl tbody td { display: flex; flex-direction: column; gap: 1px; padding: 0; border: 0; box-shadow: none; white-space: normal; text-align: left; font-size: 13px; }
  .cov-tbl tbody td::before { content: attr(data-label); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
}

.mx-info { color: var(--ink-mute, #8b8f98); }

.mv-comp { margin-top: 12px; }
.mv-comp h3 { margin: 8px 0 4px; font-size: 14px; }
.mv-comp-card { border-top: 1px solid var(--line, #333); padding: 8px 0; }
.mv-comp-card .row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }

.mv-prep { display: grid; gap: 8px; margin: 8px 0; }
.mv-prep-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 8px; border: 1px solid var(--line, #333); border-radius: 6px; }
.mv-prep-t { display: inline-flex; align-items: center; gap: 6px; min-width: 160px; }
.mv-prep-o select, .mv-prep-o input { max-width: 100%; }

.mv-tool.on { border-color: var(--amber); color: var(--amber); }

/* seleccion multiple de proyectos */
.selbox { flex: none; width: 22px; height: 22px; border: 1.5px solid var(--line); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: transparent; background: var(--panel); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.selbox:hover, .selbox:focus-visible { border-color: var(--ink-dim); }
.selbox.on { background: var(--red-dim); border-color: var(--red); color: #fff; }
.card.picked { border-color: var(--red); }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); position: sticky; top: 8px; z-index: 5; }
.selbar[hidden] { display: none; }
.selbar b { margin-right: auto; }

/* borrado multiple: modo con boton pequeno arriba */
.ph-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.btn.sm { padding: 6px 12px; font-size: 13px; min-height: 0; }
.btn.active { border-color: var(--red); color: var(--red-text); }
.cards.multi .card { cursor: pointer; user-select: none; }
.cards.multi .card.picked { border-color: var(--red); box-shadow: inset 0 0 0 2px var(--red); background: linear-gradient(170deg, var(--red-dim), var(--panel) 70%); }

/* estadisticas de uso */
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 16px 0; }
.an-grid .panel { margin: 0; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 72px; margin: 10px 0 4px; }
.spark i { flex: 1; min-height: 2px; background: var(--red); border-radius: 2px 2px 0 0; opacity: .85; }
.spark-ax { display: flex; justify-content: space-between; }

/* landing de presentacion (indexable): se muestra solo sin sesion y sin ruta */
.lp { max-width: 1080px; margin: 0 auto; padding: 0 20px 48px; color: var(--ink); }
.lp a:not(.btn) { color: inherit; }
.lp-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: Oswald, sans-serif; font-weight: 700; letter-spacing: .04em; }
.lp-brand b { color: var(--red); }
.lp-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.lp-nav a:not(.btn) { text-decoration: none; color: var(--ink-dim); font-size: 14px; }
.lp-nav a:not(.btn):hover { color: var(--ink); }
.lp-hero { padding: 56px 0 36px; max-width: 820px; }
.lp-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--red-text); margin: 0 0 12px; }
.lp-hero h1 { font-family: Oswald, sans-serif; font-size: clamp(28px, 5vw, 46px); line-height: 1.1; margin: 0 0 18px; }
.lp-lead { font-size: 18px; line-height: 1.55; color: var(--ink-dim); margin: 0 0 24px; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.lp-note { font-size: 13px; color: var(--ink-mute); margin: 0; }
.lp-sec { padding: 36px 0 8px; }
.lp-sec h2 { font-family: Oswald, sans-serif; font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 16px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.lp-grid article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.lp-grid h3 { margin: 0 0 8px; font-size: 17px; }
.lp-grid p { margin: 0; color: var(--ink-dim); line-height: 1.5; font-size: 15px; }
.lp-tbl { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 15px; }
.lp-tbl th, .lp-tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.lp-tbl thead th { color: var(--ink-dim); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.lp-steps { padding-left: 22px; line-height: 1.7; color: var(--ink-dim); }
.lp-steps b { color: var(--ink); }
.lp-access { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 28px; }
.lp-access ul { line-height: 1.8; color: var(--ink-dim); }
.lp details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.lp summary { cursor: pointer; font-weight: 600; }
.lp details p { color: var(--ink-dim); line-height: 1.55; margin: 8px 0 0; }
.lp-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-dim); font-size: 14px; }
.lp-small { font-size: 12px; color: var(--ink-mute); }

.lp { scroll-behavior: smooth; }
html:has(.lp) { scroll-behavior: smooth; }
.lp-sec { scroll-margin-top: 16px; }
.lp-nav a:focus-visible, .lp a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { html:has(.lp) { scroll-behavior: auto; } .lp { scroll-behavior: auto; } }
