.ai-masthead.home-masthead {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(28px, 4vw, 68px);
  min-height: 850px;
  padding-block: 140px 100px;
  align-items: center;
}
.ai-masthead.home-masthead .hero-copy { width: auto; transform: none; }
.ai-masthead.home-masthead h1 { font-size: clamp(62px, 7.4vw, 116px); }
.ai-masthead .hero-caption { font-size: 21px; }
.ai-hero-invite { margin-top: 20px; max-width: 330px; font-size: 16px; color: #606060; line-height: 1.6; }
.ai-studio { min-width: 0; color: #171717; background: #fff; border: 1px solid #e6e6e6; border-radius: 22px; box-shadow: 0 16px 48px #00000009; overflow: hidden; }
.ai-studio button, .ai-studio textarea { font: inherit; }
.ai-studio button { cursor: pointer; }
.ai-studio button:disabled { cursor: default; opacity: .45; }
.ai-studio :focus-visible { outline: 2px solid #625800; outline-offset: 3px; }
.ai-studio-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; }
.ai-studio-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; }
.ai-connection { font-size: 11px; color: #777; }
.ai-connection[data-ready="true"]::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 6px 2px 0; background: #508262; border-radius: 50%; }
.ai-agencies { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 5px; margin: 0 16px; background: #f3f3f0; border-radius: 12px; }
.ai-agencies button { border: 0; background: none; padding: 12px 4px; border-radius: 8px; text-align: left; padding-left: 12px; font-size: 13px; font-weight: 650; color: #777; }
.ai-agencies button span { display: block; margin-top: 4px; font-size: 11px; font-weight: 450; }
.ai-agencies button[aria-pressed="true"] { background: #191919; color: #fff; }
.ai-agencies button[aria-pressed="true"] span { color: #e3d958; }
.ai-workspace-head { display: flex; justify-content: space-between; padding: 18px 22px 10px; font-size: 12px; color: #777; }
.ai-workspace-head button { border: 0; background: none; color: #777; font-size: 12px; padding: 2px; }
.ai-messages { height: 252px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 6px 22px 16px; }
.ai-welcome { padding-top: 14px; }
.ai-welcome h2 { font-size: 25px; font-weight: 650; line-height: 1.35; letter-spacing: -.045em; max-width: 350px; }
.ai-welcome p { margin-top: 14px; font-size: 14px; line-height: 1.65; color: #777; max-width: 360px; }
.ai-capabilities { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.ai-capabilities span { border: 1px solid #e6e6e6; border-radius: 6px; font-size: 11px; padding: 6px 8px; color: #626262; }
.ai-message { margin: 10px 0 22px; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.ai-message-label { display: block; margin-bottom: 6px; color: #888; font-size: 10px; letter-spacing: .04em; }
.ai-message-user { margin-left: 25px; padding: 11px 14px; border-radius: 12px 12px 3px 12px; background: #f3f3ef; }
.ai-answer-text { white-space: pre-wrap; }
.ai-citation { display: inline-block; margin-inline: 3px; padding: 0 5px; font-size: 11px; color: #343d21; border-radius: 4px; background: #f1efcb; text-decoration: none; vertical-align: baseline; }
.ai-source-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.ai-source-list a { max-width: 100%; font-size: 11px; padding: 4px 8px; border: 1px solid #e3e3e3; border-radius: 6px; text-decoration: none; color: #555; }
.ai-source-list a:hover { border-color: #777; }
.ai-loading { color: #767676; font-size: 13px; display: flex; align-items: center; gap: 9px; }
.ai-loading::before { content: ""; width: 12px; height: 12px; border: 2px solid #dedede; border-top-color: #595959; border-radius: 50%; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-suggestions { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 20px 12px; }
.ai-suggestions button { border: 1px solid #e4e4e4; border-radius: 7px; background: #fff; color: #555; font-size: 11px; text-align: left; padding: 7px 9px; }
.ai-suggestions button:hover { background: #f4f4ee; }
.ai-composer { display: flex; gap: 10px; align-items: flex-end; margin: 0 16px; padding: 12px; border: 1px solid #d9d9d9; border-radius: 12px; }
.ai-composer:focus-within { border-color: #7c7c71; }
.ai-composer textarea { resize: none; border: 0; outline: none; background: none; min-width: 0; width: 100%; line-height: 1.6; font-size: 14px; padding: 0; color: #171717; }
.ai-composer textarea:focus-visible { outline: none; }
.ai-composer button { width: 36px; height: 36px; flex: none; border: 0; border-radius: 9px; background: #eee000; color: #161616; font-size: 23px; }
.ai-error { font-size: 12px; color: #9a352a; line-height: 1.5; margin: 9px 20px 0; }
.ai-error:empty { display: none; }
.ai-privacy { margin: 10px 20px 12px; font-size: 10px; color: #777; line-height: 1.5; }
.ai-privacy a { text-decoration: underline; text-underline-offset: 2px; }
.ai-disclaimer { margin: 0; padding: 11px 20px; background: #f7f7f5; font-size: 10px; line-height: 1.5; color: #737373; }
.ai-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1000px) {
  .ai-masthead.home-masthead { padding-inline: 32px; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 24px; }
  .ai-masthead.home-masthead h1 { font-size: 64px; }
  .ai-masthead.home-masthead .hero-caption { font-size: 19px; }
}
@media (min-width: 768px) and (max-height: 820px) {
  .ai-masthead.home-masthead { padding-block: 112px 72px; min-height: 760px; }
  .ai-messages { height: 205px; }
  .ai-welcome { padding-top: 7px; }
  .ai-capabilities { margin-top: 16px; }
}
@media (max-width: 767px) {
  .ai-masthead.home-masthead { display: grid; grid-template-columns: 1fr; min-height: auto; padding: 134px 20px 100px; gap: 36px; }
  .ai-masthead.home-masthead h1 { font-size: clamp(58px, 13vw, 94px); }
  .ai-masthead.home-masthead .hero-copy { width: 100%; }
  .ai-masthead .hero-actions { margin-top: 22px; }
  .ai-masthead .hero-caption { margin-top: 22px; }
  .ai-hero-invite { max-width: none; font-size: 14px; }
  .ai-messages { height: 280px; padding-inline: 16px; }
  .ai-agencies { margin-inline: 10px; }
  .ai-agencies button { padding: 11px 5px; text-align: center; font-size: 12px; }
  .ai-studio-top { padding-inline: 16px; }
  .ai-suggestions { padding-inline: 14px; }
  .ai-composer { margin-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) { .ai-loading::before { animation: none; } }

/* Keep the animated brand character alongside the live AI workspace. */
.ai-masthead.home-masthead .hero-visual { position: relative; inset: auto; width: 100%; height: clamp(190px, 19vw, 270px); margin-block: 4px 12px; pointer-events: auto; }
.ai-masthead.home-masthead h1 { font-size: clamp(60px, 6.4vw, 96px); }
.ai-masthead.home-masthead .hero-caption { margin-top: 0; font-size: 18px; }
.ai-masthead .ai-hero-invite { margin-top: 12px; }
.ai-masthead .hero-actions { margin-top: 22px; }
@media (max-width: 767px) {
  .ai-masthead.home-masthead .hero-visual { height: 240px; margin-block: 0 12px; }
  .ai-masthead.home-masthead h1 { font-size: clamp(58px, 13vw, 94px); }
}

/* Compact entry, full-height conversation surface. */
.ai-launcher { position: fixed; z-index: 110; bottom: max(24px, env(safe-area-inset-bottom)); right: 24px; display: flex; gap: 20px; align-items: center; border: 1px solid #333; border-radius: 99px; padding: 16px 22px; background: #191919; color: #fff; font: inherit; font-size: 14px; cursor: pointer; box-shadow: 0 6px 24px #0002; }
.ai-panel-open { overflow: hidden; }
dialog.ai-panel { position: fixed; inset: 16px 16px 16px auto; margin: 0; padding: 0; width: min(560px, calc(100vw - 32px)); height: calc(100dvh - 32px); max-height: none; max-width: none; }
dialog.ai-panel:not([open]) { display: none; }
dialog.ai-panel[open] { display: flex; flex-direction: column; animation: ai-enter .2s ease-out; }
.ai-panel::backdrop { background: #0003; }
.ai-panel > :not(.ai-messages) { flex-shrink: 0; }
.ai-panel .ai-studio-top { border-bottom: 1px solid #eee; margin-bottom: 14px; }
.ai-panel .ai-connection { margin-top: 6px; }
.ai-panel .ai-close { background: #f4f4f1; border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 27px; line-height: 1; }
.ai-panel .ai-messages { position: relative; flex: 1 1 0; height: auto; min-height: 0; padding: 16px 24px 24px; scroll-padding-block: 16px; }
.ai-panel .ai-message { font-size: 15px; line-height: 1.85; }
.ai-panel .ai-panel-footer { padding-top: 12px; border-top: 1px solid #eee; }
.ai-panel .ai-composer textarea { font-size: 16px; }
.ai-panel .ai-welcome { padding-top: 16px; }
.ai-masthead.home-masthead .hero-visual { height: clamp(240px, 25vw, 340px); }
@keyframes ai-enter { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@media (max-width: 767px) {
  dialog.ai-panel { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .ai-panel .ai-studio-top { padding-top: max(16px, env(safe-area-inset-top)); }
  .ai-panel-footer { padding-bottom: env(safe-area-inset-bottom); }
  .ai-launcher { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .ai-panel .ai-messages { padding-inline: 18px; }
  .ai-entry-copy { padding: 24px 20px; }
  .ai-panel .ai-disclaimer { display: none; }
}
@media (prefers-reduced-motion: reduce) { dialog.ai-panel[open] { animation: none; } }

/* A single invitation carried by the brand character. */
.ai-masthead.home-masthead { grid-template-columns: 1fr 1fr; min-height: min(900px, 100svh); padding-block: 120px 100px; gap: 32px; }
.ai-masthead.home-masthead h1 { font-size: clamp(72px, 8.5vw, 132px); }
.ai-masthead.home-masthead .hero-caption { margin-top: 30px; max-width: 420px; font-size: 19px; line-height: 1.7; }
.ai-invitation { min-width: 0; }
.ai-character-invite { display: block; width: 100%; border: 0; padding: 0 0 16px; background: transparent; color: inherit; font: inherit; text-align: center; cursor: pointer; border-radius: 24px; }
.ai-character-invite:focus-visible { outline: 2px solid #777; outline-offset: 8px; }
.ai-masthead.home-masthead .ai-character-invite .hero-visual { height: clamp(290px, 32vw, 440px); margin: 0; transition: transform .3s ease; }
.ai-invitation-copy { display: block; font-size: clamp(20px, 2vw, 28px); font-weight: 600; letter-spacing: -.04em; line-height: 1.5; }
.ai-invitation-link { display: inline-flex; align-items: center; gap: 18px; margin-top: 18px; padding-bottom: 7px; border-bottom: 1px solid #b5b5af; font-size: 13px; color: #60605a; }
.ai-invitation-link > span { display: inline-block; transition: transform .25s; }
@media (hover: hover) {
  .ai-character-invite:hover .hero-visual { transform: translateY(-4px); }
  .ai-character-invite:hover .ai-invitation-link > span { transform: translate(3px, -3px); }
}
.ai-launcher[hidden] { display: none; }
@media (max-width: 767px) {
  .ai-masthead.home-masthead { grid-template-columns: 1fr; padding: 124px 20px 90px; gap: 24px; min-height: auto; }
  .ai-masthead.home-masthead h1 { font-size: clamp(60px, 13vw, 94px); }
  .ai-masthead.home-masthead .hero-caption { font-size: 16px; margin-top: 20px; }
  .ai-masthead.home-masthead .ai-character-invite .hero-visual { height: 280px; }
  .ai-invitation-copy { font-size: 22px; }
  .ai-panel .ai-suggestions { flex-wrap: nowrap; overflow-x: auto; }
  .ai-panel .ai-suggestions button { flex: 0 0 auto; max-width: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-character-invite .hero-visual, .ai-invitation-link > span { transition: none !important; transform: none !important; }
}

.ai-character-bubble { position: absolute; z-index: 3; left: clamp(120px, var(--bubble-x, 50%), calc(100% - 120px)); top: max(105px, var(--bubble-y, 38%)); transform: translate(-50%, calc(-100% - 16px)); display: block; padding: 17px 22px; width: 238px; border: 0; border-radius: 14px; background: #1b1b1b; box-shadow: none; color: #fff; text-align: left; pointer-events: auto; }
.ai-character-bubble::after { content: ""; position: absolute; width: 14px; height: 14px; background: #1b1b1b; bottom: -6px; left: calc(50% - 7px); transform: rotate(45deg); border-radius: 0 0 3px 0; }
.ai-character-bubble .ai-bubble-label { display: block; color: #d1d1cd; font-size: 14px; font-weight: 450; line-height: 1.5; letter-spacing: -.02em; }
.ai-character-bubble .ai-bubble-prompt { display: block; margin-top: 5px; color: #fff; font-size: 19px; font-weight: 650; line-height: 1.5; letter-spacing: -.035em; white-space: nowrap; }
.ai-character-bubble .ai-bubble-prompt > span { color: #f0df35; margin-left: 8px; font-size: 21px; }
.ai-masthead.home-masthead .ai-character-invite .hero-visual { height: clamp(360px, 40vw, 530px); }
@media (max-width: 767px) { .ai-masthead.home-masthead .ai-character-invite .hero-visual { height: 340px; } }
