/* =====================================================================
   REGENTIAL — Motor IA Industrial · styles.css v2.0
===================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #05070D;
  --bg-soft: #080A12;
  --surface: #0F1525;
  --surface-2: #141C30;
  --surface-3: #1B2640;
  --border: rgba(27,38,64,.2);
  --border-strong: rgba(50,69,105,.4);
  --border-accent: rgba(34,211,238,.2);
  --border-accent-strong: rgba(34,211,238,.5);
  --accent: #22D3EE;
  --accent-mid: #06B6D4;
  --accent-deep: #0891B2;
  --accent-glow: rgba(34,211,238,0.35);
  --text: #EEF3FB;
  --text-soft: #B8C9E8;
  --muted: #5B7099;
  --muted-2: #7B92C2;
  --muted-3: #2A3A5C;
  --green: #7BE0A4;
  --green-soft: rgba(123,224,164,0.15);
  --red: #F87171;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 100px;
  --font-body: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;
  --font-display: 'Bebas Neue', 'Inter', sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* Scrollbar global — thin, sin track visible */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.10) transparent;
}
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 100px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(34,211,238,0.22); }

body {
  background: #050810;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(30,58,138,.25), transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 110%, rgba(15,35,90,.20), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; }
em { font-style: normal; }
[hidden] { display: none !important; }

/* =====================================================================
   ANIMATIONS — 18 @keyframes, todas usadas más abajo
===================================================================== */

@keyframes boot-fade-out {
  0%   { opacity: 1; transform: scale(1); }
  60%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); visibility: hidden; }
}

@keyframes boot-ring-spin {
  to { transform: rotate(360deg); }
}

@keyframes boot-bar-fill {
  0%   { width: 0%; }
  100% { width: 100%; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes step-enter {
  from { opacity: 0; transform: translateX(28px); filter: blur(6px); }
  to   { opacity: 1; transform: translateX(0); filter: blur(0); }
}

@keyframes step-enter-back {
  from { opacity: 0; transform: translateX(-28px); filter: blur(6px); }
  to   { opacity: 1; transform: translateX(0); filter: blur(0); }
}

@keyframes step-exit {
  from { opacity: 1; transform: translateX(0); filter: blur(0); }
  to   { opacity: 0; transform: translateX(-24px); filter: blur(4px); }
}

@keyframes step-exit-back {
  from { opacity: 1; transform: translateX(0); filter: blur(0); }
  to   { opacity: 0; transform: translateX(24px); filter: blur(4px); }
}

@keyframes option-enter {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes option-snap {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes ripple-expand {
  from { width: 0; height: 0; opacity: 0.45; }
  to   { width: 400px; height: 400px; opacity: 0; }
}

@keyframes scanline-cross {
  0%   { left: -8%; opacity: 0; }
  20%  { opacity: 0.85; }
  80%  { opacity: 0.85; }
  100% { left: 108%; opacity: 0; }
}

@keyframes bar-pulse {
  0%, 100% { transform: scaleY(0.25); opacity: 0.4; }
  50%      { transform: scaleY(1); opacity: 1; }
}

@keyframes overlay-show {
  from { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); }
  to   { opacity: 1; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}

@keyframes overlay-hide {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes thinking-card-in {
  from { opacity: 0; transform: scale(0.92) translateY(20px); filter: blur(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

@keyframes thinking-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes check-pop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(120%) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(120%); }
}

@keyframes reveal-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 8px 24px -10px var(--accent-glow); }
  50%      { box-shadow: 0 14px 36px -8px rgba(34,211,238,0.50); }
}

/* reveal-in-deep: fade + translateY + blur leve */
@keyframes reveal-in-deep {
  from { opacity: 0; transform: translateY(16px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

/* icon-pop: microinteracción de iconos SVG al hacer reveal */
@keyframes icon-pop {
  0%   { transform: scale(0.7) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.12) rotate(2deg);  opacity: 1; }
  100% { transform: scale(1) rotate(0deg);     opacity: 1; }
}

/* bar-pulse-eq: equalizer más expresivo */
@keyframes bar-pulse-eq {
  0%   { transform: scaleY(0.18); opacity: 0.35; }
  30%  { transform: scaleY(1);    opacity: 1; }
  60%  { transform: scaleY(0.55); opacity: 0.75; }
  80%  { transform: scaleY(0.90); opacity: 0.95; }
  100% { transform: scaleY(0.18); opacity: 0.35; }
}

/* =====================================================================
   BACKGROUND
===================================================================== */
.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(100,140,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,140,255,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
}
.bg-spot {
  position: fixed;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse, rgba(30,58,138,0.20) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
}

/* =====================================================================
   BOOT SEQUENCE
===================================================================== */
.boot-overlay {
  position: fixed; inset: 0;
  background: #05070D;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
body:not(.boot) .boot-overlay {
  animation: boot-fade-out 0.6s var(--ease-out) forwards;
}
.boot-content {
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.boot-logo-wrap {
  position: relative; width: 64px; height: 64px;
}
.boot-logo {
  position: absolute; inset: 8px;
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  color: #05070D;
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding-top: 3px;
  animation: boot-logo-pulse 2s ease-in-out infinite;
}
@keyframes boot-logo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,211,238,0.0); }
  50%       { box-shadow: 0 0 0 8px rgba(34,211,238,0.15); }
}
.boot-logo-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px dashed var(--border-accent-strong);
  animation: boot-ring-spin 1.6s linear infinite;
}
.boot-text { text-align: center; }
.boot-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--accent);
  margin-bottom: 6px;
}
.boot-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.boot-bar {
  width: 200px; height: 2px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.boot-bar-fill {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-mid));
  animation: boot-bar-fill 3.2s var(--ease-out) forwards;
}

/* =====================================================================
   TOPBAR
===================================================================== */
.topbar {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(5,7,13,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  gap: 16px;
}
.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  color: #05070D;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding-top: 2px;
}
.brand-name { font-weight: 600; font-size: 15px; }
.topbar-meta {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.5px;
  color: var(--muted);
}
.meta-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
.meta-label { color: var(--text-soft); }
.meta-sep { color: var(--muted-3); }
.topbar-home {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  font-size: 12px; font-weight: 500;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all 0.2s var(--ease-in-out);
}
.topbar-home:hover { border-color: var(--border-accent); color: var(--accent); }
@media (max-width: 680px) {
  .topbar { padding: 16px 18px; }
  .topbar-meta { display: none; }
}

/* =====================================================================
   APP
===================================================================== */
.app {
  position: relative; z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 56px 28px 80px;
}

/* =====================================================================
   INTRO
===================================================================== */
.intro {
  text-align: center;
  padding: 24px 0 8px;
  animation: fade-up 0.6s var(--ease-out);
}
.intro-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 28px;
}
.intro-eyebrow-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-glow);
}
.intro-title {
  font-size: clamp(34px, 5.5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 24px;
}
.intro-title em {
  background: linear-gradient(135deg, #a5f3fc 0%, #22D3EE 35%, #06B6D4 70%, #0891B2 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro-sub {
  font-size: 16px; color: var(--muted);
  line-height: 1.6;
  max-width: 540px;
  margin: 0 auto 36px;
}
.intro-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px;
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  color: #05070D;
  border: none;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  transition: all 0.2s var(--ease-in-out);
  box-shadow: 0 10px 32px -10px var(--accent-glow);
}
.intro-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px -10px rgba(34,211,238,0.50);
}
.intro-meta {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
}

