/* ==========================================================================
   TALLER ATLAS — Componentes compartidos (un solo lenguaje para todas las herramientas)
   ========================================================================== */

/* ---------- Botones ---------- */
.btn {
  --h: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px; border-radius: 11px; border: 1px solid var(--border-2);
  background: rgba(10, 21, 32, .6); color: var(--text); font-size: 13.5px; font-weight: 500;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s, box-shadow .25s var(--ease), transform .2s var(--ease);
  white-space: nowrap; user-select: none;
}
.btn:hover:not(:disabled) { border-color: var(--cyan-line); color: #fff; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn--primary { --h: 54px; background: var(--cyan); border-color: var(--cyan); color: #041019; font-size: 15px; font-weight: 600; border-radius: 13px; }
.btn--primary:hover:not(:disabled) { color: #041019; background: #3ddcff; box-shadow: 0 0 0 4px rgba(0, 212, 255, .12), 0 10px 30px rgba(0, 212, 255, .22); }
.btn--gold { border-color: rgba(200, 164, 92, .55); color: var(--gold); background: transparent; }
.btn--gold:hover:not(:disabled) { background: var(--gold-soft); color: #e3c27f; border-color: var(--gold); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 400; }
.btn--ghost:hover:not(:disabled) { color: var(--text); background: var(--card); border-color: var(--border); }
.btn--danger:hover:not(:disabled) { color: var(--danger); border-color: rgba(248, 113, 113, .4); background: var(--danger-soft); }
.btn--sm { --h: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn--xs { --h: 28px; padding: 0 9px; font-size: 12px; border-radius: 8px; gap: 6px; }
.btn--block { width: 100%; }
.btn--icon { width: var(--h); padding: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.link-btn:hover { color: var(--text); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Panel lateral (Opciones de salida) ---------- */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.panel__title { font-size: 18px; font-weight: 600; letter-spacing: .005em; }
.panel__sep { height: 1px; background: var(--border); margin: 2px 0; }
.panel--plain { background: transparent; border-style: dashed; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field__label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.field__label output { color: var(--text); letter-spacing: .02em; text-transform: none; }
.field__help { font-size: 12px; color: var(--dim); line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 11px;
  background: var(--surface); border: 1px solid rgba(122, 143, 163, .26); color: var(--text); font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: rgba(0, 212, 255, .6); box-shadow: 0 0 0 3px rgba(0, 212, 255, .1); }
.input--mono { font-family: var(--mono); font-size: 13px; }
textarea.input { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8fa3' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
select.input option { background: #0a1520; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .ico { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-wrap > .input { padding-left: 38px; }
.input-wrap > .suffix { position: absolute; right: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); pointer-events: none; }

.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(5, 10, 18, .6); border: 1px solid var(--border); }
.seg button { flex: 1 1 auto; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 500; transition: background .2s, color .2s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: rgba(0, 212, 255, .14); color: var(--cyan); }

.check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; font-size: 13.5px; color: var(--text); line-height: 1.45; }
.check input { appearance: none; flex: none; width: 18px; height: 18px; margin: 1px 0 0; border-radius: 5px; border: 1px solid rgba(122, 143, 163, .45); background: var(--surface); display: grid; place-items: center; transition: all .15s; cursor: pointer; }
.check input:checked { background: var(--cyan); border-color: var(--cyan); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #041019; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.radio-list { display: flex; flex-direction: column; gap: 10px; }
.check--radio input { border-radius: 50%; }
.check--radio input:checked::after { width: 7px; height: 7px; border: 0; border-radius: 50%; background: #041019; transform: none; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--cyan) var(--p, 50%), var(--border-2) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--border-2); }
input[type=range]::-moz-range-progress { height: 3px; background: var(--cyan); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6.5px; border-radius: 50%; background: var(--text); border: 3px solid var(--cyan); box-shadow: 0 0 0 4px rgba(0, 212, 255, .12); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text); border: 3px solid var(--cyan); }
input[type=color] { width: 44px; height: 44px; padding: 4px; border-radius: 11px; border: 1px solid rgba(122, 143, 163, .26); background: var(--surface); cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 7px; }

.adv { border-top: 1px solid var(--border); padding-top: 14px; }
.adv > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary .ico { transition: transform .25s var(--ease); }
.adv[open] > summary .ico { transform: rotate(180deg); }
.adv > summary:hover { color: var(--text); }
.adv__body { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }

.rows { display: flex; flex-direction: column; gap: 10px; font-family: var(--mono); font-size: 12.5px; }
.rows div { display: flex; justify-content: space-between; gap: 12px; }
.rows span { color: var(--muted); }
.rows b { font-weight: 500; color: var(--text); text-align: right; }

/* ---------- Zona de carga ---------- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px;
  min-height: 250px; padding: 32px 24px; border-radius: 18px; cursor: pointer;
  border: 1px dashed #1f3247; background: rgba(8, 21, 34, .35);
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.dropzone:hover, .dropzone:focus-visible { border-color: rgba(0, 212, 255, .5); background: rgba(10, 21, 32, .7); }
.dropzone.is-over { border-color: var(--cyan); background: rgba(0, 212, 255, .06); transform: scale(1.005); }
.dropzone__icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-2); background: var(--bg); color: var(--cyan); margin-bottom: 4px; transition: transform .3s var(--ease); }
.dropzone:hover .dropzone__icon { transform: translateY(-2px); }
.dropzone__title { font-size: 16px; font-weight: 500; }
.dropzone__hint { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .03em; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone--compact { min-height: 0; padding: 18px; flex-direction: row; gap: 14px; text-align: left; border-radius: 14px; }
.dropzone--compact .dropzone__icon { width: 40px; height: 40px; margin: 0; }
.dropzone--compact .dropzone__title { font-size: 14px; }

/* ---------- Barra de estado de la lista ---------- */
.statusbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 2px 2px 0; }
.statusbar__info { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.statusbar__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.statusbar__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.hint-line { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }

/* ---------- Tarjetas de documento (Unir / Imágenes a PDF) ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.doc-card {
  position: relative; display: flex; flex-direction: column; padding: 14px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--border); transition: border-color .2s, box-shadow .2s, opacity .2s;
}
.doc-card:hover { border-color: rgba(0, 212, 255, .35); }
.doc-card.is-error { border-color: rgba(248, 113, 113, .45); }
.doc-card.is-locked { border-color: rgba(200, 164, 92, .45); }
.doc-card.sortable-ghost { opacity: .35; }
.doc-card.sortable-chosen { box-shadow: 0 0 0 2px rgba(0, 212, 255, .25), var(--shadow-lift); }
.doc-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.doc-card__left { display: flex; align-items: center; gap: 6px; }
.handle { color: var(--muted); cursor: grab; padding: 2px; border-radius: 6px; display: inline-grid; }
.handle:hover { color: var(--text); }
.handle:active { cursor: grabbing; }
.idx { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--bg); border: 1px solid var(--border); font-family: var(--mono); font-size: 11px; font-weight: 500; }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--muted); transition: color .2s, background .2s; }
.icon-btn:hover { color: var(--text); background: rgba(122, 143, 163, .1); }
.icon-btn--danger:hover { color: var(--danger); background: var(--danger-soft); }
.doc-card__preview { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid rgba(20, 35, 52, .6); display: grid; place-items: center; margin-bottom: 12px; }
.doc-card__preview img, .doc-card__preview canvas { width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: .94; transition: transform .35s var(--ease), opacity .2s; }
.doc-card:hover .doc-card__preview img { transform: scale(1.02); opacity: 1; }
.doc-card__name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-card__meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.doc-card__extra { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 250px; padding: 20px; border-radius: 18px; border: 1px dashed var(--border-2); background: rgba(10, 21, 32, .25);
  color: var(--text); cursor: pointer; transition: border-color .2s, background .2s;
}
.add-card:hover { border-color: rgba(0, 212, 255, .55); background: rgba(10, 21, 32, .6); }
.add-card__plus { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-2); background: var(--bg); color: var(--text); }
.add-card b { font-weight: 500; font-size: 14.5px; }
.add-card span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; border: 1px solid var(--border-2); color: var(--muted); white-space: nowrap; }
.tag--cyan { color: var(--cyan); border-color: rgba(0, 212, 255, .35); background: rgba(0, 212, 255, .07); }
.tag--gold { color: var(--gold); border-color: rgba(200, 164, 92, .45); background: var(--gold-soft); }
.tag--danger { color: var(--danger); border-color: rgba(248, 113, 113, .4); background: var(--danger-soft); }
.tag--ok { color: var(--ok); border-color: rgba(79, 209, 165, .35); background: rgba(79, 209, 165, .07); }

/* ---------- Lista de archivos (herramientas genéricas) ---------- */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 12px 11px 14px; border-radius: 13px; background: var(--card); border: 1px solid var(--border); transition: border-color .2s; }
.file-row:hover { border-color: var(--border-2); }
.file-row__icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--cyan); overflow: hidden; }
.file-row__icon img { width: 100%; height: 100%; object-fit: cover; }
.file-row__name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__state { font-family: var(--mono); font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.file-row.is-done .file-row__state { color: var(--ok); }
.file-row.is-error { border-color: rgba(248, 113, 113, .35); }
.file-row.is-error .file-row__state { color: var(--danger); }
.file-row.is-work .file-row__state { color: var(--cyan); }
.file-row__bar { grid-column: 1 / -1; height: 2px; border-radius: 2px; background: var(--border); overflow: hidden; margin-top: 2px; }
.file-row__bar i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .25s; }

/* ---------- Rejilla de páginas (organizar, dividir, rotar…) ---------- */
.page-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); position: sticky; top: 72px; z-index: 5; }
.page-toolbar__group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.pg { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 10px 9px; border-radius: 13px; background: var(--card); border: 1px solid var(--border); cursor: pointer; user-select: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.pg:hover { border-color: var(--border-2); }
.pg.is-sel { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; background: #0b1b29; }
.pg.is-new { border-style: dashed; }
.pg.sortable-ghost { opacity: .3; }
.pg__thumb { position: relative; width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; }
.pg__thumb canvas, .pg__thumb img { max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); transition: transform .3s var(--ease); }
.pg__thumb .ph { width: 70%; height: 86%; border-radius: 3px; background: linear-gradient(110deg, #0e1e2e 30%, #13283c 50%, #0e1e2e 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pg__num { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.pg.is-sel .pg__num { color: var(--cyan); }
.pg__check { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(122, 143, 163, .5); background: rgba(5, 10, 18, .8); display: grid; place-items: center; color: #041019; }
.pg.is-sel .pg__check { background: var(--cyan); border-color: var(--cyan); }
.pg__badge { position: absolute; top: 8px; right: 8px; }
.pg__actions { position: absolute; bottom: 30px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.pg:hover .pg__actions, .pg:focus-within .pg__actions { opacity: 1; }
.pg__actions .icon-btn { width: 26px; height: 26px; background: rgba(5, 10, 18, .9); border: 1px solid var(--border-2); }

/* ---------- Visor de página (censurar, editar, vista previa) ---------- */
.viewer { position: relative; border-radius: 16px; background: #050a12; border: 1px solid var(--border); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.viewer__stage { position: relative; display: grid; place-items: center; overflow: auto; max-height: 76vh; border-radius: 10px; background: repeating-conic-gradient(#08111c 0% 25%, #0a1520 0% 50%) 50% / 22px 22px; padding: 18px; }
.viewer__page { position: relative; box-shadow: 0 10px 40px rgba(0, 0, 0, .55); background: #fff; touch-action: none; }
.viewer__page canvas { display: block; }
.viewer__overlay { position: absolute; inset: 0; }
.viewer__strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.viewer__strip button { flex: none; border: 1px solid var(--border); border-radius: 8px; background: var(--card); padding: 4px; color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.viewer__strip button[aria-current="true"] { border-color: var(--cyan); color: var(--cyan); }
.mark { position: absolute; border: 1px solid var(--cyan); }
.mark--redact { background: rgba(0, 0, 0, .86); border-color: var(--danger); }
.mark--high { background: rgba(255, 214, 0, .32); border-color: transparent; }
.mark--sel { outline: 2px dashed var(--cyan); outline-offset: 2px; }
.mark__del { position: absolute; top: -11px; right: -11px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; display: grid; place-items: center; }
.ov-item { position: absolute; cursor: move; border: 1px dashed transparent; }
.ov-item:hover, .ov-item.is-sel { border-color: var(--cyan); }
.ov-item__resize { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: var(--cyan); border-radius: 3px; cursor: nwse-resize; }
.ov-text { white-space: pre; line-height: 1.15; }
.ov-note { width: 26px; height: 26px; display: grid; place-items: center; background: #ffd34d; color: #3b2d00; border-radius: 5px; }

/* ---------- Progreso ---------- */
.progress { display: flex; flex-direction: column; gap: 9px; padding: 16px; border-radius: 14px; background: rgba(5, 10, 18, .6); border: 1px solid var(--border); }
.progress__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.progress__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.progress__bar { height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; position: relative; }
.progress__bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--cyan), #7be8ff); border-radius: 3px; transition: width .3s var(--ease); box-shadow: 0 0 12px rgba(0, 212, 255, .6); }
.progress.is-indet .progress__bar i { width: 35% !important; animation: indet 1.2s var(--ease) infinite; }
@keyframes indet { from { left: -35%; } to { left: 100%; } }

/* ---------- Avisos ---------- */
.notice { display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border-radius: 12px; font-size: 13px; line-height: 1.55; border: 1px solid var(--border); background: rgba(10, 21, 32, .6); color: var(--text); }
.notice > .ico { margin-top: 2px; color: var(--cyan); }
.notice b { font-weight: 600; }
.notice--warn { border-color: rgba(200, 164, 92, .35); background: rgba(200, 164, 92, .06); }
.notice--warn > .ico { color: var(--gold); }
.notice--error { border-color: rgba(248, 113, 113, .35); background: var(--danger-soft); }
.notice--error > .ico { color: var(--danger); }
.notice--ok { border-color: rgba(79, 209, 165, .3); background: rgba(79, 209, 165, .06); }
.notice--ok > .ico { color: var(--ok); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice small { color: var(--muted); }

/* ---------- Resultado ---------- */
.result { display: flex; flex-direction: column; gap: 16px; animation: rise .5s var(--ease) both; }
.result__head { display: flex; align-items: center; gap: 12px; }
.result__seal { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--gold); border: 1px solid rgba(200, 164, 92, .5); background: var(--gold-soft); box-shadow: 0 0 18px rgba(200, 164, 92, .18); }
.result__title { font-size: 17px; font-weight: 600; }
.result__sub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.result__files { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.res-file { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.res-file__name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-file__size { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.chain { display: flex; flex-direction: column; gap: 10px; }
.chain__label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border-2); background: transparent; color: var(--text); font-size: 12.5px; transition: all .2s; }
.chip:hover { border-color: var(--cyan-line); color: var(--cyan); background: rgba(0, 212, 255, .06); }
.chip[aria-pressed="true"] { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 212, 255, .1); }
.compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.compare div { padding: 12px 10px; border-radius: 12px; border: 1px solid var(--border); background: rgba(5, 10, 18, .5); text-align: center; }
.compare span { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.compare b { display: block; font-family: var(--mono); font-size: 16px; font-weight: 500; margin-top: 5px; }
.compare .good b { color: var(--cyan); }
.compare .bad b { color: var(--gold); }

/* ---------- Tablas de vista previa / informes ---------- */
.table-wrap { overflow: auto; border-radius: 13px; border: 1px solid var(--border); max-height: 420px; background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
table.data th { position: sticky; top: 0; z-index: 1; background: #0b1826; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
table.data td.num { font-family: var(--mono); text-align: right; }
table.data tr:nth-child(even) td { background: rgba(5, 10, 18, .35); }
table.data tr.is-bad td { color: var(--danger); }
table.data th.is-x, table.data td.is-x { box-shadow: inset 0 2px 0 var(--cyan); color: var(--cyan); }
table.data th.is-y, table.data td.is-y { box-shadow: inset 0 2px 0 var(--gold); color: var(--gold); }

/* ---------- Estadísticas (inspector) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.stat span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: -.02em; margin-top: 6px; }
.stat small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12.5px; word-break: break-word; }

/* ---------- Mapa (Leaflet con estética ATLAS) ---------- */
.map { position: relative; height: 420px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--map-bg); }
.map.leaflet-container, .map .leaflet-container { background: var(--map-bg); font-family: var(--sans); }
.map .pop-k, .map .pop-folder { color: var(--muted); }
.map .pop-folder { font-size: 11px; }
.leaflet-container canvas, .leaflet-container img, .leaflet-container svg { max-width: none !important; }
.map__bar { position: absolute; z-index: 500; top: 10px; right: 10px; display: flex; gap: 6px; }
.map__bar .btn { background: rgba(5, 10, 18, .85); backdrop-filter: blur(6px); }
.map .leaflet-control-zoom a { background: rgba(5, 10, 18, .85) !important; color: var(--text) !important; border-color: var(--border) !important; }
.map .leaflet-bar { border: 1px solid var(--border) !important; box-shadow: none !important; }
.map .leaflet-control-attribution { background: rgba(5, 10, 18, .75) !important; color: var(--muted) !important; font-size: 10px !important; }
.map .leaflet-control-attribution a { color: var(--cyan) !important; }
.map .leaflet-control-scale-line { background: rgba(5, 10, 18, .7); color: var(--muted); border-color: var(--muted); font-family: var(--mono); font-size: 10px; }
.map .leaflet-popup-content-wrapper, .map .leaflet-popup-tip { background: #0a1520; color: var(--text); border: 1px solid var(--border-2); box-shadow: var(--shadow-lift); }
.map .leaflet-popup-content { font-size: 12.5px; margin: 12px 14px; max-height: 260px; overflow: auto; }
.map .leaflet-popup-content b { color: var(--cyan); font-weight: 500; }
.map .leaflet-container a.leaflet-popup-close-button { color: var(--muted); }

/* ---------- Pestañas internas ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--card); border: 1px solid var(--border); width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { padding: 8px 14px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button[aria-selected="true"] { background: rgba(0, 212, 255, .13); color: var(--cyan); }

/* ---------- Texto / diferencias ---------- */
.textview { margin: 0; padding: 16px; max-height: 460px; overflow: auto; border-radius: 13px; background: var(--card); border: 1px solid var(--border); font-family: var(--mono); font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: #c7d3df; }
.diff-del { background: rgba(248, 113, 113, .16); color: #fca5a5; text-decoration: line-through; text-decoration-color: rgba(248, 113, 113, .6); }
.diff-ins { background: rgba(0, 212, 255, .14); color: #8be9ff; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .split-2 { grid-template-columns: 1fr; } }
.card { padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); }
.card__title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list-plain li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 8px 10px; border-radius: 9px; background: rgba(5, 10, 18, .4); }
.tree { font-size: 13px; }
.tree details { margin-left: 14px; }
.tree summary { cursor: pointer; padding: 3px 0; color: var(--text); }
.tree summary span { color: var(--muted); font-family: var(--mono); font-size: 11px; margin-left: 6px; }

/* ---------- Toasts y modal ---------- */
.toasts { position: fixed; z-index: 90; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 520px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: rgba(10, 21, 32, .96); border: 1px solid var(--border-2); box-shadow: var(--shadow-lift); font-size: 13px; animation: rise .35s var(--ease) both; }
.toast .ico { color: var(--cyan); }
.toast--error { border-color: rgba(248, 113, 113, .45); }
.toast--error .ico { color: var(--danger); }
.toast--warn .ico { color: var(--gold); }
.modal-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(2, 5, 10, .72); backdrop-filter: blur(6px); animation: fade .2s both; }
.modal { width: min(520px, 100%); max-height: 88vh; overflow: auto; padding: 26px; border-radius: 20px; background: var(--card); border: 1px solid var(--border-2); box-shadow: 0 16px 48px rgba(0, 0, 0, .8), 0 0 24px rgba(0, 212, 255, .08); display: flex; flex-direction: column; gap: 16px; animation: rise .3s var(--ease) both; }
.modal--wide { width: min(880px, 100%); }
.modal__title { font-family: var(--serif); font-size: 24px; font-weight: 500; }
.modal__body { font-size: 14px; color: var(--muted); line-height: 1.6; display: flex; flex-direction: column; gap: 14px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ---------- Sesión (archivos para continuar) ---------- */
.session-list { display: flex; flex-direction: column; gap: 8px; }
.empty-note { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 0; }

/* ---------- Recortador (Cropper.js con estética ATLAS) ---------- */
.crop-stage { max-height: 70vh; border-radius: 14px; overflow: hidden; background: #050a12; border: 1px solid var(--border); }
.crop-stage img { max-width: 100%; display: block; }
.cropper-view-box { outline: 1px solid var(--cyan) !important; outline-color: rgba(0, 212, 255, .85) !important; }
.cropper-line, .cropper-point { background-color: var(--cyan) !important; }
.cropper-modal { background: #02060c !important; opacity: .72 !important; }
