/* «Noticias» — estilo Apple de las apps de trabajo (Mail, Finder en lista): una familia tipográfica en escala
   fija, un solo color para lo que se toca, colores de estado sólo cuando dicen algo, líneas finas en vez de cajas
   con sombra. Tokens calcados de ~/.claude/skills/apple-design/references/tokens.css (con su modo oscuro: la página
   es chica y entera, así que el oscuro va completo). */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --texto: #1d1d1f; --texto-2: #6e6e73; --texto-3: #86868b;
  --fondo: #f5f5f7; --panel: #ffffff;
  --relleno: rgb(120 120 128 / .12); --relleno-2: rgb(120 120 128 / .20);
  --sep: #e5e5ea; --borde: #d2d2d7;
  --acento: #0071e3; --acento-hover: #0077ed;
  --rojo: #ff3b30; --rojo-texto: #d70015;
  --naranja: #ff9500;
  --verde: #34c759; --verde-texto: #248a3d;
  --gris: #8e8e93;
  --cuerpo: 13px; --cuerpo-lh: 18px; --sec: 12px; --sec-lh: 16px;
  --barra: rgb(245 245 247 / .8);
  --pill: 0 1px 2px rgb(0 0 0 / .12), 0 0 0 .5px rgb(0 0 0 / .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --texto: #f5f5f7; --texto-2: #a1a1a6; --texto-3: #6e6e73;
    --fondo: #000000; --panel: #1c1c1e;
    --relleno: rgb(118 118 128 / .24); --relleno-2: rgb(118 118 128 / .32);
    --sep: #38383a; --borde: #48484a;
    --acento: #0a84ff; --acento-hover: #409cff;
    --rojo: #ff453a; --rojo-texto: #ff6961;
    --naranja: #ff9f0a;
    --verde: #30d158; --verde-texto: #30db5b;
    --barra: rgb(28 28 30 / .8);
    --pill: 0 1px 2px rgb(0 0 0 / .5), 0 0 0 .5px rgb(255 255 255 / .08);
  }
}
@media (max-width: 767px) {
  :root { --cuerpo: 15px; --cuerpo-lh: 20px; --sec: 13px; --sec-lh: 18px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--texto); font-family: var(--font);
  font-size: var(--cuerpo); line-height: var(--cuerpo-lh); -webkit-font-smoothing: antialiased;
}
.num { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.oculto { display: none !important; }

/* barra superior translúcida (lo único con desenfoque) */
.barra {
  position: sticky; top: 0; z-index: 10; background: var(--barra);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--sep); padding-top: env(safe-area-inset-top);
}
.barra-in { max-width: 920px; margin: 0 auto; height: 44px; padding: 0 16px; display: flex; align-items: center; gap: 10px; }
.marca img { height: 22px; width: auto; display: block; }
.barra-titulo { font-size: var(--sec); color: var(--texto-2); font-weight: 600; }
.actualizado { margin-left: auto; font-size: 11px; line-height: 14px; color: var(--texto-3); }

.btn-texto {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--acento); font-size: var(--cuerpo); cursor: pointer;
  transition: background-color .15s var(--ease);
}
.btn-texto:hover { background: var(--relleno); }
.btn-texto svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.btn-texto:disabled { color: var(--texto-3); cursor: default; }

.contenido { max-width: 920px; margin: 0 auto; padding: 20px 16px calc(48px + env(safe-area-inset-bottom)); }
.cabeza { margin-bottom: 14px; }
.titulo { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.012em; }
.subtitulo { margin: 2px 0 0; font-size: var(--sec); line-height: var(--sec-lh); color: var(--texto-2); }

/* controles */
.controles { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.controles-2 { margin-bottom: 16px; }
.segmentado { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--relleno); }
.segmentado button {
  height: 26px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; cursor: pointer;
  font-size: var(--sec); color: var(--texto); white-space: nowrap; transition: background-color .15s var(--ease);
}
.segmentado button:hover { background: rgb(0 0 0 / .04); }
.segmentado button[aria-selected="true"] { background: var(--panel); box-shadow: var(--pill); font-weight: 600; }
@media (prefers-color-scheme: dark) { .segmentado button[aria-selected="true"] { background: #636366; } }
.cuenta { color: var(--texto-2); font-weight: 400; margin-left: 2px; }
.buscador {
  flex: 1 1 220px; max-width: 320px; height: 28px; padding: 0 8px; display: flex; align-items: center; gap: 6px;
  border-radius: 6px; background: var(--relleno); color: var(--texto-2);
}
.buscador svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.buscador input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--texto); font: inherit; font-size: var(--cuerpo); }
.buscador input::placeholder { color: var(--texto-3); }