/* =====================================================================
   STEPPER
===================================================================== */
.stepper {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.step-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.25s var(--ease-in-out);
  white-space: nowrap;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  color: var(--muted-2);
  padding: 3px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.step-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.step-pill.active {
  background: rgba(34,211,238,0.06);
  border-color: var(--border-accent-strong);
}
.step-pill.active .step-num {
  background: var(--accent); color: #05070D; border-color: var(--accent);
}
.step-pill.active .step-label { color: var(--accent); }
.step-pill.done .step-num {
  background: var(--green-soft); color: var(--green);
  border-color: rgba(74,222,128,0.3);
}
.step-pill.done .step-label { color: var(--text-soft); }
.step-line { flex: 0 0 16px; height: 1px; background: var(--border); }
@media (max-width: 680px) {
  .stepper { gap: 4px; }
  .step-line { display: none; }
  .step-label { display: none; }
  .step-pill { padding: 8px; }
  .step-pill.active .step-label { display: inline; }
}

/* =====================================================================
   STEP CARD + TRANSITIONS
===================================================================== */
.step-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 36px 28px;
  position: relative;
}
.step-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--accent-glow) 50%, transparent 90%);
  opacity: 0.4;
}
.step-card.step-enter {
  animation: step-enter 0.22s var(--ease-out);
}
.step-card.step-enter-back {
  animation: step-enter-back 0.22s var(--ease-out);
}
.step-card.step-exit {
  animation: step-exit 0.2s var(--ease-in-out) forwards;
}
.step-card.step-exit-back {
  animation: step-exit-back 0.2s var(--ease-in-out) forwards;
}
.step-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.step-card-meta {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
  padding: 5px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.step-card-id { color: var(--accent); font-weight: 600; }
.step-card-sep { color: var(--muted-3); }
.step-card-progress { color: var(--muted); }
.step-card-question {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600; line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.step-card-purpose {
  font-size: 14px; color: var(--muted);
  line-height: 1.55;
  margin-bottom: 26px;
  max-width: 560px;
}

/* OPTIONS GRID */
.options-grid {
  display: flex; flex-direction: column; gap: 10px;
}
.option-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  font-family: inherit;
  font-size: 15px; font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.18s var(--ease-in-out);
  width: 100%;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: option-enter 0.32s var(--ease-out) forwards;
}
.option-card .option-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  transition: all 0.2s var(--ease-in-out);
}
.option-card .option-icon svg { width: 20px; height: 20px; }
.option-card .option-body { flex: 1; min-width: 0; }
.option-card .option-label { display: block; line-height: 1.4; }
.option-card .option-mark {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  position: relative;
  transition: all 0.2s var(--ease-in-out);
}
.option-card .scanline {
  position: absolute;
  top: 0; bottom: 0; left: -8%;
  width: 30%;
  background: linear-gradient(90deg, transparent 0%, rgba(34,211,238,0.15) 50%, transparent 100%);
  pointer-events: none;
  opacity: 0;
}
.option-card .ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,0.30) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ripple-expand 0.7s var(--ease-out) forwards;
}
.option-card:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  /* transform y glow definidos al final del archivo */
}
.option-card:hover .option-icon {
  background: rgba(34,211,238,0.05);
  border-color: var(--border-accent);
}
.option-card:hover .option-mark { border-color: var(--accent); }
.option-card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}
.option-card.is-selected {
  background: rgba(34,211,238,0.05);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px -16px var(--accent-glow);
  animation: option-snap 0.32s var(--ease-snap);
}
.option-card.is-selected .option-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #05070D;
}
.option-card.is-selected .option-mark {
  border-color: var(--accent);
  background: var(--accent);
}
.option-card.is-selected .option-mark::after {
  content: '';
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: #05070D;
}
.option-card.is-scanning .scanline {
  animation: scanline-cross 0.65s var(--ease-out);
}

/* Step footer */
.step-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.step-back {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px; font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.2s var(--ease-in-out);
}
.step-back:hover { color: var(--text); border-color: var(--border-strong); }

/* SIGNALS PANEL */
#signalsPanel {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
#signalsPanel .signal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: rgba(34,211,238,0.04);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-soft);
}
#signalsPanel .signal-key { color: var(--accent); font-weight: 600; }
#signalsPanel .signal-val {
  color: var(--text-soft);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 680px) {
  .step-card { padding: 26px 22px 22px; }
  #signalsPanel { display: none; }
}

/* =====================================================================
   THINKING OVERLAY
===================================================================== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.88);
  z-index: 999;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 72px 24px 24px;   /* FIX: card arriba, no centrado en pantalla */
  overflow-y: auto;
  opacity: 0;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  pointer-events: none;
}
.overlay.overlay-show {
  animation: overlay-show 0.35s var(--ease-out) forwards;
  pointer-events: auto;         /* reactiva cuando está visible */
}
.overlay.overlay-hide {
  animation: overlay-hide 0.4s var(--ease-in-out) forwards;
}
.thinking-card {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border-accent-strong);
  border-radius: var(--radius-lg);
  padding: 32px 32px 28px;
  position: relative;
  overflow: hidden;
  animation: thinking-card-in 0.5s var(--ease-out);
}
.thinking-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.thinking-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.thinking-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 1.5px;
  color: var(--accent);
}
.thinking-status-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse-dot 1s ease-in-out infinite;
}
.thinking-counter-pct {
  font-family: var(--font-mono);
  font-size: 18px; font-weight: 700;
  color: var(--accent);
}
.thinking-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.thinking-bars {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 4px; height: 40px;
  margin-bottom: 20px;
}
.thinking-bars span {
  display: block;
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-mid) 100%);
  border-radius: 2px;
  transform-origin: bottom;
  animation: bar-pulse-eq 1.1s ease-in-out infinite;
}
.thinking-bars span:nth-child(1)  { animation-delay: 0.00s; animation-duration: 0.95s; height: 60%; }
.thinking-bars span:nth-child(2)  { animation-delay: 0.09s; animation-duration: 1.20s; height: 80%; }
.thinking-bars span:nth-child(3)  { animation-delay: 0.18s; animation-duration: 0.85s; height: 100%; }
.thinking-bars span:nth-child(4)  { animation-delay: 0.27s; animation-duration: 1.10s; height: 75%; }
.thinking-bars span:nth-child(5)  { animation-delay: 0.05s; animation-duration: 0.75s; height: 90%; }
.thinking-bars span:nth-child(6)  { animation-delay: 0.36s; animation-duration: 1.30s; height: 50%; }
.thinking-bars span:nth-child(7)  { animation-delay: 0.14s; animation-duration: 0.90s; height: 95%; }
.thinking-bars span:nth-child(8)  { animation-delay: 0.45s; animation-duration: 1.05s; height: 70%; }
.thinking-bars span:nth-child(9)  { animation-delay: 0.22s; animation-duration: 0.80s; height: 85%; }
.thinking-bars span:nth-child(10) { animation-delay: 0.31s; animation-duration: 1.15s; height: 55%; }
.thinking-bars span:nth-child(11) { animation-delay: 0.08s; animation-duration: 0.70s; height: 100%; }
.thinking-bars span:nth-child(12) { animation-delay: 0.40s; animation-duration: 1.00s; height: 65%; }

