/* Laeta PWA — estilos base, mobile-first y sensibles al tema claro/oscuro. */
:root {
  color-scheme: light dark;
  --bg: #f8fafc; --card: #ffffff; --border: #e2e8f0; --text: #0f172a;
  --muted: #64748b; --primary: #2563eb; --primary-ink: #ffffff;
  --alert: #dc2626; --doubt: #d97706; --safe: #059669;
  --track: #e5e7eb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --card: #111827; --border: #1f2937; --text: #e5e7eb;
    --muted: #94a3b8; --primary: #3b82f6; --track: #1f2937;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  max-width: 40rem; margin: 0 auto; padding: 16px 16px 40px;
  -webkit-text-size-adjust: 100%;
}
.top h1 { font-size: 1.5rem; margin: 8px 0 2px; }
.tagline { color: var(--muted); margin: 0 0 16px; font-size: .95rem; }

/* Cuadrado a propósito: el modelo analiza un recorte CENTRAL 1:1 (resize del lado corto a
   224 + center-crop, igual que open_clip). Con el recuadro cuadrado + object-fit:cover, la
   vista previa muestra EXACTAMENTE ese cuadrado — lo que ves es lo que se analiza. */
.stage {
  position: relative; aspect-ratio: 1 / 1; width: 100%;
  background: #000; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); display: grid; place-items: center;
}
.stage video, .stage img { width: 100%; height: 100%; object-fit: cover; }
.placeholder { color: #94a3b8; text-align: center; padding: 24px; }
.ph-bug { font-size: 3rem; display: block; opacity: .55; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.btn {
  flex: 1 1 auto; min-height: 46px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 1rem; font-weight: 600; cursor: pointer; transition: filter .15s;
}
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; flex-basis: 100%; }
.btn-ghost { background: transparent; }

.status { min-height: 1.2em; color: var(--muted); font-size: .9rem; margin: 6px 2px; }

.progress { margin: 12px 0; }
.progress-track { height: 12px; background: var(--track); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.progress-label { margin: 8px 0 2px; font-weight: 600; }
.progress-note { margin: 0; color: var(--muted); font-size: .85rem; }

.result { margin: 16px 0; }
.verdict { border-left: 6px solid var(--muted); background: var(--card);
  border: 1px solid var(--border); border-left-width: 6px; border-radius: 10px; padding: 14px 16px; }
.verdict.alert { border-left-color: var(--alert); }
.verdict.doubt { border-left-color: var(--doubt); }
.verdict.safe  { border-left-color: var(--safe); }
.verdict-head { font-size: 1.35rem; font-weight: 800; }
.verdict.alert .verdict-head { color: var(--alert); }
.verdict.doubt .verdict-head { color: var(--doubt); }
.verdict.safe  .verdict-head { color: var(--safe); }
.verdict-prob { color: var(--muted); font-size: .9rem; margin: 2px 0 8px; }

.ranking-wrap { margin-top: 12px; }
.ranking-wrap summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.hint { opacity: .8; }
.ranking { list-style: none; padding: 0; margin: 12px 0 0; }
.ranking li { margin: 0 0 10px; }
.ranking li.target .rk-name { font-weight: 700; }
.rk-top { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }
.rk-name .common { color: var(--muted); font-weight: 400; }
.rk-pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.rk-track { height: 7px; background: var(--track); border-radius: 999px; margin-top: 4px; overflow: hidden; }
.rk-bar { height: 100%; background: var(--muted); }
.ranking li.target .rk-bar { background: var(--alert); }

.disclaimer { font-size: .85rem; color: var(--muted); background: rgba(217,119,6,.08);
  border-left: 4px solid var(--doubt); border-radius: 6px; padding: 10px 14px; margin: 20px 0; }

.method, .foot { margin-top: 20px; }
.method summary { cursor: pointer; font-weight: 600; }
.method-body { padding: 8px 2px; color: var(--text); font-size: .92rem; }

.foot { border-top: 1px solid var(--border); padding-top: 16px; text-align: center; }
.foot .btn-ghost { display: inline-block; text-decoration: none; }
.credit { color: var(--muted); font-size: .82rem; margin: 12px 0 0; }
.credit a, .method a { color: var(--primary); }