/* grupos (un parte, un día del Radar) */
.grupo { margin-bottom: 22px; }
.grupo-cab { display: flex; align-items: baseline; gap: 8px; padding: 0 4px 6px; }
.grupo-titulo { font-size: 15px; line-height: 20px; font-weight: 600; }
.grupo-meta { font-size: var(--sec); line-height: var(--sec-lh); color: var(--texto-2); }
.grupo-cab .cuenta { margin-left: auto; font-size: 11px; color: var(--texto-3); }
.tarjeta { background: var(--panel); border-radius: 10px; overflow: hidden; }
.bloque {
  padding: 8px 16px 6px 34px; font-size: 11px; line-height: 14px; font-weight: 600; color: var(--texto-2);
  border-top: 1px solid var(--sep); background: var(--panel);
}
.tarjeta > .bloque:first-child { border-top: 0; }

/* filas tipo Mail: punto de no leído, dos o tres renglones, chevron */
.fila { display: flex; gap: 10px; padding: 9px 12px 9px 12px; position: relative; }
.fila + .fila::before { content: ""; position: absolute; top: 0; left: 34px; right: 0; height: 1px; background: var(--sep); }
.fila:hover { background: rgb(0 0 0 / .03); }
@media (prefers-color-scheme: dark) { .fila:hover { background: rgb(255 255 255 / .04); } }
.punto { width: 12px; flex: none; display: flex; justify-content: center; padding-top: 5px; }
.punto::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.fila.sinleer .punto::after { background: var(--acento); }
.fila.alerta .punto::after { background: var(--rojo); }
.cuerpo { min-width: 0; flex: 1; }
.enlace { display: block; cursor: pointer; }
.hecho { font-weight: 600; }
.nro { color: var(--texto-3); margin-right: 6px; }
.fila.leida .hecho { font-weight: 400; }
.para { color: var(--texto); margin-top: 2px; }
.para b { font-weight: 600; color: var(--texto-2); }
.meta { margin-top: 3px; font-size: var(--sec); line-height: var(--sec-lh); color: var(--texto-2); display: flex; flex-wrap: wrap; gap: 0 6px; align-items: center; }
.meta .sep::before { content: "·"; color: var(--texto-3); }
.meta a.fuente { color: var(--acento); }
.meta .corte { display: none; }
.mas { border: 0; background: none; padding: 0; color: var(--acento); font-size: var(--sec); cursor: pointer; }
.fuentes { margin: 6px 0 0; padding: 0; list-style: none; border-left: 2px solid var(--sep); }
.fuentes li { padding: 3px 0 3px 10px; font-size: var(--sec); line-height: var(--sec-lh); color: var(--texto-2); }
.fuentes a { color: var(--acento); }
.chev { flex: none; width: 14px; color: var(--texto-3); padding-top: 3px; }
.chev svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Radar IA */
.badge {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 9px; font-size: 11px;
  line-height: 14px; font-weight: 600; background: var(--relleno); color: var(--texto-2); margin-right: 6px; vertical-align: 1px;
}
.badge.riesgo { background: color-mix(in srgb, var(--rojo) 15%, transparent); color: var(--rojo-texto); }
.badge.aplicar { background: color-mix(in srgb, var(--verde) 15%, transparent); color: var(--verde-texto); }
.que { margin-top: 3px; }
.que b { font-weight: 600; }

/* Vidriera: la foto del producto a la izquierda */
.foto { flex: none; width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--relleno); }
.precio { margin-top: 3px; font-weight: 600; }
.angosto { display: none; }

/* Todo lo leído */
.estado-en { display: inline-flex; align-items: center; gap: 4px; }
.estado-en::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--verde); }
.estado-en.alerta::before { background: var(--rojo); }
.resumen { color: var(--texto-2); margin-top: 2px; font-size: var(--sec); line-height: var(--sec-lh);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* aviso flotante («Copiado…»): lo único con sombra, porque flota */
.aviso {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  padding: 8px 14px; border-radius: 10px; background: var(--panel); color: var(--texto); font-size: var(--sec);
  line-height: var(--sec-lh); box-shadow: 0 0 0 .5px rgb(0 0 0 / .12), 0 8px 28px rgb(0 0 0 / .16);
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); z-index: 20;
}
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }

/* vacío, carga y error */
.vacio { padding: 56px 16px; text-align: center; }
.vacio p { margin: 0; }
.vacio .t { font-size: 15px; line-height: 20px; font-weight: 600; }
.vacio .s { margin-top: 4px; font-size: var(--sec); line-height: var(--sec-lh); color: var(--texto-2); }

@media (max-width: 767px) {
  .ancho { display: none; }
  .angosto { display: inline; }
  .segmentado button { height: 40px; }
  .btn-texto, .buscador { height: 44px; }
  .buscador { max-width: none; flex-basis: 100%; }
  #vistas { width: 100%; }
  #vistas button { flex: 1; padding: 0 6px; }
  .fila { padding: 12px 12px; min-height: 44px; }
  .meta .corte { display: block; flex-basis: 100%; height: 2px; }
  .meta .s1 { display: none; }
  .meta .mas { min-height: 36px; padding: 0 2px; }
  .meta .mas + .sep { margin: 0 4px; }
  .barra-titulo { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