.thinking-progress {
  height: 4px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 18px;
}
.thinking-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-deep) 0%, var(--accent) 50%, var(--accent-mid) 100%);
  border-radius: 100px;
}
.thinking-msg-wrap {
  text-align: center;
  margin-bottom: 24px;
  min-height: 22px;
}
.thinking-msg {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.2px;
}
.thinking-msg.msg-in {
  animation: thinking-msg-in 0.25s var(--ease-out);
}
.thinking-stages {
  list-style: none;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.thinking-stages li {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.3s;
}
.stage-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.3s var(--ease-out);
}
.stage-check svg { width: 12px; height: 12px; }
.thinking-stages li.done { color: var(--text); }
.thinking-stages li.done .stage-check {
  background: var(--green);
  border-color: var(--green);
  color: #05070D;
  animation: check-pop 0.4s var(--ease-snap);
}
.thinking-routes {
  display: flex; align-items: center; justify-content: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tr-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
}
.tr-val {
  font-family: var(--font-mono);
  font-size: 18px; font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.tr-item-selected .tr-val { color: var(--accent); }
.tr-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.tr-sep { color: var(--muted-3); font-family: var(--font-mono); font-size: 14px; }
@media (max-width: 540px) {
  .thinking-card { padding: 24px 22px 22px; }
  .thinking-stages li { font-size: 12px; }
  .thinking-routes { gap: 10px; padding: 12px; }
  .tr-val { font-size: 15px; }
}

/* =====================================================================
   ACTIVITY TOASTS
===================================================================== */
.toasts {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 600;
  display: flex; flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px -16px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateX(120%);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}
.toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-mid) 100%);
}
.toast.toast-in  { animation: toast-in 0.4s var(--ease-out) forwards; }
.toast.toast-out { animation: toast-out 0.4s var(--ease-in-out) forwards; }
.toast-icon {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.toast-icon svg { width: 14px; height: 14px; }
.toast-body { flex: 1; min-width: 0; }
.toast-label {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.toast-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.4;
  font-weight: 500;
}
@media (max-width: 560px) {
  .toasts {
    bottom: 16px; right: 12px; left: 12px;
    max-width: none;
  }
}

/* =====================================================================
   TREE MAP — barra horizontal de nodos del camino de decisión
===================================================================== */
.tree-map {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 28px;
  padding: 18px 18px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.tree-map::-webkit-scrollbar { height: 4px; }
.tree-map::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.tm-node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 230px;
  transition:
    background 0.2s var(--ease-in-out),
    border-color 0.2s var(--ease-in-out),
    transform 0.2s var(--ease-in-out);
}
.tm-node[role="button"] { cursor: pointer; }
.tm-node[role="button"]:hover {
  background: rgba(255,255,255,0.025);
  border-color: var(--border);
}
.tm-node[role="button"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}

.tm-node-dot {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  color: var(--muted);
  transition:
    background 0.22s var(--ease-in-out),
    border-color 0.22s var(--ease-in-out),
    color 0.22s var(--ease-in-out),
    box-shadow 0.22s var(--ease-in-out);
}
.tm-node-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.tm-node-dot svg { width: 14px; height: 14px; }

.tm-node-body {
  display: flex; flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tm-node-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted-2);
  line-height: 1.1;
}
.tm-node-value {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.3;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}
.tm-node-em {
  font-style: normal;
  color: var(--muted-2);
  font-weight: 400;
}

/* Active node: ring de accent, glow leve */
.tm-node-active .tm-node-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #05070D;
  box-shadow: 0 0 0 4px rgba(34,211,238,0.1);
}
.tm-node-active .tm-node-label { color: var(--accent); }
.tm-node-active .tm-node-value { color: var(--text); }
.tm-node-active .tm-node-em { color: var(--accent-mid); }

/* Done node: check verde + valor visible */
.tm-node-done .tm-node-dot {
  background: var(--green);
  border-color: var(--green);
  color: #05070D;
}
.tm-node-done .tm-node-label { color: var(--text-soft); }
.tm-node-done .tm-node-value { color: var(--text); }

/* Pending: gris tenue */
.tm-node-pending { opacity: 0.55; }
.tm-node-pending .tm-node-dot { background: var(--bg); }

/* Conectores entre nodos */
.tm-link {
  flex: 1 1 28px;
  min-width: 22px;
  max-width: 60px;
  align-self: center;
  height: 1.5px;
  background: var(--border);
  position: relative;
  margin: 0 2px;
}
.tm-link::after {
  content: '';
  position: absolute;
  right: -3px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-top: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  transform: translateY(-50%) rotate(45deg);
}
.tm-link-done {
  background: var(--green);
}
.tm-link-done::after {
  border-color: var(--green);
}
.tm-link-active {
  background: linear-gradient(90deg, var(--green) 0%, var(--accent) 100%);
}
.tm-link-active::after {
  border-color: var(--accent);
}

@media (max-width: 720px) {
  .tree-map { padding: 14px 12px; gap: 0; }
  .tm-node { padding: 6px 8px; gap: 8px; max-width: 180px; }
  .tm-node-dot { width: 30px; height: 30px; }
  .tm-node-num { font-size: 10px; }
  .tm-node-value { max-width: 120px; font-size: 11.5px; }
  .tm-node-label { font-size: 9px; letter-spacing: 1px; }
  .tm-link { min-width: 14px; max-width: 24px; }
}

