/* Sublima Craft · editor como Illustrator, en gris neutro. Las normas de prueba de color en pantalla (ISO 12646) piden
   un entorno gris sin tinte alrededor de la imagen: toda la interfaz es R = G = B y el color solo aparece en el diseño,
   en la selección y en los avisos. Tipografía Geist, la de la familia Misión 50mm. */

@font-face { font-family: 'Geist'; src: url('../fonts/Geist-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('../fonts/GeistMono-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --mesa: #1e1e1e; --fondo: #1e1e1e;
  --barra: #262626; --hoja: #2b2b2b; --hoja-2: #333333; --hoja-3: #474747;
  --campo: #1f1f1f; --campo-hover: #3a3a3a; --borde-campo: #3f3f3f;
  --linea: #3d3d3d; --linea-suave: #343434; --corte: #181818;
  --texto: #ececec; --suave: #a8a8a8; --tenue: #7a7a7a;
  --negro: #ececec; --negro-texto: #141414;
  --acento: #4b9bff; --acento-texto: #6eaeff; --acento-relleno: #2f74e0;
  --tinte: rgba(75, 155, 255, .12); --tinte-2: rgba(75, 155, 255, .22);
  --ok: #4ade80; --ok-fondo: rgba(74, 222, 128, .12);
  --aviso: #facc15; --aviso-fondo: rgba(250, 204, 21, .12);
  --error: #f87171; --error-fondo: rgba(248, 113, 113, .12); --error-borde: rgba(248, 113, 113, .3);
  --gama: #00e6ff; --papel: #ffffff;
  --sombra: 0 1px 2px rgba(0, 0, 0, .35);
  --sombra-alta: 0 12px 32px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35);
  --r-campo: 6px; --r-boton: 7px; --r-tarjeta: 10px; --r-hoja: 14px;
  --control: 44px; --fila: 44px; --letra: 15px; --letra-campo: 16px; --letra-panel: 14px;
  --regla-fondo: #262626; --regla-linea: #555555; --regla-texto: #9a9a9a;
  --curva-salida: cubic-bezier(0.23, 1, 0.32, 1); --curva-cajon: cubic-bezier(0.32, 0.72, 0, 1);
}
/* Con ratón y pantalla de computadora, controles densos como en Illustrator. */
@media (pointer: fine) and (min-width: 701px) {
  :root { --control: 30px; --fila: 32px; --letra: 13px; --letra-campo: 13px; --letra-panel: 12.5px; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: var(--letra); line-height: 1.45; color: var(--texto); background: var(--mesa); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 750; letter-spacing: -0.03em; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
a { color: var(--acento-texto); }
kbd { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11.5px; color: var(--tenue); }
.num, .cifra { font-variant-numeric: tabular-nums; }
.mono { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 12px; }
.suave { color: var(--suave); }
.oculto { display: none !important; }
[hidden] { display: none !important; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 1px; }
svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.chico { width: 15px; height: 15px; }

/* ================= Armazón del editor ================= */

.ed {
  height: 100dvh; display: grid; overflow: hidden; background: var(--mesa);
  grid-template-columns: 44px minmax(0, 1fr) 300px;
  grid-template-rows: 40px auto 36px minmax(0, 1fr) 26px;
  grid-template-areas: "app app app" "aviso aviso aviso" "opc opc opc" "her cen dock" "est est est";
}
.ed[data-tipo="pagina"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: 40px auto minmax(0, 1fr); grid-template-areas: "app" "aviso" "cen"; }
.ed[data-tipo="pagina"] :is(.ed-opciones, .ed-herramientas, .ed-dock, .ed-estado, .ed-riel, .ed-inferior, .ed-flotante, .ed-zoom-flotante) { display: none !important; }
.ed-riel, .ed-inferior, .ed-zoom-flotante, .ed-dock-cabeza, .ed-app .ed-solo-compacto { display: none; }
.ed-espacio { flex: 1; }

/* Barra de la aplicación */
.ed-app { grid-area: app; display: flex; align-items: center; gap: 2px; padding: 0 6px 0 10px; background: var(--barra); box-shadow: inset 0 -1px 0 var(--corte); min-width: 0; position: relative; z-index: 3; }
.ed-marca { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 0; color: var(--texto); text-decoration: none; flex: none; }
.ed-marca img { border-radius: 5px; }
.ed-marca b { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.ed-menus { display: flex; gap: 1px; }
.ed-menus button { height: 28px; padding: 0 9px; border: 0; border-radius: 5px; background: none; font-size: 13px; cursor: default; color: var(--texto); }
.ed-menus button:hover, .ed-menus button[aria-expanded="true"] { background: var(--hoja-2); }
.ed-espacios { display: flex; gap: 2px; margin-left: 14px; padding: 2px; border-radius: 8px; background: var(--campo); box-shadow: inset 0 0 0 1px var(--linea-suave); }
.ed-espacios a { display: flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 6px; color: var(--suave); text-decoration: none; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ed-espacios a:hover { color: var(--texto); }
.ed-espacios a[aria-current="page"] { background: var(--hoja-3); color: var(--texto); box-shadow: var(--sombra); }
.ed-titulo { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin-left: 14px; font-size: 12.5px; color: var(--suave); }
.ed-titulo b { display: none; }
.ed-titulo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-exportar { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 13px; border: 0; border-radius: var(--r-boton); background: var(--negro); color: var(--negro-texto); font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; flex: none; transition: transform 140ms var(--curva-salida); }
.ed-exportar:active:not([disabled]) { transform: scale(0.97); }
.ed-exportar[disabled] { opacity: .35; cursor: not-allowed; }
.ed-boton-icono { width: var(--control); height: var(--control); display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--suave); cursor: pointer; flex: none; }
.ed-boton-icono:hover { background: var(--hoja-2); color: var(--texto); }
.ed-boton-icono[aria-pressed="true"] { background: var(--hoja-3); color: var(--texto); }
.ed-aviso { grid-area: aviso; }
.ed-aviso:not(:empty) { padding: 8px 12px; background: var(--barra); }

/* Barra de opciones (lo seleccionado) */
.ed-opciones { grid-area: opc; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--hoja); box-shadow: inset 0 -1px 0 var(--corte); font-size: 12.5px; color: var(--suave); white-space: nowrap; overflow: hidden; min-width: 0; }
.ed-opciones-fin { display: flex; align-items: center; gap: 8px; }
.op-grupo { display: flex; align-items: center; gap: 6px; flex: none; }
.op-grupo:first-child { flex: 0 1 auto; min-width: 40px; overflow: hidden; }
.op-grupo + .op-grupo { padding-left: 10px; box-shadow: inset 1px 0 0 var(--linea-suave); }
.op-nombre { color: var(--texto); font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.op-mini { width: 22px; height: 22px; border-radius: 4px; background: repeating-conic-gradient(#3a3a3a 0 25%, #2b2b2b 0 50%) 0 0 / 8px 8px; display: grid; place-items: center; overflow: hidden; flex: none; }
.op-mini canvas { max-width: 100%; max-height: 100%; }
.op-campo { display: flex; align-items: center; gap: 4px; }
.op-campo input, .op-campo select { height: 24px; min-height: 0; width: 70px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--borde-campo); background: var(--campo); font-size: 12.5px; color: var(--texto); }
.op-campo select { width: auto; max-width: 170px; }
.op-campo input:focus, .op-campo select:focus { outline: none; border-color: var(--acento); }
.op-pista { color: var(--tenue); overflow: hidden; text-overflow: ellipsis; }

/* Herramientas */
.ed-herramientas { grid-area: her; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; background: var(--hoja); box-shadow: inset -1px 0 0 var(--corte); }
.ed-herramienta { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: #c4c4c4; cursor: pointer; transition: transform 120ms var(--curva-salida); }
.ed-herramienta:hover { background: var(--hoja-2); color: #fff; }
.ed-herramienta:active { transform: scale(0.94); }
.ed-herramienta[aria-pressed="true"] { background: var(--hoja-3); color: #fff; box-shadow: inset 0 0 0 1px #5a5a5a; }

/* Lienzo */
.ed-centro { grid-area: cen; position: relative; min-width: 0; min-height: 0; background: var(--mesa); }
.ed-lienzo { position: absolute; inset: 0; overflow: hidden; }
.ed[data-tipo="pagina"] .ed-lienzo { overflow-y: auto; }
.ed-area { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.ed-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ed-regla { position: absolute; z-index: 2; pointer-events: none; }
.ed-regla.h { left: 16px; top: 0; width: calc(100% - 16px); height: 16px; }
.ed-regla.v { left: 0; top: 16px; width: 16px; height: calc(100% - 16px); }
.ed-regla-esquina { position: absolute; left: 0; top: 0; width: 16px; height: 16px; background: var(--regla-fondo); z-index: 2; box-shadow: inset -1px -1px 0 var(--regla-linea); }
.sin-reglas :is(.ed-regla, .ed-regla-esquina) { display: none; }
.ed-lienzo[data-herramienta="mano"] .ed-area, .ed-lienzo.mano-temporal .ed-area { cursor: grab; }
.ed-lienzo[data-herramienta="zoom"] .ed-area { cursor: zoom-in; }
.ed-lienzo[data-herramienta="marco"] .ed-area { cursor: crosshair; }
.ed-area.arrastrando { cursor: grabbing !important; }
.ed-flotante { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4; max-width: calc(100% - 24px); }
.ed-flotante:empty { display: none; }
.ed-vacio { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; z-index: 3; }

/* Paneles acoplados */
.ed-dock { grid-area: dock; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--hoja); box-shadow: inset 1px 0 0 var(--corte); font-size: var(--letra-panel); }
.ed-grupos { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ed-grupo { display: flex; flex-direction: column; min-height: 0; flex: 3 1 0; box-shadow: inset 0 -1px 0 var(--corte); }
.ed-grupo.plegado { flex: 0 0 auto; }
.ed-pestanas { display: flex; flex: none; height: 30px; background: var(--barra); box-shadow: inset 0 -1px 0 var(--corte); overflow: hidden; }
.ed-pestanas button { padding: 0 12px; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--suave); cursor: pointer; white-space: nowrap; box-shadow: inset -1px 0 0 var(--corte); }
.ed-pestanas button:hover { color: var(--texto); }
.ed-pestanas button[aria-selected="true"] { background: var(--hoja); color: var(--texto); box-shadow: inset -1px 0 0 var(--corte), inset 0 -1px 0 var(--hoja); }
.ed-panel-cuerpo { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.ed-panel-barra { display: flex; align-items: center; gap: 6px; padding: 8px 10px; position: sticky; top: 0; z-index: 1; background: var(--hoja); box-shadow: inset 0 -1px 0 var(--linea-suave); }

/* Contenido dentro de un panel: secciones como las de Propiedades en Illustrator */
.ed-panel-cuerpo .tarjeta { background: none; box-shadow: none; border-radius: 0; padding: 12px 12px 14px; border: 0; border-bottom: 1px solid var(--linea-suave); }
.ed-panel-cuerpo .tarjeta + .tarjeta { margin-top: 0; }
.ed-panel-cuerpo h2 { font-size: 12px; font-weight: 650; letter-spacing: 0.01em; margin-bottom: 6px; }
.ed-panel-cuerpo .nota { font-size: 12px; }
.ed-panel-cuerpo .tarjeta > .nota { margin-bottom: 10px; }

/* Barra de estado */
.ed-estado { grid-area: est; display: flex; align-items: center; gap: 14px; padding: 0 8px; background: var(--barra); box-shadow: inset 0 1px 0 var(--corte); font-size: 11.5px; color: var(--suave); white-space: nowrap; overflow: hidden; min-width: 0; }
.ed-zoom { display: flex; align-items: center; gap: 1px; }
.ed-zoom .ed-boton-icono { width: 22px; height: 22px; border-radius: 4px; }
.ed-zoom-valor { min-width: 54px; height: 20px; padding: 0 6px; border: 1px solid var(--borde-campo); border-radius: 4px; background: var(--campo); font-size: 11.5px; color: var(--texto); cursor: pointer; }
.ed-estado-vista { display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; }
.ed-estado-vista b { color: var(--texto); font-weight: 600; }
.ed-estado-vista .chip { height: 18px; font-size: 11px; }
.ed-coordenadas { margin-left: auto; color: var(--tenue); }

/* Menús desplegables (sin animación: se usan muchas veces al día) */
.ed-menu { position: fixed; z-index: 60; min-width: 230px; max-width: calc(100vw - 16px); padding: 4px; border-radius: 8px; background: #2f2f2f; box-shadow: 0 0 0 1px #464646, 0 12px 32px rgba(0, 0, 0, .55); font-size: 13px; }
.ed-menu button { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%; min-height: 26px; padding: 0 10px 0 6px; border: 0; border-radius: 5px; background: none; text-align: left; color: var(--texto); cursor: default; }
.ed-menu button:hover:not([disabled]), .ed-menu button:focus-visible { background: var(--acento-relleno); color: #fff; outline: none; }
.ed-menu button:hover kbd, .ed-menu button:focus-visible kbd { color: rgba(255, 255, 255, .8); }
.ed-menu button[disabled] { color: var(--tenue); }
.ed-menu-sep { height: 1px; margin: 4px 6px; background: #454545; }
.ed-menu-marca { display: grid; place-items: center; }
.ed-menu-texto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Descripción emergente */
.ed-tip { position: fixed; left: 0; top: 0; z-index: 80; padding: 4px 8px; border-radius: 5px; background: #ececec; color: #141414; font-size: 12px; font-weight: 550; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }

/* Cajón del menú (celular y tableta) */
.ed-velo { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .5); animation: aparecer 200ms ease; }
.ed-cajon { position: absolute; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); background: var(--hoja); overflow-y: auto; padding-bottom: calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--sombra-alta); animation: cajonEntra 280ms var(--curva-cajon); outline: none; }
.ed-velo.saliendo { opacity: 0; transition: opacity 200ms ease; }
.ed-velo.saliendo .ed-cajon { transform: translateX(-100%); transition: transform 200ms var(--curva-salida); }
.ed-cajon-cabeza { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px 16px; position: sticky; top: 0; background: var(--hoja); box-shadow: inset 0 -1px 0 var(--linea-suave); }
.ed-cajon-cabeza b { flex: 1; font-size: 15px; }
.ed-cajon-cabeza img { border-radius: 6px; }
.ed-cajon-seccion { padding: 10px 8px 4px; }
.ed-cajon-seccion h3 { font-size: 11.5px; font-weight: 650; color: var(--tenue); text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px 6px; }
.ed-cajon-fila { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--texto); text-decoration: none; font-size: 15px; text-align: left; cursor: pointer; }
.ed-cajon-fila:active { background: var(--hoja-2); }
.ed-cajon-fila[aria-current="page"] { background: var(--hoja-3); }
.ed-cajon-fila[disabled] { color: var(--tenue); }
@keyframes cajonEntra { from { transform: translateX(-100%); } }

.ed-atajos { border-collapse: collapse; width: 100%; margin-top: 10px; font-size: 13px; }
.ed-atajos td { padding: 6px 4px; border-bottom: 1px solid var(--linea-suave); }
.ed-atajos td:last-child { text-align: right; }

/* ================= Tableta: paneles flotantes ================= */
@media (max-width: 1100px) {
  .ed { grid-template-columns: 48px minmax(0, 1fr) 52px; grid-template-rows: 48px auto 40px minmax(0, 1fr) 28px; grid-template-areas: "app app app" "aviso aviso aviso" "opc opc opc" "her cen riel" "est est est"; }
  .ed[data-tipo="pagina"] { grid-template-rows: 48px auto minmax(0, 1fr); }
  .ed-menus, .ed-marca b { display: none; }
  .ed-app .ed-solo-compacto { display: inline-grid; }
  .ed-espacios { margin-left: 6px; }
  .ed-riel { grid-area: riel; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; background: var(--hoja); box-shadow: inset 1px 0 0 var(--corte); }
  .ed-herramienta { width: 40px; height: 40px; }
  .ed-dock { position: fixed; z-index: 30; right: 60px; top: 104px; bottom: 36px; width: min(360px, calc(100vw - 132px)); border-radius: 12px; box-shadow: 0 0 0 1px #464646, var(--sombra-alta); overflow: hidden; }
  .ed-dock-cabeza { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 4px 0 14px; flex: none; box-shadow: inset 0 -1px 0 var(--linea-suave); }
  .ed-dock-cabeza b { flex: 1; font-size: 14px; }
  .ed-grupos { overflow: hidden; }
  .ed-grupos > .ed-panel-cuerpo { flex: 1; }
  .ed-opciones { font-size: 13px; }
  .op-campo input, .op-campo select { height: 32px; font-size: 14px; }
  .ed-flotante { left: 28px; top: 26px; transform: none; }
}
@media (max-width: 1100px) and (pointer: coarse) { .op-campo input, .op-campo select { height: 36px; font-size: 16px; } }

/* ================= Celular: hoja inferior y barra de herramientas abajo ================= */
@media (max-width: 700px), (pointer: coarse) and (max-height: 520px) {
  .ed { grid-template-columns: minmax(0, 1fr); grid-template-rows: 48px auto minmax(0, 1fr) auto; grid-template-areas: "app" "aviso" "cen" "inf"; }
  .ed[data-tipo="pagina"] { grid-template-rows: 48px auto minmax(0, 1fr); }
  .ed-opciones, .ed-herramientas, .ed-estado, .ed-riel, .ed-espacios, .ed-marca { display: none !important; }
  .ed-app { padding: 0 6px; gap: 4px; }
  .ed-titulo { margin-left: 4px; flex-direction: column; gap: 0; line-height: 1.2; flex: 1; }
  .ed-titulo b { display: block; color: var(--texto); font-size: 15px; font-weight: 650; }
  .ed-titulo span { font-size: 12px; }
  .ed-app .ed-espacio { display: none; }
  .ed-exportar { height: 36px; padding: 0 14px; font-size: 14px; }
  .ed-regla, .ed-regla-esquina { display: none; }
  .ed-inferior { grid-area: inf; display: flex; align-items: stretch; padding: 0 4px env(safe-area-inset-bottom); background: rgba(38, 38, 38, .94); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); box-shadow: inset 0 1px 0 var(--corte); position: relative; z-index: 45; }
  .ed-inferior-boton { flex: 1 1 0; min-width: 44px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: var(--suave); font-size: 10.5px; font-weight: 600; cursor: pointer; padding: 4px 2px; }
  .ed-inferior-boton span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ed-inferior-boton .ic { width: 22px; height: 22px; padding: 3px 10px; box-sizing: content-box; border-radius: 999px; transition: background 160ms ease; }
  .ed-inferior-boton[aria-pressed="true"] { color: var(--texto); }
  .ed-inferior-boton[aria-pressed="true"] .ic { background: var(--hoja-3); }
  .ed-separador { width: 1px; margin: 12px 2px; background: var(--linea); flex: none; }
  .ed-zoom-flotante { display: flex; align-items: center; gap: 2px; position: absolute; right: 10px; bottom: 10px; z-index: 4; padding: 0 0 0 12px; border-radius: 999px; background: rgba(43, 43, 43, .88); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 0 0 1px #3d3d3d, var(--sombra); font-size: 12.5px; color: var(--suave); }
  .ed-zoom-flotante .ed-boton-icono { border-radius: 999px; }
  /* La hoja: sus posiciones las mueve hoja.js con un resorte */
  .ed-dock { position: fixed; z-index: 40; left: 0; right: 0; top: auto; bottom: calc(56px + env(safe-area-inset-bottom)); width: auto; height: calc(88dvh - 104px); border-radius: var(--r-hoja) var(--r-hoja) 0 0; box-shadow: 0 0 0 1px #3d3d3d, 0 -10px 40px rgba(0, 0, 0, .5); will-change: transform; overflow: hidden; }
  .ed-dock-cabeza { display: grid; grid-template-columns: 1fr auto; grid-template-rows: 12px 40px; align-items: center; padding: 0 4px 0 16px; height: auto; touch-action: none; cursor: grab; flex: none; box-shadow: inset 0 -1px 0 var(--linea-suave); }
  .ed-asa { grid-column: 1 / -1; justify-self: center; width: 36px; height: 5px; margin-top: 6px; border-radius: 999px; background: #5a5a5a; }
  .ed-dock-cabeza b { font-size: 16px; }
  .ed-panel-cuerpo { padding-bottom: 24px; }
  .ed-flotante { top: 10px; left: 50%; transform: translateX(-50%); }
}

/* ================= Componentes (paneles, diálogos y páginas) ================= */

.tarjeta { background: var(--hoja); border-radius: var(--r-tarjeta); box-shadow: 0 0 0 1px var(--linea-suave); padding: 16px; }
.tarjeta + .tarjeta { margin-top: 12px; }
.tarjeta > h2 { margin-bottom: 4px; }
.tarjeta > .nota { margin-bottom: 12px; }
.nota { font-size: 13px; color: var(--suave); }
.campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.campo > span { font-size: 12px; font-weight: 600; color: var(--suave); }
.campo input, .campo select, .campo textarea { min-height: var(--control); padding: 0 8px; border-radius: var(--r-campo); border: 1px solid var(--borde-campo); background: var(--campo); width: 100%; font-size: var(--letra-campo); color: var(--texto); }
.campo textarea { padding: 6px 8px; min-height: 64px; resize: vertical; line-height: 1.4; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento); }
.campo .unidad { position: relative; }
.campo .unidad input { padding-right: 38px; }
.campo .unidad i { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--tenue); font-size: 12px; pointer-events: none; }
.fila { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); align-items: end; }
.fila > * { margin-top: 0 !important; }
.fila + .fila, .fila + .campo, .campo + .fila, .campo + .campo, .seg + .fila, .fila + .seg, .campo + .seg, .seg + .campo, .interruptor + .campo, .campo + .interruptor, .fila + .interruptor, .interruptor + .interruptor, .seg + .interruptor, .interruptor + .fila { margin-top: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--control); padding: 0 12px; border-radius: var(--r-boton); border: 0; cursor: pointer; font-weight: 600; font-size: var(--letra); background: var(--hoja-3); color: var(--texto); white-space: nowrap; transition: transform 140ms var(--curva-salida), background 140ms ease; }
.btn:hover { background: #525252; }
.btn:active:not([disabled]) { transform: scale(0.97); }
.btn.principal { background: var(--negro); color: var(--negro-texto); }
.btn.principal:hover { background: #ffffff; }
.btn.chico { min-height: calc(var(--control) - 4px); padding: 0 10px; font-size: calc(var(--letra) - 0.5px); }
.btn.texto { background: none; color: var(--acento-texto); padding: 0 6px; }
.btn.peligro { color: var(--error); }
.btn.ancho { width: 100%; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--tinte-2); color: var(--acento-texto); }
.btn-icono { width: var(--control); height: var(--control); border-radius: 6px; border: 0; background: none; display: inline-grid; place-items: center; cursor: pointer; color: var(--suave); flex: none; }
.btn-icono:hover { background: var(--hoja-2); color: var(--texto); }
.btn-icono[aria-pressed="true"] { color: var(--acento-texto); }

/* Segmentado */
.seg { display: flex; background: var(--campo); border-radius: var(--r-boton); padding: 2px; gap: 2px; box-shadow: inset 0 0 0 1px var(--borde-campo); }
.seg button { flex: 1 1 auto; white-space: nowrap; min-height: calc(var(--control) - 4px); border: 0; background: none; border-radius: 5px; font-weight: 600; font-size: calc(var(--letra) - 0.5px); cursor: pointer; color: var(--suave); padding: 0 8px; }
.seg button:hover { color: var(--texto); }
.seg button[aria-pressed="true"] { background: var(--hoja-3); color: var(--texto); box-shadow: var(--sombra); }
.ed-flotante .seg { background: rgba(31, 31, 31, .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 0 0 1px #3d3d3d, var(--sombra-alta); border-radius: 999px; padding: 3px; }
.ed-flotante .seg button { border-radius: 999px; min-height: 36px; padding: 0 12px; font-size: 13px; }
.ed-opciones .seg button { min-height: 24px; font-size: 12px; }

/* Opciones en lista (flujo de impresión) */
.opciones { display: grid; gap: 6px; }
.opcion { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 8px; background: var(--campo); cursor: pointer; border: 0; text-align: left; width: 100%; box-shadow: inset 0 0 0 1px var(--linea-suave); }
.opcion:hover { background: var(--hoja-2); }
.opcion[aria-checked="true"] { background: var(--tinte); box-shadow: inset 0 0 0 1.5px var(--acento); }
.opcion .punto { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--suave); flex: none; margin-top: 2px; }
.opcion[aria-checked="true"] .punto { box-shadow: inset 0 0 0 5px var(--acento); }
.opcion b { display: block; font-size: calc(var(--letra) - 0.5px); font-weight: 600; }
.opcion span { display: block; font-size: 12px; color: var(--suave); }

/* Interruptor */
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: var(--control); cursor: pointer; }
.interruptor > div b { display: block; font-weight: 600; font-size: calc(var(--letra) - 0.5px); }
.interruptor > div span { display: block; font-size: 12px; color: var(--suave); }
.sw { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: #4a4a4a; transition: background .2s ease; border: 0; cursor: pointer; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .2s var(--curva-salida); }
.sw[aria-checked="true"] { background: var(--acento-relleno); }
.sw[aria-checked="true"]::after { transform: translateX(18px); }
@media (pointer: fine) and (min-width: 701px) { .sw { width: 32px; height: 18px; } .sw::after { top: 2px; left: 2px; width: 14px; height: 14px; } .sw[aria-checked="true"]::after { transform: translateX(14px); } }

/* Etiquetas y avisos */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 11.5px; font-weight: 600; background: var(--hoja-3); color: var(--suave); white-space: nowrap; }
.chip.ok { background: var(--ok-fondo); color: var(--ok); }
.chip.aviso { background: var(--aviso-fondo); color: var(--aviso); }
.chip.error { background: var(--error-fondo); color: var(--error); }
.chip.acento { background: var(--tinte-2); color: var(--acento-texto); }
.avisos { display: grid; gap: 6px; margin-top: 10px; }
.av { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; padding: 8px 10px; border-radius: 6px; background: var(--hoja-2); }
.av .ic { width: 16px; height: 16px; margin-top: 1px; }
.av.ok .ic { color: var(--ok); } .av.info .ic { color: var(--acento-texto); }
.av.aviso { background: var(--aviso-fondo); } .av.aviso .ic { color: var(--aviso); }
.av.error { background: var(--error-fondo); box-shadow: inset 0 0 0 1px var(--error-borde); } .av.error .ic { color: var(--error); }

/* ================= Trabajo ================= */

.soltar { max-width: 440px; width: 100%; text-align: center; padding: 30px 24px; border-radius: 14px; background: var(--hoja); box-shadow: 0 0 0 1px var(--linea); border: 1.5px dashed #555; }
.soltar.encima, .encima .soltar { border-color: var(--acento); background: #24303f; }
.soltar .ic { width: 32px; height: 32px; color: var(--suave); }
.soltar h2 { margin: 10px 0 6px; }
.soltar .btn { margin-top: 16px; }
.ed-area.encima::after { content: 'Suelta los archivos para agregarlos'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(47, 116, 224, .18); box-shadow: inset 0 0 0 2px var(--acento); font-weight: 650; font-size: 16px; pointer-events: none; z-index: 5; }

.lista-disenos { display: grid; gap: 1px; padding: 4px; }
.item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 6px; background: none; cursor: pointer; border: 0; text-align: left; width: 100%; color: var(--texto); min-height: var(--fila); }
.item:hover { background: var(--hoja-2); }
.item[aria-current="true"] { background: var(--tinte-2); box-shadow: inset 2px 0 0 var(--acento); }
.item .mini { width: 40px; height: 40px; border-radius: 5px; background: repeating-conic-gradient(#3a3a3a 0 25%, #2f2f2f 0 50%) 0 0 / 10px 10px; display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 0 0 1px var(--linea); }
.item .mini canvas, .item .mini img { max-width: 100%; max-height: 100%; }
.item .nombre { font-weight: 600; font-size: calc(var(--letra) - 0.5px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .datos { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.item .cargando { font-size: 12px; color: var(--suave); }
.contador { display: inline-flex; align-items: center; background: var(--campo); border-radius: 6px; box-shadow: inset 0 0 0 1px var(--borde-campo); }
.contador button { width: calc(var(--control) - 2px); height: calc(var(--control) - 2px); border: 0; background: none; border-radius: 5px; cursor: pointer; display: grid; place-items: center; color: var(--suave); }
.contador button:hover { background: var(--hoja-2); color: var(--texto); }
.contador output { min-width: 22px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 12.5px; }

.estadisticas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.estadisticas div { background: var(--campo); border-radius: 6px; padding: 8px; box-shadow: inset 0 0 0 1px var(--linea-suave); }
.estadisticas b { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.estadisticas span { font-size: 11px; color: var(--suave); }
.estadisticas .malo b { color: var(--error); } .estadisticas .medio b { color: var(--aviso); }

.revision { display: grid; gap: 6px; margin-top: 8px; }
.fila-color { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px; border-radius: 6px; background: var(--campo); box-shadow: inset 0 0 0 1px var(--linea-suave); }
.fila-color input { grid-column: 2 / -1; }
.par-muestras { display: flex; width: 44px; height: 30px; border-radius: 5px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--linea); }
.par-muestras span { flex: 1; }
.caja-vector { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--campo); display: grid; gap: 6px; box-shadow: inset 0 0 0 1px var(--linea-suave); }
.caja-vector .seg { background: var(--hoja); }

/* ================= Páginas (Perfiles, Cartas, Guía) ================= */

.cabecera-vista { padding: 28px 28px 8px; max-width: 1000px; margin: 0 auto; }
.cabecera-vista p { color: var(--suave); margin-top: 6px; max-width: 70ch; }
.contenido-vista { padding: 14px 28px 48px; max-width: 1000px; margin: 0 auto; }
.ed[data-tipo="pagina"] { --letra: 14px; }
.rejilla { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.rejilla .tarjeta + .tarjeta { margin-top: 0; }
.perfil-tarjeta h3 { overflow-wrap: anywhere; }
.perfil-tarjeta .datos { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.perfil-tarjeta .acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
details.ficha summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
details.ficha summary::-webkit-details-marker { display: none; }
details.ficha summary .ic { transition: transform .2s; }
details.ficha[open] summary .ic { transform: rotate(180deg); }
.colores { display: grid; gap: 8px; }
.color-fila { display: grid; grid-template-columns: 44px 1fr 130px 44px; gap: 8px; align-items: center; }
.color-fila .muestra { width: 44px; height: 44px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--linea); }
.guia h2 { margin: 24px 0 8px; }
.guia h3 { margin: 16px 0 6px; }
.guia ol, .guia ul { padding-left: 20px; margin: 6px 0; }
.guia li { margin: 5px 0; }
.guia table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 8px 0; }
.guia th, .guia td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linea); vertical-align: top; }
.guia th { font-size: 12.5px; color: var(--suave); font-weight: 650; }
.tablewrap { overflow-x: auto; }
.fuentes { font-size: 13px; color: var(--suave); }
.fuentes li { overflow-wrap: anywhere; }

/* ================= Diálogos y avisos flotantes ================= */

.velo { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: grid; place-items: center; z-index: 50; padding: 16px; animation: aparecer .2s ease; }
.dialogo { background: #2f2f2f; border-radius: 14px; box-shadow: 0 0 0 1px #464646, var(--sombra-alta); width: min(540px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; animation: entrar .24s var(--curva-salida); font-size: 14px; }
.dialogo h2 { font-size: 18px; }
.dialogo .acciones { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.dialogo .btn { --control: 36px; }
/* Las partes en grande: la galería al terminar de rehacer y la vista de una parte junto a su original. */
.dialogo.grande { width: min(1280px, 100%); }
.vista-grande { display: grid; gap: 12px; margin-top: 12px; }
.vista-pareja { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vista-pareja figure, .galeria-tarjeta { margin: 0; display: grid; gap: 6px; min-width: 0; }
.vista-pareja figcaption { font-size: 12px; color: var(--letra-panel); }
.vista-caja { height: min(62dvh, 720px); display: grid; place-items: center; border-radius: 8px; overflow: hidden; padding: 12px; box-shadow: inset 0 0 0 1px var(--linea-suave); }
.vista-caja :is(canvas, img) { width: 100%; height: 100%; object-fit: contain; display: block; }
.vista-caja .bloque { width: 100%; height: 100%; border-radius: 4px; }
.vista-caja[data-fondo="cuadros"] { background: repeating-conic-gradient(#3a3a3a 0 25%, #2f2f2f 0 50%) 0 0 / 16px 16px; }
.vista-caja[data-fondo="blanco"] { background: #fff; }
.vista-caja[data-fondo="negro"] { background: #000; }
.vista-caja[data-fondo="pieza"] { background: var(--pieza, #808080); }
.vista-pie { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.galeria-abrir { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; display: block; width: 100%; }
.galeria-abrir:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.galeria-vista { height: 240px; }
.galeria-tarjeta figcaption { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-width: 0; font-size: 13px; }
.galeria-tarjeta figcaption b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.galeria-acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.comparativa.ampliable { cursor: zoom-in; }
@media (max-width: 700px) {
  .vista-pareja { grid-template-columns: 1fr; }
  .vista-caja { height: 40dvh; }
  .galeria { grid-template-columns: 1fr 1fr; }
  .galeria-vista { height: 160px; }
}
.barra { height: 6px; border-radius: 999px; background: var(--hoja-3); overflow: hidden; margin: 16px 0 8px; }
.barra i { display: block; height: 100%; background: var(--acento); width: 0; transition: width .2s ease; }
.pasos { counter-reset: paso; list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.pasos li { counter-increment: paso; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 13.5px; }
.pasos li::before { content: counter(paso); width: 24px; height: 24px; border-radius: 50%; background: var(--tinte-2); color: var(--acento-texto); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: var(--negro); color: var(--negro-texto); padding: 10px 16px; border-radius: 10px; box-shadow: var(--sombra-alta); z-index: 90; font-weight: 600; font-size: 13.5px; max-width: calc(100% - 32px); animation: subirT .25s var(--curva-salida); display: flex; align-items: center; gap: 12px; }
.toast button { border: 0; background: none; color: var(--acento-relleno); font-weight: 700; cursor: pointer; padding: 4px; }
@media (max-width: 700px) { .toast { bottom: calc(72px + env(safe-area-inset-bottom)); } }
@keyframes aparecer { from { opacity: 0; } }
@keyframes entrar { from { transform: scale(0.97); opacity: 0; } }
@keyframes subirT { from { transform: translate(-50%, 12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }

/* ================= Proceso ================= */

/* Submenú de espacios (Impresión) en la barra de la app */
.ed-espacios-grupo { display: flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px 0 12px; border: 0; border-radius: 6px; background: none; color: var(--suave); font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.ed-espacios-grupo:hover { color: var(--texto); }
.ed-espacios-grupo[aria-current="page"] { background: var(--hoja-3); color: var(--texto); box-shadow: var(--sombra); }
.tenue { color: var(--tenue); }

/* Inicio: nuevo archivo y recientes */
.inicio .contenido-vista section > h2 { font-size: 15px; margin-bottom: 10px; }
.entradas { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.entrada { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 12px; align-items: start; text-align: left; padding: 18px; border-radius: var(--r-hoja); border: 1.5px dashed var(--linea); background: var(--hoja); color: var(--texto); cursor: pointer; }
.entrada .ic { width: 28px; height: 28px; color: var(--suave); grid-row: span 2; }
.entrada b { font-size: 15px; font-weight: 650; }
.entrada span { font-size: 13px; color: var(--suave); }
button.entrada:hover, .entrada.encima { border-color: var(--acento); background: #24303f; }
button.entrada:active { transform: scale(0.99); }
.entrada[aria-disabled="true"] { border-style: solid; border-color: var(--linea-suave); background: none; cursor: default; }
.entrada[aria-disabled="true"] :is(b, .ic) { color: var(--tenue); }
.recientes { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.reciente { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; padding: 6px 6px 6px 8px; border-radius: var(--r-tarjeta); background: var(--hoja); box-shadow: 0 0 0 1px var(--linea-suave); }
.reciente:hover { box-shadow: 0 0 0 1px var(--linea); }
.reciente-abrir { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 64px; color: var(--texto); text-decoration: none; border-radius: 6px; }
.reciente-mini { width: 64px; height: 64px; border-radius: 6px; background: var(--campo); display: grid; place-items: center; overflow: hidden; color: var(--tenue); }
.reciente-mini img { width: 100%; height: 100%; object-fit: cover; }
.reciente-texto { display: grid; gap: 1px; min-width: 0; font-size: 12.5px; color: var(--suave); }
.reciente-texto b { font-size: 14px; color: var(--texto); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ruta-pasos { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 32px 0 0; counter-reset: ruta; font-size: 12.5px; color: var(--tenue); }
.ruta-pasos li { counter-increment: ruta; }
.ruta-pasos li::before { content: counter(ruta) '. '; font-variant-numeric: tabular-nums; }

/* Pasos del proceso en la barra de opciones */
.pasos-barra { flex: 0 1 auto !important; min-width: 0; overflow: hidden; }
.proceso-pasos { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; min-width: 0; }
.proceso-pasos li { display: flex; align-items: center; min-width: 0; }
.proceso-pasos li + li::before { content: ''; width: 10px; height: 1px; margin: 0 2px; background: var(--linea); flex: none; }
.paso { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 4px; border: 0; border-radius: 6px; background: none; color: var(--tenue); font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.paso:hover { background: var(--hoja-2); color: var(--texto); }
.paso-num { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: 10.5px; font-weight: 700; box-shadow: inset 0 0 0 1.5px currentColor; flex: none; }
.paso-num .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.paso small { font-size: 11px; font-weight: 600; color: var(--tenue); }
.paso.hecho { color: var(--suave); }
.paso.hecho .paso-num { background: var(--hoja-3); box-shadow: none; color: var(--texto); }
.paso.actual { color: var(--texto); background: var(--tinte); }
.paso.actual .paso-num { background: var(--acento-relleno); color: #fff; box-shadow: none; }
.paso.falla { color: var(--texto); background: var(--error-fondo); }
.paso.falla .paso-num { background: var(--error); color: #141414; box-shadow: none; }
.paso.falla small { color: var(--error); }
.proceso-pasos.vertical { flex-direction: column; align-items: stretch; gap: 4px; margin-top: 12px; }
.proceso-pasos.vertical li::before { display: none; }
.proceso-pasos.vertical .paso { width: 100%; height: 44px; font-size: 15px; padding: 0 12px; gap: 12px; }
.proceso-pasos.vertical .paso small { margin-left: auto; font-size: 13px; }
.pasos-compacto { display: none; }

/* Partes: fondos y elementos */
.partes { padding: 2px 0 8px; }
.partes-titulo { display: flex; align-items: baseline; gap: 8px; padding: 12px 12px 4px; }
.partes-titulo b { font-size: 12px; font-weight: 650; }
.partes-titulo span { font-size: 11.5px; color: var(--tenue); }
.partes-vacio { padding: 14px 12px; }
.parte { display: grid; grid-template-columns: 30px 30px 30px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: calc(var(--fila) + 8px); padding: 2px 8px 2px 4px; cursor: pointer; }
.parte:hover { background: var(--hoja-2); }
.parte[aria-selected="true"] { background: var(--tinte-2); box-shadow: inset 2px 0 0 var(--acento); }
.parte.excluida :is(.parte-texto, .capa-mini) { opacity: .4; }
.parte.faltante { grid-template-columns: 30px minmax(0, 1fr); cursor: default; padding-bottom: 6px; }
.parte.faltante .capa-ojo { color: var(--aviso); }
.parte.faltante .parte-acciones { grid-column: 2; display: flex; gap: 4px; flex-wrap: wrap; }
.parte-texto { display: grid; min-width: 0; line-height: 1.25; }
.parte-texto b { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; font-weight: 600; }
.parte-texto b span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parte-texto b i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.parte-texto > span { font-size: 11px; color: var(--tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capa-mini.vacia { background: none; box-shadow: inset 0 0 0 1px var(--linea); }

/* Propiedades de una parte */
.comparativa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.comparativa figure { margin: 0; display: grid; gap: 4px; min-width: 0; }
.comparativa-caja { aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; overflow: hidden; background: repeating-conic-gradient(#3a3a3a 0 25%, #2f2f2f 0 50%) 0 0 / 10px 10px; box-shadow: inset 0 0 0 1px var(--linea-suave); }
.comparativa-caja :is(canvas, img) { max-width: 100%; max-height: 100%; display: block; }
.comparativa-caja .bloque { width: 100%; height: 100%; }
.comparativa-caja .nota { padding: 8px; text-align: center; font-size: 11.5px; }
.comparativa figcaption { font-size: 11px; color: var(--tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.revisiones { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.revisiones li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 12px; }
.revisiones li .ic { width: 15px; height: 15px; margin-top: 1px; }
.revisiones li b { display: block; font-weight: 600; }
.revisiones li span { color: var(--suave); }
.revisiones .pasa .ic { color: var(--ok); } .revisiones .revisar .ic { color: var(--aviso); } .revisiones .no_pasa .ic { color: var(--error); }
.revisiones :is(.pendiente, .no_aplica) { opacity: .7; } .revisiones :is(.pendiente, .no_aplica) .ic { color: var(--tenue); }
.acciones-parte { display: flex; gap: 6px; flex-wrap: wrap; }
.imagenes-archivo { display: grid; gap: 4px; }
.imagen-archivo { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.imagen-archivo img { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; background: var(--campo); }
.imagen-archivo > span { display: grid; min-width: 0; font-size: 12px; }
.imagen-archivo > span span { color: var(--tenue); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tableta: los pasos solo con número, salvo el actual */
@media (max-width: 1100px) {
  .paso:not(.actual):not(.falla) span, .paso:not(.actual):not(.falla) small { display: none; }
  .paso { padding: 0 4px; height: 32px; }
  .paso-num { width: 22px; height: 22px; font-size: 11.5px; }
}
/* Celular: el paso actual flota abajo a la izquierda y abre la lista completa */
@media (max-width: 700px), (pointer: coarse) and (max-height: 520px) {
  .pasos-compacto { display: block; position: absolute; left: 10px; bottom: 10px; z-index: 4; }
  .paso-compacto { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(31, 31, 31, .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 0 0 1px #3d3d3d, var(--sombra); color: var(--texto); font-size: 13px; }
  .paso-compacto span { color: var(--tenue); font-size: 12px; }
  .paso-compacto small { color: var(--suave); font-size: 12px; }
  .paso-compacto.falla small { color: var(--error); }
  .parte { min-height: 52px; }
  .recientes { grid-template-columns: minmax(0, 1fr); }
  .inicio .cabecera-vista, .inicio .contenido-vista { padding-left: 16px; padding-right: 16px; }
}

/* Lienzo del proceso */

.mundo { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.mundo img { display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.mundo svg.cajas { position: absolute; left: 0; top: 0; overflow: visible; }
.mundo svg.armado { display: block; background: repeating-conic-gradient(#3a3a3a 0 25%, #333 0 50%) 0 0 / 10mm 10mm; }
.cajas .caja { cursor: move; }
.ed-lienzo[data-herramienta="marco"] .cajas .caja { cursor: crosshair; }
/* Las esquinas van en data-esquina, no en clases: «.sw» es el interruptor y pintaba la asa de abajo a la izquierda como uno. */
.cajas .manija[data-esquina="nw"], .cajas .manija[data-esquina="se"] { cursor: nwse-resize; } .cajas .manija[data-esquina="ne"], .cajas .manija[data-esquina="sw"] { cursor: nesw-resize; }
.cajas text { paint-order: stroke; stroke: rgba(0, 0, 0, .7); pointer-events: none; font-family: Geist, system-ui, sans-serif; }

.capas { padding: 4px 0; }
.capa { display: grid; grid-template-columns: 30px 30px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: var(--fila); padding: 0 8px 0 4px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; color: var(--texto); font-size: var(--letra-panel); }
.capa:hover { background: var(--hoja-2); }
.capa[aria-selected="true"] { background: var(--tinte-2); box-shadow: inset 2px 0 0 var(--acento); }
.capa.hija { padding-left: 20px; }
.capa.excluida .capa-nombre, .capa.excluida .capa-mini { opacity: .4; }
.capa-ojo { width: 30px; height: var(--fila); border: 0; background: none; color: var(--suave); display: grid; place-items: center; cursor: pointer; }
.capa-ojo:hover { color: var(--texto); }
.capa-mini { width: 28px; height: 28px; border-radius: 4px; background: repeating-conic-gradient(#3a3a3a 0 25%, #2f2f2f 0 50%) 0 0 / 8px 8px; box-shadow: inset 0 0 0 1px var(--linea); display: grid; place-items: center; overflow: hidden; }
.capa-mini canvas, .capa-mini img { max-width: 100%; max-height: 100%; display: block; }
.capa-mini.color { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.capa-nombre { display: flex; align-items: center; gap: 6px; min-width: 0; }
.capa-nombre span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capa-nombre i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.capa.grupo .capa-nombre span { font-weight: 650; }
.capas-vacio { padding: 14px 12px; }

.candidatas { display: grid; gap: 4px; margin-top: 8px; }
.candidata { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; padding: 8px; border: 0; border-radius: 6px; background: var(--campo); box-shadow: inset 0 0 0 1px var(--linea-suave); text-align: left; cursor: pointer; color: var(--texto); width: 100%; }
.candidata:hover { background: var(--hoja-2); }
.candidata[aria-checked="true"] { background: var(--tinte); box-shadow: inset 0 0 0 1.5px var(--acento); }
.candidata b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidata .muestra-texto { grid-column: 1 / -1; height: 30px; width: 100%; }
.candidata .muestra-texto svg { height: 30px; width: 100%; display: block; }
.parecido { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 650; }
.parecido.alto { color: var(--ok); } .parecido.medio { color: var(--aviso); } .parecido.bajo { color: var(--error); }
.resultado { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.resultado img, .resultado .bloque { width: 88px; height: 64px; object-fit: contain; border-radius: 6px; background: repeating-conic-gradient(#3a3a3a 0 25%, #2f2f2f 0 50%) 0 0 / 10px 10px; box-shadow: inset 0 0 0 1px var(--linea); }
.muestras { display: flex; gap: 4px; }
.muestras span { width: 20px; height: 20px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.lista-fuentes { display: grid; gap: 2px; }
.fila-fuente { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 10px; border-radius: 6px; background: var(--campo); min-height: var(--control); }
.fila-fuente span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acciones-armar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.costo { font-variant-numeric: tabular-nums; color: var(--suave); }
