/* =====================================================================
   ISP-NOC.COM — Landing Stylesheet v2
   Light theme, alineado con noc-ia.sitelco.cl/planes
   Primary #1a2a6c | Accent #2563eb | Highlight #00d4ff
   ===================================================================== */

:root {
  --bg: #f0f4f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dde3ee;
  --soft: #f1f5f9;
  --primary: #1a2a6c;
  --primary-hover: #142159;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --highlight: #00d4ff;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 12px 36px rgba(26, 42, 108, .10);
  --shadow-sm: 0 4px 16px rgba(26, 42, 108, .07);
  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 90px;
}

/* =====================================================================
   TOPBAR
   ===================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 20px;
  max-width: 1280px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  color: var(--primary);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  color: #fff;
  font-size: 17px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .25);
}

.brand-text { letter-spacing: -0.5px; }

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.topbar-nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 14.5px;
}

.topbar-nav a:hover { color: var(--primary); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  transition: .2s;
}

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: transform .22s ease, box-shadow .22s ease, background .18s ease;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26, 42, 108, .25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(26, 42, 108, .30);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: #b0bfd4;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(26, 42, 108, .10);
}

.btn-sm { min-height: 40px; padding: 0 16px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  text-align: center;
  padding: 56px 0 42px;
}

.eyebrow {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--primary);
}

.gradient {
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  max-width: 860px;
  margin: 20px auto 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* =====================================================================
   TOP BENEFITS
   ===================================================================== */
.top-benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0 44px;
}

.benefit {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.benefit:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.benefit strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--primary);
  font-weight: 800;
}

.benefit span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* =====================================================================
   PRICING GRID
   ===================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;
}

.plan {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.plan:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.plan.popular {
  border: 2px solid var(--accent);
  box-shadow: 0 8px 32px rgba(37, 99, 235, .18);
}
.plan.popular:hover {
  transform: translateY(-7px);
  box-shadow: 0 16px 44px rgba(37, 99, 235, .22);
}

.badge {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  letter-spacing: .2px;
}

.plan-name {
  font-size: 26px;
  font-weight: 800;
  margin: 2px 0 10px;
  color: var(--primary);
}

.plan-desc {
  color: var(--muted);
  line-height: 1.55;
  min-height: 68px;
  font-size: 15px;
}

.price {
  margin: 24px 0 6px;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--primary);
}

.price small {
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0;
}

.subprice {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 14px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.plan li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
  color: #1e293b;
  font-size: 14.5px;
}

.plan li::before {
  content: "✓";
  color: var(--success);
  font-weight: 800;
  flex: 0 0 auto;
}

.plan .cta {
  margin-top: auto;
}

.plan .mini-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
}

/* =====================================================================
   LOGOS
   ===================================================================== */
.logos {
  margin: 78px 0 28px;
  text-align: center;
}

.logos h2 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--primary);
  letter-spacing: -.5px;
}

.logos p {
  color: var(--muted);
  max-width: 760px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.logo-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  text-align: center;
  transition: transform .22s ease, box-shadow .22s ease;
}
.logo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* =====================================================================
   NOC PREVIEW
   ===================================================================== */
.noc-preview { margin-top: 72px; }

.noc-preview h2 {
  font-size: 34px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -.6px;
  text-align: center;
  color: var(--primary);
}

.noc-preview p.head {
  text-align: center;
  color: var(--muted);
  max-width: 780px;
  margin: 0 auto 32px;
  line-height: 1.65;
}

.noc-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.noc-card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.noc-card-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.noc-card-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

.noc-card-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
}

.noc-card-header span {
  margin-left: auto;
  font-size: 11px;
  opacity: .65;
}

