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

/* Editor + vista previa: en escritorio, el QR queda al lado del formulario. */
:root { --col: 960px; }
.qr-layout { display: grid; gap: var(--space-4); padding-top: var(--space-5); }
@media (min-width: 860px) { .qr-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .qr-side { position: sticky; top: 76px; } }

/* Tipos de QR: opciones excluyentes con ícono propio */
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: var(--space-4); }
@media (min-width: 560px) { .types { grid-template-columns: repeat(6, 1fr); } }
.types button { min-height: 60px; border-radius: var(--radius-md); border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; font: 500 13px/18px var(--font-sans); display: grid; place-items: center; gap: 4px; padding: 8px 4px; }
.types button:hover { color: var(--ink); border-color: var(--line-strong); }
.types button[aria-pressed="true"] { color: var(--app-strong); border-color: var(--app-strong); background: var(--app-soft); }

/* El código va sobre blanco: así lo leen todas las cámaras */
.qr-box { background: #fff; border-radius: var(--radius-md); padding: 14px; display: grid; place-items: center; }
.qr-box svg { width: 100%; max-width: 300px; height: auto; display: block; }
.qr-box .cap { color: #111; font: 600 16px/22px var(--font-sans); text-align: center; margin-top: 6px; overflow-wrap: anywhere; }
.qr-empty { color: #5b5c66; padding: 60px 10px; font-size: 14px; line-height: 20px; }
.never { display: flex; align-items: center; gap: 6px; margin: 12px 0; font-size: 13px; line-height: 18px; color: var(--muted); }
.never svg.i { width: 14px; height: 14px; color: var(--success); }
.warn-box { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--danger); border-radius: var(--radius-md); padding: 10px 12px; margin: 8px 0; font-size: 13px; line-height: 18px; color: var(--danger); }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.colors input[type="color"] { width: 100%; height: 48px; border: 1px solid var(--control); border-radius: var(--radius-md); background: var(--surface); padding: 6px; cursor: pointer; }
.err-msg { min-height: 18px; margin: 0 0 6px; }

/* Mis QR (componente ListRow) */
.hist { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.hist li { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 8px 8px 12px; }
.hist li + li { border-top: 1px solid var(--line); }
.hist li:hover { background: var(--surface); box-shadow: inset 2px 0 0 var(--app-strong); }
.hist .mini { width: 40px; height: 40px; background: #fff; border-radius: var(--radius-sm); flex: none; display: grid; place-items: center; overflow: hidden; }
.hist .mini svg { width: 100%; height: 100%; }
.hist .main { flex: 1; min-width: 0; cursor: pointer; }
.hist .main b { display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 15px/22px var(--font-sans); }
.hist .main b svg.i { width: 16px; height: 16px; color: var(--muted); }
.hist .main span { font-size: 13px; line-height: 18px; color: var(--muted); }

#print-root { display: none; }
@media print {
  body { background: #fff; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: flex !important; flex-direction: column; align-items: center; justify-content: center; min-height: 90vh; gap: 18px; }
  #print-root svg { width: 12cm; height: 12cm; }
  #print-root p { font: 600 26pt Inter, Arial, sans-serif; color: #000; text-align: center; margin: 0; }
}

/* Modo claro (colorido 2005) */
[data-theme="light"] .types button { background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink); font-weight: 600; border-radius: 14px; }
[data-theme="light"] .types button:hover { background: var(--surface-2); }
[data-theme="light"] .types button[aria-pressed="true"] { background: var(--app-strong); border-color: var(--app-strong); color: var(--on-app); box-shadow: var(--shadow-button); }
[data-theme="light"] .qr-box { border: 2px solid var(--line-strong); }
[data-theme="light"] .colors input[type="color"] { border-width: 2px; border-radius: 12px; }
[data-theme="light"] .warn-box { border-width: 2px; background: var(--surface); }
[data-theme="light"] .hist { border: 2px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-card); background: var(--surface); }
[data-theme="light"] .hist li + li { border-top: 2px dashed var(--line); }
[data-theme="light"] .hist li:hover { background: var(--app-soft); }
[data-theme="light"] .hist .mini { border: 1px solid var(--line-strong); }
[data-theme="light"] .hist .main b { font-weight: 700; }
