:root{
    /* Default = AI Company brand. White-label tweak overrides these. */
    --brand-primary: #1B3A6B;
    --brand-secondary: #1E6BB0;
    --brand-accent: #E8620A;
    --brand-name: "AI Company";

    --bg: #ffffff;
    --bg-subtle: #F4F8FC;
    --bg-dark: #0E1F3A;
    --bg-darker: #081428;
    --ink: #1A1A1A;
    --ink-soft: #4B5663;
    --ink-mute: #8892A0;
    --line: rgba(15, 30, 60, 0.08);
    --line-strong: rgba(15, 30, 60, 0.14);
    --success: #16A34A;
    --warn: #E0A800;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --shadow-sm: 0 1px 2px rgba(15,30,60,.06), 0 1px 1px rgba(15,30,60,.04);
    --shadow: 0 8px 28px -8px rgba(15,30,60,.18), 0 2px 6px rgba(15,30,60,.06);
    --shadow-lg: 0 24px 60px -16px rgba(15,30,60,.28), 0 6px 16px rgba(15,30,60,.08);

    --container: 1200px;
    --header-h: 68px;
  }

  *,*::before,*::after{box-sizing:border-box}
  html,body{margin:0;padding:0}
  html{scroll-behavior:smooth;overflow-x:hidden}
  body{overflow-x:hidden; min-width: 0}
  /* Universal containment — protect against any element overflowing the viewport */
  img, video, svg, iframe, table{ max-width: 100% }
  /* Sections should never push the page wider than the viewport */
  section{ max-width: 100vw; overflow-x: clip }
  body{
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  a{color:inherit;text-decoration:none}
  button{font-family:inherit;cursor:pointer;border:0;background:none;color:inherit}
  h1,h2,h3,h4{margin:0;font-weight:700;letter-spacing:-0.02em;text-wrap:balance}
  p{margin:0;text-wrap:pretty}
  ::selection{background: color-mix(in oklab, var(--brand-accent), white 30%); color:#1A1A1A}

  .container{max-width: var(--container); margin: 0 auto; padding: 0 24px}
  .section{padding: 96px 0; position: relative}
  .section-tight{padding: 64px 0}
  .eyebrow{
    display:inline-flex;align-items:center;gap:8px;
    font-size:12px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;
    color: var(--brand-secondary);
    padding: 6px 12px;border-radius:999px;
    background: color-mix(in oklab, var(--brand-secondary), white 88%);
    border: 1px solid color-mix(in oklab, var(--brand-secondary), white 78%);
  }
  .eyebrow .dot{width:6px;height:6px;border-radius:999px;background:var(--brand-accent)}
  .h-display{font-size: clamp(36px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 800}
  .h-section{font-size: clamp(28px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 700}
  .h-card{font-size: 18px; font-weight: 600; letter-spacing: -0.01em}
  .lead{font-size: clamp(16px, 1.4vw, 19px); color: var(--ink-soft); line-height: 1.6; max-width: 56ch}
  .mono{font-family:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px}

  /* Buttons */
  .btn{
    display:inline-flex;align-items:center;gap:8px;
    padding: 12px 20px;border-radius:10px;font-weight:600;font-size:15px;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
    white-space:nowrap;
  }
  .btn-primary{background: var(--brand-accent); color:#fff; box-shadow: 0 8px 20px -8px color-mix(in oklab, var(--brand-accent), black 10%)}
  .btn-primary:hover{transform: translateY(-1px); box-shadow: 0 14px 28px -10px color-mix(in oklab, var(--brand-accent), black 20%)}
  .btn-ghost{background: rgba(255,255,255,.08); color:#fff; border:1px solid rgba(255,255,255,.18)}
  .btn-ghost:hover{background: rgba(255,255,255,.14)}
  .btn-outline{border:1px solid var(--line-strong); color: var(--ink)}
  .btn-outline:hover{border-color: var(--brand-primary); color: var(--brand-primary)}
  .btn-lg{padding: 16px 26px; font-size: 16px; border-radius: 12px}

  /* Hex pattern bg */
  .hex-pattern{
    background-color: var(--bg-dark);
    background-image:
      radial-gradient(ellipse at 20% 0%, rgba(30,107,176,.35), transparent 55%),
      radial-gradient(ellipse at 90% 100%, rgba(232,98,10,.18), transparent 60%),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'><path d='M28 2 L52 16 L52 48 L28 62 L4 48 L4 16 Z' fill='none' stroke='rgba(255,255,255,0.055)' stroke-width='1'/></svg>");
    background-size: auto, auto, 56px 64px;
    background-position: 0 0, 0 0, 0 0;
  }
  .hex-pattern.subtle{
    background-image:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'><path d='M28 2 L52 16 L52 48 L28 62 L4 48 L4 16 Z' fill='none' stroke='rgba(27,58,107,0.05)' stroke-width='1'/></svg>");
    background-color: var(--bg-subtle);
    background-size: 56px 64px;
  }

  /* Hex intensity (driven by body[data-hex]) */
  body[data-hex="visible"] .hex-pattern{
    background-image:
      radial-gradient(ellipse at 20% 0%, rgba(30,107,176,.4), transparent 55%),
      radial-gradient(ellipse at 90% 100%, rgba(232,98,10,.22), transparent 60%),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'><path d='M28 2 L52 16 L52 48 L28 62 L4 48 L4 16 Z' fill='none' stroke='rgba(255,255,255,0.12)' stroke-width='1'/></svg>");
  }
  body[data-hex="visible"] .hex-pattern.subtle{
    background-image:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'><path d='M28 2 L52 16 L52 48 L28 62 L4 48 L4 16 Z' fill='none' stroke='rgba(27,58,107,0.11)' stroke-width='1'/></svg>");
  }
  body[data-hex="off"] .hex-pattern{
    background-image:
      radial-gradient(ellipse at 20% 0%, rgba(30,107,176,.3), transparent 55%),
      radial-gradient(ellipse at 90% 100%, rgba(232,98,10,.15), transparent 60%);
  }
  body[data-hex="off"] .hex-pattern.subtle{ background-image: none; }

  /* Header */
  header.site{
    position: sticky; top:0; z-index: 50;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
  }
  header.site .inner{
    height: var(--header-h);
    display:flex;align-items:center;justify-content:space-between;
  }
  .brand{display:flex;align-items:center;gap:10px;font-weight:700;letter-spacing:-0.01em}
  .brand .glyph{
    width: 30px; height: 34px;
    background: var(--brand-accent);
    clip-path: polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
    position: relative;
  }
  .brand .glyph::after{
    content:''; position:absolute; inset: 6px;
    background: color-mix(in oklab, var(--brand-accent), white 12%);
    clip-path: polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
  }
  .brand .name{font-size: 17px}
  nav.primary{display:flex;align-items:center;gap:28px}
  nav.primary a{font-size:14px;color:var(--ink-soft);font-weight:500;transition:color .15s}
  nav.primary a:hover{color:var(--ink)}
  .header-cta{display:flex;align-items:center;gap:10px}
  .header-cta .login{font-size:14px;color:var(--ink-soft);font-weight:500}
  @media(max-width: 880px){
    nav.primary{display:none}
  }

  /* Utility */
  .row{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
  .grid{display:grid;gap:24px}
  .text-muted{color: var(--ink-soft)}
  .text-mute{color: var(--ink-mute)}
  .text-accent{color: var(--brand-accent)}
  .text-primary{color: var(--brand-primary)}

  /* Card */
  .card{
    background:#fff; border:1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease;
  }
  .card.hoverable:hover{transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong)}

  /* Pulse */
  .pulse-dot{
    width: 8px; height:8px; border-radius:999px; background: var(--success);
    box-shadow: 0 0 0 0 color-mix(in oklab, var(--success), transparent 50%);
    animation: pulse 2.2s infinite;
    display:inline-block;
  }
  @keyframes pulse{
    0%{box-shadow: 0 0 0 0 color-mix(in oklab, var(--success), transparent 30%)}
    70%{box-shadow: 0 0 0 8px color-mix(in oklab, var(--success), transparent 100%)}
    100%{box-shadow: 0 0 0 0 color-mix(in oklab, var(--success), transparent 100%)}
  }

  /* Fade-up on intersect */
  .reveal{opacity:0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease}
  .reveal.in{opacity:1; transform: none}

  /* Section dark */
  .section.dark{ background: var(--bg-dark); color:#fff }
  .section.dark .lead{color: rgba(255,255,255,.7)}
  .section.dark .text-muted{color: rgba(255,255,255,.7)}

  /* Form/inputs (onboarding modal) */
  input[type="text"], input[type="email"], select, textarea{
    font-family: inherit; font-size: 14px;
    background: #fff; color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: 10px;
    padding: 10px 12px; outline: none;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
  }
  input:focus, select:focus, textarea:focus{
    border-color: var(--brand-secondary);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand-secondary), white 80%);
  }

  /* Marquee */
  .marquee{overflow:hidden; mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent)}
  .marquee-track{display:flex; gap:64px; animation: marq 32s linear infinite; width:max-content}
  @keyframes marq{ from{ transform: translateX(0)} to{ transform: translateX(-50%)} }

  /* Voxel office styles */
  .voxel-stage{
    position:relative;
    aspect-ratio: 16/11;
    background: linear-gradient(180deg, #DCE6F2 0%, #BCC9DE 100%);
    border-radius: var(--radius-lg);
    overflow:hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
  }
  .voxel-grid{
    position:absolute; inset:0;
    background-image:
      linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(15,30,60,.06) 100%),
      linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(15,30,60,.06) 100%);
    background-size: 28px 28px;
    transform-origin: 50% 50%;
    transform: rotateX(60deg) rotateZ(-45deg) scale(1.4);
    opacity:.5;
  }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce){
    *{animation-duration:.001ms !important; transition-duration:.001ms !important}
    .reveal{opacity:1; transform:none}
  }

/* ─────────────────────────────── */
/* Article (blog post) typography  */
/* ─────────────────────────────── */
.article-prose{ font-size: 17px; line-height: 1.75; color: var(--ink); max-width: 70ch }
.article-prose p{ margin: 0 0 22px }
.article-prose h2{ font-size: 28px; margin: 48px 0 14px; letter-spacing:-0.02em }
.article-prose h3{ font-size: 21px; margin: 32px 0 10px; letter-spacing:-0.015em }
.article-prose ul, .article-prose ol{ margin: 0 0 22px; padding-left: 22px }
.article-prose li{ margin: 6px 0 }
.article-prose strong{ color: var(--ink); font-weight: 700 }
.article-prose a{ color: var(--brand-secondary); border-bottom: 1px solid color-mix(in oklab, var(--brand-secondary), white 60%); transition: border-color .15s }
.article-prose a:hover{ border-bottom-color: var(--brand-secondary) }
.article-prose blockquote{
  margin: 28px 0; padding: 16px 22px;
  border-left: 4px solid var(--brand-accent);
  background: var(--bg-subtle);
  border-radius: 0 12px 12px 0;
  font-size: 18px; font-style: italic; color: var(--ink-soft);
}
.article-prose code{
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  background: var(--bg-subtle); padding: 2px 6px; border-radius: 6px;
  color: var(--brand-primary);
}
.article-prose .callout{
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in oklab, var(--brand-secondary), white 96%), #fff);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 15px;
}
.article-prose .callout .label{
  display:inline-flex; align-items:center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--brand-secondary);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px;
}
.article-prose figure{ margin: 28px 0 }
.article-prose figcaption{ font-size: 13px; color: var(--ink-mute); margin-top: 8px; text-align: center }

