@layer reset, base, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, ul { margin: 0; }
  button, input, textarea, select { font: inherit; }
  button, select { cursor: pointer; }
  a { color: inherit; }
  img, svg { display: block; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    color-scheme: dark;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    --sidebar-width: 264px;
    --content-width: 780px;
    --background: #191821;
    --sidebar: #13121a;
    --panel: #24222e;
    --panel-hover: #2d293b;
    --input: #22202c;
    --border: #3b374b;
    --border-soft: #302d40;
    --text: #f7f4fc;
    --muted: #c6bfda;
    --secondary: #aaa4bf;
    --accent: #cebaff;
    --accent-strong: #b599ff;
    --accent-ink: #201438;
    --accent-dim: #302744;
    --danger: #ffb4c2;
    --backdrop: rgb(6 5 10 / 74%);
    --ambient: rgb(160 120 255 / 9%);
    --shadow: 0 22px 65px rgb(8 7 13 / 35%);
    background: var(--background);
  }

  body[data-brand="comparemyinsurance"], body[data-brand="compare"] {
    --background: #0e1c28;
    --sidebar: #101923;
    --panel: #142936;
    --panel-hover: #1b3541;
    --input: #132633;
    --border: #35515d;
    --border-soft: #263e4b;
    --text: #f1faf7;
    --muted: #bdd1d3;
    --secondary: #a7bdc3;
    --accent: #9debd0;
    --accent-strong: #6ad8b5;
    --accent-ink: #0a2520;
    --accent-dim: #173932;
    --danger: #ffb7bc;
    --backdrop: rgb(2 10 16 / 76%);
    --ambient: rgb(97 225 187 / 8%);
    --shadow: 0 22px 65px rgb(2 11 16 / 42%);
  }

  body { color: var(--text); line-height: 1.5; }
  a:hover { color: var(--accent); }
  button { border: 0; background: transparent; color: inherit; }
  button:disabled { cursor: default; }
  input, textarea, select { color: inherit; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
  ::selection { background: var(--accent); color: var(--accent-ink); }

  .sr-only, .skip-link:not(:focus) {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); clip-path: inset(50%); border: 0; white-space: nowrap;
  }

  .skip-link:focus { position: fixed; padding: .65rem 1rem; inset: 8px auto auto 8px; z-index: 20; background: var(--panel); }
}

