@layer agent {
  .site-agent { position: fixed; right: clamp(1rem, 2vw, 2rem); bottom: clamp(5rem, 8vw, 6.5rem); z-index: 80; }
  .site-agent-launcher { display: flex; align-items: center; gap: .75rem; min-height: 3rem; padding: .5rem 1rem .5rem .5rem; border: 1px solid color-mix(in srgb, var(--paper) 24%, transparent); border-radius: 999px; color: var(--paper); background: color-mix(in srgb, var(--ink) 92%, transparent); backdrop-filter: blur(16px); cursor: pointer; }
  .site-agent-launcher span { display: grid; place-items: center; inline-size: 2rem; block-size: 2rem; border-radius: 50%; color: var(--ink); background: var(--paper); font-family: var(--font-display, serif); }
  .site-agent-launcher strong { font-size: .75rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
  .site-agent-dialog { width: min(31rem, calc(100vw - 2rem)); max-height: min(46rem, calc(100dvh - 2rem)); margin: auto 1rem 1rem auto; padding: 0; border: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); border-radius: 1rem; color: var(--paper); background: #15171b; box-shadow: 0 1.5rem 5rem rgb(0 0 0 / .35); }
  .site-agent-dialog::backdrop { background: rgb(0 0 0 / .28); backdrop-filter: blur(3px); }
  .site-agent-shell { display: grid; grid-template-rows: auto minmax(12rem, 1fr) auto auto; max-height: min(46rem, calc(100dvh - 2rem)); }
  .site-agent-head { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem; border-bottom: 1px solid rgb(255 255 255 / .12); }
  .site-agent-head small { color: rgb(255 255 255 / .58); font-size: .7rem; letter-spacing: .11em; text-transform: uppercase; }
  .site-agent-head h2 { margin: .25rem 0 0; color: inherit; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 400; }
  .site-agent-head > button { align-self: start; inline-size: 2.5rem; block-size: 2.5rem; border: 0; border-radius: 50%; color: inherit; background: rgb(255 255 255 / .08); font-size: 1.5rem; cursor: pointer; }
  .site-agent-log { overflow-y: auto; display: flex; flex-direction: column; gap: .75rem; padding: 1.25rem; overscroll-behavior: contain; }
  .site-agent-message { max-width: 88%; padding: .85rem 1rem; border-radius: .85rem; background: rgb(255 255 255 / .09); }
  .site-agent-message--user { align-self: end; background: var(--paper); color: var(--ink); }
  .site-agent-message p { margin: 0; font-size: .95rem; line-height: 1.5; }
  .site-agent-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
  .site-agent-actions a { padding: .55rem .75rem; border: 1px solid rgb(255 255 255 / .22); border-radius: 999px; color: inherit; font-size: .76rem; text-decoration: none; }
  .site-agent-actions a[data-kind="primary"] { background: var(--paper); color: var(--ink); }
  .site-agent-quick { display: flex; gap: .5rem; overflow-x: auto; padding: 0 1.25rem 1rem; scrollbar-width: none; }
  .site-agent-quick button { flex: 0 0 auto; padding: .55rem .75rem; border: 1px solid rgb(255 255 255 / .16); border-radius: 999px; color: inherit; background: transparent; font-size: .75rem; cursor: pointer; }
  .site-agent-form { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid rgb(255 255 255 / .12); }
  .site-agent-form > label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .site-agent-form > div { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; }
  .site-agent-form textarea { min-height: 3.25rem; max-height: 8rem; resize: vertical; padding: .75rem; border: 1px solid rgb(255 255 255 / .18); border-radius: .7rem; color: inherit; background: rgb(255 255 255 / .06); font: inherit; }
  .site-agent-form button { min-height: 3.25rem; padding: 0 1rem; border: 0; border-radius: .7rem; background: var(--paper); color: var(--ink); cursor: pointer; }
  .site-agent-form button:disabled { opacity: .55; cursor: wait; }
  .site-agent-form > p { margin: .65rem 0 0; color: rgb(255 255 255 / .52); font-size: .68rem; line-height: 1.4; }
  .site-agent button:focus-visible, .site-agent a:focus-visible, .site-agent textarea:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
  @media (max-width: 640px) {
    .site-agent { right: 1rem; bottom: 4.75rem; }
    .site-agent-launcher strong { display: none; }
    .site-agent-launcher { padding-right: .5rem; }
    .site-agent-dialog { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 1rem 1rem 0 0; }
    .site-agent-shell { max-height: 92dvh; }
  }
  @media (prefers-reduced-motion: no-preference) {
    .site-agent-launcher { transition: transform .2s ease, background-color .2s ease; }
    .site-agent-launcher:hover { transform: translateY(-2px); }
  }
}
