
  .hero--ai-chat {
    gap: clamp(1.9rem, 3vw, 2.6rem);
  }

  .ai-mode-intro {
    width: min(100%, 48rem);
    margin-inline: auto;
    display: grid;
    gap: 1.1rem;
    justify-items: center;
    text-align: center;
  }

  .ai-mode-copy {
    display: grid;
    gap: 1rem;
    justify-items: center;
  }

  .hero--ai-chat .kicker {
    margin-inline: auto;
  }

  .hero--ai-chat h1 {
    max-width: none;
    font-size: clamp(3.8rem, 7vw, 5.8rem);
    line-height: 0.92;
    text-align: center;
  }

  .hero--ai-chat .subtitle {
    max-width: 30rem;
    margin-inline: auto;
    text-align: center;
  }

  .hero--ai-chat .actions {
    justify-content: center;
  }

  .chat-console {
    min-width: 0;
    display: grid;
    gap: 1rem;
    padding: 1.15rem;
    border-radius: var(--radius-lg);
    border: 1px solid color-mix(in srgb, var(--ink-900), transparent 72%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--paper-100), white 8%), color-mix(in srgb, var(--paper-200), var(--navy) 12%));
    box-shadow: var(--shadow-subtle);
    position: relative;
    overflow: hidden;
  }

  .chat-console::before {
    content: "";
    position: absolute;
    inset: auto auto -18% -6%;
    width: 13rem;
    height: 13rem;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--coral), transparent 82%), transparent 70%);
    pointer-events: none;
  }

  .chat-console__body,
  .chat-stage {
    min-width: 0;
    position: relative;
    z-index: 1;
  }

  .chat-console__body {
    display: grid;
    gap: 0.85rem;
  }

  .chat-prompt-surface--grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  }

  .chat-prompt-surface--message {
    min-height: 2.5rem;
    display: flex;
    align-items: center;
  }

  .chat-prompt-loading {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.78rem 0.9rem;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--blue), transparent 62%);
    background:
      linear-gradient(145deg, color-mix(in srgb, var(--paper-100), white 10%), color-mix(in srgb, var(--paper-200), var(--navy) 10%)),
      linear-gradient(90deg, color-mix(in srgb, var(--blue), transparent 90%), transparent 45%);
    box-shadow: var(--shadow-subtle);
  }

  .chat-prompt-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    flex: 0 0 auto;
  }

  .chat-prompt-spinner span {
    width: 0.46rem;
    height: 0.46rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--blue), var(--navy) 16%);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue), transparent 86%);
    animation: promptRefreshPulse 1s ease-in-out infinite;
  }

  .chat-prompt-spinner span:nth-child(2) {
    animation-delay: 0.15s;
  }

  .chat-prompt-spinner span:nth-child(3) {
    animation-delay: 0.3s;
  }

  .chat-prompt-button {
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--ink-900), transparent 72%);
    border-radius: 18px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--paper-100), white 8%), color-mix(in srgb, var(--paper-200), var(--navy) 9%));
    color: var(--ink-900);
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .chat-prompt-button {
    padding: 0.72rem 0.8rem;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
  }

  .chat-prompt-button:hover,
  .chat-prompt-button:focus-visible {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--blue), transparent 42%);
    box-shadow: 0 14px 28px rgba(24, 32, 43, 0.14);
  }

  .chat-prompt-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
    box-shadow: var(--shadow-subtle);
  }

  .chat-stage {
    min-height: 0;
    display: grid;
    gap: 0.85rem;
  }

  .chat-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .chat-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ink-900), transparent 76%);
    background: color-mix(in srgb, var(--paper-100), white 8%);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .chat-status::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--amber);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber), transparent 82%);
  }

  .chat-error {
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--coral), transparent 54%);
    background: color-mix(in srgb, var(--coral), transparent 90%);
    color: color-mix(in srgb, var(--ink-900), var(--coral) 20%);
    font-size: 0.94rem;
    font-weight: 650;
  }

  .chat-transcript {
    min-height: 24rem;
    max-height: 34rem;
    overflow: auto;
    padding: 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--ink-900), transparent 80%);
    background: color-mix(in srgb, var(--paper-100), white 14%);
    display: grid;
    gap: 0.85rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  }

  .chat-transcript[hidden] {
    display: none;
  }

  .chat-turn {
    display: grid;
    gap: 0.35rem;
  }

  .chat-turn--user {
    justify-items: end;
  }

  .chat-turn__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .chat-turn__label {
    font-family: var(--font-mono);
    font-size: 0.69rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-700);
  }

  .chat-turn__ttft {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    background: color-mix(in srgb, var(--blue), transparent 88%);
    color: color-mix(in srgb, var(--blue), var(--ink-900) 24%);
    border: 1px solid color-mix(in srgb, var(--blue), transparent 75%);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    user-select: none;
  }

  .chat-turn__bubble {
    max-width: min(100%, 42rem);
    padding: 0.95rem 1rem;
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--ink-900), transparent 78%);
    box-shadow: var(--shadow-subtle);
    line-height: 1.6;
    font-size: 0.97rem;
  }

  .chat-turn--user .chat-turn__bubble {
    background: linear-gradient(135deg, color-mix(in srgb, var(--amber), white 10%), color-mix(in srgb, var(--coral), white 6%));
    color: #1a2232;
  }

  .chat-turn--assistant .chat-turn__bubble {
    background: linear-gradient(145deg, color-mix(in srgb, var(--paper-100), white 10%), color-mix(in srgb, var(--paper-200), var(--navy) 11%));
  }

  .chat-turn__text {
    margin: 0;
    white-space: normal;
  }

  .chat-turn__text > :first-child {
    margin-top: 0;
  }

  .chat-turn__text > :last-child {
    margin-bottom: 0;
  }

  .chat-turn__text p,
  .chat-turn__text ul,
  .chat-turn__text ol,
  .chat-turn__text blockquote,
  .chat-turn__text :is(h1, h2, h3, h4, h5, h6) {
    margin: 0;
  }

  .chat-turn__text p + p,
  .chat-turn__text p + ul,
  .chat-turn__text p + ol,
  .chat-turn__text p + blockquote,
  .chat-turn__text ul + p,
  .chat-turn__text ol + p,
  .chat-turn__text blockquote + p,
  .chat-turn__text :is(h1, h2, h3, h4, h5, h6) + p,
  .chat-turn__text :is(h1, h2, h3, h4, h5, h6) + ul,
  .chat-turn__text :is(h1, h2, h3, h4, h5, h6) + ol,
  .chat-turn__text :is(h1, h2, h3, h4, h5, h6) + blockquote {
    margin-top: 0.75rem;
  }

  .chat-turn__text ul,
  .chat-turn__text ol {
    padding-left: 1.3rem;
  }

  .chat-turn__text li + li {
    margin-top: 0.35rem;
  }

  .chat-turn__text li > ul,
  .chat-turn__text li > ol {
    margin-top: 0.35rem;
  }

  .chat-turn__text strong {
    font-weight: 800;
  }

  .chat-turn__text em {
    font-style: italic;
  }

  .chat-turn__text code {
    padding: 0.08rem 0.35rem;
    border-radius: 0.45rem;
    background: color-mix(in srgb, var(--paper-200), var(--navy) 12%);
    font-family: var(--font-mono);
    font-size: 0.92em;
  }

  .chat-turn__text a {
    color: color-mix(in srgb, var(--blue), var(--navy) 24%);
    font-weight: 700;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.15em;
  }

  .chat-turn__text blockquote {
    padding-left: 0.9rem;
    border-left: 3px solid color-mix(in srgb, var(--blue), transparent 58%);
    color: color-mix(in srgb, var(--ink-900), transparent 12%);
  }

  .chat-turn__text :is(h1, h2, h3, h4, h5, h6) {
    font-size: 1rem;
    line-height: 1.35;
  }

  .chat-turn__typing {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    min-height: 1.2rem;
  }

  .chat-turn__typing-text {
    margin-right: 0.1rem;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: color-mix(in srgb, var(--ink-900), transparent 22%);
  }

  .chat-turn__typing-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--blue), var(--navy) 26%);
    animation: typingPulse 1s ease-in-out infinite;
  }

  .chat-turn__typing-dot--2 {
    animation-delay: 0.15s;
  }

  .chat-turn__typing-dot--3 {
    animation-delay: 0.3s;
  }

  .chat-form {
    min-width: 0;
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--ink-900), transparent 78%);
    background: linear-gradient(145deg, color-mix(in srgb, var(--paper-100), white 9%), color-mix(in srgb, var(--paper-200), var(--navy) 8%));
  }

  .chat-form__prompts {
    display: grid;
    gap: 0.55rem;
  }

  .chat-form__prompts-title {
    margin: 0;
    font-size: 0.9rem;
    color: color-mix(in srgb, var(--ink-900), transparent 16%);
    font-weight: 700;
  }

  .chat-prompt-unavailable {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--ink-700), transparent 10%);
  }

  .chat-prompt-refreshing {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--blue), var(--ink-700) 28%);
  }

  .chat-form__label-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.8rem;
  }

  .chat-form__label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-700);
  }

  .chat-form__counters {
    display: flex;
    gap: 0.85rem;
    align-items: center;
  }

  .chat-word-count,
  .chat-transcript-count {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--ink-700), transparent 28%);
  }

  .chat-textarea {
    width: 100%;
    resize: vertical;
    min-height: 7rem;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--ink-900), transparent 76%);
    background: color-mix(in srgb, var(--paper-100), white 16%);
    color: var(--ink-900);
    font: inherit;
    padding: 0.95rem 1rem;
    line-height: 1.55;
  }

  .chat-textarea:focus-visible,
  .chat-prompt-button:focus-visible,
  .chat-reset:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--ring), var(--shadow-subtle);
  }

  .chat-form__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
  }

  .chat-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-left: auto;
  }

  .chat-form__hint {
    margin: 0;
    color: color-mix(in srgb, var(--ink-900), transparent 24%);
    font-size: 0.9rem;
  }

  .chat-reset,
  .chat-send {
    min-width: 10.25rem;
  }

  .chat-reset:disabled,
  .chat-send:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: var(--shadow-subtle);
  }

  .chat-send:disabled {
    cursor: wait;
  }

  @keyframes typingPulse {
    0%, 100% {
      opacity: 0.4;
      transform: translateY(0);
    }
    50% {
      opacity: 1;
      transform: translateY(-2px);
    }
  }

  @keyframes promptRefreshPulse {
    0%, 100% {
      opacity: 0.35;
      transform: translateY(0) scale(0.92);
    }
    50% {
      opacity: 1;
      transform: translateY(-1px) scale(1);
    }
  }

  @media (max-width: 680px) {
    .chat-console {
      padding: 1rem;
    }

    .chat-status-row,
    .chat-form__footer {
      align-items: stretch;
    }

    .chat-form__counters {
      width: 100%;
      flex-wrap: wrap;
    }

    .chat-actions {
      width: 100%;
    }

    .chat-reset,
    .chat-send {
      width: 100%;
    }
  }