/* =====================================================================
   TREE STAGE — viewport con cámara horizontal
===================================================================== */
.tree-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}
.tree-main {
  min-width: 0;
  position: relative;
}
@media (max-width: 880px) {
  .tree-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

/* Ghost panel: rama tenue del próximo paso */
.tree-ghost {
  position: relative;
  padding: 18px 16px 22px;
  background: linear-gradient(180deg, rgba(34,211,238,0.025) 0%, transparent 100%);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s var(--ease-in-out), background 0.2s var(--ease-in-out);
}
.tree-ghost-head {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.tree-ghost-eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.tree-ghost-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.005em;
  transition: color 0.2s var(--ease-in-out);
}
.tree-ghost-cards {
  display: flex; flex-direction: column;
  gap: 8px;
  position: relative;
}
.tree-ghost-fade {
  pointer-events: none;
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 40px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-soft) 90%);
  opacity: 0.6;
}
.tree-ghost-empty .tree-ghost-fade { display: none; }

/* Estado hover: la rama se "ilumina" levemente */
.tree-ghost-hover {
  border-color: var(--border-accent);
  background: linear-gradient(180deg, rgba(34,211,238,0.05) 0%, transparent 100%);
}
.tree-ghost-hover .tree-ghost-label { color: var(--accent); }

.ghost-card {
  display: flex; align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  border-radius: 8px;
  opacity: 0.55;
  transition:
    opacity 0.2s var(--ease-in-out),
    border-color 0.2s var(--ease-in-out),
    transform 0.2s var(--ease-in-out),
    background 0.2s var(--ease-in-out);
}
.ghost-card-dot {
  flex-shrink: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.02);
}
.ghost-card-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 500;
}
.ghost-card-highlight {
  opacity: 0.92;
  border-color: var(--border-accent);
  background: rgba(34,211,238,0.04);
  transform: translateX(2px);
}
.ghost-card-highlight .ghost-card-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.12);
}
.ghost-card-highlight .ghost-card-label { color: var(--text); }
.ghost-card-final .ghost-card-dot { background: var(--accent); }
.ghost-card-final .ghost-card-label { color: var(--text-soft); }
.ghost-empty {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.3px;
  padding: 6px 4px;
}

/* =====================================================================
   OPTIONS GRID — refinado como "node cards" con spine + branch
===================================================================== */
.options-grid {
  position: relative;
  padding-left: 28px;
}
.options-grid::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 22px;
  bottom: 22px;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, var(--border-strong) 18%, var(--border-strong) 82%, transparent 100%);
  pointer-events: none;
}

.option-card::after {
  /* Branch horizontal: del spine al borde izquierdo del card */
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  width: 16px;
  height: 1px;
  background: var(--border-strong);
  transform: translateY(-0.5px);
  transition: background 0.2s var(--ease-in-out), width 0.2s var(--ease-in-out);
  pointer-events: none;
}
.option-card:hover::after,
.option-card:focus-visible::after {
  background: var(--accent);
  width: 18px;
}
.option-card.is-selected::after {
  background: var(--accent);
}

@media (max-width: 540px) {
  .options-grid { padding-left: 22px; }
  .options-grid::before { left: 10px; }
  .option-card::after { left: -12px; width: 12px; }
  .option-card:hover::after, .option-card:focus-visible::after { width: 14px; }
}


.report {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
}
.stagger { opacity: 0; }
.stagger.reveal-in { animation: reveal-in-deep 0.60s var(--ease-out) forwards; }
.stagger:nth-child(1).reveal-in { animation-delay:   0ms; }
.stagger:nth-child(2).reveal-in { animation-delay: 110ms; }
.stagger:nth-child(3).reveal-in { animation-delay: 220ms; }
.stagger:nth-child(4).reveal-in { animation-delay: 330ms; }
.stagger:nth-child(5).reveal-in { animation-delay: 440ms; }
.stagger:nth-child(6).reveal-in { animation-delay: 550ms; }
.stagger:nth-child(7).reveal-in { animation-delay: 660ms; }
.stagger:nth-child(8).reveal-in { animation-delay: 770ms; }

.report-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 28px 32px;
  background: linear-gradient(180deg, var(--surface-2) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  gap: 24px;
  flex-wrap: wrap;
}
.report-head-left { flex: 1; min-width: 240px; }
.report-head-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 10px;
}
.report-head-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
.report-head-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.report-head-right { display: flex; gap: 16px; }
.report-meta-block { text-align: right; }
.report-meta-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.report-meta-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* Case chips */
.report-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}
.chip {
  background: var(--bg-soft);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.chip-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34,211,238,0.06);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  color: var(--accent);
}
.chip-icon svg { width: 14px; height: 14px; }
.chip-body { flex: 1; min-width: 0; }
.chip-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 3px;
}
.chip-value {
  font-size: 12px;
  color: var(--text);
  line-height: 1.35;
  font-weight: 500;
}
@media (max-width: 720px) {
  .report-chips { grid-template-columns: repeat(2, 1fr); }
}

