/* Escaneá: estilos propios. La base (tokens, botones, campos, diálogos, header, pie) está en appita.css. */

/* Inicio (componente EmptyState) con zona para soltar archivos: alineado a la izquierda */
.drop { display: grid; justify-items: start; gap: 16px; padding: 40px var(--space-5); margin-top: var(--space-6); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); transition: border-color .15s, background-color .15s; }
.drop.over, body.dragging .drop { border-color: var(--app-strong); background: var(--app-soft); }
.drop h1 { font: 600 28px/34px var(--font-sans); letter-spacing: -0.025em; }
.drop p { margin: 0; font-size: 16px; line-height: 26px; color: var(--muted); max-width: 420px; }

/* Lista de archivos (componente ListRow) */
.files { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.file { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px 10px 16px; background: var(--bg); }
.file + .file { border-top: 1px solid var(--line); }
.file:hover { background: var(--surface); box-shadow: inset 2px 0 0 var(--app-strong); }
.thumb { width: 44px; height: 56px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); flex: none; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.thumb canvas, .thumb img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.file .main { flex: 1; min-width: 0; }
.file .main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 15px/22px var(--font-sans); }
.file .main span { font-size: 13px; line-height: 18px; color: var(--muted); }
.file .tools { display: flex; gap: 2px; flex: none; }
.file .tools button { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; position: relative; }
.file .tools button::after { content: ""; position: absolute; inset: -4px; }
.file .tools button:hover { background: var(--surface-2); color: var(--ink); }

/* Opciones excluyentes en lista */
.qualities { display: grid; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.q { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer; }
.q + .q { border-top: 1px solid var(--line); }
.q:hover { background: var(--surface); }
.q:has(input:checked) { background: var(--app-soft); }
.q input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--app-strong); flex: none; }
.q b { display: block; font: 500 15px/22px var(--font-sans); }
.q span { font-size: 13px; line-height: 18px; color: var(--muted); }

/* Avance y resultado */
.progress { height: 4px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; margin-top: 12px; }
.progress div { height: 100%; width: 0; background: var(--app-strong); border-radius: inherit; transition: width .2s; }
.result { display: grid; justify-items: start; gap: 4px; }
.result h2 { font: 600 20px/28px var(--font-sans); letter-spacing: -0.015em; text-transform: none; color: var(--ink); margin: 0; }
.saved-pill { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 12px; font: 500 13px/18px var(--font-sans); color: var(--success); }
.saved-pill svg.i { width: 14px; height: 14px; }
.result .stack { width: 100%; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions .btn { flex: 1; }

/* Acción principal anclada abajo, al alcance del pulgar */
.sticky-cta { position: sticky; bottom: 0; z-index: 5; padding: var(--space-4) 0 calc(var(--space-4) + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.thumb { width: 56px; height: 56px; }
.custom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.custom .field { margin: 0; }
.file .ok { display: inline-flex; align-items: center; gap: 4px; color: var(--success); }
.file .warn { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); }
.file .ok svg.i, .file .warn svg.i { width: 14px; height: 14px; }
.file .dl { flex: none; }
.file.done .main span { display: flex; }

/* Modo claro (colorido 2005): paneles blancos con borde de 2px y sombra sólida */
[data-theme="light"] .drop { background: var(--surface); border: 3px dashed var(--line-strong); border-radius: 18px; }
[data-theme="light"] .drop.over, [data-theme="light"] body.dragging .drop { border-color: var(--app-strong); background: var(--app-soft); }
[data-theme="light"] .drop h1 { font-weight: 800; letter-spacing: -0.03em; }
[data-theme="light"] .files, [data-theme="light"] .qualities { border: 2px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-card); background: var(--surface); }
[data-theme="light"] .file { background: var(--surface); }
[data-theme="light"] .file + .file, [data-theme="light"] .q + .q { border-top: 2px dashed var(--line); }
[data-theme="light"] .file:hover, [data-theme="light"] .q:hover { background: var(--app-soft); }
[data-theme="light"] .file .main b, [data-theme="light"] .q b { font-weight: 700; }
[data-theme="light"] .file .tools button { color: var(--ink); }
[data-theme="light"] .thumb { border: 2px solid var(--line-strong); }
[data-theme="light"] .progress { height: 8px; background: var(--surface-2); }
[data-theme="light"] .result h2 { font-weight: 800; color: var(--app-strong); }

/* Editor de esquinas */
.crop { position: relative; width: 100%; max-height: 70vh; margin: 8px auto 0; touch-action: none; user-select: none; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2); }
.crop canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.handle { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; padding: 0; background: none; cursor: grab; touch-action: none; }
.handle::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--app-strong); box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(0,0,0,.4); }
.handle:focus-visible::before { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--app-strong); }
.editor .row-actions .btn-lg { flex: 1; }
/* Páginas */
.pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pg { display: grid; gap: 6px; }
.pg img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); }
.pg-tools { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.pg-n { flex: 1 0 100%; font: 500 13px/18px var(--font-sans); color: var(--muted); }
.pg-tools .icon-btn { width: 36px; height: 36px; }
.pg-tools .icon-btn:disabled { opacity: .3; }
.sticky-cta .row-actions .btn-lg { flex: 1; }
[data-theme="light"] .pg img { border: 2px solid var(--line-strong); }
