  /* ============================================================
     Design system dual — CLARO por defecto, oscuro con override.
     Override con data-theme="light"|"dark" en <html>.
     Sin override explícito: sigue prefers-color-scheme del OS.

     El default era oscuro y eso dejaba al buscador viviendo en otra
     casa que personnn.com y que el tablero de Rank, que son claros.
     Los tokens claros son ahora los mismos del design system del
     sitio (blue-belt): #f5f5f7 de fondo, #1d1d1f de tinta, acento
     Buddy #8c7cff. Quien prefiera oscuro lo sigue teniendo.
     ============================================================ */

  :root {
    --violeta:      #8c7cff;
    --violeta-2:    #b9aeff;
    --violeta-soft: rgba(140,124,255,0.14);
    --violeta-ring: rgba(140,124,255,0.30);
  }

  :root[data-theme='dark'] {
    --bg:         #08080a;
    --bg-soft:    #0e0e11;
    --fg:         rgba(245,245,247,0.96);
    --fg-2:       rgba(235,235,245,0.60);
    --fg-3:       rgba(235,235,245,0.38);
    --hover:      rgba(255,255,255,0.025);
    --activo:     rgba(140,124,255,0.14);
    --hairline:   rgba(255,255,255,0.07);
    --hairline-2: rgba(255,255,255,0.11);
    --field:      rgba(255,255,255,0.045);
    --field-foc:  rgba(255,255,255,0.07);
    --fav-bg:     rgba(255,255,255,0.06);
    --r-title:    #b9aeff;
    --r-snip:     rgba(245,245,247,0.72);
    --sk-1:       rgba(255,255,255,0.04);
    --sk-2:       rgba(255,255,255,0.10);
    --surf:       rgba(255,255,255,0.06);
    --kbd-bg:     rgba(255,255,255,0.06);
    --kbd-bdr:    rgba(255,255,255,0.11);
    --v-glow:     .14;
    --btn-buscar: #0a0a0c;
    --logo-filter: invert(1);
    /* Atmósfera soberana: grano + grid hairline */
    --grid-line:  rgba(255,255,255,0.022);
    --grain-1:    rgba(255,255,255,0.045);
    --grain-2:    rgba(255,255,255,0.020);
    --caret:      #b9aeff;
    --dossier-rule: rgba(232,226,255,0.14);
    --dossier-ink:  rgba(245,245,247,0.78);
    --keyline:    rgba(255,255,255,0.10);
  }

  :root, :root[data-theme='light'] {
    /* Paleta del design system de personnn.com: fondo #f5f5f7, papel blanco,
       tinta #1d1d1f, secundario #3a3a3c, apagado #86868b. Nunca negro puro. */
    --bg:         #f5f5f7;
    --bg-soft:    #ffffff;
    --fg:         #1d1d1f;
    --fg-2:       #3a3a3c;
    --fg-3:       #86868b;
    --hover:      rgba(0,0,0,0.035);
    --activo:     rgba(140,124,255,0.10);
    --hairline:   rgba(0,0,0,0.09);
    --hairline-2: rgba(0,0,0,0.15);
    --field:      #ffffff;
    --field-foc:  #ffffff;
    --fav-bg:     rgba(0,0,0,0.05);
    --r-title:    #1d1d1f;
    --r-snip:     #3a3a3c;
    --sk-1:       rgba(0,0,0,0.05);
    --sk-2:       rgba(0,0,0,0.11);
    --surf:       #ffffff;
    --kbd-bg:     rgba(255,255,255,0.70);
    --kbd-bdr:    rgba(0,0,0,0.12);
    --v-glow:     .07;
    --btn-buscar: #ffffff;
    --logo-filter: none;
    /* El grano y la grilla se apagan en claro. Sobre negro daban atmósfera;
       sobre un fondo claro son ruido encima del texto y nada más. */
    --grid-line:  transparent;
    --grain-1:    transparent;
    --grain-2:    transparent;
    --caret:      #5a4ce6;
    --dossier-rule: rgba(40,30,90,0.14);
    --dossier-ink:  rgba(29,29,31,0.82);
    --keyline:    rgba(0,0,0,0.12);
  }

  @media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
      --bg:         #f5f5f7;
      --bg-soft:    #ffffff;
      --fg:         #1d1d1f;
      --fg-2:       rgba(60,60,67,0.60);
      --fg-3:       rgba(60,60,67,0.38);
      --hover:      rgba(0,0,0,0.04);
      --activo:     rgba(140,124,255,0.10);
      --hairline:   rgba(0,0,0,0.09);
      --hairline-2: rgba(0,0,0,0.15);
      --field:      rgba(255,255,255,0.70);
      --field-foc:  rgba(255,255,255,0.95);
      --fav-bg:     rgba(0,0,0,0.05);
      --r-title:    #5a4ce6;
      --r-snip:     rgba(60,60,67,0.78);
      --sk-1:       rgba(0,0,0,0.05);
      --sk-2:       rgba(0,0,0,0.11);
      --surf:       rgba(255,255,255,0.65);
      --kbd-bg:     rgba(255,255,255,0.70);
      --kbd-bdr:    rgba(0,0,0,0.12);
      --v-glow:     .07;
      --btn-buscar: #ffffff;
      --logo-filter: none;
      --grid-line:  rgba(0,0,0,0.030);
      --grain-1:    rgba(0,0,0,0.050);
      --grain-2:    rgba(0,0,0,0.022);
      --caret:      #5a4ce6;
      --dossier-rule: rgba(40,30,90,0.14);
      --dossier-ink:  rgba(29,29,31,0.82);
      --keyline:    rgba(0,0,0,0.12);
    }
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
      --bg:         #08080a;
      --bg-soft:    #0e0e11;
      --fg:         rgba(245,245,247,0.96);
      --fg-2:       rgba(235,235,245,0.60);
      --fg-3:       rgba(235,235,245,0.38);
      --hover:      rgba(255,255,255,0.025);
      --activo:     rgba(140,124,255,0.14);
      --hairline:   rgba(255,255,255,0.07);
      --hairline-2: rgba(255,255,255,0.11);
      --field:      rgba(255,255,255,0.045);
      --field-foc:  rgba(255,255,255,0.07);
      --fav-bg:     rgba(255,255,255,0.06);
      --r-title:    #b9aeff;
      --r-snip:     rgba(245,245,247,0.72);
      --sk-1:       rgba(255,255,255,0.04);
      --sk-2:       rgba(255,255,255,0.10);
      --surf:       rgba(255,255,255,0.06);
      --kbd-bg:     rgba(255,255,255,0.06);
      --kbd-bdr:    rgba(255,255,255,0.11);
      --v-glow:     .14;
      --btn-buscar: #0a0a0c;
      --logo-filter: invert(1);
      --grid-line:  rgba(255,255,255,0.022);
      --grain-1:    rgba(255,255,255,0.045);
      --grain-2:    rgba(255,255,255,0.020);
      --caret:      #b9aeff;
      --dossier-rule: rgba(232,226,255,0.14);
      --dossier-ink:  rgba(245,245,247,0.78);
      --keyline:    rgba(255,255,255,0.10);
    }
  }

  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { height: 100%; }

  body {
    background: var(--bg);
    background-color: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: -0.006em;
    display: flex; flex-direction: column; align-items: center;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "cv11", "tnum";
    -webkit-text-size-adjust: 100%;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    transition: background-color 1s ease, color 1s ease;
  }

  /* Atmósfera soberana — grano tipo papel + grid hairline 1px muy tenue.
     Reemplaza el viejo splash violeta: ahora el fondo codifica "instrumento",
     no "marketing". El grano está en un SVG inline (ruido fractal) y el grid
     es un repeating-linear-gradient. */
  body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
      linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 64px,
      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 64px 100%;
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.75), rgba(0,0,0,0.2) 60%, transparent 92%);
            mask-image: linear-gradient(180deg, rgba(0,0,0,0.75), rgba(0,0,0,0.2) 60%, transparent 92%);
    opacity: .85;
  }
  body::after {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 220px 220px;
    mix-blend-mode: overlay;
    opacity: .42;
  }
  /* El contenido queda por encima de la atmósfera. */
  .theme-switch, .theme-sky, .health, .escena, .resultados, .kbd-row, .legal-footer, main, header, aside { position: relative; z-index: 1; }
  .theme-sky, .theme-switch, .kbd-row, .legal-footer { z-index: 90; }
  .theme-switch { z-index: 100; }

  .theme-sky {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
  }
  .theme-sky::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 86% 12%, rgba(255,214,0,.22), transparent 17rem),
      linear-gradient(180deg, rgba(255,255,255,.36), rgba(255,255,255,.12));
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
  }
  .theme-sky.to-dark::before {
    background:
      radial-gradient(circle at 86% 12%, rgba(185,174,255,.18), transparent 17rem),
      linear-gradient(180deg, rgba(8,8,10,.34), rgba(8,8,10,.14));
  }
  .theme-sky.is-animating {
    animation: themeWash 1.18s ease both;
  }
  @keyframes themeWash {
    0% { opacity: 0; }
    18% { opacity: 1; }
    48% { opacity: .86; }
    100% { opacity: 0; }
  }

  /* ---------- Theme toggle ---------- */
  .theme-switch {
    --switch-w: 52px;
    --switch-h: 30px;
    --knob: 22px;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100;
    display: inline-block;
    width: var(--switch-w);
    height: var(--switch-h);
    cursor: pointer;
  }
  .theme-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
  }
  .theme-slider {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 999px;
    background:
      radial-gradient(circle at 68% 36%, rgba(185,174,255,.18), transparent 19px),
      #090a14;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 12px 28px rgba(0,0,0,.18);
    transition: background .58s ease, box-shadow .58s ease, border-color .58s ease;
  }
  .theme-orb {
    position: absolute;
    left: 4px;
    bottom: 4px;
    z-index: 3;
    width: var(--knob);
    height: var(--knob);
    border-radius: 50%;
    background: #f4f1ff;
    box-shadow: 0 0 0 7px rgba(255,255,255,.08), 0 2px 10px rgba(0,0,0,.22);
    transform: translateX(calc(var(--switch-w) - var(--knob) - 8px));
    transition: transform .58s cubic-bezier(.32,.72,0,1), background .58s ease, box-shadow .58s ease;
  }
  .theme-switch input:checked + .theme-slider {
    background:
      radial-gradient(circle at 22% 42%, rgba(255,255,255,.72), transparent 10px),
      linear-gradient(180deg, #91d9ff, #5dbce8);
    border-color: rgba(255,255,255,.22);
  }
  .theme-switch input:checked + .theme-slider .theme-orb {
    background: #ffd600;
    box-shadow: 0 0 0 7px rgba(255,255,255,.12), 0 2px 10px rgba(0,0,0,.18);
    transform: translateX(0);
    animation: rotate-center .6s ease-in-out both;
  }
  .moon-dot,
  .light-ray {
    position: absolute;
  }
  .moon-dot {
    z-index: 4;
    border-radius: 999px;
    background: #a7a6ad;
    opacity: 1;
    transition: opacity .35s ease;
  }
  .moon-dot.one { left: 9px; top: 3px; width: 5px; height: 5px; }
  .moon-dot.two { left: 3px; top: 10px; width: 8px; height: 8px; }
  .moon-dot.three { left: 15px; top: 16px; width: 3px; height: 3px; }
  .light-ray {
    z-index: -1;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
  }
  .light-ray.one { inset: -7px; }
  .light-ray.two { inset: -13px; opacity: .7; }
  .light-ray.three { inset: -18px; opacity: .45; }
  .theme-switch input:checked + .theme-slider .moon-dot {
    opacity: 0;
  }
  .theme-switch input:active + .theme-slider .theme-orb {
    scale: .9;
  }
  .theme-switch:has(input:focus-visible) .theme-slider {
    box-shadow: 0 0 0 3px var(--violeta-soft), 0 12px 28px rgba(0,0,0,.18);
  }
  @keyframes rotate-center {
    from { rotate: 0deg; }
    to { rotate: 360deg; }
  }

  /* ---------- Escena ---------- */
  .escena { width: min(680px, 92vw); margin-top: 24vh; transition: margin-top .5s cubic-bezier(.32,.72,0,1); position: relative; }
  .escena.arriba { margin-top: 36px; }

  .marca {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
    cursor: pointer; user-select: none;
  }

  .marca-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    line-height: 1;
  }

  .marca .logo-search {
    font-size: 30px; font-weight: 500; font-style: italic; color: var(--violeta);
    letter-spacing: -0.03em; line-height: .86;
  }
  .escena.arriba .marca .logo-search { font-size: 17px; }
  .marca .logo {
    display: block;
    height: 38px; width: auto;
    filter: var(--logo-filter);
    transition: filter .2s ease, transform .06s ease;
  }
  .marca:hover .logo { filter: var(--logo-filter) brightness(1.12); }
  .marca:active .logo { transform: scale(0.985); }
  /* El PNG es negro sobre alpha: --logo-filter lo invierte a blanco en dark
     y lo deja natural en light (definido junto a los tokens de cada tema). */
  
  .escena.arriba .marca { margin-bottom: 14px; }
  .escena.arriba .marca .logo { height: 22px; }

  .caja {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    min-height: 64px;
    background: color-mix(in srgb, var(--field) 88%, #2f3640 12%);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    padding: 7px 76px 7px 22px;
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, var(--card-hi), transparent 42%),
      0 18px 48px rgba(0,0,0,.16);
    transition: background .18s, border-color .18s, box-shadow .18s, transform .18s;
  }
  .caja:hover {
    background: var(--field-foc);
    transform: translateY(-1px);
  }
  .caja:focus-within {
    background: var(--field-foc);
    border-color: var(--violeta-ring);
    box-shadow:
      0 0 0 3px var(--violeta-soft),
      0 22px 58px rgba(0,0,0,.18),
      inset 0 0 0 1px color-mix(in srgb, var(--violeta) 22%, transparent);
  }

  .caja .lupa {
    width: 16px; height: 16px; flex: 0 0 auto;
    color: var(--fg-3); transition: color .18s;
  }
  .caja:focus-within .lupa { color: var(--fg-2); }

  .caja input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--fg); font-size: 16px; font-family: inherit;
    min-width: 0;
    padding: 15px 4px; letter-spacing: -0.01em;
    font-feature-settings: "ss01", "cv11";
    caret-color: var(--caret);
  }
  .caja input::placeholder { color: var(--fg-3); }
  /* Cuando el input está enfocado, el caret también pulsa un halo violeta en el lado
     izquierdo del campo — micro-señal de "instrumento activo". */
  .caja:focus-within .lupa {
    color: var(--violeta);
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--violeta) 60%, transparent));
  }

  .caja .limpiar {
    position: absolute;
    right: 64px;
    top: 50%;
    transform: translateY(-50%);
    appearance: none; border: none; background: none; cursor: default;
    display: none; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 999px;
    color: var(--fg-3); padding: 0;
    transition: background .15s, color .15s;
  }
  .caja .limpiar:hover { background: var(--hover); color: var(--fg-2); }
  .caja.tiene-valor .limpiar { display: inline-flex; }

  .caja button[type="submit"] {
    position: absolute;
    right: 7px;
    top: 50%;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #75d8ee 0%, #9375ee 52%, #ee75d2 100%);
    color: #fff; border: none; cursor: pointer;
    font-weight: 600; font-size: 13px; font-family: inherit;
    padding: 0; border-radius: 999px;
    letter-spacing: -0.01em;
    box-shadow:
      0 12px 28px rgba(0,0,0,.22),
      0 0 24px color-mix(in srgb, var(--violeta) 34%, transparent);
    transform: translateY(-50%);
    transition: filter .2s cubic-bezier(.23,1,.32,1), transform .2s cubic-bezier(.23,1,.32,1), box-shadow .2s;
  }
  .caja button[type="submit"] .label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .caja button[type="submit"]::before {
    content: '';
    width: 17px;
    height: 17px;
    border: 3px solid currentColor;
    border-radius: 999px;
    transform: translate(-2px, -2px);
  }
  .caja button[type="submit"]::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    transform: translate(8px, 8px) rotate(45deg);
  }
  .caja button[type="submit"]:hover {
    filter: brightness(1.08);
    transform: translateY(calc(-50% - 2px));
    box-shadow:
      0 16px 34px rgba(0,0,0,.26),
      0 0 30px color-mix(in srgb, var(--violeta) 42%, transparent);
  }
  .caja button[type="submit"]:active { transform: translateY(-50%) scale(.96); }

  .promesa {
    text-align: center; margin-top: 14px;
    font-size: 11.5px; color: var(--fg-3);
    letter-spacing: 0.005em;
  }
  .promesa .sep { margin: 0 6px; opacity: 0.5; }
  .promesa .cuenta b {
    color: var(--violeta-2); font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  .escena.arriba .promesa { display: none; }

  /* ---------- Juegos: descanso del buscador ---------- */
  .juegos {
    width: min(680px, 92vw);
    margin: 18px auto 0;
  }
  .juegos-kicker {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 10px;
    font-family: "SF Mono", ui-monospace, monospace;
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase;
    color: var(--fg-3);
  }
  .juegos-dot { opacity: .45; }
  .juegos-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  }
  .juego-card {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 13px 12px 13px 13px;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background: color-mix(in srgb, var(--field) 92%, transparent);
    text-decoration: none;
    transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s, box-shadow .18s, background .18s;
    overflow: hidden;
  }
  .juego-card::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
    background: radial-gradient(420px 180px at 0% 0%, color-mix(in srgb, var(--violeta) 10%, transparent), transparent 68%);
    transition: opacity .18s;
  }
  .juego-card:hover {
    transform: translateY(-2px);
    background: var(--field-foc);
    border-color: color-mix(in srgb, var(--hairline-2) 60%, var(--violeta-ring));
    box-shadow: 0 14px 32px rgba(0,0,0,.11);
  }
  .juego-card:hover::before { opacity: 1; }
  .juego-card:active { transform: translateY(0) scale(.985); }
  .juego-icon {
    flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: 11px; position: relative; overflow: hidden;
    font-size: 20px;
  }
  .juego-icon.runner {
    background: linear-gradient(135deg, #FFE9A6 0%, #FFD23F 45%, #FFB347 100%);
    color: #1d1d1f;
  }
  .juego-icon.runner .panda { position: relative; z-index: 1; transform: translateX(0); transition: transform .45s cubic-bezier(.2,.7,.3,1); }
  .juego-card:hover .juego-icon.runner .panda { transform: translateX(3px); }
  .runner-track {
    position: absolute; bottom: 8px; left: 8px; right: 8px; height: 3px; border-radius: 999px;
    background: rgba(29,29,31,.18);
    overflow: hidden;
  }
  .runner-track::after {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(29,29,31,.28) 6px 8px);
    animation: runnerDash 0.9s linear infinite;
  }
  .juego-card:hover .runner-track::after { animation-duration: .45s; }
  @keyframes runnerDash { to { transform: translateX(8px); } }
  .juego-icon.craft {
    background: linear-gradient(135deg, #D4F5D6 0%, #8AD48F 55%, #5AB87E 100%);
    color: #1d1d1f;
  }
  .craft-blocks {
    position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 7px;
    opacity: .92;
  }
  .craft-blocks i { border-radius: 2px; background: rgba(29,29,31,.14); border: 1px solid rgba(29,29,31,.08); }
  .craft-blocks i:nth-child(1) { background: #fff; }
  .craft-blocks i:nth-child(4) { background: rgba(29,29,31,.22); }
  .juego-icon .panda.mini { position: relative; z-index: 1; font-size: 17px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.18)); }
  .juego-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
  .juego-copy strong { color: var(--fg); font-size: 13.5px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
  .juego-copy span { color: var(--fg-3); font-size: 11.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .juego-cta {
    flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center;
    border-radius: 999px; border: 1px solid var(--hairline);
    color: var(--fg-3); font-size: 12px; line-height: 1; background: var(--field);
    transition: background .15s, color .15s, border-color .15s, transform .15s;
  }
  .juego-card:hover .juego-cta { background: var(--fg); color: var(--bg-soft); border-color: var(--fg); transform: rotate(0deg); }
  /* Se oculta cuando hay búsqueda activa: la primera vista es para buscar, no para jugar */
  .escena.arriba ~ .juegos { display: none; }
  @media (max-width: 640px) {
    .juegos { width: 100%; margin-top: 14px; }
    .juegos-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .juego-card { padding: 11px 10px; gap: 10px; }
    .juego-icon { flex: 0 0 38px; width: 38px; height: 38px; font-size: 18px; border-radius: 10px; }
    .juego-copy strong { font-size: 13px; }
    .juego-copy span { font-size: 10.5px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  }
  @media (max-width: 380px) {
    .juegos-grid { grid-template-columns: 1fr; }
  }
  @media (prefers-reduced-motion: reduce) {
    .runner-track::after { animation: none; }
    .juego-card, .juego-card:hover { transform: none; }
  }

  /* Health — puntito de estado del servicio, esquina superior izquierda */
  .health {
    position: fixed; top: 16px; left: 18px; z-index: 30;
    display: none; align-items: center; gap: 7px;
    font-size: 11px; color: var(--fg-3);
  }
  .health.visible { display: inline-flex; }
  .health .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #34c759; box-shadow: 0 0 6px rgba(52,199,89,0.55);
  }
  .health.caido .dot { background: #ff453a; box-shadow: 0 0 6px rgba(255,69,58,0.55); }

  /* ---------- Rank home — top 3 ---------- */
  .rank-home {
    width: min(680px, 92vw);
    margin: 14px auto 0;
    border: 1px solid var(--hairline);
    border-radius: 18px;
    background:
      radial-gradient(420px 180px at 0% 0%, color-mix(in srgb, var(--violeta) 8%, transparent), transparent 70%),
      color-mix(in srgb, var(--field) 88%, transparent);
    padding: 12px 12px 10px;
  }
  .rank-home-head {
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
    padding: 2px 4px 10px;
    border-bottom: 1px solid var(--hairline);
  }
  .rank-home-title {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg);
  }
  .rank-home-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #ff375f;
    box-shadow: 0 0 8px rgba(255,55,95,.45);
  }
  .rank-home-sub {
    font-size: 11.5px; color: var(--fg-3);
  }
  .rank-home-link {
    margin-left: auto; font-size: 12px; font-weight: 600; color: var(--violeta-2);
    text-decoration: none;
  }
  .rank-home-link:hover { text-decoration: underline; text-underline-offset: 3px; }
  .rank-home-list {
    list-style: none; margin: 0; padding: 4px 0 0; display: flex; flex-direction: column;
  }
  .rank-home-list li {
    display: grid; grid-template-columns: 28px 1fr auto; align-items: center; column-gap: 10px;
    padding: 10px 6px; border-top: 1px solid transparent;
  }
  .rank-home-list li + li { border-top-color: var(--hairline); }
  .rank-home-list .pos {
    text-align: right; font-size: 13px; font-weight: 600; color: var(--fg-3);
    font-variant-numeric: tabular-nums;
  }
  .rank-home-list .who { min-width: 0; }
  .rank-home-list .host {
    display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -0.015em; color: var(--fg);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none;
  }
  .rank-home-list .host:hover { color: var(--violeta-2); }
  .rank-home-list .meta-row {
    display: flex; gap: 8px; align-items: center; margin-top: 2px; font-size: 11px; color: var(--fg-3);
  }
  .rank-home-list .chip-love {
    display: inline-flex; align-items: center; gap: 4px;
    font-variant-numeric: tabular-nums;
  }
  .rank-home-list .chip-love b { color: #ff375f; font-weight: 650; }
  .rank-home-list .bar {
    width: 56px; height: 3px; border-radius: 999px; background: var(--soft, rgba(0,0,0,.08));
    overflow: hidden; flex: 0 0 56px;
  }
  .rank-home-list .bar i {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #ff375f, #ff6b8b);
  }
  .rank-home-list .vacio, .rank-home-loading {
    padding: 12px 4px; font-size: 13px; color: var(--fg-3);
  }
  /* Oculto cuando hay búsqueda, igual que juegos */
  .escena.arriba ~ .rank-home { display: none; }
  @media (max-width: 640px) {
    .rank-home { width: 100%; margin-top: 10px; border-radius: 14px; padding: 10px 10px 8px; }
    .rank-home-list .bar { display: none; }
  }
  :root[data-theme='dark'] .rank-home {
    background: color-mix(in srgb, var(--surf) 72%, transparent);
  }
  :root[data-theme='dark'] .rank-home-list .bar { background: rgba(255,255,255,.08); }

  /* SEO prosa — visible en home, oculto al buscar. Aporta H2/H3 y 300+ palabras SSR */
  .seo-prosa {
    width: min(680px, 92vw);
    margin: 14px auto 0;
    padding: 14px 16px;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background: color-mix(in srgb, var(--field) 90%, transparent);
    color: var(--fg-2);
    font-size: 13px; line-height: 1.55;
  }
  .seo-prosa h2 { font-size: 13px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg); margin-bottom: 6px; }
  .seo-prosa p { margin: 6px 0; }
  .seo-prosa ul { margin: 6px 0 6px 18px; }
  .seo-prosa li { margin: 2px 0; }
  .seo-prosa a { color: var(--violeta-2); text-decoration: none; }
  .seo-prosa a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .escena.arriba ~ .seo-prosa { display: none; }
  @media (max-width: 640px) {
    .seo-prosa { width: 100%; margin-top: 10px; border-radius: 14px; padding: 12px 14px; font-size: 12.5px; }
  }

  /* ---------- Resultados ---------- */
  .resultados { width: min(640px, calc(100vw - 32px)); padding: 22px 0 100px; display: none; }
  .resultados.visible { display: block; }
  .result-shell { display: block; }

  .meta {
    font-size: 11.5px; color: var(--fg-3);
    margin-bottom: 16px; letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
  }
  .meta b { color: var(--fg-2); font-weight: 500; }
  .meta .aviso { color: var(--violeta-2); margin-left: 6px; }

  .news-strip {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--hairline);
    border-radius: 18px;
    background:
      radial-gradient(circle at 0% 0%, rgba(117,216,238,.1), transparent 9rem),
      color-mix(in srgb, var(--surf) 78%, transparent);
  }
  .news-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }
  .news-head strong {
    color: var(--fg);
    font-size: 14px;
    letter-spacing: -0.01em;
  }
  .news-head span {
    color: var(--fg-3);
    font-size: 11px;
    white-space: nowrap;
  }
  .news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .news-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: color-mix(in srgb, var(--field) 72%, transparent);
    text-decoration: none;
    transition: background .15s ease, transform .15s ease, border-color .15s ease;
  }
  .news-card:hover {
    transform: translateY(-1px);
    background: var(--field-foc);
    border-color: var(--violeta-ring);
  }
  .news-card .source {
    display: block;
    color: var(--fg-3);
    font-size: 10.5px;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .news-card .title {
    display: block;
    color: var(--r-title);
    font-size: 13.5px;
    line-height: 1.28;
    margin-bottom: 6px;
  }
  .news-card .news-date {
    display: block;
    width: fit-content;
    margin: -1px 0 7px;
    padding: 2px 6px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    color: var(--fg-3);
    font-size: 10.5px;
    line-height: 1.3;
  }
  .news-card .summary {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--r-snip);
    font-size: 12.5px;
    line-height: 1.38;
  }

  /* Precios comparados. Bloques hermanos de los resultados, para la
     intención "dónde compro". */
  .prod-strip {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--hairline);
    border-radius: 18px;
    background:
      radial-gradient(circle at 0% 0%, rgba(140,124,255,.12), transparent 9rem),
      color-mix(in srgb, var(--surf) 78%, transparent);
  }
  .prod-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }
  .prod-head strong { color: var(--fg); font-size: 14px; letter-spacing: -0.01em; }
  .prod-head span   { color: var(--fg-3); font-size: 11px; white-space: nowrap; }
  .prod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
    gap: 8px;
  }
  .prod-cobertura {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--hairline);
    font-size: 10.5px;
  }
  .prod-cobertura-label { color: var(--fg-3); }
  .prod-cobertura-link {
    color: var(--fg-2);
    text-decoration: underline;
    text-decoration-color: var(--hairline-2);
    text-underline-offset: 3px;
  }
  .prod-cobertura-link:hover { color: var(--violeta-2); text-decoration-color: var(--violeta); }

  .prod-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 13px 14px 11px;
    border: 1px solid var(--hairline);
    border-radius: 15px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.035), transparent 42%),
      color-mix(in srgb, var(--surf) 58%, transparent);
    transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s ease, box-shadow .18s ease;
  }
  /* El violeta aparece al pasar el cursor, no antes: en reposo la grilla se lee
     como una sola superficie tranquila y el color señala dónde estás. */
  .prod-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--violeta) 42%, var(--hairline));
    box-shadow: 0 14px 34px rgba(0,0,0,.28), 0 0 0 1px var(--violeta-soft);
  }
  @media (prefers-reduced-motion: reduce) {
    .prod-card { transition: none; }
    .prod-card:hover { transform: none; }
  }

  /* El precio es el héroe: tamaño de titular, cifras tabulares para que la
     columna de tarjetas se lea como una tabla aunque no lo sea. */
  .prod-hero { display: flex; flex-direction: column; gap: 1px; }
  .prod-hero-precio {
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-decoration: none;
    color: var(--fg);
  }
  .prod-monto-fila { display: flex; align-items: baseline; gap: 7px; }
  .prod-monto {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
  }
  a.prod-hero-precio:hover .prod-monto { color: var(--violeta-2); }
  .prod-en-tienda { color: var(--fg-3); font-size: 10.5px; }
  .prod-otras {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-top: 8px;
    border-top: 1px solid var(--hairline);
  }

  /* Miniatura en fila, como una fila de Finder: la foto ancla el reconocimiento
     sin gastar media tarjeta como hacía el banner. */
  .prod-head-item { display: flex; gap: 10px; align-items: flex-start; }
  .prod-thumb {
    flex: 0 0 auto;
    width: 54px; height: 54px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: color-mix(in srgb, var(--surf) 40%, transparent);
    overflow: hidden;
  }
  .prod-thumb img { width: 100%; height: 100%; object-fit: contain; }
  /* Sin foto no se deja un hueco gris: el bloque se retira y el texto respira. */
  .prod-thumb.vacio { display: none; }
  .prod-ident { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  /* Cuánto más caro. El dato que evita que la persona tenga que restar. */
  .prod-delta {
    color: var(--fg-3);
    font-size: 9.5px;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .prod-nombre {
    color: var(--fg);
    font-size: 12px;
    line-height: 1.32;
    font-weight: 500;
    letter-spacing: -0.005em;
  }
  .prod-sub { color: var(--fg-3); font-size: 10px; }
  .prod-fila {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: baseline;
    gap: 8px;
    padding: 3px 6px;
    border-radius: 7px;
    text-decoration: none;
    color: var(--fg-2);
    font-size: 11px;
  }
  a.prod-fila:hover { background: color-mix(in srgb, var(--surf) 90%, transparent); }
  /* La oferta más barata se marca sola: es la respuesta a "dónde compro". */
  .prod-tienda { color: var(--fg-3); }
  .prod-precio { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .prod-antes { color: var(--fg-3); font-size: 10px; margin-left: 3px; }

  .prod-pie { display: flex; align-items: center; justify-content: flex-end; margin-top: 2px; }
  /* Acción secundaria: sin caja. Una caja acá competiría con el precio, que es
     la única cosa de la tarjeta que debe pedir atención. */
  .hist-boton {
    border: 0;
    background: none;
    color: var(--fg-3);
    font: inherit;
    font-size: 10.5px;
    padding: 2px 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--hairline-2);
    text-underline-offset: 3px;
  }
  .hist-boton:hover:not(:disabled) { color: var(--fg); text-decoration-color: var(--violeta); }
  .hist-boton:disabled { opacity: .6; cursor: default; }
  .hist-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--hairline);
  }
  .hist-spark { width: 100%; height: 44px; overflow: visible; }
  /* Marca fina, sin relleno: la forma de la variación es el dato, no el área. */
  .hist-linea {
    fill: none;
    stroke: var(--violeta);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
  }
  /* Anillo del color de la superficie: separa el punto de la línea sin un borde
     de otro color que compita. */
  .hist-punto {
    fill: var(--violeta);
    stroke: var(--bg);
    stroke-width: 2;
  }
  /* Los números viven en tinta de texto, nunca en el color de la serie. */
  .hist-resumen, .hist-vacio { color: var(--fg-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }
  .hist-minimo { color: var(--violeta-2); font-size: 10.5px; }

  .prod-ahorro {
    color: var(--violeta-2);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
  }

  .lista { display: flex; flex-direction: column; }
  .r {
    padding: 14px 4px;
    border-radius: 8px;
    border-top: 1px solid var(--hairline);
    transition: background .14s, border-radius .14s;
    position: relative;
  }
  .r:first-child { border-top: none; }
  .r:hover { background: var(--hover); }
  .r.activo { background: var(--activo); }
  .r.activo::before {
    content: ''; position: absolute; left: -6px; top: 10px; bottom: 10px; width: 2px;
    background: var(--violeta); border-radius: 2px;
  }

  .r .fila-url {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 3px;
  }
  .r .favicon {
    width: 14px; height: 14px; border-radius: 3px;
    flex: 0 0 auto; background: var(--fav-bg);
  }
  .r .favicon img { width: 14px; height: 14px; border-radius: 3px; display: block; }

  .r .u {
    font-size: 11.5px; color: var(--fg-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    letter-spacing: 0.01em;
  }
  .r a.t {
    display: inline-block; font-size: 16px; font-weight: 500;
    color: var(--r-title); text-decoration: none;
    margin: 1px 0 4px; letter-spacing: -0.014em;
  }
  .r a.t:hover { text-decoration: underline; text-underline-offset: 2px; }
  .r .s { font-size: 13.5px; color: var(--r-snip); line-height: 1.5; letter-spacing: -0.003em; }

  .chip {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 9.5px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--violeta-2);
    border: 1px solid var(--violeta-ring); border-radius: 4px;
    padding: 1px 5px; margin-left: 7px; vertical-align: 1px;
  }
  .chip.vivo {
    color: #ffd27a;
    border-color: rgba(255,210,122,0.42);
    background: rgba(255,210,122,0.06);
  }
  .chip.vivo svg { width: 8px; height: 8px; }

  /* ---------- Skeleton ---------- */
  .sk { padding: 14px 4px; border-top: 1px solid var(--hairline); }
  .sk:first-child { border-top: none; }
  .search-loader + .sk,
  .search-loader + .sk + .sk,
  .search-loader + .sk + .sk + .sk {
    animation: skeletonReveal .42s cubic-bezier(.32,.72,0,1) both;
  }
  .search-loader + .sk { animation-delay: 40ms; }
  .search-loader + .sk + .sk { animation-delay: 80ms; }
  .search-loader + .sk + .sk + .sk { animation-delay: 120ms; }
  .sk .fila { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
  .sk .bar {
    background: linear-gradient(90deg, var(--sk-1) 25%, var(--sk-2) 37%, var(--sk-1) 63%);
    background-size: 400% 100%;
    border-radius: 4px; animation: shimmer 1.4s ease infinite;
  }
  .sk .favicon { width: 14px; height: 14px; }
  .sk .url { height: 8px; width: 28%; }
  .sk .titulo { height: 14px; width: 68%; margin: 6px 0 8px; }
  .sk .snippet { height: 10px; width: 92%; margin-bottom: 5px; }
  .sk .snippet.s2 { width: 78%; margin-bottom: 0; }
  @keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
  @keyframes skeletonReveal {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Loader inspirado en https://uiverse.io/AatreyuShau/lazy-quail-10 */
  .search-loader {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 4px 20px;
    border-top: 1px solid var(--hairline);
    color: var(--fg-2);
  }
  .search-loader:first-child { border-top: none; }
  .search-loader-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
    font-size: 13px;
    line-height: 1.35;
  }
  .search-loader-copy strong {
    color: var(--fg);
    font-size: 14px;
    letter-spacing: -0.01em;
  }
  .search-loader-copy span { color: var(--fg-3); }
  .personnn-loader {
    position: relative;
    flex: 0 0 76px;
    width: 96px;
    height: 78px;
    transform: translateX(-5px) scale(.74);
    transform-origin: center;
  }
  .personnn-loader span {
    position: absolute;
    display: block;
    box-sizing: border-box;
  }
  .personnn-loader .bod {
    left: 23px;
    top: 22px;
    width: 58px;
    height: 46px;
    border-radius: 50% 48% 44% 54%;
    background: #191e2e;
    box-shadow: inset -8px -10px 0 rgba(255,255,255,.04), 0 8px 18px rgba(0,0,0,.16);
    animation: loaderBob 1s infinite ease-in-out;
  }
  .personnn-loader .head {
    left: 36px;
    top: 3px;
    width: 42px;
    height: 34px;
    border-radius: 50% 48% 42% 52%;
    background: #191e2e;
    box-shadow: inset -5px -6px 0 rgba(255,255,255,.045);
    animation: loaderBob 1s infinite ease-in;
  }
  .personnn-loader .head::before,
  .personnn-loader .head::after {
    content: '';
    position: absolute;
    top: 14px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #fff;
  }
  .personnn-loader .head::before { left: 15px; }
  .personnn-loader .head::after { right: 9px; }
  .personnn-loader .legl,
  .personnn-loader .legr {
    width: 8px;
    height: 36px;
    border-radius: 999px;
    background: #191e2e;
    transform-origin: 50% 4px;
  }
  .personnn-loader .legl {
    left: 37px;
    top: 54px;
    animation: loaderLeftStep 1s infinite ease-in;
  }
  .personnn-loader .legr {
    left: 61px;
    top: 52px;
    animation: loaderRightStep 1s infinite ease-in;
    animation-delay: .45s;
  }
  .personnn-loader .gnd {
    left: -4px;
    bottom: 2px;
    width: 130px;
    height: 10px;
    border-radius: 999px;
    background:
      linear-gradient(90deg, transparent, rgba(0,0,0,.28), transparent),
      color-mix(in srgb, var(--fg) 18%, transparent);
    filter: blur(.4px);
    opacity: .25;
    transform: rotate(8deg);
    animation: loaderGround 1s infinite ease-in-out;
  }
  @keyframes loaderBob {
    0%, 5%, 100% { transform: translateY(0) rotate(3deg); }
    25%, 70% { transform: translateY(5px) rotate(0deg); }
    50% { transform: translateY(0) rotate(-3deg); }
  }
  @keyframes loaderLeftStep {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    33% { transform: translateY(-13px) translateX(24px) rotate(35deg); }
    66% { transform: translateY(0) translateX(18px) rotate(-25deg); }
  }
  @keyframes loaderRightStep {
    0%, 100% { transform: translateY(0) translateX(0) rotate(-5deg); }
    33% { transform: translateY(-10px) translateX(22px) rotate(35deg); }
    66% { transform: translateY(0) translateX(15px) rotate(-25deg); }
  }
  @keyframes loaderGround {
    0%, 100% { transform: translateY(6px) translateX(18px) rotate(8deg); opacity: .1; }
    35% { transform: translateY(4px) translateX(-4px) rotate(8deg); opacity: .32; }
    70% { transform: translateY(2px) translateX(-22px) rotate(8deg); opacity: .22; }
  }

  /* ---------- Estado vacío / error ---------- */
  .estado { padding: 14px 4px; color: var(--fg-2); font-size: 14px; border-top: 1px solid var(--hairline); }
  .estado .hint { color: var(--fg-3); font-size: 12.5px; margin-top: 4px; }
  .estado button {
    appearance: none; cursor: pointer; background: var(--surf);
    color: var(--fg); border: 1px solid var(--hairline-2);
    padding: 7px 14px; border-radius: 7px; font-family: inherit; font-size: 13px;
    font-weight: 500; transition: background .15s;
  }
  .estado > button { margin-top: 12px; }
  .estado button:hover { background: var(--hover); }
  .estado button.ghost {
    background: transparent;
    color: var(--fg-2);
  }
  .estado.empty { padding: 22px 4px 18px; }
  .estado .empty-title {
    color: var(--fg-2);
    font-size: 15px;
    line-height: 1.4;
    margin: 0;
  }
  .estado .empty-title b { color: var(--fg); font-weight: 600; }
  .estado .empty-tips {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
  }
  .estado .empty-tips li {
    position: relative;
    padding-left: 14px;
    color: var(--fg-3);
    font-size: 13px;
    line-height: 1.4;
  }
  .estado .empty-tips li::before {
    content: '·';
    position: absolute;
    left: 2px;
    color: var(--fg-3);
  }
  .estado .empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
  }
  .estado .empty-recent {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--hairline);
  }
  .estado .empty-recent-label {
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-3);
    margin-bottom: 8px;
  }
  .estado .empty-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .estado .empty-chip {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    background: var(--field);
    color: var(--fg-2);
    font-size: 12.5px;
  }
  .estado .empty-chip:hover {
    background: var(--hover);
    color: var(--fg);
  }

  /* ---------- Sugerencias de historial local ---------- */
  .suggest {
    width: min(560px, 100%);
    margin: 8px auto 0;
    display: none;
    text-align: left;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--field-foc) 92%, transparent), var(--field)),
      var(--bg-soft);
    box-shadow: 0 18px 48px rgba(0,0,0,.16);
    overflow: hidden;
    z-index: 45;
  }
  .suggest.visible { display: block; }
  .escena.arriba .suggest { width: 100%; }
  .suggest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-3);
  }
  .suggest-local {
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--fg-3);
    opacity: 0.9;
  }
  .suggest-list {
    display: grid;
    gap: 2px;
    padding: 4px 6px 8px;
  }
  .suggest-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    padding: 2px 4px 2px 8px;
    border-radius: 10px;
  }
  .suggest-item:hover,
  .suggest-item.activo {
    background: var(--hover);
  }
  .suggest-icon {
    color: var(--fg-3);
    font-size: 13px;
    line-height: 1;
    text-align: center;
  }
  .suggest-q {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--fg);
    font: inherit;
    font-size: 14px;
    text-align: left;
    padding: 8px 4px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
  }
  .suggest-remove {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--fg-3);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: background .15s, color .15s, opacity .15s;
  }
  .suggest-remove:hover {
    background: var(--hover);
    color: var(--fg-2);
    opacity: 1;
  }

  .preview-panel { display: none; }

  @media (min-width: 980px) {
    .escena.arriba {
      width: min(640px, calc(100vw - 440px));
      margin-left: auto;
      margin-right: auto;
    }
    .resultados {
      width: min(1120px, calc(100vw - 48px));
    }
    .result-shell {
      display: grid;
      grid-template-columns: minmax(0, 640px) minmax(280px, 360px);
      gap: 34px;
      align-items: start;
    }
    .result-main { min-width: 0; }
    /* Sin vista previa, los productos usan el ancho completo y caben tres por
       fila en vez de dos apretadas. */
    .result-shell.con-productos { grid-template-columns: 1fr; }
    .preview-panel {
      position: sticky;
      top: 34px;
      display: block;
      min-height: 420px;
      padding: 20px;
      border: 1px solid var(--hairline);
      border-radius: 18px;
      background:
        linear-gradient(180deg, rgba(255,255,255,.03), transparent 34%),
        color-mix(in srgb, var(--surf) 82%, transparent);
      box-shadow: 0 22px 70px rgba(0,0,0,.13);
      overflow: hidden;
    }
    .preview-panel::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: inherit;
      pointer-events: none;
      background:
        linear-gradient(90deg, transparent 0 22px, var(--dossier-rule) 22px 23px, transparent 23px 100%),
        linear-gradient(transparent 0 22px, var(--dossier-rule) 22px 23px, transparent 23px 100%);
      background-size: 46px 46px;
      opacity: .5;
    }
    .preview-inner {
      position: relative;
      z-index: 1;
      display: grid;
      gap: 16px;
    }
    .preview-kicker {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      color: var(--fg-3);
      font-family: "SF Mono", "JetBrains Mono", "IBM Plex Mono", "Menlo", ui-monospace, monospace;
      font-size: 10.5px;
      font-weight: 700;
      letter-spacing: .16em;
      text-transform: uppercase;
    }
    .preview-kicker > span:first-child {
      color: var(--dossier-ink);
      background: linear-gradient(90deg, var(--fg-3), var(--fg), var(--fg-3));
      -webkit-background-clip: text;
              background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .preview-stamp {
      margin-left: auto;
      padding: 4px 7px;
      border: 1px solid color-mix(in srgb, var(--violeta) 38%, var(--hairline));
      border-radius: 4px;
      color: var(--violeta-2);
      letter-spacing: .1em;
      transform: rotate(-1.5deg);
    }
    .preview-score {
      color: var(--violeta-2);
      font-variant-numeric: tabular-nums;
    }
    .preview-orb {
      width: 74px;
      height: 74px;
      display: grid;
      place-items: center;
      border: 1px solid var(--hairline-2);
      border-radius: 22px;
      background:
        linear-gradient(135deg, rgba(117,216,238,.2), rgba(238,117,210,.15)),
        var(--field);
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 16px 36px rgba(0,0,0,.12);
    }
    .preview-orb img {
      width: 30px;
      height: 30px;
      border-radius: 8px;
    }
    .preview-orb span {
      color: var(--violeta-2);
      font-size: 26px;
      font-weight: 800;
      text-transform: uppercase;
    }
    .preview-title {
      color: var(--fg);
      font-size: clamp(25px, 2.6vw, 38px);
      line-height: .98;
      letter-spacing: -.045em;
      overflow-wrap: anywhere;
    }
    .preview-host {
      color: var(--violeta-2);
      font-size: 13px;
      font-weight: 600;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .preview-snippet {
      color: var(--r-snip);
      font-size: 14px;
      line-height: 1.58;
    }
    .preview-meta-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .preview-meta-grid span {
      min-width: 0;
      padding: 10px;
      border: 1px solid var(--hairline);
      border-radius: 12px;
      background: var(--field);
      color: var(--fg-3);
      font-size: 11px;
      line-height: 1.35;
    }
    .preview-meta-grid b {
      display: block;
      margin-top: 4px;
      color: var(--fg-2);
      font-size: 12px;
      font-weight: 650;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .preview-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      padding-top: 2px;
    }
    .preview-actions a,
    .preview-actions button {
      appearance: none;
      border: 1px solid var(--hairline-2);
      border-radius: 999px;
      background: var(--field);
      color: var(--fg);
      cursor: pointer;
      font-family: inherit;
      font-size: 12px;
      font-weight: 650;
      padding: 9px 12px;
      text-decoration: none;
    }
    .preview-actions a {
      background: var(--violeta);
      color: var(--btn-buscar);
      border-color: transparent;
    }
    .preview-empty {
      min-height: 380px;
      display: grid;
      place-items: center;
      color: var(--fg-3);
      text-align: center;
      font-size: 13px;
      line-height: 1.45;
    }
  }

  /* ---------- Paginación ---------- */
  .paginacion {
    margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 2px;
    background: var(--field);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    padding: 3px;
    width: fit-content; margin-left: auto; margin-right: auto;
  }
  .paginacion button {
    appearance: none; border: none; background: none;
    color: var(--fg-2); cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: 500;
    padding: 7px 16px; border-radius: 7px;
    letter-spacing: -0.01em; transition: background .15s, color .15s, transform .06s;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .paginacion button:hover:not(:disabled) { background: var(--hover); color: var(--fg); }
  .paginacion button:active:not(:disabled) { transform: scale(.98); }
  .paginacion button:disabled { color: var(--fg-3); cursor: default; opacity: 0.45; }
  .paginacion button.primario { background: var(--violeta); color: var(--btn-buscar); }
  .paginacion button.primario:hover:not(:disabled) { filter: brightness(1.06); background: var(--violeta); }
  .paginacion .sep { color: var(--fg-3); padding: 0 4px; }

  /* ---------- Hints de teclado ---------- */
  .kbd-row {
    position: fixed; bottom: 38px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 18px;
    pointer-events: none;
    opacity: 0; transition: opacity .3s;
  }
  .kbd-row.visible { opacity: 0; }
  body.search-focused.search-hover .kbd-row.visible { opacity: 1; }
  .kbd-row .hint { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fg-3); letter-spacing: 0.01em; }
  .legal-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 12px;
    z-index: 25;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    color: var(--fg-3);
    font-size: 10.5px;
    letter-spacing: 0.02em;
    opacity: .62;
  }
  .footer-status {
    max-width: min(42vw, 240px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .legal-footer a {
    pointer-events: auto;
    color: inherit;
    text-decoration: none;
    transition: color .15s ease, opacity .15s ease;
  }
  .legal-footer a:hover {
    color: var(--fg-2);
    opacity: 1;
  }
  .legal-footer .dot {
    opacity: .45;
    user-select: none;
  }
  kbd {
    appearance: none; background: var(--kbd-bg);
    border: 1px solid var(--kbd-bdr);
    border-bottom-width: 2px;
    padding: 1px 6px 2px; border-radius: 5px;
    color: var(--fg-2); font-family: inherit; font-size: 11px;
    line-height: 1.4; letter-spacing: 0; min-width: 16px; text-align: center;
    font-feature-settings: "tnum";
  }

  :focus-visible { outline: none; box-shadow: 0 0 0 3px var(--violeta-soft); border-radius: 7px; }
  .caja input:focus-visible { box-shadow: none; }

  @media (max-width: 640px) {
    body {
      display: block;
      overflow-x: hidden;
      padding-left: max(12px, env(safe-area-inset-left));
      padding-right: max(12px, env(safe-area-inset-right));
      padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
    .theme-switch {
      top: max(8px, env(safe-area-inset-top));
      right: max(10px, env(safe-area-inset-right));
      --switch-w: 50px;
      --switch-h: 28px;
      --knob: 20px;
    }
    .health {
      position: static;
      width: fit-content;
      margin: max(12px, env(safe-area-inset-top)) 0 0;
      padding: 7px 10px;
      border: 1px solid var(--hairline);
      border-radius: 999px;
      background: var(--field);
    }
    .escena {
      width: 100%;
      margin-top: clamp(92px, 18vh, 132px);
      transition: margin-top .28s cubic-bezier(.32,.72,0,1);
    }
    .escena.arriba {
      position: sticky;
      top: 0;
      z-index: 20;
      margin-top: 10px;
      padding: 8px 0 10px;
      background: var(--bg);
      border-bottom: 1px solid var(--hairline);
    }
    .marca { margin-bottom: 18px; }
    .escena.arriba .marca { margin-bottom: 8px; }
    .marca .logo { height: 32px; }
    .marca-inner { gap: 8px; }
    .marca .logo-search { font-size: 24px; }
    .escena.arriba .marca .logo { height: 20px; }
    .escena.arriba .marca .logo-search { font-size: 16px; }
    .caja {
      gap: 8px;
      min-height: 58px;
      padding: 6px 62px 6px 14px;
      border-radius: 999px;
      box-shadow: none;
    }
    .caja .lupa { width: 17px; height: 17px; }
    .caja input {
      min-width: 0;
      font-size: 16px;
      padding: 11px 0;
    }
    .caja .limpiar {
      right: 54px;
      width: 28px;
      height: 28px;
      border-radius: 999px;
      flex: 0 0 auto;
    }
    .caja button[type="submit"] {
      right: 6px;
      width: 46px;
      height: 46px;
      min-height: 46px;
      padding: 0 14px;
      border-radius: 999px;
      flex: 0 0 auto;
    }
    .promesa {
      max-width: 30ch;
      margin: 12px auto 0;
      line-height: 1.45;
    }
    .promesa .cuenta {
      display: block;
      margin-bottom: 3px;
    }
    .promesa .cuenta + .sep { display: none; }
    .resultados {
      width: 100%;
      padding: 10px 0 72px;
    }
    .preview-panel { display: none !important; }
    .result-shell,
    .result-main { display: block; }
    .meta {
      position: static;
      margin: 0;
      padding: 6px 2px 8px;
    }
    .prod-strip {
      margin: 2px 0 12px;
      padding: 13px;
      border-radius: 14px;
    }
    .prod-grid { grid-template-columns: 1fr; }
    .news-strip {
      margin: 2px 0 12px;
      padding: 13px;
      border-radius: 14px;
    }
    .news-head {
      align-items: flex-start;
      margin-bottom: 10px;
    }
    .news-head span {
      white-space: normal;
      text-align: right;
    }
    .news-grid {
      grid-template-columns: 1fr;
      gap: 8px;
    }
    .news-card {
      padding: 11px;
      border-radius: 10px;
    }
    .lista { gap: 0; }
    .r {
      min-height: 0;
      padding: 13px 2px 14px;
      border: 0;
      border-top: 1px solid var(--hairline);
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }
    .r:first-child { border-top: 0; }
    .r:hover,
    .r.activo { background: transparent; }
    .r.activo::before { display: none; }
    .r .fila-url { margin-bottom: 4px; }
    .r .favicon,
    .r .favicon img {
      width: 16px;
      height: 16px;
      border-radius: 4px;
    }
    .r .u {
      min-width: 0;
      font-size: 12px;
    }
    .r a.t {
      display: block;
      font-size: 16px;
      line-height: 1.3;
      margin: 2px 0 5px;
      word-break: break-word;
    }
    .r .s {
      font-size: 13.5px;
      line-height: 1.45;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .chip {
      margin: 2px 0 6px;
      width: fit-content;
    }
    .sk,
    .estado {
      padding: 14px 2px;
      border: 0;
      border-top: 1px solid var(--hairline);
      border-radius: 0;
      background: transparent;
    }
    .sk + .sk { margin-top: 0; }
    .estado {
      font-size: 15px;
      line-height: 1.45;
    }
    .estado .hint {
      font-size: 13.5px;
      line-height: 1.45;
      margin-top: 6px;
    }
    .paginacion {
      position: static;
      width: fit-content;
      margin-top: 18px;
      justify-content: center;
      gap: 2px;
      padding: 3px;
      border-radius: 10px;
      box-shadow: none;
    }
    .paginacion button {
      flex: 0 0 auto;
      justify-content: center;
      min-height: 36px;
      padding: 0 13px;
      border-radius: 7px;
      font-size: 13px;
    }
    .paginacion .sep { display: inline; }
    .kbd-row { display: none; }
    .legal-footer {
      bottom: max(10px, env(safe-area-inset-bottom));
      font-size: 10px;
    }
  }

  @media (max-width: 380px) {
    .caja { gap: 6px; padding-left: 12px; padding-right: 58px; }
    .caja button[type="submit"] {
      width: 44px;
      height: 44px;
      min-height: 44px;
      padding: 0;
    }
    .caja .limpiar { right: 50px; }
    .r a.t { font-size: 16px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
  }