/* Report sections */
.r-section {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
}
.r-section:last-child { border-bottom: none; }
.r-section-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
}
.r-section-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-accent-strong);
  background: rgba(34,211,238,0.06);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.r-section-tag {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.r-section-mini {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 2px;
}

.r-reading {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  padding-left: 42px;
}

.r-arch-box {
  margin-top: 4px;
  padding: 24px 26px;
  background: rgba(34,211,238,0.04);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  margin-left: 42px;
}
.r-arch-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-mid);
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 8px;
}
.r-arch-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1.05;
  background: linear-gradient(135deg, #cffafe 0%, #22D3EE 35%, #06B6D4 70%, #0891B2 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.r-arch-para {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  margin-bottom: 14px;
}
.r-arch-bullets {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 8px;
}
.r-arch-bullets li {
  position: relative;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
}
.r-arch-bullets li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.r-resolves {
  list-style: none;
  padding-left: 42px;
  display: flex; flex-direction: column;
  gap: 10px;
}
.r-resolves li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-soft);
}
.r-resolves li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* MODULES with badges */
.r-mod-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-left: 42px;
}
.r-mod-group-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.r-mod-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.r-mod-group:first-child .r-mod-group-label { color: var(--accent); }
.r-mod-group:last-child .r-mod-group-label { color: var(--muted); }
.r-mod-group-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
}
.r-mod-list {
  display: flex; flex-direction: column;
  gap: 10px;
}
.mod-card {
  padding: 14px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s;
}
.mod-card:hover { border-color: var(--border-strong); }
.mod-card.core { border-left: 2px solid var(--accent); }
.mod-card.optional { border-left: 2px solid var(--muted-2); opacity: 0.92; }
.mod-card-head {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 10px;
}
.mod-card-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34,211,238,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
}
.mod-card-icon svg { width: 15px; height: 15px; }
.mod-card-title { flex: 1; min-width: 0; }
.mod-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.mod-card-id {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--accent-mid);
  letter-spacing: 1px;
  margin-top: 2px;
}
.mod-badge {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  padding: 3px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.mod-badge.core {
  background: rgba(34,211,238,0.1);
  color: var(--accent);
  border: 1px solid var(--border-accent);
}
.mod-badge.optional {
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border: 1px solid var(--border);
}
.mod-card-body {
  display: flex; flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.mod-row {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  line-height: 1.45;
}
.mod-row-label {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
  min-width: 78px;
  padding-top: 1px;
}
.mod-row-value {
  flex: 1;
  color: var(--text-soft);
}

/* Phases */
.r-phases {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-left: 42px;
}
.r-phase {
  padding: 16px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.r-phase-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.r-phase-num {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  color: #05070D;
  background: var(--accent);
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.r-phase-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.r-phase-list {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 7px;
}
.r-phase-list li {
  position: relative;
  padding-left: 14px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}
.r-phase-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 7px;
  width: 5px; height: 5px;
  background: var(--accent-mid);
  border-radius: 50%;
}

@media (max-width: 720px) {
  .r-arch-box, .r-resolves, .r-mod-groups, .r-phases { margin-left: 0; }
  .r-reading { padding-left: 0; }
  .r-mod-groups, .r-phases { grid-template-columns: 1fr; }
  .r-section { padding: 22px 22px; }
  .report-head { padding: 22px 22px; }
}

/* CTA section */
.r-section-cta .r-cta-wrap {
  display: flex; flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-left: 42px;
}
@media (max-width: 720px) {
  .r-section-cta .r-cta-wrap { padding-left: 0; }
}
.r-cta-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px;
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  color: #05070D;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.2s var(--ease-in-out);
  animation: cta-pulse 2.8s ease-in-out infinite;
}
.r-cta-primary:hover {
  transform: translateY(-1px);
}
.r-cta-secondary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 18px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s var(--ease-in-out);
}
.r-cta-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}
.r-cta-microcopy {
  margin-top: 14px;
  padding-left: 42px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
@media (max-width: 720px) {
  .r-cta-microcopy { padding-left: 0; }
}

/* =====================================================================
   ERROR
===================================================================== */
.error-box {
  margin: 60px auto;
  max-width: 460px;
  padding: 40px 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.error-icon {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
.error-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.error-msg { font-size: 14px; color: var(--muted); margin-bottom: 22px; line-height: 1.5; }
.error-retry {
  padding: 10px 24px;
  background: var(--accent);
  color: #05070D;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s var(--ease-in-out);
}
.error-retry:hover { background: var(--accent-mid); }

/* =====================================================================
   FOOTER
===================================================================== */
.footer-mini {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-sep { color: var(--muted-3); }
.footer-link { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-link:hover { color: var(--accent); }

/* =====================================================================
   INVESTOR BANNER — Solo visible con ?demo=1 (html.investor-mode)
===================================================================== */
.investor-banner { display: none; }

html.investor-mode .investor-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(34,211,238,0.07) 0%, rgba(34,211,238,0.02) 100%);
  border: 1px solid var(--border-accent-strong);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
html.investor-mode .investor-banner::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.85;
}

.ib-left {
  display: flex; flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.ib-tag {
  display: inline-flex; align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 1.8px;
  color: var(--accent);
  font-weight: 600;
}
.ib-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.ib-text {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.4;
}

.ib-actions {
  display: flex; align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ib-btn {
  display: inline-flex; align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.18s var(--ease-in-out);
  white-space: nowrap;
}
.ib-btn:hover { border-color: var(--border-strong); color: var(--text); }
.ib-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}
.ib-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ib-btn-primary {
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  color: #05070D;
  border-color: var(--accent);
  box-shadow: 0 4px 14px -6px var(--accent-glow);
}
.ib-btn-primary:hover { color: #05070D; transform: translateY(-1px); }

/* Banner status states */
html.investor-mode .investor-banner[data-status="running"]  { border-color: var(--accent); }
html.investor-mode .investor-banner[data-status="processing"] { border-color: var(--accent-mid); }
html.investor-mode .investor-banner[data-status="done"] { border-color: rgba(74,222,128,0.4); }
html.investor-mode .investor-banner[data-status="done"] .ib-dot { background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,0.6); }

@media (max-width: 720px) {
  html.investor-mode .investor-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 16px;
  }
  .ib-actions { width: 100%; }
  .ib-btn { flex: 1; justify-content: center; }
}

/* =====================================================================
   EXECUTIVE SUMMARY — bloque al inicio del reporte
===================================================================== */
.exec-summary {
  padding: 26px 32px 22px;
  background: linear-gradient(180deg, rgba(34,211,238,0.04) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.exec-summary::before {
  content: '';
  position: absolute; top: 0; left: 0;
  height: 100%; width: 3px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-mid) 100%);
}

.exec-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
  flex-wrap: wrap;
}
.exec-head-tag {
  display: inline-flex; align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 1.8px;
  color: var(--accent);
  font-weight: 600;
}
.exec-head-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.exec-head-route {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 880px) {
  .exec-grid { grid-template-columns: 1fr; gap: 14px; }
}

.exec-block {
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.exec-block-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.exec-list {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 8px;
}
.exec-list li {
  position: relative;
  padding-left: 14px;
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.5;
}
.exec-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 5px; height: 5px;
  background: var(--accent-mid);
  border-radius: 50%;
}
.exec-list-phases li::before {
  border-radius: 1px;
  background: var(--accent);
  width: 4px; height: 4px;
  top: 9px;
}

/* Acciones / botones de export — barra sticky */
.exec-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin: 10px 0 0;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: sticky;
  bottom: 16px;
  z-index: 50;
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.55);
}
@media (max-width: 720px) {
  .exec-actions { bottom: 10px; padding: 10px 12px; }
}
html.embed-mode .exec-actions { position: sticky; bottom: 8px; z-index: 20; }
.exec-btn {
  display: inline-flex; align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.18s var(--ease-in-out);
}
.exec-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}
.exec-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}
.exec-btn-primary {
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  color: #05070D;
  border-color: var(--accent);
  box-shadow: 0 4px 14px -6px var(--accent-glow);
}
.exec-btn-primary:hover {
  color: #05070D;
  transform: translateY(-1px);
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
}
.exec-btn.is-ok {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}
.exec-btn.is-fail {
  border-color: var(--red);
  background: rgba(239,68,68,0.1);
  color: var(--red);
}

