@layer tool.viral-growth-loop-visualizer {
  .growth-loop-viz {
    --growth-loop-accent: #c04a2d;
    display: grid;
    gap: var(--size-5);
    margin-top: var(--size-5);
  }

  .growth-loop-viz__computed {
    display: none;
  }

  .growth-loop-viz__hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: var(--size-5);
    align-items: start;
  }

  .growth-loop-viz__hero-note {
    margin: 0;
    padding: var(--size-4);
    border: 1px solid rgba(53, 44, 34, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(192, 74, 45, 0.12), rgba(255, 255, 255, 0.72));
    line-height: 1.7;
  }

  .growth-loop-viz__panel {
    padding: var(--size-5);
    border: 1px solid rgba(53, 44, 34, 0.08);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 20px 40px rgba(53, 44, 34, 0.05);
  }

  .growth-loop-viz__panel--results {
    background:
      radial-gradient(circle at top right, rgba(192, 74, 45, 0.12), transparent 34%),
      rgba(255, 255, 255, 0.6);
  }

  .growth-loop-viz__section-header {
    margin-bottom: var(--size-4);
  }

  .growth-loop-viz__section-header h3 {
    margin: 0 0 0.35rem;
    font-family: var(--font-serif-custom);
    font-size: 1.35rem;
    line-height: 1.08;
    letter-spacing: -0.04em;
  }

  .growth-loop-viz__section-header p,
  .growth-loop-viz__summary-card p,
  .growth-loop-viz__loop-node p,
  .growth-loop-viz__diagnosis article,
  .growth-loop-viz__explain-grid p {
    margin: 0;
    color: var(--ink-1);
    line-height: 1.7;
  }

  .growth-loop-viz__controls,
  .growth-loop-viz__summary,
  .growth-loop-viz__loop-map,
  .growth-loop-viz__split,
  .growth-loop-viz__explain-grid,
  .growth-loop-viz__diagnosis {
    display: grid;
    gap: var(--size-4);
  }

  .growth-loop-viz__controls--profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .growth-loop-viz__controls--rates,
  .growth-loop-viz__summary,
  .growth-loop-viz__loop-map,
  .growth-loop-viz__split,
  .growth-loop-viz__explain-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .growth-loop-viz__field {
    display: grid;
    gap: 0.55rem;
  }

  .growth-loop-viz__field span,
  .growth-loop-viz__summary-card span,
  .growth-loop-viz__diagnosis span {
    color: var(--ink-2);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .growth-loop-viz__field small {
    color: var(--ink-2);
    line-height: 1.6;
  }

  .growth-loop-viz input[type="range"] {
    width: 100%;
    min-width: 0;
  }

  .growth-loop-viz__summary-card,
  .growth-loop-viz__loop-node,
  .growth-loop-viz__diagnosis article,
  .growth-loop-viz__explain-grid article {
    padding: var(--size-4);
    border-radius: 20px;
    border: 1px solid rgba(53, 44, 34, 0.06);
    background: rgba(255, 255, 255, 0.62);
  }

  .growth-loop-viz__summary-card strong,
  .growth-loop-viz__diagnosis strong {
    display: block;
    margin: 0.45rem 0 0.6rem;
    font-family: var(--font-serif-custom);
    font-size: 1.7rem;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--ink-0);
  }

  .growth-loop-viz__summary-card--dark {
    background: linear-gradient(180deg, #5c2517, #c04a2d);
    box-shadow: 0 22px 38px rgba(92, 37, 23, 0.22);
    color: #fff !important;
  }

  .growth-loop-viz__summary-card--dark span,
  .growth-loop-viz__summary-card--dark strong,
  .growth-loop-viz__summary-card--dark p,
  .growth-loop-viz__summary-card--dark * {
    color: #fff !important;
  }

  .growth-loop-viz__track {
    overflow: hidden;
    height: 12px;
    margin: 0.8rem 0;
    border-radius: 999px;
    background: rgba(192, 74, 45, 0.12);
  }

  .growth-loop-viz__track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background:
      linear-gradient(90deg, rgba(192, 74, 45, 0.92), rgba(236, 133, 77, 0.92)),
      linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0));
    background-size: 100% 100%, 180px 100%;
    transition: width 280ms var(--ease-out);
    animation: growth-loop-sheen 3.2s linear infinite;
  }

  .growth-loop-viz__loop-node {
    position: relative;
    overflow: hidden;
  }

  .growth-loop-viz__loop-node::after {
    content: "";
    position: absolute;
    inset: auto 16px 12px auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(192, 74, 45, 0.4);
    box-shadow: 0 0 0 0 rgba(192, 74, 45, 0.3);
    animation: growth-loop-pulse 2.6s ease-out infinite;
  }

  .growth-loop-viz__loop-node h4,
  .growth-loop-viz__explain-grid h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    line-height: 1.3;
  }

  .growth-loop-viz__diagnosis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .growth-loop-viz__diagnosis--advice {
    grid-template-columns: 1fr;
  }

  .growth-loop-viz__diagnosis article strong {
    font-size: 1.08rem;
    line-height: 1.4;
  }

  .tool-embed--article[data-tool-embed="viral-growth-loop-visualizer"] .growth-loop-viz__hero,
  .tool-embed--article[data-tool-embed="viral-growth-loop-visualizer"] .growth-loop-viz__controls--profile,
  .tool-embed--article[data-tool-embed="viral-growth-loop-visualizer"] .growth-loop-viz__controls--rates,
  .tool-embed--article[data-tool-embed="viral-growth-loop-visualizer"] .growth-loop-viz__summary,
  .tool-embed--article[data-tool-embed="viral-growth-loop-visualizer"] .growth-loop-viz__loop-map,
  .tool-embed--article[data-tool-embed="viral-growth-loop-visualizer"] .growth-loop-viz__split,
  .tool-embed--article[data-tool-embed="viral-growth-loop-visualizer"] .growth-loop-viz__explain-grid,
  .tool-embed--article[data-tool-embed="viral-growth-loop-visualizer"] .growth-loop-viz__diagnosis {
    grid-template-columns: 1fr;
  }

  .tool-embed--article[data-tool-embed="viral-growth-loop-visualizer"] .growth-loop-viz__panel {
    padding: 1.25rem;
  }

  .tool-embed--article[data-tool-embed="viral-growth-loop-visualizer"] .growth-loop-viz__hero-note {
    padding: 1rem 1.05rem;
  }

  @keyframes growth-loop-sheen {
    from {
      background-position: 0 0, -180px 0;
    }
    to {
      background-position: 0 0, 180px 0;
    }
  }

  @keyframes growth-loop-pulse {
    0% {
      transform: scale(0.9);
      box-shadow: 0 0 0 0 rgba(192, 74, 45, 0.3);
    }
    70% {
      transform: scale(1);
      box-shadow: 0 0 0 10px rgba(192, 74, 45, 0);
    }
    100% {
      transform: scale(0.9);
      box-shadow: 0 0 0 0 rgba(192, 74, 45, 0);
    }
  }

  @media (max-width: 960px) {
    .growth-loop-viz__hero,
    .growth-loop-viz__controls--profile,
    .growth-loop-viz__controls--rates,
    .growth-loop-viz__summary,
    .growth-loop-viz__loop-map,
    .growth-loop-viz__split,
    .growth-loop-viz__explain-grid,
    .growth-loop-viz__diagnosis {
      grid-template-columns: 1fr;
    }
  }
}