/* Image placeholders (striped, with mono label) */
.placeholder-img{
  position: relative; overflow: hidden; border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--brand-secondary), white 88%) 0 16px,
      color-mix(in oklab, var(--brand-secondary), white 92%) 16px 32px);
  border: 1px solid var(--line);
}
.placeholder-img > span{
  position: absolute; inset:auto 0 0 0; padding: 8px 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .04em;
  color: var(--ink-mute);
  background: rgba(255,255,255,.9);
  border-top: 1px solid var(--line);
}

/* Article hero */
.article-hero{
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--line);
}
.article-meta{
  display:flex; align-items:center; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-mute);
}
.article-meta .pill{
  background: color-mix(in oklab, var(--brand-secondary), white 90%);
  color: var(--brand-primary);
  padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 12px;
}
.article-meta .author{
  display:inline-flex; align-items:center; gap:8px; font-weight: 500; color: var(--ink-soft);
}
.article-meta .author .avatar{
  width: 28px; height: 28px; border-radius: 999px; background: var(--brand-primary);
  color:#fff; display:inline-flex; align-items:center; justify-content:center;
  font-weight: 700; font-size: 12px;
}

/* TOC */
.toc{
  position: sticky; top: 88px; align-self: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; font-size: 13.5px;
}
.toc .label{ font-size: 11px; font-weight: 700; color: var(--ink-mute); text-transform:uppercase; letter-spacing:.08em; margin-bottom: 12px }
.toc ol{ list-style: none; padding: 0; margin: 0; counter-reset: t; }
.toc li{ counter-increment: t; padding: 6px 0; border-top: 1px solid var(--line) }
.toc li:first-child{ border-top: 0 }
.toc li a{ color: var(--ink-soft); display: block; position: relative; padding-left: 28px }
.toc li a::before{ content: counter(t, decimal-leading-zero); position: absolute; left: 0; color: var(--ink-mute); font-family: 'JetBrains Mono', monospace; font-size: 11px; top: 3px }
.toc li a:hover{ color: var(--brand-primary) }