@media (max-width: 720px) {
  .exec-summary { padding: 22px 22px 20px; }
  .exec-head-route { max-width: 100%; text-align: left; }
  .exec-actions { width: 100%; }
  .exec-btn { flex: 1 1 calc(50% - 5px); justify-content: center; min-width: 130px; }
  .exec-btn-primary { flex-basis: 100%; }
}



/* Fondo totalmente transparente — el host (sitio padre) provee el fondo */
html.embed-mode,
html.embed-mode body {
  background: transparent !important;
}

/* Body: sin altura forzada, sin flex de página completa.
   Permite que el contenido fluya a su altura natural dentro del iframe. */
html.embed-mode body {
  min-height: 0;
  display: block;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Ocultar TODO el cromo del sitio standalone y las capas decorativas:
   topbar, footer, grid, spot, boot overlay, toasts e investor banner. */
html.embed-mode .topbar,
html.embed-mode .footer-mini,
html.embed-mode .bg-grid,
html.embed-mode .bg-spot,
html.embed-mode .boot-overlay,
html.embed-mode .toasts,
html.embed-mode .investor-banner {
  display: none !important;
}

/* App contenedor: sin flex:1 (que forzaba altura completa = doble scroll).
   Padding compacto, ancho controlado. */
html.embed-mode .app {
  flex: 0 1 auto;
  padding: 24px 20px 28px;
  max-width: 920px;
}

/* Intro compactada, sin animación de fade-up al entrar (lo hace el host) */
html.embed-mode .intro {
  padding: 4px 0 0;
  animation: none;
}
html.embed-mode .intro-eyebrow { margin-bottom: 18px; }
html.embed-mode .intro-title {
  font-size: clamp(26px, 4.2vw, 40px);
  margin-bottom: 18px;
}
html.embed-mode .intro-sub {
  font-size: 15px;
  margin-bottom: 24px;
}
html.embed-mode .intro-meta { margin-top: 14px; }

/* Tree-map y step-card más compactos */
html.embed-mode .tree-map { margin-bottom: 20px; padding: 14px 14px; }
html.embed-mode .step-card { padding: 26px 26px 22px; }

/* DESACTIVAR animaciones decorativas infinitas en embed.
   Se conservan microtransiciones (hover/focus/select) y animaciones
   one-shot funcionales (step-enter, option-enter, reveal-in, check-pop,
   thinking-card-in, toast-in, scanline, ripple, option-snap). */
html.embed-mode .boot-logo-ring,
html.embed-mode .meta-dot,
html.embed-mode .intro-eyebrow-dot,
html.embed-mode .thinking-status-dot,
html.embed-mode .report-head-dot,
html.embed-mode .r-cta-primary {
  animation: none !important;
}

/* Suavizar shadows del CTA primario (asumían fondo muy oscuro) */
html.embed-mode .intro-cta {
  box-shadow: 0 6px 20px -8px var(--accent-glow);
}
html.embed-mode .intro-cta:hover {
  box-shadow: 0 10px 26px -10px rgba(34,211,238,0.45);
}

/* Ocultar atajos al diagnóstico que vivirían en una topbar del host */
html.embed-mode .top-actions,
html.embed-mode .top-cta,
html.embed-mode a[href*="diagnostico"],
html.embed-mode .btn-diagnostic {
  display: none !important;
}

/* En embed estrecho: ocultar ghost panel (no aporta en pantallas chicas) */
@media (max-width: 760px) {
  html.embed-mode .tree-stage { grid-template-columns: minmax(0, 1fr); }
  html.embed-mode .tree-ghost { display: none; }
}

@media (max-width: 680px) {
  html.embed-mode .app { padding: 18px 14px 24px; }
  html.embed-mode .step-card { padding: 22px 18px 18px; }
  html.embed-mode .intro-title { font-size: clamp(24px, 6vw, 32px); }
}

/* =====================================================================
   REDUCED MOTION — Solo fades, no apagar todo
===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }
  .stagger, .r-reveal {
    animation: reveal-in 0.25s ease-out forwards !important;
    animation-delay: 0ms !important;
  }
  .option-card { animation: reveal-in 0.25s ease-out forwards !important; }
  .step-card.step-enter,
  .step-card.step-enter-back { animation: reveal-in 0.25s ease-out !important; }
  .step-card.step-exit,
  .step-card.step-exit-back { animation: overlay-hide 0.18s ease forwards !important; }
  .thinking-bars span { animation: none !important; }
  .thinking-card { animation: reveal-in 0.25s ease-out !important; }
  .toast.toast-in { animation: reveal-in 0.25s ease-out forwards !important; }
  .toast.toast-out { animation: overlay-hide 0.2s ease forwards !important; }
}
/* =====================================================================
   PRINT — Salida limpia para PDF (window.print) — solo el reporte
===================================================================== */
@media print {
  /* Asegurar fondo blanco y color de texto oscuro */
  html, body {
    background: #fff !important;
    color: #111 !important;
    overflow: visible !important;
    min-height: 0 !important;
  }
  body {
    display: block !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Ocultar TODO menos el reporte */
  .bg-grid, .bg-spot,
  .boot-overlay,
  .toasts,
  .topbar,
  .footer-mini,
  .investor-banner,
  .intro,
  .tree-map,
  .tree-stage,
  .error-box,
  .overlay,
  .exec-actions,
  .r-section-cta,
  .r-cta-microcopy {
    display: none !important;
  }

  /* App ocupa todo el ancho */
  .app {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Reporte: fondo blanco, sin border-radius ni overflow hidden,
     sin animaciones de stagger (deben verse instantáneamente) */
  .report {
    background: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
  }
  .stagger, .r-reveal {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }

  /* Heads y secciones: tipografía oscura para impresión */
  .report-head,
  .r-section,
  .exec-summary {
    background: #fff !important;
    border-color: #ddd !important;
    page-break-inside: avoid;
  }
  .report-head-title,
  .step-card-question,
  .r-arch-name,
  .r-section-tag,
  .exec-block-label,
  .exec-head-tag,
  .chip-value,
  .mod-card-name {
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
  }
  .report-head-tag,
  .report-meta-label,
  .r-section-mini,
  .chip-label,
  .mod-card-id,
  .mod-row-label {
    color: #555 !important;
  }
  .r-reading,
  .r-arch-para,
  .r-arch-bullets li,
  .r-resolves li,
  .r-phase-list li,
  .mod-row-value,
  .exec-list li {
    color: #222 !important;
  }
  .r-arch-name {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
  }
  .report-meta-value,
  .r-arch-id,
  .r-mod-group:first-child .r-mod-group-label {
    color: #6b5b1f !important;
  }

  /* Bordes visibles en impresión */
  .chip,
  .mod-card,
  .r-phase,
  .r-arch-box,
  .exec-block {
    background: #fff !important;
    border: 1px solid #ddd !important;
    color: #222 !important;
  }
  .report-chips { background: #ddd !important; }

  /* Page break controls */
  .exec-summary { page-break-after: avoid; }
  .r-section { page-break-inside: avoid; }
  .mod-card, .r-phase, .exec-block { page-break-inside: avoid; }

  /* Quitar dots y glows que solo distraen en papel */
  .report-head-dot,
  .exec-head-dot {
    background: #6b5b1f !important;
    box-shadow: none !important;
    animation: none !important;
  }
}

/* =====================================================================
   MICROINTERACCIONES — iconos de sección + focus ring global
===================================================================== */
.stagger.reveal-in .r-section-letter {
  animation: icon-pop 0.45s var(--ease-snap) both;
  animation-delay: inherit;
}
.stagger.reveal-in .chip-icon {
  animation: icon-pop 0.38s var(--ease-snap) both;
}

/* Focus ring global accesible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Cursor pointer en todos los elementos interactivos */
button,
[role="button"],
[role="option"],
.option-card,
.tm-node[role="button"],
.ib-btn,
.exec-btn,
.r-cta-primary,
.r-cta-secondary,
.step-back,
.intro-cta,
.error-retry,
.topbar-home {
  cursor: pointer;
}
button:disabled,
.ib-btn:disabled { cursor: not-allowed; }

/* scroll-margin para que el topbar no tape el contenido */
.step-card,
.report { scroll-margin-top: 80px; }

/* =====================================================================
   REDUCED MOTION — desactivar blur y equalizer
===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .stagger.reveal-in {
    animation: reveal-in 0.25s ease-out forwards !important;
    animation-delay: 0ms !important;
  }
  .stagger.reveal-in .r-section-letter,
  .stagger.reveal-in .chip-icon { animation: none !important; }
  .thinking-bars span { animation: none !important; }
}

/* Boot typewriter cursor */
#bootStatus { min-height: 18px; transition: none; }

/* =====================================================================
   CURSOR CUSTOM — dot + ring, idempotente, pointer-events:none
===================================================================== */
#rg-cursor-dot,
#rg-cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  will-change: transform;
  transition: opacity 0.25s ease;
}
#rg-cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
#rg-cursor-ring {
  width: 32px; height: 32px;
  border: 1.5px solid rgba(34,211,238,0.50);
  background: transparent;
  /* ring sigue al dot con lag via JS */
  transition: width 0.18s var(--ease-out),
              height 0.18s var(--ease-out),
              border-color 0.18s var(--ease-out),
              background 0.18s var(--ease-out),
              opacity 0.25s ease;
}
/* Estado hover (sobre interactivos) */
body.rg-cursor-hover #rg-cursor-ring {
  width: 44px; height: 44px;
  border-color: var(--accent);
  background: rgba(34,211,238,0.06);
}
body.rg-cursor-hover #rg-cursor-dot {
  width: 4px; height: 4px;
  box-shadow: 0 0 10px var(--accent-glow);
}
/* Estado click */
body.rg-cursor-click #rg-cursor-ring {
  width: 26px; height: 26px;
  border-color: var(--accent);
  background: rgba(34,211,238,0.12);
}
/* Ocultar cuando el mouse sale de la ventana */
body.rg-cursor-out #rg-cursor-dot,
body.rg-cursor-out #rg-cursor-ring { opacity: 0; }

