/* foto.nonimo.ai — the tokens of nonimo.ai (src/styles/global.css), light only like the site. No web fonts: this
   origin serves nothing but the tool, and the system font keeps the first load at a few KB. */
:root {
  --acento: #2fbf9f; --acento-texto: #0f7a63; --fondo: #fbfcfb; --panel: #ffffff; --tinta: #10201c;
  --tinta-suave: #4a5c57; --borde: #e3eae7; --marca-suave: #e9f6f2; color-scheme: light;
  --manual: #94601a; --manual-fondo: #fdf3e1;
  --alto-foto: 70vh;   /* the preview's height cap: app.js sets it from the visible window (the parent's, embedded) */
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
body { background: var(--fondo); color: var(--tinta); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif; }
main { max-width: 1000px; margin: 0 auto; padding: 24px 16px 40px; }
.incrustado body { background: transparent; }
.incrustado main { padding: 0 0 4px; max-width: none; }
.incrustado h1 { display: none; }
h1 { font-size: 1.4rem; line-height: 1.25; margin-bottom: 6px; letter-spacing: -0.01em; }
.promesa { color: var(--tinta-suave); font-size: 0.95rem; margin-bottom: 16px; }
.soltar { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px; text-align: center;
  border: 1.5px dashed color-mix(in srgb, var(--acento) 55%, var(--borde)); border-radius: 14px; background: var(--panel); cursor: pointer; }
.soltar:hover, .soltar.encima { background: var(--marca-suave); border-color: var(--acento); }
.soltar:focus-within, .soltar:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.soltar input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.soltar-titulo { font-weight: 650; }
.soltar-boton { padding: 10px 20px; border-radius: 999px; background: var(--acento); color: #06231d; font-weight: 650; }
.soltar-nota { color: var(--tinta-suave); font-size: 0.85rem; }
.aviso { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--manual-fondo); color: var(--manual); font-size: 0.9rem; }
button, select, input[type=text] { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── the controls: chips on the left, the big «Tapar a mano» on the right (desktop, notebook #38) ── */
.mando { display: grid; gap: 10px 20px; margin-bottom: 10px; }
/* the two columns only with room for them: a narrow desktop window (or a narrow frame) gets one column, never chips
   squeezed one per line beside the button (measured at 375 px with a mouse) */
@media (min-width: 720px) { .escritorio .mando { grid-template-columns: minmax(0, 1fr) 230px; align-items: start; } }
.estado { min-height: 1.5em; color: var(--tinta-suave); font-size: 0.9rem; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--borde); border-radius: 999px; padding: 4px 11px; font-size: 0.86rem; background: var(--panel); }
.chip[aria-pressed=true] { background: var(--tinta); color: var(--panel); border-color: var(--tinta); }
.ayuda { color: var(--tinta-suave); font-size: 0.82rem; margin-top: 6px; }
.mando-lado { display: grid; gap: 6px; align-content: start; }
.manual { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 10px 14px;
  border: 1.5px solid var(--manual); border-radius: 12px; background: var(--manual-fondo); color: var(--manual); font-weight: 650; }
.manual svg { width: 22px; height: 22px; }
.manual[aria-pressed=true] { background: var(--manual); color: var(--panel); }
.nota { color: var(--tinta-suave); font-size: 0.8rem; line-height: 1.35; }
.acciones { display: flex; gap: 12px; flex-wrap: wrap; }
.acciones button { border: 0; background: transparent; padding: 4px 2px; font-size: 0.85rem; color: var(--acento-texto); text-decoration: underline; text-underline-offset: 2px; }

/* ── the toolbar over the picture: rotate, crop, whole photo, fit ── */
.barra { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.barra button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--borde); border-radius: 8px;
  background: var(--panel); font-size: 0.84rem; }
.barra button.icono { padding: 5px 7px; }
.barra button:hover:not(:disabled) { border-color: var(--acento); }

/* ── the picture: contained — never taller than the window (notebook #4, #31, #41) ── */
.lienzo { position: relative; min-height: 220px; border-radius: 10px; background: color-mix(in srgb, var(--borde) 45%, var(--panel)); }
.hojas { display: grid; gap: 12px; justify-items: center; padding: 8px; }
.hojas canvas { display: block; border-radius: 6px; background: var(--borde); max-width: 100%; }
.hojas.manual-on canvas { cursor: crosshair; }

/* ── «Tapar a mano» on a phone: an explicit drawing mode. Everything but the photo steps aside, the bar sits over it
   (sticky when standalone; embedded the parent scrolls the tool up) and only then does the photo take the finger:
   mano.js sets that on the canvas itself, never this stylesheet (guardian D) ── */
.dibujando .promesa, .dibujando .mando, .dibujando .barra, .dibujando .salida { display: none; }
.dibujo { position: sticky; top: 0; z-index: 2; display: grid; gap: 6px; padding: 6px 0 8px; background: var(--fondo); }
.incrustado .dibujo { background: transparent; }
.dibujo-ayuda { color: var(--manual); font-size: 0.86rem; line-height: 1.35; }
/* the bar's three buttons are mano.js's (src/lib/mano.js, shared with the PDF tool): Deshacer / Empezar de nuevo / Listo */
.dibujo-botones .mano-barra { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dibujo-botones button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 8px;
  border: 1px solid var(--borde); border-radius: 10px; background: var(--panel); font-size: 0.88rem; line-height: 1.2; }
.dibujo-botones .mano-listo { background: var(--manual); color: var(--panel); border-color: var(--manual); font-weight: 650; }
.dibujando .hojas canvas { outline: 2px solid var(--manual); outline-offset: 2px; }
.editor { display: grid; gap: 8px; justify-items: center; padding: 8px; }
.editor canvas { display: block; max-width: 100%; border-radius: 6px; cursor: grab; }
.editor-botones { display: flex; gap: 8px; }
.editor-botones button { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--borde); background: var(--panel); }
.editor-botones .primario, .descargar .primario { background: var(--acento); color: #06231d; border-color: var(--acento); font-weight: 650; }
.leyendo .mando, .leyendo .barra, .leyendo .salida { display: none; }
.leyendo .lienzo { min-height: 300px; }
.lienzo.ocupado .hojas, .lienzo.ocupado .editor { opacity: 0.35; pointer-events: none; }

/* ── «Estamos cargando tu imagen» (notebook #3): a big round spinner, in the middle, Nonimo's colours ── */
.cargando { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 16px; }
.rueda { width: 56px; height: 56px; border-radius: 50%; border: 5px solid color-mix(in srgb, var(--acento) 22%, transparent); border-top-color: var(--acento); animation: girar 0.9s linear infinite; }
.cargando-texto { font-weight: 650; font-size: 1.05rem; }
.progreso { color: var(--tinta-suave); font-size: 0.85rem; min-height: 1.3em; }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes latir { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .rueda { animation: latir 2.4s ease-in-out infinite; } }

/* ── watermark and download, one compact block under the picture ── */
.salida { display: grid; gap: 10px; margin-top: 12px; }
.estilos { display: inline-flex; border: 1px solid var(--borde); border-radius: 999px; overflow: hidden; background: var(--panel); }
.estilos button { border: 0; background: transparent; padding: 5px 11px; font-size: 0.85rem; }
.estilos button[aria-pressed=true] { background: var(--tinta); color: var(--panel); }
.marca { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.interruptor { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.marca input[type=text] { flex: 1 1 240px; padding: 8px 12px; border: 1px solid var(--borde); border-radius: 10px; background: var(--panel); }
.marca.apagada .estilos, .marca.apagada input[type=text] { opacity: 0.4; pointer-events: none; }
.descargar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.descargar select, .descargar button { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--borde); background: var(--panel); }
.descargar .discreto { border: 0; background: transparent; color: var(--acento-texto); text-decoration: underline; padding: 10px 4px; }
@media (min-width: 720px) { .escritorio .salida { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.mercados { display: grid; gap: 6px; margin-top: 12px; }
.mercados a { color: var(--acento-texto); }
.mando .aviso { margin: 0 0 8px; }
