/* Solos · estilo sobrio tipo cal.com: blanco, bordes finos, Cal Sans en titulares, Inter en texto
   y un único color de marca (coral "atardecer") para la acción principal y para quien se queda. */
:root {
  --brand-50: #fff4f0;
  --brand-100: #ffe4da;
  --brand-200: #ffc6b2;
  --brand-500: #ff6a45;
  --brand-600: #d9431f;   /* botones: contraste AA con texto blanco */
  --brand-700: #b5361a;
  --ink: #0f0f10;
  --ink-2: #4b4b52;
  --ink-3: #8a8a93;
  --line: #e8e8ea;
  --line-2: #f0f0f2;
  --bg: #ffffff;
  --subtle: #f7f7f8;
  --stage: #f2f2f4;
  /* escala de radios común con la app: 9 pequeños, 12 botones y paneles internos, 16 tarjetas y escenario, 20 hojas */
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --radius: var(--r-lg);
  --display: "Cal Sans", "Inter", system-ui, sans-serif;
  /* sombras comunes con la app */
  --shadow-sm: 0 1px 2px rgba(15, 15, 16, .05);
  --shadow-cta: 0 8px 24px rgba(217, 67, 31, .3);   /* resplandor coral del botón principal */
  --shadow: 0 1px 2px rgba(15, 15, 16, .04), 0 6px 24px rgba(15, 15, 16, .06);
  /* movimiento común con la app: duraciones y curvas */
  --t-fast: 120ms;     /* pulsar, resaltar */
  --t-base: 200ms;     /* conmutadores, fundidos, toasts */
  --t-slow: 320ms;     /* hojas, entrada del editor */
  --t-reveal: 700ms;   /* solo el antes/después */
  --ease-out: cubic-bezier(.22, 1, .36, 1);     /* entradas */
  --ease-in: cubic-bezier(.4, 0, 1, 1);         /* salidas */
  --ease-inout: cubic-bezier(.65, 0, .35, 1);   /* barridos y bucles */
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
  display: flex; flex-direction: column; min-height: 100vh;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* fotogramas comunes (solo opacity y transform) */
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(var(--rise, 8px)); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes pop-sm { from { opacity: 0; transform: scale(.9); } }
@keyframes leave { to { opacity: 0; transform: translateY(-8px); } }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes breathe { 50% { opacity: .6; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes bar-a { to { transform: scaleX(.6); } }
@keyframes bar-c { to { transform: scaleX(.9); } }
@keyframes bar-d { to { transform: scaleX(.7); } }

/* cabecera */
.top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line-2); background: rgba(255,255,255,.86); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 400; font-size: 22px; }
/* la marca es el icono de la app (tres personas), igual en la web, la app y la tienda */
.brand .mark { width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto; }
.spacer { flex: 1; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; }
.lang button { border: 0; background: none; padding: 4px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: background var(--t-base), color var(--t-base); }
.lang button.on { background: var(--ink); color: #fff; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--brand-600); background: var(--brand-600); color: #fff; padding: 11px 18px; border-radius: var(--r-md); font-weight: 600; font-size: 14.5px; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease-out), opacity var(--t-base); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.working:disabled { opacity: 1; cursor: progress; }
.btn.ghost { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--subtle); border-color: #d6d6da; }
.btn.small { padding: 7px 12px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn.saved, .btn.saved:hover { background: var(--ink); border-color: var(--ink); }
.btn .spinner.inline { margin: 0; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.primary-action:not(:disabled) { box-shadow: var(--shadow-cta); }

/* portada */
.hero { max-width: 760px; margin: 9vh auto 0; padding: 0 24px 56px; text-align: center; }
/* entrada escalonada, una sola vez */
.hero > * { --rise: 12px; animation: rise var(--t-slow) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
.hero > :nth-child(2) { --i: 1; } .hero > :nth-child(3) { --i: 2; } .hero > :nth-child(4) { --i: 3; }
.hero > :nth-child(5) { --i: 3; } .hero > :nth-child(6) { --i: 4; } .hero > :nth-child(7) { --i: 5; }
.hero.leaving { animation: leave var(--t-base) var(--ease-in) forwards; }
.badge-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); margin-bottom: 22px; background: var(--bg); }
.badge-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-500); }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 7vw, 68px); line-height: 1.05; letter-spacing: 0; margin: 0 0 18px; text-wrap: balance; }
.hero h1 .nw { white-space: nowrap; }
/* «randoms» va siempre en cursiva en castellano; Cal Sans no tiene cursiva, así que se inclina */
.hero h1 em { font-style: normal; display: inline-block; transform: skewX(-10deg); transform-origin: 50% 100%; padding-right: .04em; }
.hero > p { color: var(--ink-2); font-size: 18px; max-width: 540px; margin: 0 auto 32px; text-wrap: pretty; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--subtle); border: 1.5px dashed #d4d4d8; border-radius: var(--r-lg); padding: 40px 24px; cursor: pointer; color: var(--ink-3); transition: border-color var(--t-base), background var(--t-base), transform var(--t-base) var(--ease-out); }
.drop:hover, .drop.over { border-color: var(--brand-500); background: var(--brand-50); }
.drop.over { border-style: solid; transform: scale(1.01); }
.drop .icon { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand-600); margin-bottom: 10px; box-shadow: var(--shadow-sm); transition: transform var(--t-base) var(--ease-out); }
.drop.over .icon { transform: translateY(-2px); }
.drop strong { color: var(--ink); font-size: 16px; font-weight: 600; }
.drop span { font-size: 13.5px; }
.samples { margin-top: 28px; font-size: 13.5px; color: var(--ink-3); }
.sample-list { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.sample-list button { border: 1px solid var(--line); padding: 3px; border-radius: var(--r-md); overflow: hidden; cursor: pointer; width: 100px; height: 72px; background: var(--bg); transition: border-color var(--t-fast), transform var(--t-fast) var(--ease-out), opacity var(--t-base); }
@media (hover: hover) { .sample-list button:hover { border-color: var(--brand-500); transform: translateY(-2px); } }
.sample-list button:active { transform: scale(.97); }
.sample-list button.loading { border-color: var(--brand-500); opacity: .6; transform: scale(.97); }
.sample-list img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--r-sm); }