/* Ocultar cursor nativo SOLO cuando JS confirmó el cursor custom
   (clase body.cursor-ready). Sin esa clase → cursor nativo del SO
   queda visible (safety net si JS falla). */
@media (pointer: fine) {
  body.cursor-ready { cursor: none !important; }
  body.cursor-ready a,
  body.cursor-ready button,
  body.cursor-ready [role="button"],
  body.cursor-ready [role="option"],
  body.cursor-ready .option-card,
  body.cursor-ready .tm-node[role="button"],
  body.cursor-ready .intro-cta,
  body.cursor-ready .r-cta-primary,
  body.cursor-ready .r-cta-secondary,
  body.cursor-ready .exec-btn,
  body.cursor-ready .ib-btn,
  body.cursor-ready .step-back,
  body.cursor-ready .error-retry,
  body.cursor-ready .topbar-home { cursor: none !important; }
}

/* prefers-reduced-motion: volver a cursor nativo, ocultar elementos custom */
@media (prefers-reduced-motion: reduce) {
  #rg-cursor-dot, #rg-cursor-ring { display: none !important; }
  body { cursor: auto !important; }
  a, button, [role="button"], [role="option"],
  .option-card { cursor: pointer !important; }
}

/* =====================================================================
   BLOQUE MACRO — "144 escenarios posibles" encima de las métricas
===================================================================== */
.thinking-macro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 16px 14px;
  margin-bottom: 16px;
  background: rgba(34,211,238,0.03);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.thinking-macro::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.7;
}
.thinking-macro-num {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 58px);
  font-weight: 400;
  letter-spacing: 2px;
  line-height: 1;
  background: linear-gradient(135deg, #cffafe 0%, #22D3EE 35%, #06B6D4 70%, #0891B2 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  /* glow via filter */
  filter: drop-shadow(0 0 12px rgba(34,211,238,0.30));
  animation: macro-glow 3s ease-in-out infinite;
}
.thinking-macro-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-mid);
  margin-top: 2px;
}
.thinking-macro-sub {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  max-width: 340px;
}
@keyframes macro-glow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(34,211,238,0.22)); }
  50%       { filter: drop-shadow(0 0 20px rgba(34,211,238,0.45)); }
}
@media (prefers-reduced-motion: reduce) {
  .thinking-macro-num { animation: none !important; filter: none; }
}

/* =====================================================================
   OPCIONES ANIMADAS — hover premium + selección + stagger mejorado
===================================================================== */

/* Stagger de entrada: delay más visible entre cards */
.option-card:nth-child(1) { animation-delay:  30ms; }
.option-card:nth-child(2) { animation-delay:  90ms; }
.option-card:nth-child(3) { animation-delay: 150ms; }
.option-card:nth-child(4) { animation-delay: 210ms; }
.option-card:nth-child(5) { animation-delay: 270ms; }
.option-card:nth-child(6) { animation-delay: 330ms; }