.noc-card-body { padding: 20px 18px 22px; }

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; flex-direction: column; gap: 4px; }
.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.bar-track {
  height: 10px;
  background: #f0f4f9;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  animation: barGrow .8s ease both;
}
@keyframes barGrow { from { width: 0; } }
.bar-fill.green  { background: linear-gradient(90deg, #22c55e, #4ade80); }
.bar-fill.yellow { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-fill.red    { background: linear-gradient(90deg, #ef4444, #f87171); }
.bar-fill.blue   { background: linear-gradient(90deg, var(--accent), #60a5fa); }

/* Line chart */
.line-chart { width: 100%; height: 90px; }
.line-chart-wrap { position: relative; }
.line-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.latency-stat {
  display: flex;
  gap: 18px;
  margin-top: 12px;
}
.latency-stat .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.latency-stat .stat span:first-child {
  font-size: 11px;
  color: var(--muted);
}
.latency-stat .stat span:last-child {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* RxPower */
.rxpower-wrap { display: flex; flex-direction: column; gap: 14px; }
.rx-meter { display: flex; flex-direction: column; gap: 6px; }
.rx-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.rx-label span:first-child { color: var(--muted); font-weight: 500; }
.rx-label span:last-child  { font-weight: 700; color: var(--primary); font-size: 13px; }
.rx-track {
  height: 14px;
  background: #f0f4f9;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.rx-fill {
  height: 100%;
  border-radius: 999px;
  position: relative;
}
.rx-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, .7);
  border-radius: 999px;
}
.rx-fill.good { background: linear-gradient(90deg, #22c55e, #86efac); }
.rx-fill.warn { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.rx-fill.bad  { background: linear-gradient(90deg, #ef4444, #fca5a5); }

.rx-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Lock overlay */
.noc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
}

.lock-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, .12);
  border: 2px solid rgba(255, 255, 255, .25);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.noc-overlay p {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  max-width: 180px;
  line-height: 1.45;
}

.noc-overlay a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: background .18s;
}
.noc-overlay a:hover { background: #1d4ed8; }

/* =====================================================================
   COMPARISON TABLE
   ===================================================================== */
.section { margin-top: 72px; }

.section h2 {
  font-size: 34px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -.6px;
  text-align: center;
  color: var(--primary);
}

.section p.head {
  text-align: center;
  color: var(--muted);
  max-width: 880px;
  margin: 0 auto 28px;
  line-height: 1.65;
}

.comparison-wrap {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th, td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 14.5px;
}

th {
  background: var(--soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

th:first-child, td:first-child {
  text-align: left;
  font-weight: 600;
  width: 260px;
  color: var(--text);
}

tbody tr:hover { background: var(--soft); }
tbody tr:last-child td { border-bottom: none; }

/* =====================================================================
   CONTACTO
   ===================================================================== */
.contacto-section { margin-top: 72px; }

.contacto-section h2 {
  font-size: 34px;
  font-weight: 800;
  margin: 0 0 10px;
  text-align: center;
  color: var(--primary);
  letter-spacing: -.6px;
}

.contacto-section p.head {
  text-align: center;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.65;
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  padding: 36px 32px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--line);
  color: var(--text);
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin: 0 auto 24px;
  max-width: 560px;
  font-size: 14.5px;
  font-weight: 600;
}
.alert-ok {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}
.alert-err {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* =====================================================================
   FOOTER
   ===================================================================== */
.footer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 40px 0 32px;
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 0 !important;
}

.footer .wrap { padding-bottom: 0 !important; }

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-brand .brand { margin-bottom: 4px; }

.footer-brand p {
  color: var(--muted);
  font-size: 13.5px;
}

.footer-legal {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1100px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .top-benefits { grid-template-columns: repeat(2, 1fr); }
  .logo-grid { grid-template-columns: repeat(3, 1fr); }
  .noc-cards { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .wrap { padding: 0 16px 72px; }
  .hero { padding: 40px 0 32px; }

  .nav-toggle { display: flex; }
  .topbar-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .topbar-nav.open { display: flex; }
  .topbar-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .topbar-nav a:last-child {
    border-bottom: none;
    margin-top: 8px;
  }

  .plan.popular { transform: none; }
  .plan.popular:hover { transform: translateY(-5px); }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-legal { text-align: center; }
}

@media (max-width: 560px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .top-benefits { grid-template-columns: 1fr; }
  .logo-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .latency-stat { flex-wrap: wrap; gap: 12px; }
  .contact-form { padding: 26px 20px; }
}

/* =====================================================================
   DEMO CHAT IA — ventana de chat interactiva simulada
   ===================================================================== */
.demo-chat {
  margin: 8px 0 56px;
}

.demo-header {
  text-align: center;
  margin-bottom: 28px;
}

.demo-header h2 {
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.6px;
  margin: 12px 0 8px;
}

.demo-header p {
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.6;
  font-size: 15.5px;
}

.chat-window {
  max-width: 580px;
  margin: 0 auto;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px -20px rgba(26, 42, 108, .25), 0 8px 20px -8px rgba(26, 42, 108, .12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.chat-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--primary), #26388a);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--highlight), var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0a0f1e;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(0, 212, 255, .35);
  flex-shrink: 0;
}

.chat-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-title strong {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .2px;
}

.chat-status {
  font-size: 11.5px;
  color: rgba(255, 255, 255, .7);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ade80;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

.chat-actions {
  display: flex;
  gap: 6px;
}

.window-btn {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
}
.window-btn:nth-child(1) { background: #ff6057; }
.window-btn:nth-child(2) { background: #ffbd2e; }
.window-btn:nth-child(3) { background: #27c93f; }

/* Chips */
.chat-chips {
  display: flex;
  gap: 8px;
  padding: 14px 18px 12px;
  flex-wrap: wrap;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.chip {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .18s ease;
  font-family: inherit;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .12);
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Body */
.chat-body {
  padding: 18px 18px 8px;
  height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  background: #fafbfd;
}

.chat-body::-webkit-scrollbar { width: 8px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

/* Bubbles */
.bubble {
  display: flex;
  gap: 10px;
  max-width: 92%;
  animation: bubbleIn .32s ease both;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bubble-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.bubble-ai .bubble-avatar {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

.bubble-content {
  background: #fff;
  border: 1px solid var(--line);
  padding: 13px 16px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  box-shadow: 0 2px 6px rgba(26, 42, 108, .04);
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble-content strong { color: var(--primary); }
.bubble-content code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Fira Code', ui-monospace, Menlo, Consolas, monospace;
}

.bubble-content .mini-table {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 14px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: var(--soft);
  border-radius: 10px;
  font-size: 13px;
}
.bubble-content .mini-table div { padding: 2px 0; }
.bubble-content .mini-table .th { font-weight: 700; color: var(--primary); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.bubble-content .mini-table .num { font-variant-numeric: tabular-nums; color: var(--primary); font-weight: 600; text-align: right; }

.bubble-content .insight {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 8px;
}
.bubble-content .warn {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 8px;
}

/* User bubble */
.bubble-user {
  margin-left: auto;
  flex-direction: row-reverse;
}
.bubble-user .bubble-avatar {
  background: var(--soft);
  color: var(--primary);
  border: 1.5px solid var(--line);
}
.bubble-user .bubble-content {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  border-top-left-radius: 14px;
  border-top-right-radius: 4px;
}
.bubble-user .bubble-content strong { color: #fff; }

/* Typing indicator */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
.typing span {
  width: 7px;
  height: 7px;
  background: var(--muted);
  border-radius: 50%;
  animation: typingBounce 1.3s infinite ease-in-out;
}
.typing span:nth-child(1) { animation-delay: 0s; }
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Cursor parpadeante del typewriter */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blinkCursor 1s step-end infinite;
}
@keyframes blinkCursor {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Footer tipo ChatGPT/Gemini (input "activo" pero readonly, con cursor parpadeante) */
.chat-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  align-items: center;
}

.chat-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--soft);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  transition: border-color .2s, box-shadow .2s;
}

.chat-input-wrap.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
  background: #fff;
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  padding: 0;
  min-width: 0;
}

.chat-input::placeholder {
  color: var(--muted);
  font-style: italic;
}

.chat-input-wrap.active::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--accent);
  margin-left: 2px;
  animation: blinkCursor 1s step-end infinite;
  flex-shrink: 0;
}

.chat-send {
  background: var(--soft);
  border: none;
  color: var(--muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: default;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}

.chat-send.active {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
}

.chat-send.active:hover,
.chat-send.active:active {
  background: #1d4ed8;
  transform: scale(1.08);
}

.chat-note {
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  padding: 9px 18px 12px;
  margin: 0;
  background: #fff;
  border-top: 1px solid var(--soft);
}

/* Responsive chat */
@media (max-width: 720px) {
  .chat-body { padding: 14px 14px 8px; height: 360px; }
  .bubble { max-width: 96%; }
  .bubble-content { font-size: 13.5px; padding: 10px 13px; }
  .chat-topbar { padding: 12px 14px; }
  .chat-actions { display: none; }
  .chat-footer { padding: 10px 12px; gap: 6px; }
  .chat-input-wrap { padding: 8px 14px; }
  .chat-input { font-size: 13px; }
  .chat-note { font-size: 11px; padding: 7px 14px 10px; }
}

/* Reduced motion — skip animations */
@media (prefers-reduced-motion: reduce) {
  .bubble, .status-dot, .typing span, .cursor { animation: none !important; }
  .chat-body { scroll-behavior: auto; }
}