/* editor */
.editor { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; padding: 20px 24px; min-height: 0; }
.editor.enter .stage-wrap { --rise: 12px; animation: rise var(--t-slow) var(--ease-out) backwards; }
.editor.enter .panel { --rise: 12px; animation: rise var(--t-slow) var(--ease-out) 60ms backwards; }
.stage-wrap { display: flex; flex-direction: column; min-width: 0; }
.stage-bar { display: flex; align-items: center; gap: 14px; min-height: 38px; margin-bottom: 10px; }
.hint { color: var(--ink-3); font-size: 13px; }
/* conmutador Resultado / Original: la píldora blanca se desliza entre los dos */
.seg { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--subtle); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; }
.seg::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 2); border-radius: var(--r-sm); background: var(--bg); box-shadow: var(--shadow-sm); transition: transform var(--t-base) var(--ease-out); }
.seg[data-on="edit"]::before { transform: translateX(100%); }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 6px 14px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: color var(--t-base); }
.seg button.on { color: var(--ink); }
.stage { position: relative; flex: 1; min-height: 420px; background: var(--stage); border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.frame { position: relative; line-height: 0; max-width: 100%; max-height: 100%; border-radius: var(--r-md); overflow: hidden; }
.frame img { display: block; max-width: 100%; max-height: calc(100vh - 200px); user-select: none; -webkit-user-drag: none; }
/* original debajo y resultado encima: el barrido, el fundido y "mantener pulsado" son solo opacidad o recorte */
.frame .img-o { opacity: 0; transition: opacity var(--t-base) var(--ease-out); }
.frame .img-o.in { opacity: 1; }
.frame .img-r { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; transition: opacity var(--t-base) var(--ease-out); }
.frame.is-result .img-r { opacity: 1; }
.frame.is-result.peek .img-r { opacity: 0; transition-duration: var(--t-fast); }
.frame.reveal .img-r { opacity: 1; transition: none; clip-path: inset(0 100% 0 0); animation: wipe var(--t-reveal) var(--ease-inout) forwards; }
.frame svg { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; cursor: crosshair; transition: opacity var(--t-base) var(--ease-out); }
.frame.is-result svg { opacity: 0; pointer-events: none; }
.frame g { cursor: pointer; }
.frame polygon { vector-effect: non-scaling-stroke; opacity: 0; transition: opacity var(--t-base) var(--ease-out), fill-opacity var(--t-base), stroke-width var(--t-fast); }
/* dos capas por persona (contorno coral y rayado): el rayado no se puede interpolar, así que se cruzan por opacidad */
.frame polygon.k { fill: var(--brand-500); fill-opacity: .1; stroke: var(--brand-500); stroke-width: 2.5; }
.frame polygon.r { fill: url(#hatch); stroke: rgba(255,255,255,.9); stroke-width: 1.5; stroke-dasharray: 4 4; }
.frame g.keep polygon.k, .frame g.remove polygon.r { opacity: 1; }
.frame g.hot polygon.k { stroke-width: 4; fill-opacity: .25; }
.frame g.hot polygon.r { stroke-width: 3; }
.tag { position: absolute; top: 12px; z-index: 3; padding: 4px 9px; border-radius: var(--r-sm); font: 600 12px/1.3 "Inter", system-ui, sans-serif; background: rgba(15,15,16,.72); color: #fff; pointer-events: none; opacity: 0; transition: opacity var(--t-fast); }
.tag.l { left: 12px; }
.tag.t-res { background: var(--brand-600); }
.frame.is-result:not(.peek) .t-res, .frame.is-result.peek .t-orig { opacity: 1; }
.frame.is-result.reveal:not(.peek) .t-res { opacity: 0; }
.frame.is-result { cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }

/* espera: la foto sigue siendo la protagonista */
.busy-veil { position: absolute; inset: 0; z-index: 5; overflow: hidden; background: rgba(255,255,255,.35); animation: fadein var(--t-base) var(--ease-out) 250ms both; }
.busy-veil.closing { pointer-events: none; animation: fadeout var(--t-base) var(--ease-in) 60ms forwards; }
.busy-veil.err { line-height: 1.4; display: grid; place-items: center; padding: 16px; text-align: center; font-weight: 600; font-size: 14.5px; background: rgba(255,255,255,.85); animation: fadein var(--t-base) var(--ease-out) both; }
.busy-bar { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--brand-600); transform-origin: left; transform: scaleX(0); }
.busy-veil[data-kind="analyzing"] .busy-bar { animation: bar-a 6s var(--ease-out) forwards; }
.busy-veil[data-kind="cleaning"] .busy-bar { animation: bar-c 25s var(--ease-out) forwards; }
.busy-veil[data-kind="adding"] .busy-bar { animation: bar-d 3s var(--ease-out) forwards; }
/* analizando: una banda de luz recorre la foto */
.busy-veil[data-kind="analyzing"]::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: sweep 1600ms var(--ease-inout) infinite; }
.busy-pill { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-radius: 99px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; max-width: calc(100% - 24px); }
.busy-pill .spinner.inline { margin: 0; flex: 0 0 auto; }
.pt-wrap { display: grid; }
.pt { grid-area: 1 / 1; text-align: center; opacity: 0; transform: translateY(6px); }
.pt.on { opacity: 1; transform: none; transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out); }
.pt.gone { opacity: 0; transform: translateY(-6px); transition: opacity var(--t-fast) var(--ease-in), transform var(--t-fast) var(--ease-in); }
/* limpiando: las siluetas de quienes se quitan respiran */
.stage[data-busy="cleaning"] .frame g.remove { animation: breathe 1400ms var(--ease-inout) infinite; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand-600); animation: spin .8s linear infinite; }
.spinner.inline { display: inline-block; width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; margin-right: 6px; }