/* Hover premium: lift + glow lateral */
.option-card:hover {
  background: var(--surface-2);
  border-color: var(--border-accent);
  transform: translateX(4px);
  box-shadow: -3px 0 0 0 var(--accent-mid),
              0 6px 24px -8px rgba(34,211,238,0.15);
}
/* Seleccionado: borde + pulse del indicador */
.option-card.is-selected {
  background: rgba(34,211,238,0.06);
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: -3px 0 0 0 var(--accent),
              0 0 0 1px var(--accent),
              0 10px 32px -12px var(--accent-glow);
  animation: option-snap 0.32s var(--ease-snap);
}
/* Pulse del radio al seleccionar */
.option-card.is-selected .option-mark {
  border-color: var(--accent);
  background: var(--accent);
  animation: mark-pulse 0.55s var(--ease-snap);
}
@keyframes mark-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,211,238,0.55); transform: scale(0.8); }
  50%  { box-shadow: 0 0 0 7px rgba(34,211,238,0.0); transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0 rgba(34,211,238,0.0);  transform: scale(1); }
}
/* Icono: destacar en hover */
.option-card:hover .option-icon,
.option-card.is-selected .option-icon {
  background: rgba(34,211,238,0.08);
  border-color: var(--border-accent-strong);
  color: var(--accent);
}
/* Label: más brillante al seleccionar */
.option-card.is-selected .option-label {
  color: var(--text);
}

/* prefers-reduced-motion: sin lift, sin pulse */
@media (prefers-reduced-motion: reduce) {
  .option-card:hover,
  .option-card.is-selected { transform: none !important; }
  .option-card.is-selected .option-mark { animation: none !important; }
  .option-card { animation-delay: 0ms !important; }
}

/* =====================================================================
   ARCHITECTURE MAP — sección G del reporte, cuadro de las 6 ARQs
===================================================================== */
.arch-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.arch-map-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.arch-map-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.arch-map-card:hover { border-color: var(--border-accent); }
.arch-map-card:hover::before { opacity: 1; }

/* Card activa (la ruta recomendada) */
.arch-map-card-active {
  background: rgba(34,211,238,0.05);
  border-color: var(--border-accent-strong);
  box-shadow: 0 0 0 1px var(--border-accent), 0 16px 40px -20px rgba(34,211,238,0.3);
}
.arch-map-card-active::before {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7 !important;
}

.arch-map-card-head {
  display: flex; align-items: center; gap: 10px;
}
.arch-map-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent-mid);
  flex-shrink: 0;
}
.arch-map-icon svg { width: 16px; height: 16px; }
.arch-map-id-wrap { display: flex; align-items: center; gap: 8px; }
.arch-map-id {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 2px;
  color: var(--muted-2);
}
.arch-map-badge {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #05070D;
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 100px;
}
.arch-map-name {
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text);
}
.arch-map-card-active .arch-map-name { color: var(--accent); }
.arch-map-tagline {
  font-size: 12.5px; color: var(--muted);
  line-height: 1.5;
}
.arch-map-when {
  font-size: 11.5px; color: var(--muted-2);
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.arch-map-when-label {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted-3);
  display: block;
  margin-bottom: 2px;
}
.arch-map-delivers {
  list-style: none;
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 2px;
}
.arch-map-delivers li {
  font-size: 12px; color: var(--text-soft);
  line-height: 1.4;
  display: flex; align-items: baseline; gap: 7px;
}
.arch-map-delivers li::before {
  content: '›';
  color: var(--accent-mid);
  flex-shrink: 0;
  font-size: 13px;
}
.arch-map-card-active .arch-map-delivers li::before { color: var(--accent); }

@media (max-width: 680px) {
  .arch-map { grid-template-columns: 1fr; }
}

/* =====================================================================
   THINKING OVERLAY — card posicionada arriba (no centrada)
===================================================================== */
/* FIX: el overlay ya tiene align-items:flex-start + padding-top:72px.
   Aseguramos que el thinking-card no exceda el viewport. */
.thinking-card {
  margin-bottom: 24px; /* espacio si el usuario hace scroll */
}

/* =====================================================================
   INTRO CTA — pulse animation más visible
===================================================================== */
.intro-cta {
  animation: cta-pulse 2.4s ease-in-out infinite;
}


/* =====================================================================
   OPERATIONAL AI SCORE — sección destacada del reporte
   Gauge + radar + spectrum + dimensiones + narrativa
===================================================================== */
:root {
  --score-ok: #7BE0A4;
  --score-warn: #FBBF24;
  --score-bad: #F87171;
}

.r-section-score {
  background: linear-gradient(180deg, rgba(34,211,238,0.04) 0%, rgba(34,211,238,0.015) 100%);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  padding: 26px 26px 24px;
}
.r-section-score .r-section-letter {
  background: var(--accent);
  color: #05070D;
  border-color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.score-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
  margin-top: 6px;
}
.score-col-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.score-gauge-wrap {
  display: flex;
  justify-content: center;
}
.score-col-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.score-level-block {
  text-align: center;
}
.score-level-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.score-level-bench {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* Spectrum horizontal */
.score-spectrum {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.score-spec-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  margin-bottom: 7px;
}
.score-spec-labels .score-spec-active {
  color: var(--accent);
  font-weight: 600;
}
.score-spec-track {
  height: 6px;
  background: var(--surface-3);
  border-radius: 100px;
  position: relative;
}
.score-spec-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 100px;
  opacity: 0.85;
}
.score-spec-marker {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px var(--border-accent-strong);
}
.score-spec-nums {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 8px;
  font-family: var(--font-mono, monospace);
}
.score-spec-nums .score-spec-you {
  color: var(--accent);
  font-weight: 600;
}

/* Dimensiones */
.score-dims-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 20px;
}
.score-dim-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
}
.score-dim-chip-weak {
  border-color: rgba(251,191,36,0.35);
  background: rgba(251,191,36,0.05);
}
.score-dim-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.score-dim-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-top: 1px;
}
.score-dim-den {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-2);
}
.score-dim-bar {
  height: 3px;
  background: var(--surface-3);
  border-radius: 100px;
  margin-top: 7px;
  overflow: hidden;
}
.score-dim-fill {
  height: 100%;
  border-radius: 100px;
}
.score-dim-note {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 5px;
}
.score-dim-note-weak {
  color: var(--score-warn);
  font-weight: 600;
}

/* Narrativa interpretativa */
.score-narrative {
  margin-top: 18px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
}
.score-narrative-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-mid);
  margin-bottom: 5px;
}
.score-narrative-text {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.65;
}

@media (max-width: 680px) {
  .score-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .score-dims-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .r-section-score {
    padding: 20px 18px;
  }
}