/* Radar de tendencias, como Instagram: una columna de posteos, historias arriba, la lupa en grilla y el perfil de cada
   etiqueta. Usa las superficies y colores del tema oscuro de Grilla; cada categoría pone su tono (--hue). */
.radar-status, .radar-empty, .radar-note { color: var(--muted); font-size: 12px; }
.radar-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.radar-source-status { border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; font-size: 10px; color: var(--muted); }
.radar-source-status.failed { color: #fecaca; border-color: color-mix(in srgb, #ef4444 50%, var(--line)); }
.radar-source-status.partial { color: #fde68a; border-color: color-mix(in srgb, #f59e0b 50%, var(--line)); }
/* Lo que no puede pasar de largo: el radar atrasado, una fuente que no respondió o un dato que no se puede mostrar. */
.radar-alert { margin: 0 0 14px; padding: 9px 12px; border-radius: 8px; font-size: 12px; line-height: 1.45; color: #fde68a; background: color-mix(in srgb, #f59e0b 14%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 45%, var(--line)); overflow-wrap: anywhere; }
.radar-marks { display: flex; flex-wrap: wrap; gap: 6px; }
.radar-mark { font-size: 11px; border-radius: 6px; padding: 3px 8px; }
.radar-mark.focus { background: color-mix(in srgb, #22c55e 18%, var(--surface)); color: #bbf7d0; }
.radar-mark.avoid { background: color-mix(in srgb, #f59e0b 18%, var(--surface)); color: #fde68a; }
.radar-mark.sensitive { background: color-mix(in srgb, #ef4444 18%, var(--surface)); color: #fecaca; }
.radar-reason { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 0 14px 12px; }
.radar-reason input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); font: inherit; font-size: 12px; min-width: 0; }
.radar-reason [aria-busy="true"], .ig-action[aria-busy="true"] { opacity: .6; cursor: progress; }
.radar-chip { border: 1px solid var(--line); background: var(--surface-raised); color: var(--text); border-radius: 20px; padding: 5px 11px; font: inherit; font-size: 11px; cursor: pointer; }

/* El contenido: una columna angosta como el celular, también en la compu. */
.ig-app { max-width: 520px; margin: 0 auto; }
.ig-avatar { --size: 32px; width: var(--size); height: var(--size); flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-size: calc(var(--size) * .5); background: hsl(var(--hue) 45% 22%); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px hsl(var(--hue) 70% 60%); }
.ig-avatar.big { --size: 58px; }
.ig-avatar.huge { --size: 84px; }

/* Historias: los nichos de foco de la cuenta que mira. */
.ig-stories { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.ig-story { display: grid; justify-items: center; gap: 6px; width: 72px; flex: none; background: none; border: 0; color: var(--text); font: inherit; font-size: 10px; cursor: pointer; padding: 0; }
.ig-story span:last-child { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-story.empty { opacity: .45; }

/* El posteo. */
.ig-feed { display: grid; gap: 18px; }
.ig-post { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; }
.ig-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ig-avatars { display: flex; }
.ig-avatars .ig-avatar + .ig-avatar { margin-left: -12px; }
.ig-who { min-width: 0; display: grid; gap: 1px; }
.ig-who small { color: var(--muted); font-size: 11px; }
.ig-names { font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.ig-author { background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.ig-author:hover { text-decoration: underline; }
.ig-and { color: var(--muted); }
.ig-marks { padding: 0 12px 8px; }
.ig-media { position: relative; }
.ig-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ig-carousel::-webkit-scrollbar, .ig-stories::-webkit-scrollbar { display: none; }
.ig-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 4 / 5; display: flex; min-width: 0; }
.ig-slide > * { flex: 1; min-width: 0; }
/* La portada sin imágenes: el titular grande es el protagonista. El tamaño sale del ancho de la lámina (cqw) y del largo
   del texto (xl a xs), así llena la portada en la compu y en el teléfono sin cortarse. */
.ig-slide { container-type: inline-size; }
.ig-cover { display: flex; flex-direction: column; gap: 4cqw; padding: 7cqw 7cqw 6cqw; background: radial-gradient(circle at 20% 15%, hsl(var(--hue) 70% 32%), hsl(var(--hue) 45% 12%) 70%); color: #fff; overflow-wrap: anywhere; }
.ig-kicker { margin: 0; font-size: max(12px, 3.4cqw); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.ig-cover-text { margin: auto 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.08; text-wrap: balance; }
.ig-cover-text.xl { font-size: 11.5cqw; }
.ig-cover-text.l { font-size: 9.6cqw; }
.ig-cover-text.m { font-size: 8.2cqw; }
.ig-cover-text.s { font-size: 7cqw; line-height: 1.12; }
.ig-cover-text.xs { font-size: 6cqw; line-height: 1.15; }
.ig-cover small { font-size: max(12px, 3.2cqw); opacity: .75; }
.ig-text { padding: 22px; background: var(--surface-raised); overflow-y: auto; }
.ig-text h4 { margin: 0 0 14px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.ig-text ol { margin: 0; padding-left: 18px; display: grid; gap: 12px; font-size: 15px; line-height: 1.35; }
.ig-text ol small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.ig-text a, .ig-caption a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.ig-score { margin: 0 0 16px; display: flex; align-items: baseline; gap: 6px; }
.ig-score strong { font-size: 56px; line-height: 1; }
.ig-score span { color: var(--muted); font-size: 13px; }
.ig-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 13px; }
.ig-bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.ig-bar-value { font-weight: 700; }
.ig-bars i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #f59e0b, #ef4444) 0 0 / var(--w) 100% no-repeat, var(--line); }
.ig-fine { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.ig-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .85); color: #111; font-size: 20px; line-height: 1; cursor: pointer; opacity: .75; }
.ig-arrow.prev { left: 8px; } .ig-arrow.next { right: 8px; }
.ig-arrow:hover { opacity: 1; }
.ig-dots { display: flex; justify-content: center; gap: 4px; padding-top: 8px; }
.ig-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.ig-dots span.on { background: #3b82f6; }
.ig-actions { display: flex; align-items: center; gap: 4px; padding: 6px 8px 0; }
.ig-action { background: none; border: 0; font-size: 24px; line-height: 1; padding: 6px; cursor: pointer; border-radius: 8px; }
.ig-action:hover { background: var(--surface-hover); }
.ig-action.save { margin-left: auto; }
.ig-viral { font-size: 13px; font-weight: 700; padding: 0 8px; }
.ig-action.save + .ig-viral { margin-left: 0; }
.ig-actions > .ig-viral:first-child, .ig-action:not(.save) + .ig-viral { margin-left: auto; }
.ig-count { margin: 2px 14px 0; font-size: 13px; font-weight: 700; }
.ig-caption { margin: 4px 14px 12px; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }

/* La lupa y los perfiles: grilla de cuadritos. */
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.ig-tile { position: relative; aspect-ratio: 1; border: 0; border-radius: 0; padding: 8px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; text-align: left; color: #fff; font: inherit; cursor: pointer; background: radial-gradient(circle at 25% 20%, hsl(var(--hue) 65% 30%), hsl(var(--hue) 45% 12%) 75%); overflow: hidden; min-width: 0; }
.ig-tile.note { background: radial-gradient(circle at 25% 20%, hsl(var(--hue) 30% 26%), hsl(var(--hue) 25% 11%) 75%); }
.ig-tile-emoji { position: absolute; top: 6px; left: 8px; font-size: 18px; }
.ig-tile-title { font-size: 12px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ig-tile-line { font-size: 10px; line-height: 1.25; opacity: .85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ig-tile-viral { position: absolute; top: 6px; right: 8px; font-size: 11px; font-weight: 700; background: rgb(0 0 0 / .35); border-radius: 10px; padding: 1px 6px; }
.ig-tile-day { position: absolute; top: 28px; right: 8px; font-size: 9px; background: rgb(0 0 0 / .35); border-radius: 10px; padding: 1px 6px; }
.ig-tile:hover { filter: brightness(1.15); }
.ig-profile-head { display: flex; align-items: center; gap: 18px; margin: 8px 0 12px; }
.ig-profile-head h2 { margin: 0 0 4px; font-size: 20px; }
.ig-profile-head p { margin: 0 0 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.ig-profile-head .ig-profile-stats { color: var(--text); font-size: 13px; }
.ig-related { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ig-back { margin-bottom: 4px; }

/* Una publicación abierta desde la grilla, encima de todo. */
.ig-overlay { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .72); display: grid; place-items: start center; overflow-y: auto; padding: 32px 12px; }
.ig-overlay-box { position: relative; width: min(520px, 100%); }
.ig-close { position: absolute; top: -28px; right: 0; color: #fff; }

.radar-config-dialog { width: 760px; }
.radar-config-dialog .view-switch { margin-bottom: 12px; }
.radar-config-dialog .view-switch small { opacity: .8; }
.radar-config-category { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.radar-config-category legend { font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 0 4px; color: var(--text); }
.radar-config-chip { border: 1px solid var(--line); background: var(--surface-raised); color: var(--muted); border-radius: 20px; padding: 5px 10px; font: inherit; font-size: 11px; cursor: pointer; }
.radar-config-chip.focus { background: color-mix(in srgb, #22c55e 22%, var(--surface)); color: #dcfce7; border-color: transparent; }
.radar-config-chip.avoid { background: color-mix(in srgb, #f59e0b 22%, var(--surface)); color: #fef3c7; border-color: transparent; }
.radar-config-chip small { font-weight: 700; margin-left: 3px; }

@media (max-width: 640px) {
  .radar-reason { grid-template-columns: 1fr; }
  .ig-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ig-carousel { scroll-behavior: auto; } }

/* Conversación se usa todos los días: sin título arriba, el contenido en el centro y todo lo demás en la columna de la
   derecha, que se pliega a una tira de íconos. */
.radar-layout .page-heading { display: none; }
.radar-layout .main-content { padding-top: 24px; }
.rd-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: start; }
.rd-main { min-width: 0; }
.rd-side { position: sticky; top: calc(var(--studio-top) + 16px); width: 292px; max-height: calc(100dvh - var(--studio-top) - 32px); overflow: hidden auto; scrollbar-width: thin; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; align-content: start; gap: 4px; }
.rd-toggle { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); font-size: 18px; line-height: 1; }
.rd-toggle:hover { background: var(--surface-hover); color: var(--text); }
.rd-panel { display: grid; gap: 18px; }
.rd-block { display: grid; gap: 8px; min-width: 0; }
.rd-label { margin: 0; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.rd-side .radar-accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.rd-side .radar-accounts button { padding: 8px 6px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-views { gap: 2px; }
.rd-views .rd-label { margin-bottom: 6px; }
.rd-view { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; font-size: 13px; color: var(--muted); text-align: left; }
.rd-view:hover { background: var(--surface-hover); color: var(--text); }
.rd-view.selected { background: var(--surface-raised); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.rd-side .radar-meta { display: grid; gap: 2px; margin: 0; font-size: 12px; }
.rd-side .radar-meta span:first-child { color: var(--text); }
.rd-more { justify-self: start; padding: 0; font-size: 11px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.rd-more:hover { color: var(--text); }
.rd-how { font-size: 12px; line-height: 1.5; color: var(--muted); }
.rd-how p { margin: 0 0 8px; }
.rd-config { width: 100%; }
/* Plegada: una tira angosta con las vistas, para cambiar de una a otra sin abrirla. */
.rd-rail { display: none; }
.folded .rd-side { width: 56px; padding: 10px 8px; overflow: visible; }
.folded .rd-toggle { position: static; justify-self: center; }
.folded .rd-panel { display: none; }
.folded .rd-rail { display: grid; gap: 4px; justify-items: center; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.rd-rail-item { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; }
.rd-rail-item:hover { background: var(--surface-hover); }
.rd-rail-item.selected { background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); }
/* Al plegar o abrir (no al repintar): la columna entra deslizándose. */
.rd-anim:not(.folded) .rd-panel { animation: rd-in .22s ease-out; }
.rd-anim.folded .rd-rail { animation: rd-in .18s ease-out; }
@keyframes rd-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 800px) {
  .rd-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rd-side { order: -1; position: relative; top: 0; width: auto; max-height: none; }
  .folded .rd-side { width: auto; display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
  .folded .rd-toggle { order: 2; margin-left: auto; }
  .folded .rd-rail { display: flex; border-top: 0; margin-top: 0; padding-top: 0; }
  .rd-toggle span { display: inline-block; transform: rotate(-90deg); }
}
@media (prefers-reduced-motion: reduce) { .rd-anim .rd-panel, .rd-anim .rd-rail { animation: none; } }