/* panel lateral */
.panel { position: relative; z-index: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; overflow-anchor: none; max-height: calc(100vh - 110px); align-self: start; }
/* ocupado: se atenúa todo salvo el botón principal, que se queda legible */
.panel > * { transition: opacity var(--t-base) var(--ease-out); }
.panel.busy { pointer-events: none; }
.panel.busy > :not(.foot) { opacity: .6; }
.panel h2 { font-family: var(--display); font-weight: 400; font-size: 20px; margin: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.panel-head h2 { white-space: nowrap; }
.panel-head .count { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
[data-rise] { animation: rise var(--t-slow) var(--ease-out) backwards; animation-delay: var(--d, 0ms); }
/* caja de sugerencia: gris muy claro con borde fino; el coral queda solo para quien se queda */
.suggest { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; min-height: 66px; background: var(--subtle); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); }
.suggest b { color: var(--ink); }
.sg-txt { align-self: stretch; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.suggest.open .sg-txt { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
.sg-more { border: 0; background: none; padding: 0; color: var(--brand-700); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.people { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.person { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 8px 6px; border-radius: var(--r-md); cursor: pointer; transition: background var(--t-fast), transform var(--t-fast) var(--ease-out); }
.person:hover, .person.hot { background: var(--subtle); }
.person:active { background: var(--subtle); transform: scale(.985); }
.person.enter { animation: rise var(--t-base) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
.person canvas { width: 42px; height: 52px; border-radius: var(--r-sm); background: var(--line-2); transition: opacity var(--t-base), filter var(--t-base); }
.person.enter canvas.drawn { animation: fadein var(--t-base) var(--ease-out) backwards; }
.person.remove canvas { opacity: .45; filter: grayscale(1); }
.person .who { font-size: 14px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.person .nm { white-space: nowrap; }
.person .why { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.badge { font-size: 10.5px; font-weight: 600; color: var(--brand-700); background: var(--brand-100); padding: 1px 7px; border-radius: 99px; white-space: nowrap; animation: pop-sm var(--t-fast) var(--ease-out) backwards; }
.toggle { display: flex; align-items: center; gap: 8px; }
.toggle span { font-size: 12.5px; font-weight: 500; min-width: 56px; text-align: right; color: var(--ink-3); transition: color var(--t-base); }
.toggle.keep span { color: var(--brand-700); }
.switch { position: relative; flex: 0 0 auto; width: 40px; height: 24px; border-radius: 99px; border: 0; padding: 0; cursor: pointer; background: #dcdce0; transition: background var(--t-base) var(--ease-out); }
.switch::before { content: ""; position: absolute; inset: -8px; }   /* zona de toque más grande */
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--t-base) var(--ease-out); }
.toggle.keep .switch { background: var(--brand-600); }
.toggle.keep .switch::after { transform: translateX(16px); }
.group { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; border: 1px dashed var(--line); background: var(--subtle); border-radius: var(--r-md); padding: 10px 12px; font-size: 13px; color: var(--ink-2); cursor: pointer; text-align: left; margin: 4px 0; transition: background var(--t-fast), transform var(--t-fast) var(--ease-out); }
.group:active { transform: scale(.99); }
.group b { color: var(--ink); }
.group .g-sub { display: block; font-size: 12.5px; color: var(--ink-3); }
.group .g-act { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-700); font-weight: 500; white-space: nowrap; }
.group .chev { transition: transform var(--t-base) var(--ease-out); }
.group[aria-expanded="true"] .chev { transform: rotate(180deg); }
/* "Revisar una a una" se despliega en sitio */
.rest { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows var(--t-base) var(--ease-out), opacity var(--t-base) var(--ease-out), visibility 0s linear var(--t-base); }
.rest.open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition-delay: 0s; }
.rest-in { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line); background: var(--bg); padding: 5px 11px; border-radius: 99px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.quick button:hover { border-color: var(--ink-3); color: var(--ink); }
.quick button:active { transform: scale(.98); }
.result-box { display: flex; align-items: center; gap: 10px; background: var(--subtle); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); }
.result-box::before { content: "✓"; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-600); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; animation: pop var(--t-base) var(--ease-out) 120ms backwards; }
.foot { display: flex; flex-direction: column; }
.muted { color: var(--ink-3); font-size: 13px; margin: 0; }
.divider { height: 1px; background: var(--line-2); margin: 2px 0; }

/* filas fantasma mientras llegan las personas */
.person.ghost { cursor: default; pointer-events: none; }
.sk { position: relative; display: block; overflow: hidden; background: var(--line-2); border-radius: var(--r-sm); }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); transform: translateX(-100%); animation: shimmer 1400ms linear infinite; }
.sk-thumb { width: 42px; height: 52px; }
.sk-line { height: 10px; border-radius: 6px; margin: 6px 0; }
.sk-sw { width: 40px; height: 24px; border-radius: 99px; }

/* tira de fotos */
.strip { display: flex; gap: 10px; padding: 0 24px 20px; overflow-x: auto; }
.thumb { position: relative; flex: 0 0 auto; width: 92px; height: 66px; border-radius: var(--r-sm); overflow: hidden; border: 0; padding: 0; cursor: pointer; outline: 2px solid transparent; outline-offset: 2px; background: var(--line-2); transition: outline-color var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.thumb:active { transform: scale(.98); }
.thumb.on { outline-color: var(--brand-500); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb i { position: absolute; right: 6px; bottom: 6px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; background: var(--ink-3); }
.thumb i.ready { background: #f5b83d; }
.thumb i.done { background: var(--brand-600); animation: pop var(--t-base) var(--ease-out); }
.thumb i.work { background: #fff; animation: pulse 1s infinite; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-md); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity var(--t-fast) var(--ease-in), transform var(--t-fast) var(--ease-in); max-width: 90vw; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out); }
/* hojas: fundido del fondo y subida del panel; al cerrar, más cortas */
.save-sheet { position: fixed; inset: 0; background: rgba(15,15,16,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 80; opacity: 0; transition: opacity var(--t-base) var(--ease-in); }
.save-sheet.open { opacity: 1; transition: opacity var(--t-base) var(--ease-out); }
.sheet { background: var(--bg); width: 100%; max-width: 520px; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); text-align: center; overscroll-behavior: contain; transform: translateY(100%); transition: transform var(--t-base) var(--ease-in); }
.save-sheet.open .sheet { transform: none; transition: transform var(--t-slow) var(--ease-out); }
.sheet img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--r-md); -webkit-touch-callout: default; }
.sheet p { font-size: 15px; color: var(--ink-2); margin: 12px 0; }

/* móvil */
.pick-mobile { display: none; }
@media (min-width: 700px) {
  .save-sheet { align-items: center; }
  .sheet { border-radius: var(--r-xl); transform: translateY(8px) scale(.98); }
}
@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .panel { max-height: none; overflow: visible; }
  .frame img { max-height: 58vh; }
  .stage { min-height: 0; }
  .hint { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top { padding: 12px 16px; }
  .strip { padding: 10px 12px 0; }
}
/* cabecera estrecha: "Probar otra foto" queda en un icono; el estado del interruptor lo da su color */
@media (max-width: 520px) {
  .toggle span { display: none; }
}
@media (max-width: 480px) {
  .top { gap: 8px; }
  .lang button { padding: 3px 7px; font-size: 12px; }
  #addMore { padding: 0; width: 36px; height: 36px; border-radius: 50%; }
  #addMore span { display: none; }
}
body.mobile .pick-mobile { display: inline-flex; font-size: 17px; padding: 16px 30px; border-radius: var(--r-md); }
body.mobile .drop { display: none; }
body.mobile .hero { margin-top: 7vh; }
body.mobile .hero > p { font-size: 16px; }
/* botón principal fijo abajo con degradado: no tapa la última fila */
body.mobile .panel .foot { position: sticky; bottom: 0; z-index: 3; margin: 0 -20px -20px; padding: 28px 20px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 62%, rgba(255,255,255,0)); border-radius: 0 0 var(--radius) var(--radius); }
/* en el resultado el botón de guardar va justo debajo del "Listo": sin fijar ni degradado */
body.mobile .panel .foot.static { position: static; margin: 0; padding: 0; background: none; }
body.mobile .panel .primary-action { padding: 15px; font-size: 16px; }
body.mobile .pick-mobile { box-shadow: var(--shadow-cta); }
body.mobile .switch { width: 48px; height: 28px; }
body.mobile .switch::after { width: 24px; height: 24px; }
body.mobile .toggle.keep .switch::after { transform: translateX(20px); }
body.mobile .top { order: 0; }
body.mobile .strip { order: 1; }
body.mobile .editor { order: 2; }
body.mobile .thumb { width: 72px; height: 54px; }

/* tarjeta "descarga la app": QR en el ordenador, botón en el móvil */
.app-card { display: flex; gap: 16px; align-items: center; text-align: left; margin: 20px auto 0; max-width: 480px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.app-card:empty { display: none; }
.app-card > .app-card { margin: 0; border: 0; padding: 0; background: none; }
.app-card img { flex: 0 0 auto; border-radius: var(--r-sm); background: #fff; }
.app-card b { display: block; font-size: 14.5px; text-wrap: balance; }
.app-card span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; text-wrap: pretty; }
.app-card small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 6px; text-wrap: balance; }
body.mobile .app-card { flex-direction: column; align-items: stretch; }
/* en el panel (columna estrecha con scroll) la tarjeta no se encoge ni se pisa con la lista: vertical y centrada */
.panel .app-card { margin: 12px 0 0; border-color: var(--line-2); box-shadow: none; flex: 0 0 auto; flex-direction: column; align-items: center; text-align: center; padding: 16px; gap: 12px; }
.panel .app-card > div { min-width: 0; }
/* insignias de App Store y Google Play: sin partir; si no caben dos en una fila, una debajo de la otra */
.app-card .stores { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.panel .app-card .stores { justify-content: center; }
.app-card .store { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; border-radius: var(--r-sm); padding: 6px 12px 6px 10px; text-decoration: none; white-space: nowrap; transition: background var(--t-fast), transform var(--t-fast) var(--ease-out); }
.app-card .store:hover { background: #2a2a2e; }
.app-card .store:active { transform: scale(.98); }
.app-card .store svg { flex: 0 0 auto; }
.app-card .store .store-txt { display: block; margin: 0; color: #fff; font-size: 15px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.app-card .store .store-txt i { display: block; font-style: normal; font-size: 10.5px; font-weight: 400; opacity: .85; white-space: nowrap; }
body.mobile .app-card .stores { justify-content: center; }
body.mobile .app-card .store { flex: 1 1 auto; justify-content: center; padding: 9px 12px; }
#appSheet .sheet { padding: 28px 24px max(20px, env(safe-area-inset-bottom)); }
#appSheet .sheet h2 { font-family: "Cal Sans", Inter, sans-serif; font-weight: 400; font-size: 22px; margin: 0 auto 8px; max-width: 24ch; text-align: center; text-wrap: balance; }
#appSheet .sheet p { color: var(--ink-2); margin: 0 auto 4px; max-width: 34ch; text-align: center; text-wrap: balance; }
/* QR de ~180 px centrado; la caja se ajusta a él */
#appSheet .app-card { flex-direction: column; align-items: center; text-align: center; width: fit-content; max-width: 100%; margin: 18px auto; padding: 16px; gap: 12px; }
#appSheet .app-card img { width: 180px; height: 180px; max-height: none; border-radius: var(--r-sm); }
#appSheet .app-card > div { max-width: 220px; }
#appSheet .app-card .stores { justify-content: center; }
#appSheet .app-card:has(> div:only-child) { width: auto; }

/* pronto.html: mismo estilo que la portada */
.soon h1 { font-size: clamp(30px, 5vw, 48px); }
.soon .btn { margin-top: 4px; }

/* reducir movimiento: sin recorridos ni bucles; el giro pasa a pulso de opacidad y el revelado a un fundido corto */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .spinner { animation: pulse 1.4s ease-in-out infinite !important; }
  .frame.reveal .img-r { clip-path: none; animation: fadein 150ms linear forwards !important; }
  .busy-veil[data-kind="analyzing"]::before { display: none; }
  .busy-bar { display: none; }
}
