/* /agent/: the scripted agent (a simulation). Uses the tokens in site.css. Code Apache-2.0. */
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.agent-page{max-width:48rem;margin:0 auto;padding:var(--s5,24px) 16px var(--s7,48px)}
.agent-page *{min-width:0}
.agent-intro p{color:var(--ink-2);margin-top:0}
.agent{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:6px;background:var(--bg);margin:var(--s5,24px) 0;overflow:hidden}
.agent-head{position:sticky;top:0;z-index:1;background:var(--surface);border-bottom:1px solid var(--line);padding:12px 16px}
.agent-title{font-size:1.125rem;margin:0;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.agent-tag{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;background:var(--band-bg);color:var(--band-ink);border-radius:4px;padding:2px 6px}
.agent-label{margin:6px 0 0;font-size:.875rem;font-weight:600;color:var(--ink)}
.agent-log{height:min(60vh,520px);overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){.agent-log{scroll-behavior:auto}}
.agent-log:focus-visible{outline:3px solid var(--sea);outline-offset:-3px}
.agent-msg{display:flex;gap:8px;align-items:flex-start;max-width:92%}
.agent-msg-me{align-self:flex-end}
.agent-msg-bot{align-self:flex-start}
.agent-avatar{flex:0 0 32px;height:32px;border-radius:50%;background:var(--surface);border:1px solid var(--line);display:grid;place-items:center;color:var(--ink)}
.agent-bubble{padding:10px 12px;border-radius:6px;line-height:1.5;overflow-wrap:anywhere}
.agent-msg-me .agent-bubble{background:var(--surface);border:1.5px solid var(--ink)}
.agent-msg-bot .agent-bubble{background:var(--surface);border:1px solid var(--line)}
.agent-bubble p{margin:0 0 6px}
.agent-bubble p:last-child{margin-bottom:0}
.agent-bubble ul{margin:4px 0 8px;padding-left:20px}
.agent-bubble a{color:var(--accent)}
.agent-source{font-size:.75rem;color:var(--ink-2);border-top:1px solid var(--line);padding-top:6px;margin-top:8px!important}
.agent-typing{display:inline-flex;gap:4px;padding:4px 0}
.agent-typing i{width:7px;height:7px;border-radius:50%;background:var(--ink-2);animation:agent-dot 1s infinite ease-in-out}
.agent-typing i:nth-child(2){animation-delay:.15s}.agent-typing i:nth-child(3){animation-delay:.3s}
.agent-typing.still i{animation:none;opacity:.6}
@keyframes agent-dot{0%,80%,100%{opacity:.25}40%{opacity:1}}
@media (prefers-reduced-motion:reduce){.agent-typing i{animation:none;opacity:.6}}
.agent-chips{display:flex;flex-wrap:wrap;gap:8px;padding:0 16px 12px}
.agent-chip{font:inherit;font-size:.875rem;border:1.5px solid var(--sea);color:var(--sea);background:var(--surface);border-radius:999px;padding:6px 12px;cursor:pointer;text-align:left}
.agent-chip:hover{background:var(--bg)}
.agent-chip:focus-visible,.agent-send:focus-visible,.agent-reset:focus-visible,.agent-input:focus-visible{outline:3px solid var(--sea);outline-offset:2px}
.agent-form{display:flex;flex-wrap:wrap;gap:8px;padding:12px 16px;border-top:1px solid var(--line);background:var(--surface)}
.agent-input{flex:1 1 200px;font:inherit;padding:10px 12px;border:1.5px solid var(--ink-2);border-radius:6px;background:var(--bg);color:var(--ink)}
.agent-send,.agent-reset{font:inherit;padding:10px 16px;border-radius:6px;cursor:pointer}
.agent-send{background:var(--accent);color:var(--on-accent);border:1.5px solid var(--accent);font-weight:600}
.agent-reset{background:transparent;color:var(--ink);border:1.5px solid var(--line)}
.agent-privacy{margin:0;padding:0 16px 12px;background:var(--surface);font-size:.8125rem;color:var(--ink-2)}
.agent-noscript{padding:16px}
.agent-how{border-top:1px solid var(--line);padding-top:var(--s4,16px)}
.agent-how li{margin-bottom:8px}
@media (max-width:480px){.agent-log{height:60vh}.agent-msg{max-width:100%}.agent-send,.agent-reset{flex:1 1 auto}}
/* round 2: a home's drawing (64 px) and the joke pictures in answers */
.agent-draw{float:right;margin:0 0 6px 10px}
.agent-draw svg{display:block;width:64px;height:auto;background:var(--bg);border:1px solid var(--line);border-radius:4px}
.agent-pics{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,7rem),1fr));gap:8px;margin:8px 0 0;clear:both}
.agent-pics figure{margin:0}
.agent-pics img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover;border-radius:4px;background:var(--taken)}
.agent-pics figcaption{font-size:.75rem;line-height:1.35;margin-top:4px}
.agent-pics figcaption span{display:block;color:var(--ink-2)}
/* round 2: reserve the chat's height before the script builds it, so the text below does not jump (layout shift) */
#agent{min-height:calc(min(60vh,520px) + 335px)}
@media (max-width:480px){#agent{min-height:calc(60vh + 580px)}}