/* Blog cards */
.blog-card{
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; transition: transform .2s, box-shadow .25s, border-color .2s;
  cursor: pointer;
}
.blog-card:hover{ transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong) }
.blog-card .cover{ aspect-ratio: 16/9; }
.blog-card .body{ padding: 22px; display:flex; flex-direction: column; gap: 10px; flex: 1 }
.blog-card .cat{
  font-size: 11px; font-weight: 700; color: var(--brand-secondary);
  text-transform: uppercase; letter-spacing: .08em;
}
.blog-card h3{ font-size: 19px; letter-spacing:-0.015em; line-height: 1.25 }
.blog-card p{ font-size: 14px; color: var(--ink-soft); line-height: 1.55 }
.blog-card .meta{ display:flex; align-items:center; gap:8px; font-size: 12px; color: var(--ink-mute); margin-top: auto }

/* Active nav state */
nav.primary a.active{ color: var(--brand-primary); font-weight: 600 }
nav.primary a.active::after{
  content:''; display:block; height:2px; background: var(--brand-accent);
  margin-top: 2px; border-radius: 2px;
}

/* Page hero (lightweight) */
.page-hero{
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 20% 0%, color-mix(in oklab, var(--brand-secondary), white 86%), transparent 60%),
    var(--bg-subtle);
}
.page-hero .crumb{
  font-size: 12px; color: var(--ink-mute);
  display:inline-flex; align-items:center; gap: 6px; margin-bottom: 16px;
  font-family: 'JetBrains Mono', monospace;
}
.page-hero .crumb a{ color: var(--ink-soft) }
.page-hero .crumb a:hover{ color: var(--brand-primary) }