@layer components {
  .app {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    height: var(--app-height, 100dvh);
    min-height: 0;
    overflow: hidden;
    isolation: isolate;
  }
  .app.sidebar-closed { grid-template-columns: minmax(0, 1fr); }
  .app.sidebar-closed .sidebar { display: none; }
  .sidebar {
    display: flex; min-height: 0; min-width: 0; flex-direction: column; gap: 1.35rem;
    padding: 20px 16px 13px;
    background: var(--sidebar); border-right: 1px solid var(--border-soft);
  }
  .sidebar-header, .topbar-start, .topbar-actions { display: flex; align-items: center; gap: .65rem; }
  .sidebar-header { justify-content: space-between; }
  .wordmark { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); line-height: 1; font-size: 1rem; font-weight: 730; letter-spacing: -.035em; min-width: 0; }
  .wordmark img { flex: 0 0 auto; }
  .wordmark span { white-space: nowrap; }
  .icon-button {
    display: inline-grid; flex: 0 0 auto; place-items: center; min-width: 36px; min-height: 36px;
    border-radius: 9px; color: var(--muted); padding: 7px;
  }
  .icon-button:hover, .icon-button:focus-visible { background: var(--panel-hover); color: var(--text); }
  .icon-button svg, [data-icon] svg { width: 18px; height: 18px; }
  .new-chat {
    display: flex; align-items: center; gap: .6rem; text-align: left;
    min-height: 43px; border-radius: 10px; padding: .55rem .7rem; font-weight: 625;
    color: var(--accent); border: 1px solid var(--border); background: var(--accent-dim);
    font-size: .9rem;
  }
  .new-chat:hover:not(:disabled) { border-color: var(--accent-strong); }
  .new-chat:disabled { opacity: .65; }
  .history { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: .5rem; }
  .history h2 { color: var(--secondary); padding-inline: .5rem; font-size: .875rem; font-weight: 650; }
  .history-empty { color: var(--secondary); font-size: .875rem; line-height: 1.45; padding: .15rem .5rem; }
  .conversation-list { list-style: none; display: grid; align-content: start; gap: .15rem; min-height: 0; overflow: auto; padding: 3px; }
  .conversation-row { position: relative; display: flex; min-width: 0; align-items: center; gap: 2px; border-radius: 8px; }
  .conversation-row:hover, .conversation-row:focus-within, .conversation-row.current { background: var(--panel); }
  .conversation-button { display: flex; flex: 1; min-width: 0; align-items: center; gap: .5rem; text-align: left; padding: .55rem .45rem; color: var(--muted); }
  .conversation-button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; }
  .conversation-row.current .conversation-button { color: var(--text); }
  .conversation-menu { min-width: 29px; min-height: 33px; padding: 5px; color: var(--secondary); }
  .conversation-menu svg { width: 15px; height: 15px; }
  .sidebar-footer { display: grid; gap: .78rem; }
  .account-panel { display: grid; gap: .7rem; border: 1px solid var(--border-soft); border-radius: 11px; padding: .7rem; background: var(--panel); }
  .account-identity { display: flex; align-items: center; min-width: 0; gap: .55rem; }
  .account-identity > div { display: grid; min-width: 0; overflow-wrap: anywhere; }
  .account-avatar { flex: 0 0 auto; align-self: start; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-dim); color: var(--accent); }
  #account-name { font-size: .9rem; font-weight: 670; line-height: 1.35; }
  .account-identity small { color: var(--secondary); font-size: .8rem; }
  .account-action { display: block; width: 100%; text-align: center; text-decoration: none; padding: .37rem .45rem; font-size: .85rem; font-weight: 650; border: 1px solid var(--border); border-radius: 7px; }
  .account-action:hover { background: var(--panel-hover); }
  .workspace-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .7rem; }
  .workspace-footer a { text-decoration: none; }
  .workspace-footer a:hover { color: var(--accent); text-decoration: underline; }

  .workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse 58% 52% at 50% 23%, var(--ambient), transparent 78%), var(--background); }
  .topbar { z-index: 1; display: flex; justify-content: space-between; gap: .6rem; align-items: center; min-height: 65px; padding: 11px clamp(15px, 3vw, 34px); }
  .topbar-start { min-width: 0; }
  .topbar-actions { flex: 0 0 auto; }
  .compact-brand { display: none; }
  .app:not(.sidebar-closed) #open-sidebar { display: none; }
  .app.sidebar-closed .compact-brand { display: inline-flex; }
  .active-title { color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
  .agent-button, .resource-link {
    display: inline-flex; align-items: center; justify-content: center; gap: .42rem;
    padding: .48rem .72rem; min-height: 38px; border-radius: 8px; font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  }
  .resource-link { color: var(--muted); }
  .resource-link:hover { background: var(--panel); }
  .agent-button { color: var(--accent); border: 1px solid var(--border); }
  .agent-button:hover:not(:disabled) { background: var(--accent-dim); border-color: var(--accent-strong); }
  .agent-button:disabled { opacity: .6; }

  .work-content { min-height: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; overflow: auto; padding: 10px clamp(18px, 4vw, 44px) 18px; }
  .work-content.has-conversation { padding-top: 0; justify-content: start; overflow: hidden; background: var(--background); }
  .welcome, .interaction, .chat-status, .messages { width: min(100%, var(--content-width)); margin-inline: auto; }
  .welcome { text-align: center; margin-bottom: clamp(1.5rem, 4vh, 2.9rem); }
  .welcome-orbit { position: relative; display: grid; place-items: center; width: 108px; height: 100px; margin: 0 auto 19px; }
  .brand-tile {
    display: grid; place-items: center; width: 83px; height: 83px; border-radius: 26px;
    border: 1px solid var(--border); background: linear-gradient(155deg, var(--accent-dim), var(--panel)); box-shadow: var(--shadow);
  }
  .brand-tile img { width: 56px; height: 56px; }
  .orbit-detail { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-strong); opacity: .75; }
  .orbit-detail-one { left: 3px; top: 26px; }
  .orbit-detail-two { right: 5px; bottom: 21px; width: 3px; height: 3px; opacity: .6; }
  .welcome h1 { font-size: clamp(2.1rem, 4.4vw, 3.65rem); line-height: 1.065; font-weight: 650; letter-spacing: -.07em; text-wrap: balance; max-width: 760px; margin-inline: auto; }
  .welcome-description { margin-top: .85rem; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.16rem); }
  .notice { margin-top: .7rem; color: var(--muted); }
  .notice a { text-underline-offset: 3px; }

  .interaction { flex: 0 0 auto; }
  .composer {
    display: grid; gap: .25rem; border: 1px solid var(--border); border-radius: 17px;
    padding: 12px 12px 10px 15px; background: var(--input);
    box-shadow: 0 12px 35px rgb(4 4 10 / 17%);
  }
  .composer:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 1px var(--accent-strong); }
  .composer textarea {
    display: block; width: 100%; min-height: 40px; max-height: 155px;
    resize: none; border: 0; outline: 0; background: transparent; color: var(--text); line-height: 1.55;
    padding: .2rem .3rem .15rem 0; caret-color: var(--accent);
  }
  .composer textarea::placeholder { color: var(--secondary); opacity: 1; }
  .composer textarea:focus-visible { outline: 0; }
  .composer-tools { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; min-height: 34px; }
  .send-button { display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); width: 38px; height: 38px; border-radius: 11px; }
  .send-button:hover:not(:disabled) { background: var(--accent-strong); }
  .send-button:disabled { background: var(--accent-dim); color: var(--accent); opacity: .7; }
  .send-button svg { width: 19px; height: 19px; }
  .stop-button { display: inline-flex; align-items: center; gap: .38rem; color: var(--text); border: 1px solid var(--border); border-radius: 9px; min-height: 36px; padding: .3rem .55rem; font-size: .875rem; }
  .stop-button:hover { background: var(--panel-hover); }
  .stop-button svg { width: 13px; height: 13px; }

  .messages-scroll { flex: 1 1 auto; overflow: auto; min-height: 0; overscroll-behavior: contain; padding: 12px 4px 20px; scrollbar-color: var(--border) transparent; }
  .messages { display: grid; gap: 1.7rem; padding-inline: 3px; }
  .message { min-width: 0; overflow-wrap: anywhere; }
  .message-user { align-self: start; justify-self: end; width: fit-content; max-width: min(630px, 92%); background: var(--accent-dim); border: 1px solid var(--border); border-radius: 16px 16px 4px 16px; padding: .65rem .85rem; white-space: pre-wrap; }
  .message-assistant { display: grid; grid-template-columns: 31px minmax(0, 1fr); gap: .65rem; }
  .message-assistant-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-dim); padding: 3px; }
  .message-body { min-width: 0; line-height: 1.68; }
  .message-body > * + * { margin-top: .7rem; }
  .message-body h2, .message-body h3, .message-body h4 { line-height: 1.25; }
  .message-body h2 { font-size: 1.25rem; }
  .message-body h3, .message-body h4 { font-size: 1.05rem; }
  .message-body ol, .message-body ul { padding-left: 1.45rem; }
  .message-body li + li { margin-top: .28rem; }
  .message-body a { color: var(--accent); text-underline-offset: 3px; }
  .message-body blockquote { margin: .7rem 0; padding-left: .75rem; border-left: 2px solid var(--accent-strong); color: var(--muted); }
  .message-body code { background: var(--panel); border-radius: 4px; padding: .1em .22em; font-size: .9em; }
  .message-body pre { padding: .6rem .75rem; border: 1px solid var(--border-soft); background: var(--panel); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .message-body pre code { padding: 0; }
  .message-body .table-wrap { width: 100%; overflow: auto; border-radius: 8px; border: 1px solid var(--border-soft); }
  .message-body table { border-collapse: collapse; width: 100%; font-size: .9rem; }
  .message-body th, .message-body td { text-align: left; min-width: 90px; padding: .4rem .55rem; border: 1px solid var(--border-soft); }
  .message-body th { background: var(--panel); }
  .message-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
  .message-tools .icon-button { min-width: 34px; min-height: 34px; }
  .message-limit, .thinking { color: var(--secondary); font-size: .9rem; }
  .chat-status { color: var(--muted); margin-bottom: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem .65rem; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; }
  .text-button { color: var(--accent); text-underline-offset: 3px; text-decoration: underline; font-weight: 650; }
  .work-content.has-conversation .interaction { padding-top: .55rem; }

  .workspace-footer { display: flex; flex: 0 0 auto; justify-content: center; align-items: center; flex-wrap: wrap; gap: .3rem 1rem; padding: 6px 18px max(11px, env(safe-area-inset-bottom)); color: var(--secondary); font-size: .81rem; text-align: center; }
  .workspace-footer .disclosure { font-size: .6875rem; font-weight: 400; line-height: 1.45; }
  .workspace-footer .disclosure a { text-decoration: underline; text-underline-offset: 3px; }
  .workspace-footer nav { justify-content: center; }
  .scrim { display: none; }

  .dialog {
    margin: auto; width: min(calc(100% - 28px), 510px); max-height: min(740px, calc(var(--app-height, 100dvh) - 24px));
    overflow: auto; color: var(--text); border: 1px solid var(--border); border-radius: 16px;
    background: var(--panel); padding: clamp(16px, 4vw, 24px); box-shadow: var(--shadow);
  }
  .dialog::backdrop { background: var(--backdrop); }
  .dialog-header { display: flex; justify-content: space-between; align-items: start; gap: .5rem; }
  .dialog h2 { font-size: 1.5rem; letter-spacing: -.035em; }
  .dialog h3 { font-size: 1.05rem; }
  .dialog a { color: var(--accent); text-underline-offset: 3px; }
  .dialog-description { color: var(--muted); margin: .35rem 0 .9rem; }
  .dialog-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
  .dialog-actions > a { margin-right: auto; }
  .primary-button, .subtle-button { min-height: 40px; padding: .45rem .7rem; font-size: .9rem; font-weight: 620; border: 1px solid var(--border); border-radius: 8px; }
  .subtle-button:hover { background: var(--panel-hover); }
  .primary-button { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
  .primary-button:hover:not(:disabled) { background: var(--accent-strong); }
  .primary-button:disabled, .subtle-button:disabled { opacity: .55; }
  .primary-button.destructive { background: var(--danger); color: #321421; }
  .field { display: grid; gap: .24rem; margin-bottom: .72rem; font-weight: 550; font-size: .9rem; }
  .field input, .field select { width: 100%; min-height: 40px; border: 1px solid var(--border); background: var(--input); border-radius: 7px; padding: .4rem .5rem; font-size: 1rem; }
  .field select {
    appearance: none;
    padding-right: 2rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-size: 5px 5px;
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
    background-repeat: no-repeat;
  }
  .fields { display: grid; gap: 0 .7rem; grid-template-columns: 1fr 1fr; }
  .consent { display: flex; align-items: flex-start; gap: .53rem; margin: .7rem 0; font-size: .9rem; color: var(--muted); }
  .consent input { accent-color: var(--accent-strong); width: 17px; height: 17px; flex-shrink: 0; margin: 4px 0 0; }
  .form-error { color: var(--danger); font-size: .9rem; margin: .65rem 0 0; }
  .handoff-status-panel { border: 1px solid var(--border-soft); background: var(--input); border-radius: 10px; padding: .78rem; }
  .handoff-status-panel p { color: var(--muted); margin-top: .28rem; }
  .handoff-status-panel button { margin-top: .75rem; }
  .handoff-status-panel button + button { margin-left: .3rem; }

  body[data-brand^="compare"] .workspace {
    background: radial-gradient(ellipse 66% 72% at 65% 35%, var(--ambient), transparent 76%), var(--background);
  }
  body[data-brand^="compare"] .welcome { text-align: left; }
  body[data-brand^="compare"] .welcome h1 { margin-inline: 0; text-wrap: pretty; max-width: 620px; }
  body[data-brand^="compare"] .welcome-orbit { margin-left: 0; width: 86px; height: 78px; margin-bottom: 14px; }
  body[data-brand^="compare"] .brand-tile { width: 72px; height: 72px; border-radius: 16px; justify-self: start; background: var(--accent-dim); transform: rotate(-4deg); }
  body[data-brand^="compare"] .brand-tile img { width: 51px; height: 51px; transform: rotate(4deg); }
  body[data-brand^="compare"] .orbit-detail-one { top: 9px; left: auto; right: 0; width: 4px; height: 4px; border-radius: 1px; }
  body[data-brand^="compare"] .orbit-detail-two { right: 7px; bottom: 2px; border-radius: 1px; }
  body[data-brand^="compare"] .composer { border-radius: 12px; }
  body[data-brand^="compare"] .send-button { border-radius: 8px; }
}

@layer responsive {
  @media (max-height: 800px) {
    .work-content:not(.has-conversation) { justify-content: safe center; }
    .welcome { margin-bottom: 1.5rem; }
    .welcome-orbit { scale: .86; margin-bottom: 8px; }
  }
  @media (max-width: 900px) {
    :root { --sidebar-width: 228px; }
    .sidebar { padding-inline: 12px; }
    .sidebar .wordmark { font-size: .94rem; }
  }
  @media (max-width: 730px) {
    .app, .app.sidebar-closed { grid-template-columns: minmax(0, 1fr); }
    .app .sidebar, .app.sidebar-closed .sidebar {
      position: fixed; z-index: 4; display: flex; inset: 0 auto 0 0;
      height: var(--app-height, 100dvh); width: min(300px, calc(100vw - 36px));
      transform: translateX(-103%); visibility: hidden; transition: transform 140ms ease-out, visibility 140ms;
      padding: max(17px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
    }
    .app.mobile-open .sidebar { transform: translateX(0); visibility: visible; }
    .app.mobile-open .scrim { display: block; position: fixed; z-index: 3; inset: 0; background: var(--backdrop); }
    .app .compact-brand, .app.sidebar-closed .compact-brand, .app:not(.sidebar-closed) #open-sidebar { display: inline-flex; }
    .topbar { min-height: 54px; padding: max(6px, env(safe-area-inset-top)) 10px 6px; }
    .topbar-start, .topbar-actions { gap: .2rem; }
    .topbar .active-title { display: none !important; }
    .topbar .icon-button { min-width: 40px; min-height: 42px; }
    .agent-button { min-height: 40px; padding: .4rem .5rem; font-size: .83rem; }
    .agent-button [data-icon] svg { width: 15px; height: 15px; }
    .resource-link { display: none; }
    .work-content { padding-inline: 15px; }
    .workspace-footer { font-size: .8rem; }
  }
  @media (max-width: 490px) {
    .compact-brand { font-size: .9rem; gap: .3rem; }
    .compact-brand img { width: 20px; height: 20px; }
    .agent-button [data-icon] { display: none; }
    .welcome h1 { font-size: clamp(1.95rem, 9vw, 2.75rem); }
    .welcome-orbit { scale: .8; margin-bottom: 5px; height: 82px; }
    body[data-brand^="compare"] .welcome-orbit { margin-bottom: 8px; }
    .welcome { margin-bottom: 1.2rem; }
    .composer { padding: .52rem .63rem .55rem .7rem; }
    .conversation-list { gap: .3rem; }
    .conversation-button { min-height: 42px; }
    .conversation-menu { min-height: 40px; min-width: 40px; }
    .message-assistant { grid-template-columns: 25px minmax(0, 1fr); gap: .5rem; }
    .message-assistant-icon { width: 25px; height: 25px; }
    .message-body { line-height: 1.58; }
  }
  @media (max-height: 520px) and (max-width: 730px) {
    .workspace-footer { padding-top: 2px; }
    .workspace-footer nav { display: none; }
    .work-content { padding-bottom: 8px; }
    .work-content:not(.has-conversation) { justify-content: flex-start; }
    .work-content:focus-within:not(.has-conversation) .welcome { display: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
  }
}

@layer components {
  .fixture-notice { color: var(--accent); margin: 0 0 .45rem; font-size: .82rem; }
  .welcome-sign-in { display: none; width: fit-content; line-height: 1.3; margin: .82rem auto 0; padding: .47rem .65rem; border-radius: 7px; border: 1px solid var(--border-soft); color: var(--muted); font-size: .875rem; text-decoration: none; }
  .welcome-sign-in:hover { background: var(--panel); border-color: var(--border); }
  .workspace-footer button { padding: 0; font-size: inherit; color: inherit; }
  .workspace-footer button:hover:not(:disabled) { color: var(--accent); text-decoration: underline; }
  .workspace-footer button:disabled { opacity: .72; }
  .app.sidebar-closed .work-content:not(.has-conversation) .welcome-sign-in { display: block; }
}
@layer responsive {
  @media (max-width: 730px) {
    .work-content:not(.has-conversation) .welcome-sign-in { display: block; }
  }
}


@layer components {
  .response-motion-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    min-height: 36px;
    min-width: 65px;
    padding: .25rem .55rem;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: color-mix(in srgb, var(--input) 78%, var(--panel-hover));
    color: var(--muted);
    font-size: .82rem;
    font-weight: 650;
    white-space: nowrap;
  }
  .response-motion-trigger:hover,
  .response-motion-trigger[aria-expanded="true"] {
    border-color: var(--border);
    background: var(--panel-hover);
    color: var(--text);
  }
  .response-motion-chevron {
    width: 6px;
    height: 6px;
    margin: -.2rem 1px 0 0;
    border: solid currentColor;
    border-width: 0 1px 1px 0;
    transform: rotate(45deg);
    transition: transform 150ms ease;
  }
  .response-motion-trigger[aria-expanded="true"] .response-motion-chevron {
    margin-top: .14rem;
    transform: rotate(225deg);
  }
  .response-motion-popup {
    position: fixed;
    inset: auto;
    margin: 0;
    width: min(252px, calc(100vw - 16px));
    padding: .78rem .85rem .69rem;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: linear-gradient(154deg, color-mix(in srgb, var(--panel-hover) 38%, var(--panel)), var(--input));
    box-shadow: 0 14px 32px rgb(0 0 0 / 36%), inset 0 1px rgb(255 255 255 / 6%);
    color: var(--text);
    overflow: visible;
  }
  .response-motion-popup label {
    display: block;
    padding-inline: .15rem;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.25;
    font-weight: 650;
  }
  .response-motion-range {
    position: relative;
    height: 39px;
    margin-top: 1px;
    border-radius: 9px;
  }
  #response-motion-slider {
    appearance: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    background: transparent;
    opacity: 0;
    cursor: pointer;
    touch-action: pan-y;
  }
  #response-motion-slider::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; }
  #response-motion-slider::-moz-range-thumb { width: 18px; height: 18px; }
  .response-motion-visual {
    position: absolute;
    inset: 0 9px;
    pointer-events: none;
  }
  .response-motion-track {
    position: absolute;
    inset: calc(50% - 6px) -4px auto;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(100deg, #167d83, #34cfca 53%, #9decd7);
    box-shadow: 0 0 0 1px rgb(235 255 252 / 12%), 0 2px 7px rgb(0 0 0 / 28%);
  }
  .response-motion-track::before,
  .response-motion-track::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 280ms ease;
  }
  .response-motion-track::before { background: linear-gradient(99deg, #119764, #72eeaa 44%, #54b8eb 76%, #798bfa); }
  .response-motion-track::after { background: linear-gradient(99deg, #3676ea, #5babff 25%, #8c7bfa 66%, #d791f6); }
  [data-response-motion="medium"] .response-motion-track::before,
  [data-response-motion="ultra"] .response-motion-track::after { opacity: 1; }

  .response-motion-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    border-radius: 50%;
    background: #51dccd;
    box-shadow: 0 1px 7px rgb(0 0 0 / 57%), 0 0 0 1px rgb(234 255 255 / 32%);
    transition: left 210ms cubic-bezier(.2,.8,.35,1), background-color 260ms ease;
  }
  .response-motion-range:has(:focus-visible) .response-motion-thumb {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  [data-response-motion="medium"] .response-motion-thumb { left: 50%; background-color: #66ddae; }
  [data-response-motion="ultra"] .response-motion-thumb { left: 100%; background-color: #a58af3; }

  .response-motion-pixels {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity 220ms ease;
  }
  [data-response-motion="ultra"] .response-motion-pixels { opacity: .86; }
  .response-motion-pixels i {
    position: absolute;
    left: var(--pixel-x);
    top: var(--pixel-y);
    width: 2px;
    height: 2px;
    border-radius: 0.5px;
    background: #f3eeff;
    box-shadow: 0 0 3px #e8deff;
  }
  .response-motion-pixels i:nth-child(1) { --pixel-x: 12%; --pixel-y: 35%; --pixel-time: 2.4s; --pixel-delay: -.3s; }
  .response-motion-pixels i:nth-child(2) { --pixel-x: 29%; --pixel-y: 63%; --pixel-time: 2.9s; --pixel-delay: -1.7s; }
  .response-motion-pixels i:nth-child(3) { --pixel-x: 47%; --pixel-y: 29%; --pixel-time: 2s; --pixel-delay: -.8s; }
  .response-motion-pixels i:nth-child(4) { --pixel-x: 66%; --pixel-y: 57%; --pixel-time: 2.55s; --pixel-delay: -1.1s; }
  .response-motion-pixels i:nth-child(5) { --pixel-x: 85%; --pixel-y: 36%; --pixel-time: 2.75s; --pixel-delay: -2s; }
  [data-response-motion="ultra"] .response-motion-popup:popover-open .response-motion-pixels i {
    animation: response-pixel var(--pixel-time) var(--pixel-delay) ease-in-out infinite alternate;
  }
  @keyframes response-pixel {
    0% { transform: translate3d(-7px, 1px, 0); opacity: .44; }
    55% { transform: translate3d(3px, -3px, 0); opacity: 1; }
    100% { transform: translate3d(12px, 2px, 0); opacity: .69; }
  }
  .response-motion-labels {
    display: flex;
    justify-content: space-between;
    padding-inline: 2px;
    color: var(--secondary);
    font-size: .73rem;
    line-height: 1;
  }
  [data-response-motion="light"] .response-motion-labels span:nth-child(1),
  [data-response-motion="medium"] .response-motion-labels span:nth-child(2),
  [data-response-motion="ultra"] .response-motion-labels span:nth-child(3) { color: var(--text); font-weight: 690; }

  .workspace {
    --response-duration: 2.5s;
    --response-strength: 100%;
    --response-highlight: color-mix(in srgb, var(--accent-strong) var(--response-strength), var(--border));
  }
  [data-response-motion="light"] .workspace { --response-duration: 5.6s; --response-strength: 34%; }
  [data-response-motion="medium"] .workspace { --response-duration: 3.8s; --response-strength: 58%; }

  .composer:has(.stop-button:not([hidden])) {
    border-color: transparent;
    background:
      linear-gradient(var(--input), var(--input)) padding-box,
      linear-gradient(105deg, var(--border) 10%, var(--response-highlight) 28%, var(--accent) 40%, var(--response-highlight) 51%, var(--border) 69%) border-box;
    background-size: 100% 100%, 240% 100%;
    animation: response-edge var(--response-duration) ease-in-out infinite alternate;
  }
  .response-streaming .message-assistant-icon {
    background: linear-gradient(115deg, var(--accent-dim) 12%, var(--response-highlight) 47%, var(--accent-dim) 83%);
    background-size: 230% 100%;
    animation: response-highlight var(--response-duration) ease-in-out infinite alternate;
  }
  .response-streaming .thinking {
    display: table;
    background: linear-gradient(104deg, var(--muted) 28%, var(--text) 49%, var(--accent) 59%, var(--muted) 77%);
    background-size: 230% 100%;
    background-clip: text;
    color: transparent;
    animation: response-highlight var(--response-duration) ease-in-out infinite alternate;
  }
  @keyframes response-highlight {
    from { background-position: 95% 50%; }
    to { background-position: 5% 50%; }
  }
  @keyframes response-edge {
    from { background-position: 0 0, 95% 50%; }
    to { background-position: 0 0, 5% 50%; }
  }
}
@layer responsive {
  @media (max-width: 490px) {
    .response-motion-trigger { min-height: 38px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .composer:has(.stop-button:not([hidden])),
    .response-streaming .message-assistant-icon,
    .response-streaming .thinking,
    [data-response-motion="ultra"] .response-motion-popup:popover-open .response-motion-pixels i { animation: none; }
    .response-streaming .thinking { color: var(--muted); background: none; }
  }
  @media (forced-colors: active) {
    #response-motion-slider { appearance: auto; opacity: 1; }
    .response-motion-visual { display: none; }
    .composer:has(.stop-button:not([hidden])) { border-color: Highlight; }
    .response-streaming .thinking { color: CanvasText; background: none; }
  }
}