/* Form */
.form-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 18px }
.form-grid .full{ grid-column: 1 / -1 }
.form-label{ font-size: 13px; font-weight: 600; color: var(--ink); display:block; margin-bottom: 6px }
.form-help{ font-size: 12px; color: var(--ink-mute); margin-top: 6px }

@media (max-width: 720px){
  .form-grid{ grid-template-columns: 1fr }
}


/* ═══════════════════════════════════════════════════════════════ */
/* RESPONSIVE — mobile-first overrides                             */
/* ═══════════════════════════════════════════════════════════════ */

/* Header CTA — desktop default */
.btn-cta-header{ padding: 9px 16px !important; font-size: 14px !important; }

/* Hamburger button — hidden on desktop */
.hamburger{
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  background: transparent; border: 0; cursor: pointer;
  margin-left: 6px; padding: 0;
}
.hamburger .bar{
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.hamburger .bar.open:nth-child(1){ transform: translateY(7px) rotate(45deg) }
.hamburger .bar.open:nth-child(2){ opacity: 0 }
.hamburger .bar.open:nth-child(3){ transform: translateY(-7px) rotate(-45deg) }

/* Mobile drawer */
.mobile-drawer{
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
  background: rgba(10, 18, 36, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.mobile-drawer.open{ opacity: 1; pointer-events: auto; }
.mobile-drawer-inner{
  position: absolute; top: 0; right: 0; left: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 20px 24px 28px;
  transform: translateY(-12px);
  transition: transform .3s ease;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.mobile-drawer.open .mobile-drawer-inner{ transform: none }
.mobile-drawer nav{ display: flex; flex-direction: column; gap: 4px }
.mobile-drawer nav a{
  padding: 14px 6px; font-size: 16px; font-weight: 500;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.mobile-drawer nav a.active{ color: var(--brand-primary); font-weight: 700 }
.mobile-drawer nav a:last-child{ border-bottom: 0 }
.mobile-drawer nav a.btn{ border-bottom: 0; color: #fff }

/* Footer grid responsive */
.footer-grid{
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
}

/* ─── ≤ 1024px (tablet / small laptop) ─── */
@media (max-width: 1024px) {
  .section{ padding: 72px 0 }
  .container{ padding: 0 20px }
  /* Prevenir desborde horizontal en tablet */
  section > .container { max-width: 100%; overflow-x: hidden; }
  /* Voxel containment — never wider than its column */
  .voxel-stage{ max-width: 100%; width: 100% }
  /* Min-width:0 universal en hijos de grid/flex para evitar blowout */
  section .container > *{ min-width: 0 }
  /* Cualquier grid inline de 2 columnas (minmax o fr) colapsa a 1 col */
  section .container[style*="grid-template-columns"],
  section [style*="grid-template-columns: minmax"],
  section [style*="grid-template-columns:'minmax"],
  section [style*="grid-template-columns: 1.05fr"],
  section [style*="grid-template-columns: 1fr 1fr"],
  section [style*="gridTemplateColumns"]{
    grid-template-columns: 1fr !important;
  }
  /* Hero & DemoVisual main grids stack */
  section[data-screen-label="Hero"] > .container,
  section[data-screen-label="Demo visual"] > .container{
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  /* Al apilar el grid, el ActivityDock y ChatWindow en posición
     absoluta desbordan la sección. Los convertimos en estáticos. */
  section[data-screen-label="Hero"] .container > div:last-child > div{
    min-height: auto !important;
    display: flex; flex-direction: column; gap: 16px;
  }
  section[data-screen-label="Hero"] .container > div:last-child div[style*="absolute"][style*="bottom"]{
    position: static !important;
    width: 100% !important; max-width: 480px !important;
  }
  section[data-screen-label="Demo visual"] > .container > div:last-child > div[style*="absolute"]{
    position: static !important; margin-top: 14px;
  }
  section[data-screen-label="Demo visual"] > .container > div:last-child{
    display: flex; flex-direction: column; gap: 16px;
  }
}

/* ─── ≤ 880px (tablet portrait) ─── */
@media (max-width: 880px) {
  /* Show hamburger, hide desktop nav */
  nav.primary{ display: none !important }
  .hamburger{ display: inline-flex !important }

  /* Cualquier botón grande/CTA hero — full width para evitar overflow */
  section[data-screen-label="Hero"] .btn-lg,
  section[data-screen-label="Hero"] .btn{ max-width: 100% }
  .btn{ max-width: 100% }
  /* Hide "Contacto" link on small to save space (in drawer instead) */
  .header-cta .login{ display: none }

  .footer-grid{ grid-template-columns: 1fr 1fr; gap: 32px }
  .footer-grid > :first-child{ grid-column: 1 / -1 }

  /* Article body — drop TOC sidebar */
  section[data-screen-label="Article Body"] > .container{
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  section[data-screen-label="Article Body"] aside .toc{ position: static !important }

  /* All "How it works" detail steps stack */
  section[data-screen-label="Steps detail"] > .container > div{
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  section[data-screen-label="Steps detail"] > .container > div > div:nth-child(1){ order: 0 !important }
  section[data-screen-label="Steps detail"] > .container > div > div:nth-child(2){ order: 1 !important }

  /* Industries / Featured cards stack */
  section[data-screen-label="Casos de uso"] .card[style*="grid-template-columns"],
  section[data-screen-label="Featured Inmobiliario"] .card,
  section[data-screen-label="Featured Articles"] a.card,
  section[data-screen-label="Featured Articles"] a[class*="card"]{
    grid-template-columns: 1fr !important;
  }

  /* Contact + Demo forms — sidebar drops below */
  section[data-screen-label="Contact form"] > .container,
  section[data-screen-label="Demo form"] > .container{
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Page hero text smaller */
  .page-hero{ padding: 48px 0 36px }

  /* Smaller cards */
  .card{ padding: 22px }
}

/* ─── ≤ 720px (large mobile) ─── */
@media (max-width: 720px) {
  :root{ --header-h: 60px }
  .container{ padding: 0 16px }
  .section{ padding: 56px 0 }

  /* Contener desborde horizontal — solo secciones de contenido */
  section > .container { max-width: 100%; overflow-x: hidden; }
  main { overflow-x: hidden; }

  /* Force any 2-col inline grid to single column except .grid (auto-fit handles itself) */
  /* Selector: descendant of section with inline grid-template-columns */
  section [style*="grid-template-columns: minmax"],
  section [style*="grid-template-columns:'minmax"],
  section [style*="gridTemplateColumns"],
  .container[style*="grid-template-columns"]{
    grid-template-columns: 1fr !important;
  }

  /* Grid items en hero: min-width:0 evita blowout de columna */
  section[data-screen-label="Hero"] .container > * { min-width: 0; }

  /* Eyebrow: truncar si el texto es demasiado largo */
  .eyebrow{
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    font-size: 10px !important;
    letter-spacing: .08em !important;
    padding: 5px 10px !important;
  }

  /* Footer to single col */
  .footer-grid{ grid-template-columns: 1fr !important; gap: 28px }
  .footer-grid > :first-child{ grid-column: auto }

  /* Hero — tighter spacing */
  section[data-screen-label="Hero"]{ padding-top: 56px !important; padding-bottom: 64px !important }

  /* Heading sizes */
  .h-display{ font-size: clamp(28px, 8vw, 40px) !important; line-height: 1.08 !important }
  .h-section{ font-size: clamp(24px, 6.5vw, 32px) !important; line-height: 1.15 !important }

  /* Hero buttons stack full-width */
  section[data-screen-label="Hero"] .row .btn{
    width: 100%; justify-content: center;
  }
  section[data-screen-label="Hero"] .row{ width: 100% }
  section[data-screen-label="Hero"] .row > a{ flex: 1 1 100% }

  /* CTA Final btn */
  section[data-screen-label="CTA Final"] .btn{ width: 100%; justify-content: center }

  /* Tabs of industries wrap nicely */
  section[data-screen-label="Casos de uso"] .container > div[style*="flex-wrap"]{ justify-content: flex-start }

  /* Header CTA shrink */
  .btn-cta-header{ padding: 8px 14px !important; font-size: 13px !important }

  /* Voxel stage min height smaller */
  .voxel-stage{ min-height: 280px }

  /* Activity dock / chat → stack below voxel on mobile
     BUG FIX: el hero "split" tiene un div wrapper extra, por lo que
     el selector con > (hijo directo) no hacía match al ActivityDock.
     Solución: descendant selector + override del inner wrapper. */
  section[data-screen-label="Hero"] .container > div:last-child > div{
    min-height: auto !important;
    display: flex; flex-direction: column; gap: 14px;
  }
  section[data-screen-label="Hero"] .container > div:last-child div[style*="absolute"][style*="bottom"]{
    position: static !important;
    width: 100% !important; max-width: 100% !important;
  }
  section[data-screen-label="Demo visual"] > .container > div:last-child > div[style*="absolute"]{
    position: static !important; margin-top: 14px;
  }
  section[data-screen-label="Demo visual"] > .container > div:last-child{ display: flex; flex-direction: column; gap: 14px }

  /* Forms — labels and inputs full width */
  .form-grid{ gap: 14px }

  /* Pricing cards — full width, less padding */
  section[data-screen-label="Precios"] .card{ padding: 24px }

  /* Comparison table — horizontal scroll preserved, but tighten cells */
  section[data-screen-label="Comparativa"] th,
  section[data-screen-label="Comparativa"] td{
    padding: 12px 10px !important; font-size: 13px !important;
  }

  /* Eyebrow centered alignment */
  .eyebrow{ font-size: 10.5px; padding: 5px 10px }

  /* Tweaks panel — keep usable */
  .twk-panel{ max-width: calc(100vw - 24px) }

  /* Article body inner padding */
  .article-prose{ font-size: 16px; line-height: 1.7 }
  .article-prose h2{ font-size: 24px; margin-top: 36px }
  .article-prose h3{ font-size: 18px }
  .article-prose pre{ font-size: 12px !important; padding: 14px !important }
  .article-prose table{ font-size: 12.5px !important }

  /* Demo visual list inline padding */
  section[data-screen-label="Demo visual"] ul li{ font-size: 14px }

  /* Floating dot adjustments — fewer offsets that overflow */
  section[data-screen-label="Hero"] .container > div:last-child{ min-height: auto !important }

  /* Industries flex tabs become 2-col */
  section[data-screen-label="Casos de uso"] > .container > div[style*="flex-wrap: wrap"]{
    display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px;
  }
  section[data-screen-label="Casos de uso"] > .container > div[style*="flex-wrap: wrap"] button{
    width: 100%; justify-content: center; font-size: 13px;
  }

  /* Marquee size smaller */
  .marquee-track span{ font-size: 17px !important }

  /* Onboarding modal stack columns */
  .twk-panel + div[style*="position:fixed"] > div[style*="grid-template-columns"],
  div[style*="grid-template-columns: minmax(320px"]{
    grid-template-columns: 1fr !important;
  }

  /* Featured blog card stack */
  a.card[style*="grid-template-columns"]{
    grid-template-columns: 1fr !important;
  }
  a.card[style*="grid-template-columns"] > div[style*="aspect-ratio"]{
    aspect-ratio: 16/9 !important;
  }

  /* Big metrics block in case study */
  div[style*="linear-gradient(135deg, var(--brand-primary)"][style*="border-radius: 22px"]{
    padding: 22px !important;
  }
}

/* ─── ≤ 480px (small mobile) ─── */
@media (max-width: 480px) {
  .container{ padding: 0 14px }
  .h-display{ font-size: clamp(24px, 7.5vw, 34px) !important }
  .h-section{ font-size: clamp(22px, 6vw, 28px) !important }
  .lead{ font-size: 15.5px !important }

  /* Hide certain decorative elements on tiny screens */
  section[data-screen-label="Hero"] .row + div{ gap: 14px !important; flex-direction: column; align-items: flex-start !important }

  /* Hero check-marks list — tighter */
  section[data-screen-label="Hero"] .row + div span{ font-size: 12.5px }

  /* Pulse legend on voxel — smaller */
  .voxel-stage > div[style*="position:absolute"][style*="left: 16px"]{
    font-size: 10.5px !important; padding: 6px 10px !important;
  }
  .voxel-stage > div[style*="position:absolute"][style*="right: 16px"] button{
    padding: 4px 10px !important; font-size: 10px !important;
  }

  /* Smaller chat in hero */
  .voxel-stage{ min-height: 240px }

  /* Header brand name slightly smaller */
  .brand .name{ font-size: 15px }
  .brand .glyph{ width: 24px; height: 28px }

  /* Card icon containers smaller */
  .card > div[style*="width: 56px"][style*="height: 56px"]{
    width: 44px !important; height: 44px !important;
  }

  /* Page-hero crumbs wrap */
  .page-hero .crumb{ flex-wrap: wrap }

  /* Big number metrics — smaller font */
  div[style*="font-size: 28px"][style*="font-weight: 800"]{ font-size: 22px !important }
  div[style*="font-size: 36px"][style*="font-weight: 800"]{ font-size: 28px !important }

  /* Table-of-comparison: hide column 4 (least important) to make room */
  /* (Keeping all columns is more honest; instead we already scroll. Skip.) */
}

/* ─── Touch device niceties ─── */
@media (hover: none) and (pointer: coarse) {
  .card.hoverable:hover{ transform: none !important }
  .btn-primary:hover{ transform: none !important }
}

/* Anchor scroll offset for sticky header */
:where(h2, h3)[id]{ scroll-margin-top: calc(var(--header-h) + 16px) }
