/* Site Builder — Agents, the Claude panel's second tab (agents.js).
   It lives inside the panel, so it wears the panel's Claude skin (app.css,
   "the Claude panel wears Claude's own skin"): warm paper, near-black ink,
   clay accent, white cards resting on soft shadows. Every control keeps the
   press contract — lift slowly, give at once, spring back. */

.chat { container: cl-panel / inline-size; }

/* ---- the tabs: Claude | Agents ---- */
.ag-tabs {
  position: relative; display: inline-flex; flex-shrink: 0; padding: 2px; border-radius: 999px;
  background: rgba(20, 20, 19, .06); box-shadow: inset 0 1px 2px rgba(20, 20, 19, .06);
}
.ag-tabs-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 0; width: 0; border-radius: 999px;
  background: var(--cl-card, #fff); box-shadow: 0 1px 2px rgba(20, 20, 19, .08), 0 2px 8px rgba(20, 20, 19, .06);
  transition: transform .34s var(--ease-out), width .34s var(--ease-out);
}
.ag-tab {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 5px;
  height: 25px; padding: 0 10px 0 8px; border: none; border-radius: 999px; background: none; cursor: pointer;
  font: 650 12px var(--sans); letter-spacing: -.005em; color: var(--cl-muted, var(--muted)); white-space: nowrap;
  transition: color .2s var(--ease-out), transform .32s var(--ease-spring);
}
.ag-tab:hover { color: var(--cl-ink, var(--ink)); }
.ag-tab:active { transform: scale(.94); transition-duration: .06s; }
.ag-tab[aria-selected="true"] { color: var(--cl-ink, var(--ink)); }
.ag-tab svg { width: 13px; height: 13px; flex: none; }
.chat .ag-tab .cl-star { margin-right: 0; }
.ag-tab:not([aria-selected="true"]) .cl-star { color: var(--cl-muted); }
.ag-tab[data-tab="agents"][aria-selected="true"] svg { color: var(--clay); }
.ag-tab:focus-visible { outline: 2px solid var(--clay); outline-offset: 1px; }
/* Claude is working (the open chat) / an agent is working on this site: a
   clay dot on the tab. The header's "working…" word used to say the first;
   with two tabs there is no room for it, so it stays in the markup unseen. */
.ag-tab-dot, .chat .panel-title:has(#chat-busy:not([hidden])) #chat-tab-claude::after {
  content: ''; position: absolute; top: 2px; right: 1px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--clay); box-shadow: 0 0 0 1.5px var(--cl-paper), 0 0 6px rgba(217, 119, 87, .7); animation: pulse 1.2s ease-in-out infinite;
}
.ag-tab-dot[hidden] { display: none; }
/* "+ New chat": the word after "New" is its own span (it drops out on a
   narrow panel), so the gap between them is a space's width, not the pill's */
:is(#chat-new, #ag-new) { gap: .28em; }
.chat .panel-title #chat-busy { display: none; }

/* the panel header keeps one line: with Agents up, the chat's own controls
   step out; the round header buttons are the system's 29px circles */
.chat.is-agents :is(#chat-people, #chat-new) { display: none; }
.chat.is-agents > :is(#chat-tabs-wrap, #chat-feed, #chat-form, #ag-chatbar) { display: none !important; }
.chat .panel-title { gap: 8px; }
.chat .panel-title .panel-btn { width: 29px; height: 29px; padding: 0; display: grid; place-items: center; flex: none; }
.chat .panel-title .panel-btn svg { width: 15px; height: 15px; display: block; }
/* a narrower panel: the tab icons go first, then the button words, then the
   people toggle (still on the slash menu as /people) — never the ‹ that folds
   the panel away */
@container cl-panel (max-width: 345px) {
  .chat .panel-title { gap: 6px; padding-left: 11px; padding-right: 11px; }
  .ag-tab svg { display: none; }
  .ag-tab { padding: 0 11px; }
}
@container cl-panel (max-width: 308px) {
  .cn-long { display: none; }
}
@container cl-panel (max-width: 266px) {
  .chat .panel-title { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .ag-tab { padding: 0 8px; font-size: 11.5px; }
}
@container cl-panel (max-width: 244px) {
  .chat .panel-title #chat-people { display: none; }
}

/* ---- the pane ---- */
.ag-view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 16px; }
.ag-view[hidden] { display: none; }
.ag-pane { display: flex; flex-direction: column; gap: 10px; }
.ag-pane.ag-in-fwd { animation: ag-in-fwd .32s var(--ease-out) both; }
.ag-pane.ag-in-back { animation: ag-in-back .32s var(--ease-out) both; }
@keyframes ag-in-fwd { from { opacity: 0; transform: translateX(16px); } }
@keyframes ag-in-back { from { opacity: 0; transform: translateX(-16px); } }

.ag-kicker {
  display: flex; align-items: center; gap: 6px;
  font: 700 10px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--cl-muted);
}
.ag-kicker b {
  font: 650 10px var(--sans); letter-spacing: 0; padding: 0 6px; border-radius: 999px; line-height: 16px;
  background: rgba(20, 20, 19, .07); color: var(--cl-muted);
}
.ag-kicker b:empty { display: none; }
.ag-quiet { margin: 0; font-size: 12px; line-height: 1.5; color: var(--cl-muted); }
.ag-err {
  margin: 0; padding: 7px 10px; border-radius: 10px; font-size: 12px; line-height: 1.45;
  background: rgba(192, 58, 49, .06); border: 1px solid rgba(192, 58, 49, .24); color: #8C2D24;
}
.ag-err[hidden] { display: none; }
.ag-loading { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 40px 0; font-size: 12.5px; color: var(--cl-muted); }
.ag-spin {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(217, 119, 87, .3); border-top-color: var(--clay);
  animation: stage-spin .8s linear infinite;
}

/* ---- faces: an icon on its tint ---- */
.ag-face {
  --ag-bg: #FBE9E2; --ag-fg: #B4532F;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 11px; color: var(--ag-fg);
  background: linear-gradient(155deg, #FFFFFF -40%, var(--ag-bg) 75%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ag-fg) 15%, transparent), inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 2px rgba(20, 20, 19, .07);
}
.ag-face svg { width: 18px; height: 18px; display: block; }
.ag-face.sm { width: 18px; height: 18px; border-radius: 6px; }
.ag-face.sm svg { width: 11px; height: 11px; stroke-width: 2.6; }
.ag-face.md { width: 26px; height: 26px; border-radius: 8px; }
.ag-face.md svg { width: 14px; height: 14px; }
.ag-face.lg { width: 52px; height: 52px; border-radius: 16px; }
.ag-face.lg svg { width: 26px; height: 26px; stroke-width: 2; }
.ag-face.t-clay  { --ag-bg: #FBE6DD; --ag-fg: #B4532F; }
.ag-face.t-sage  { --ag-bg: #E1EEE4; --ag-fg: #3F7050; }
.ag-face.t-plum  { --ag-bg: #ECE5F3; --ag-fg: #6B4E8F; }
.ag-face.t-ochre { --ag-bg: #F5ECD3; --ag-fg: #8A6A1E; }
.ag-face.t-rose  { --ag-bg: #F7E3E8; --ag-fg: #A0405A; }
.ag-face.t-slate { --ag-bg: #E9E8E3; --ag-fg: #45443F; }

/* ---- the list ---- */
.ag-list-head { display: flex; align-items: baseline; gap: 8px; padding: 6px 2px 0; }
.ag-list-hint { margin-left: auto; font-size: 11px; color: var(--cl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ag-search {
  display: flex; align-items: center; gap: 7px; padding: 0 11px; border-radius: 999px;
  background: #fff; border: 1px solid var(--cl-line);
  transition: border-color .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
.ag-search:focus-within { border-color: var(--clay); box-shadow: 0 0 0 3px rgba(217, 119, 87, .15); }
.ag-search svg { width: 13px; height: 13px; color: var(--cl-muted); flex: none; }
.ag-search input { flex: 1; min-width: 0; border: none; background: none; box-shadow: none; padding: 7px 0; font: 400 12.5px var(--sans); color: var(--cl-ink); outline: none; }
.ag-cards { display: flex; flex-direction: column; gap: 7px; }
.ag-none { margin: 4px 2px; font-size: 12px; color: var(--cl-muted); }

.ag-card {
  position: relative; display: flex; flex-wrap: wrap; align-items: center;
  background: var(--cl-card); border: 1px solid var(--cl-line-soft); border-radius: 14px; box-shadow: var(--cl-rest);
  animation: ag-card-in .34s var(--ease-out) backwards;
  transition: transform .32s var(--ease-spring), box-shadow .3s var(--ease-out), border-color .2s var(--ease-out);
}
.ag-cards .ag-card:nth-child(2) { animation-delay: .03s; }
.ag-cards .ag-card:nth-child(3) { animation-delay: .06s; }
.ag-cards .ag-card:nth-child(n+4) { animation-delay: .09s; }
@keyframes ag-card-in { from { opacity: 0; transform: translateY(6px); } }
.ag-card:hover { transform: translateY(-2px); box-shadow: var(--cl-lift); border-color: var(--cl-line); }
.ag-card:has(.ag-card-main:active) { transform: scale(.985); transition-duration: .06s; }
.ag-card-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 10px 6px 10px 10px;
  border: none; background: none; text-align: left; cursor: pointer; border-radius: 14px 0 0 14px; color: inherit;
  font: 400 12px var(--sans);
}
.ag-card-main:focus-visible { outline: 2px solid var(--clay); outline-offset: -2px; }
.ag-card-text { display: grid; gap: 1px; min-width: 0; }
.ag-card-text b { font: 650 13px var(--sans); letter-spacing: -.005em; color: var(--cl-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-card-sum {
  font-size: 11.5px; line-height: 1.4; color: var(--cl-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ag-card-meta { margin-top: 2px; font: 600 10px var(--sans); letter-spacing: .02em; color: var(--cl-muted); opacity: .85; }
.ag-card.is-working .ag-card-meta { color: #A64B28; opacity: 1; }

/* working: a clay ring turns around the face */
.ag-card.is-working .ag-face::after, .chat-tab.is-agent.busy .ag-face.row::after {
  content: ''; position: absolute; inset: -3px; border-radius: 13px; pointer-events: none;
  box-shadow: 0 0 0 1.5px rgba(217, 119, 87, .75), 0 0 10px rgba(217, 119, 87, .45);
  animation: ag-breathe 1.6s ease-in-out infinite;
}
.chat-tab.is-agent.busy .ag-face.row::after { inset: -2px; border-radius: 50%; }
@keyframes ag-breathe { 50% { opacity: .25; transform: scale(1.06); } }

/* Run: the round clay button on each card */
.ag-run {
  flex: none; width: 30px; height: 30px; margin-right: 10px; padding: 0; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: var(--clay);
  box-shadow: 0 2px 8px rgba(217, 119, 87, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .32s var(--ease-spring), box-shadow .3s var(--ease-out), background .16s var(--ease-out);
}
.ag-run svg { width: 14px; height: 14px; margin-left: 1px; }   /* the 1px optical nudge toward the point */
.ag-run[data-act="chat"] { background: #fff; color: #A64B28; box-shadow: inset 0 0 0 1px rgba(217, 119, 87, .45); }
.ag-run[data-act="chat"] svg { margin-left: 0; width: 13px; height: 13px; fill: none; }
.ag-run:hover { transform: translateY(-1px) scale(1.04); background: #C86643; box-shadow: 0 5px 16px rgba(217, 119, 87, .45); }
.ag-run[data-act="chat"]:hover { background: var(--clay-soft); }
.ag-run:active { transform: scale(.9); transition-duration: .06s; box-shadow: 0 1px 4px rgba(217, 119, 87, .3); }
.ag-run:disabled { opacity: .6; cursor: progress; transform: none; }
.ag-card.is-starting .ag-run svg { animation: pulse .8s ease-in-out infinite; }
.ag-run:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }

/* the question an agent asks before a run, glided open under its card */
.ag-ask-glide { flex-basis: 100%; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s var(--ease-out); }
.ag-card.is-asking .ag-ask-glide { grid-template-rows: 1fr; }
.ag-ask-in { overflow: hidden; min-height: 0; }
.ag-ask { padding: 0 10px 10px; display: grid; gap: 6px; }
.ag-ask-q { font: 600 11.5px var(--sans); color: var(--cl-ink); padding: 8px 2px 0; border-top: 1px solid var(--cl-line-soft); }
.ag-ask-row { display: flex; align-items: center; gap: 6px; }
.ag-ask-row input { flex: 1; min-width: 0; }
.ag-go {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px 0 9px; border-radius: 999px; border: none; cursor: pointer;
  font: 650 12px var(--sans); color: #fff; background: var(--clay); box-shadow: 0 2px 8px rgba(217, 119, 87, .3);
  transition: transform .32s var(--ease-spring), background .16s var(--ease-out);
}
.ag-go svg { width: 11px; height: 11px; }
.ag-go:hover { background: #C86643; transform: translateY(-1px); }
.ag-go:active { transform: scale(.94); transition-duration: .06s; }
.ag-ask-x {
  width: 26px; height: 26px; padding: 0; border-radius: 50%; border: none; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--cl-muted); transition: background .16s var(--ease-out), transform .32s var(--ease-spring);
}
.ag-ask-x svg { width: 12px; height: 12px; }
.ag-ask-x:hover { background: var(--cl-sand); color: var(--cl-ink); }
.ag-ask-x:active { transform: scale(.9); transition-duration: .06s; }

.ag-add-row {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed rgba(20, 20, 19, .16); background: transparent; color: var(--cl-muted); font: 600 12px var(--sans);
  transition: border-color .16s var(--ease-out), color .16s var(--ease-out), background .16s var(--ease-out), transform .32s var(--ease-spring);
}
.ag-add-row svg { width: 13px; height: 13px; }
.ag-add-row:hover { border-color: var(--clay); color: #A64B28; background: rgba(251, 233, 226, .45); transform: translateY(-1px); }
.ag-add-row:active { transform: scale(.98); transition-duration: .06s; }

/* ---- nothing here yet ---- */
.ag-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 4px 4px; }
.ag-hero { display: flex; justify-content: center; margin: 8px 0 16px; height: 62px; }
.ag-hero .ag-face { margin: 0 -7px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ag-fg) 15%, transparent), inset 0 1px 0 rgba(255, 255, 255, .85), 0 6px 16px rgba(20, 20, 19, .1); }
.ag-hero .ag-face:nth-child(1) { transform: rotate(-9deg) translateY(6px); animation: ag-float-a 4.6s ease-in-out infinite; }
.ag-hero .ag-face:nth-child(2) { z-index: 1; animation: ag-float-b 4.6s ease-in-out infinite; }
.ag-hero .ag-face:nth-child(3) { transform: rotate(9deg) translateY(6px); animation: ag-float-c 4.6s ease-in-out infinite; }
@keyframes ag-float-a { 50% { transform: rotate(-11deg) translateY(2px); } }
@keyframes ag-float-b { 50% { transform: translateY(-4px); } }
@keyframes ag-float-c { 50% { transform: rotate(11deg) translateY(2px); } }
.ag-empty h3 { margin: 0 0 6px; font: 700 16px var(--sans); letter-spacing: -.01em; color: var(--cl-ink); }
.ag-empty p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.55; color: var(--cl-muted); max-width: 260px; }
.ag-ideas-k { align-self: stretch; margin: 18px 2px 7px; }
.ag-ideas { align-self: stretch; display: flex; flex-direction: column; gap: 5px; }
.ag-idea {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 7px; border-radius: 12px; cursor: pointer; text-align: left;
  background: var(--cl-card); border: 1px solid var(--cl-line-soft); box-shadow: var(--cl-rest);
  font: 600 12.5px var(--sans); color: var(--cl-ink);
  transition: transform .32s var(--ease-spring), box-shadow .3s var(--ease-out), border-color .2s var(--ease-out);
}
.ag-idea-name { flex: 1; min-width: 0; }
.ag-idea > svg { width: 13px; height: 13px; color: var(--cl-muted); opacity: .6; transition: transform .32s var(--ease-spring); }
.ag-idea:hover { transform: translateY(-1px); box-shadow: var(--cl-lift); border-color: var(--cl-line); }
.ag-idea:hover > svg { transform: translateX(2px); opacity: 1; }
.ag-idea:active { transform: scale(.985); transition-duration: .06s; }

/* ---- buttons in the pane ---- */
.ag-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 15px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  font: 650 12.5px var(--sans); border: 1px solid var(--cl-line); background: #fff; color: var(--cl-ink);
  box-shadow: var(--cl-rest);
  transition: transform .32s var(--ease-spring), box-shadow .3s var(--ease-out), background .16s var(--ease-out), border-color .16s var(--ease-out);
}
.ag-btn svg { width: 13px; height: 13px; flex: none; }
.ag-btn:hover { transform: translateY(-1px); box-shadow: var(--cl-lift); border-color: rgba(217, 119, 87, .5); }
.ag-btn:active { transform: scale(.95); transition-duration: .06s; box-shadow: none; }
.ag-btn.primary { background: var(--clay); border-color: transparent; color: #fff; box-shadow: 0 2px 10px rgba(217, 119, 87, .3); }
.ag-btn.primary:hover { background: #C86643; box-shadow: 0 5px 18px rgba(217, 119, 87, .42); }
.ag-btn.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--cl-muted); }
.ag-btn.quiet:hover { background: var(--cl-sand); color: var(--cl-ink); border-color: transparent; box-shadow: none; }
.ag-btn.wide { width: 100%; height: 36px; font-size: 13px; }
.ag-btn.sm { height: 28px; padding: 0 12px; font-size: 12px; }
.ag-btn:disabled { opacity: .55; cursor: default; transform: none; }
.ag-btn.loading { cursor: progress; }
.ag-btn.loading > svg { display: none; }
.ag-btn.loading::before {
  content: ''; width: 11px; height: 11px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-top-color: transparent; animation: stage-spin .7s linear infinite;
}
.ag-btn:focus-visible, .ag-back:focus-visible, .ag-link:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.ag-link {
  border: none; background: none; padding: 2px 0; cursor: pointer;
  font: 600 11.5px var(--sans); color: #A64B28; text-decoration: underline; text-decoration-color: rgba(166, 75, 40, .3); text-underline-offset: 2px;
}
.ag-link:hover { text-decoration-color: currentColor; }

/* ---- sub-view header ---- */
.ag-head { display: flex; align-items: center; gap: 8px; padding-top: 2px; }
.ag-head .spacer { flex: 1; }
.ag-head-t { margin-left: auto; font: 700 10px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--cl-muted); }
.ag-back {
  display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 10px 0 5px; border-radius: 999px;
  border: none; background: transparent; cursor: pointer; max-width: 70%;
  font: 600 12px var(--sans); color: var(--cl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .16s var(--ease-out), color .16s var(--ease-out), transform .32s var(--ease-spring);
}
.ag-back svg { width: 14px; height: 14px; flex: none; transition: transform .32s var(--ease-spring); }
.ag-back:hover { background: var(--cl-sand); color: var(--cl-ink); }
.ag-back:hover svg { transform: translateX(-2px); }
.ag-back:active { transform: scale(.95); transition-duration: .06s; }

/* ---- one agent ---- */
.ag-who { display: flex; align-items: flex-start; gap: 13px; padding: 4px 2px 2px; }
.ag-who h3 { margin: 3px 0 2px; font: 700 16px var(--sans); letter-spacing: -.012em; color: var(--cl-ink); }
.ag-who p { margin: 0 0 4px; font-size: 12.5px; line-height: 1.45; color: var(--cl-ink); opacity: .85; }
.ag-stats { font: 500 10.5px var(--sans); color: var(--cl-muted); }
.ag-runbox { display: grid; gap: 6px; }
.ag-runbox:has(input) { padding: 10px; border-radius: 14px; background: var(--cl-card); border: 1px solid var(--cl-line-soft); box-shadow: var(--cl-rest); }
.ag-runbox .ag-ask-q { border-top: none; padding: 0 2px; }
.ag-runbox .ag-btn svg { width: 12px; height: 12px; }

.ag-sec { display: grid; gap: 7px; padding-top: 12px; border-top: 1px solid var(--cl-line); }

.ag-teach { display: grid; gap: 7px; }
.ag-teach-foot { display: flex; align-items: center; gap: 8px; }
.ag-teach-foot .spacer { flex: 1; }
.ag-check { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; cursor: pointer; font: 500 11.5px var(--sans); color: var(--cl-muted); }
.ag-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--clay); flex: none; }
.ag-check span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ag-proposal {
  display: grid; gap: 8px; padding: 11px 12px 12px; border-radius: 14px; background: var(--cl-card);
  border: 1px solid rgba(217, 119, 87, .5); box-shadow: 0 0 0 3px rgba(217, 119, 87, .1), var(--cl-lift);
  animation: ag-card-in .3s var(--ease-out) both;
}
.ag-prop-head { display: flex; align-items: center; gap: 7px; font: 650 12.5px var(--sans); color: var(--cl-ink); }
.ag-prop-head svg { width: 13px; height: 13px; color: var(--clay); }
.ag-prop-sub { font: 600 11.5px var(--sans); color: var(--cl-muted); }
.ag-changes { margin: 0; padding-left: 17px; font-size: 12px; line-height: 1.5; color: var(--cl-ink); }
.ag-changes li::marker { color: var(--clay); }
.ag-newsteps summary { cursor: pointer; font: 600 11.5px var(--sans); color: #A64B28; }
.ag-newsteps .ag-steps-text { margin-top: 6px; padding: 9px 11px; border-radius: 10px; background: var(--cl-sand); max-height: 220px; overflow: auto; }
.ag-prop-foot { display: flex; justify-content: flex-end; gap: 6px; }

.ag-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ag-lessons li {
  display: flex; align-items: flex-start; gap: 9px; padding: 7px 6px 7px 9px; border-radius: 11px;
  background: rgba(255, 255, 255, .6); border: 1px solid var(--cl-line-soft);
}
.ag-lesson-dot { width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--clay); flex: none; }
.ag-lesson-text { flex: 1; min-width: 0; font-size: 12px; line-height: 1.45; color: var(--cl-ink); }
.ag-lesson-meta { display: block; margin-top: 2px; font-size: 10.5px; color: var(--cl-muted); }
.ag-forget {
  width: 22px; height: 22px; padding: 0; border-radius: 50%; border: none; background: none; cursor: pointer; flex: none;
  display: grid; place-items: center; color: var(--cl-muted); opacity: 0;
  transition: opacity .16s var(--ease-out), background .16s var(--ease-out), transform .32s var(--ease-spring);
}
.ag-forget svg { width: 11px; height: 11px; }
.ag-lessons li:hover .ag-forget, .ag-forget:focus-visible { opacity: 1; }
.ag-forget:hover { background: rgba(192, 58, 49, .08); color: #8C2D24; }
.ag-forget:active { transform: scale(.88); transition-duration: .06s; }
@media (hover: none) { .ag-forget { opacity: .7; } }

.ag-steps {
  position: relative; padding: 10px 12px; border-radius: 12px; background: var(--cl-card); border: 1px solid var(--cl-line-soft);
  max-height: none; overflow: hidden;
}
.ag-steps.is-long { max-height: 164px; }
.ag-steps.is-long:not(.is-open)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46px; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff 85%);
}
.ag-steps.is-open { max-height: none; }
.ag-steps-text { font-size: 12px; line-height: 1.6; color: var(--cl-ink); white-space: pre-wrap; word-break: break-word; }
.ag-steps-foot { display: flex; justify-content: space-between; gap: 10px; }
.ag-steps-foot:empty { display: none; }
.ag-setup { font: 500 10.5px var(--sans); color: var(--cl-muted); }

.ag-runs { display: grid; gap: 3px; }
.ag-runrow {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border-radius: 10px; cursor: pointer; text-align: left;
  border: 1px solid transparent; background: transparent; color: var(--cl-ink); font: 500 12px var(--sans);
  transition: background .16s var(--ease-out), border-color .16s var(--ease-out), transform .32s var(--ease-spring);
}
.ag-runrow:hover { background: var(--cl-card); border-color: var(--cl-line-soft); }
.ag-runrow:active { transform: scale(.985); transition-duration: .06s; }
.ag-runrow.current { background: var(--cl-card); border-color: var(--cl-line-soft); box-shadow: var(--cl-rest); }
.ag-runrow-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(20, 20, 19, .2); flex: none; }
.ag-runrow.busy .ag-runrow-dot { background: var(--clay); box-shadow: 0 0 6px rgba(217, 119, 87, .6); animation: pulse 1.2s ease-in-out infinite; }
.ag-runrow-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-runrow-s { font-size: 10.5px; color: var(--cl-muted); white-space: nowrap; }
.ag-runrow.busy .ag-runrow-s { color: #A64B28; }
.ag-runrow > svg { width: 12px; height: 12px; color: var(--cl-muted); opacity: .5; flex: none; }

.ag-del-row { display: flex; justify-content: center; padding: 14px 0 2px; border-top: 1px solid var(--cl-line); margin-top: 2px; }
.ag-del {
  border: 1px solid transparent; background: none; cursor: pointer; padding: 5px 12px; border-radius: 999px;
  font: 600 11.5px var(--sans); color: #8C2D24; opacity: .75;
  transition: background .16s var(--ease-out), border-color .16s var(--ease-out), opacity .16s var(--ease-out), transform .32s var(--ease-spring);
}
.ag-del:hover { opacity: 1; background: rgba(192, 58, 49, .06); }
.ag-del:active { transform: scale(.95); transition-duration: .06s; }
.ag-del.is-confirm { opacity: 1; background: rgba(192, 58, 49, .08); border-color: rgba(192, 58, 49, .4); }

/* ---- making one: describe ---- */
.ag-describe { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 2px 0; }
.ag-describe-face { height: 56px; margin-bottom: 10px; }
.ag-describe.is-busy .ag-describe-face .ag-face { animation: ag-try .42s var(--ease-out); }
@keyframes ag-try { from { transform: scale(.86) rotate(-6deg); opacity: .4; } }
.ag-describe h3 { margin: 0 0 5px; font: 700 16px var(--sans); letter-spacing: -.01em; color: var(--cl-ink); }
.ag-describe > .ag-quiet { max-width: 270px; margin-bottom: 12px; }
.ag-describe-form { align-self: stretch; display: grid; gap: 8px; text-align: left; }
.ag-self { justify-self: center; }
.ag-drafting { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 2px; }
.ag-shimmer {
  font: 600 12.5px var(--sans);
  background: linear-gradient(90deg, var(--cl-muted) 0%, var(--cl-muted) 35%, var(--clay) 50%, var(--cl-muted) 65%, var(--cl-muted) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: cl-shimmer 2.2s linear infinite;
}
.ag-chips { align-self: stretch; display: flex; flex-wrap: wrap; gap: 5px; }
.ag-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; cursor: pointer;
  background: var(--cl-card); border: 1px solid var(--cl-line-soft); box-shadow: var(--cl-rest);
  font: 600 11.5px var(--sans); color: var(--cl-ink);
  transition: transform .32s var(--ease-spring), box-shadow .3s var(--ease-out), border-color .2s var(--ease-out);
}
.ag-chip .ag-face.sm { border-radius: 50%; width: 20px; height: 20px; }
.ag-chip:hover { transform: translateY(-1px); box-shadow: var(--cl-lift); border-color: rgba(217, 119, 87, .45); }
.ag-chip:active { transform: scale(.95); transition-duration: .06s; }

/* ---- the form ---- */
.ag-view :is(input[type="text"], textarea, select) {
  width: 100%; box-sizing: border-box; margin: 0; padding: 8px 11px; border-radius: 11px;
  background: #fff; border: 1px solid var(--cl-line); box-shadow: none;
  font: 400 12.5px/1.5 var(--sans); color: var(--cl-ink);
  transition: border-color .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
.ag-view textarea { resize: vertical; min-height: 58px; }
.ag-view :is(input[type="text"], textarea, select):focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px rgba(217, 119, 87, .15); background: #fff; }
.ag-view :is(input, textarea)::placeholder { color: var(--cl-muted); opacity: .8; }
.ag-view :is(input, textarea):disabled { opacity: .6; }
.ag-view select { height: 34px; padding: 0 9px; cursor: pointer; }
.ag-form { display: grid; gap: 12px; }
.ag-form-top { display: flex; align-items: center; gap: 11px; }
.ag-form-names { flex: 1; min-width: 0; display: grid; gap: 5px; }
.ag-view .ag-f-name { font: 700 14px var(--sans); }
.ag-view .ag-f-sum { resize: none; min-height: 0; }
.ag-face-btn {
  position: relative; flex: none; padding: 0; border: none; background: none; cursor: pointer; border-radius: 16px;
  transition: transform .32s var(--ease-spring);
}
.ag-face-btn:hover { transform: translateY(-2px) rotate(-3deg); }
.ag-face-btn:active { transform: scale(.92); transition-duration: .06s; }
.ag-face-btn:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.ag-face-edit {
  position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--cl-ink); box-shadow: 0 1px 4px rgba(20, 20, 19, .2);
}
.ag-face-edit svg { width: 10px; height: 10px; }
.ag-picker-glide { display: grid; grid-template-rows: 0fr; margin-top: -12px; transition: grid-template-rows .3s var(--ease-out), margin .3s var(--ease-out); }
.ag-picker-glide.open { grid-template-rows: 1fr; margin-top: 0; }
.ag-picker-in { overflow: hidden; min-height: 0; }
.ag-picker { display: grid; gap: 9px; padding: 10px; border-radius: 14px; background: var(--cl-card); border: 1px solid var(--cl-line-soft); box-shadow: var(--cl-rest); }
.ag-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 4px; }
.ag-pick-icon {
  aspect-ratio: 1; padding: 0; border-radius: 9px; border: 1px solid transparent; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--cl-muted);
  transition: background .16s var(--ease-out), color .16s var(--ease-out), transform .32s var(--ease-spring);
}
.ag-pick-icon svg { width: 16px; height: 16px; }
.ag-pick-icon:hover { background: var(--cl-sand); color: var(--cl-ink); transform: translateY(-1px); }
.ag-pick-icon:active { transform: scale(.9); transition-duration: .06s; }
.ag-pick-icon.on { background: var(--clay-soft); border-color: rgba(217, 119, 87, .5); color: #A64B28; }
.ag-tints { display: flex; gap: 8px; justify-content: center; }
.ag-pick-tint {
  width: 22px; height: 22px; padding: 0; border-radius: 50%; cursor: pointer; border: none;
  background: var(--ag-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ag-fg) 30%, transparent);
  transition: transform .32s var(--ease-spring), box-shadow .16s var(--ease-out);
}
.ag-pick-tint.t-clay  { --ag-bg: #F3CDBE; --ag-fg: #B4532F; }
.ag-pick-tint.t-sage  { --ag-bg: #C4DDCB; --ag-fg: #3F7050; }
.ag-pick-tint.t-plum  { --ag-bg: #D8CBE7; --ag-fg: #6B4E8F; }
.ag-pick-tint.t-ochre { --ag-bg: #EBD9A6; --ag-fg: #8A6A1E; }
.ag-pick-tint.t-rose  { --ag-bg: #EDC4CF; --ag-fg: #A0405A; }
.ag-pick-tint.t-slate { --ag-bg: #D6D4CC; --ag-fg: #45443F; }
.ag-pick-tint:hover { transform: scale(1.12); }
.ag-pick-tint:active { transform: scale(.9); transition-duration: .06s; }
.ag-pick-tint.on { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--ag-fg); }

.ag-notes { padding: 9px 11px; border-radius: 12px; background: var(--cl-sand); border: 1px solid var(--cl-line-soft); }
.ag-notes-h { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font: 650 11.5px var(--sans); color: var(--cl-ink); }
.ag-notes-h svg { width: 12px; height: 12px; color: var(--clay); }
.ag-notes ul { margin: 0; padding-left: 17px; font-size: 11.5px; line-height: 1.5; color: var(--cl-ink); }
.ag-field { display: grid; gap: 5px; }
.ag-pair { grid-template-columns: 1fr 1fr; gap: 8px; }
.ag-pair label { display: grid; gap: 5px; min-width: 0; }
.ag-seg { display: flex; padding: 2px; border-radius: 999px; background: rgba(20, 20, 19, .06); box-shadow: inset 0 1px 2px rgba(20, 20, 19, .06); }
.ag-seg button {
  flex: 1; height: 28px; border: none; border-radius: 999px; background: none; cursor: pointer;
  font: 600 12px var(--sans); color: var(--cl-muted);
  transition: background .2s var(--ease-out), color .2s var(--ease-out), box-shadow .2s var(--ease-out), transform .32s var(--ease-spring);
}
.ag-seg button:hover { color: var(--cl-ink); }
.ag-seg button:active { transform: scale(.96); transition-duration: .06s; }
.ag-seg button[aria-pressed="true"] { background: #fff; color: var(--cl-ink); box-shadow: 0 1px 2px rgba(20, 20, 19, .08), 0 2px 8px rgba(20, 20, 19, .06); }
.ag-foot {
  position: sticky; bottom: -16px; z-index: 1; display: flex; justify-content: flex-end; gap: 6px;
  margin: 0 -12px -16px; padding: 10px 12px 14px;
  background: var(--cl-paper); border-top: 1px solid var(--cl-line);
}

/* ---- the strip over the composer on a chat an agent ran ---- */
.ag-chatbar {
  display: flex; align-items: center; gap: 7px; margin: 2px 11px 7px; padding: 4px 4px 4px 5px; border-radius: 999px;
  background: var(--cl-card); border: 1px solid var(--cl-line-soft); box-shadow: var(--cl-rest);
  font: 500 11.5px var(--sans); color: var(--cl-muted); flex-shrink: 0;
  animation: ag-card-in .3s var(--ease-out) both;
}
.ag-chatbar[hidden] { display: none; }
.ag-cb-who {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 1px 6px 1px 1px; border-radius: 999px;
  border: none; background: none; cursor: pointer; transition: background .16s var(--ease-out);
}
.ag-cb-who:hover { background: var(--cl-sand); }
.ag-cb-who b { font: 650 11.5px var(--sans); color: var(--cl-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-cb-say { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-cb-teach {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; cursor: pointer; flex: none;
  border: 1px solid rgba(217, 119, 87, .4); background: var(--clay-soft); color: #A64B28; font: 650 11px var(--sans);
  transition: transform .32s var(--ease-spring), background .16s var(--ease-out), box-shadow .3s var(--ease-out);
}
.ag-cb-teach svg { width: 11px; height: 11px; }
.ag-cb-teach:hover { background: #F8DCD0; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(217, 119, 87, .25); }
.ag-cb-teach:active { transform: scale(.94); transition-duration: .06s; }
.ag-cb-teach:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }

/* the agent's face on its chat rows and on the first message of its runs */
.chat .chat-tab.is-agent .ag-face.row { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }
.att-chip.is-agent { cursor: pointer; padding: 2px 9px 2px 2px; font-weight: 600; }
.att-chip.is-agent .ag-face.sm { border-radius: 50%; width: 20px; height: 20px; }
.att-chip.is-agent:hover { border-color: var(--clay); transform: translateY(-1px); }

/* full-screen preview: the pane fades with the rest of the panel's content,
   and on the smoked glass it goes light-on-dark like the transcript does */
body.mb-full .chat :is(.ag-view, .ag-chatbar) { opacity: var(--mb-ghost); transition: opacity .32s var(--ease-out); }
body.mb-full .chat :is(.ag-who h3, .ag-who p, .ag-card-text b, .ag-empty h3, .ag-describe h3, .ag-lesson-text, .ag-steps-text,
  .ag-runrow, .ag-idea, .ag-chip, .ag-prop-head, .ag-changes, .ag-notes-h, .ag-notes ul, .ag-ask-q, .ag-cb-who b) { color: #F1F1F1; }
body.mb-full .chat :is(.ag-kicker, .ag-quiet, .ag-stats, .ag-card-sum, .ag-card-meta, .ag-setup, .ag-lesson-meta, .ag-runrow-s,
  .ag-list-hint, .ag-back, .ag-head-t, .ag-check, .ag-cb-say, .ag-prop-sub, .ag-empty p) { color: rgba(238, 238, 238, .66); }
body.mb-full .chat :is(.ag-card, .ag-steps, .ag-lessons li, .ag-runrow.current, .ag-runrow:hover, .ag-idea, .ag-chip, .ag-proposal,
  .ag-picker, .ag-runbox:has(input), .ag-chatbar, .ag-notes) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); box-shadow: none; }
body.mb-full .chat .ag-steps::after { display: none; }
body.mb-full .chat .ag-view :is(input[type="text"], textarea, select) { background: rgba(14, 14, 14, .34); border-color: rgba(255, 255, 255, .16); color: #F4F4F4; }
body.mb-full .chat .ag-search { background: rgba(14, 14, 14, .34); border-color: rgba(255, 255, 255, .16); }
body.mb-full .chat .ag-search input { color: #F4F4F4; }
body.mb-full .chat .ag-btn:not(.primary) { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #EDEDED; }
body.mb-full .chat .ag-btn.quiet { background: transparent; border-color: transparent; color: rgba(238, 238, 238, .75); }
body.mb-full .chat .ag-foot { background: rgba(16, 16, 16, .6); border-top-color: rgba(255, 255, 255, .14); }
body.mb-full .chat :is(.ag-link, .ag-newsteps summary) { color: #F0B39B; }
body.mb-full .chat .ag-del { color: #F2A49C; }
body.mb-full .chat .ag-add-row { border-color: rgba(255, 255, 255, .22); color: rgba(238, 238, 238, .72); }
body.mb-full .chat .ag-seg { background: rgba(255, 255, 255, .08); box-shadow: none; }
body.mb-full .chat .ag-seg button { color: rgba(238, 238, 238, .66); }
body.mb-full .chat .ag-seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .2); color: #FFFFFF; box-shadow: none; }
body.mb-full .chat .ag-pick-icon { color: rgba(238, 238, 238, .7); }
body.mb-full .chat .ag-tabs { background: rgba(255, 255, 255, .1); box-shadow: none; opacity: var(--mb-chrome); }
body.mb-full .chat .ag-tabs-thumb { background: rgba(255, 255, 255, .2); box-shadow: none; }
body.mb-full .chat .ag-tab { color: rgba(238, 238, 238, .7); }
body.mb-full .chat .ag-tab[aria-selected="true"] { color: #F4F4F4; }

/* phones: 16px fields so iOS does not zoom */
@media (max-width: 768px), (pointer: coarse) and (max-width: 1024px) {
  .ag-view :is(input[type="text"], textarea, select) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ag-pane, .ag-card, .ag-proposal, .ag-chatbar, .ag-hero .ag-face, .ag-face::after { animation: none !important; }
}

/* ---- the Learning button (learning.js) ----------------------------------------
   A circle with a book and a pencil, in every composer and every "new" form.
   Off: a quiet ring. On: the maroon CTA with the pictogram in gold. */
.learn-btn {
  display: inline-grid; place-items: center; flex-shrink: 0; align-self: center;
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(26, 26, 26, .18); background: rgba(255, 255, 255, .72); color: #2E2E2E;
  cursor: pointer;
  transition: background .18s var(--ease-out, ease-out), color .18s var(--ease-out, ease-out),
              border-color .18s var(--ease-out, ease-out), box-shadow .18s var(--ease-out, ease-out), transform .16s var(--ease-out, ease-out);
}
.learn-btn svg { width: 17px; height: 17px; }
.learn-btn:hover { background: #fff; color: #7B1E2E; border-color: rgba(123, 30, 46, .38); }
.learn-btn:active { transform: scale(.92); transition-duration: .06s; }
.learn-btn:focus-visible { outline: 2px solid #7B1E2E; outline-offset: 2px; }
.learn-btn[aria-pressed="true"], .learn-btn[aria-pressed="true"]:hover {
  background: linear-gradient(180deg, #6E1A29 0%, #8E2A3C 100%); border-color: transparent; color: #F5C518;
  box-shadow: 0 0 0 3px rgba(245, 197, 24, .3);
}
.learn-btn.big { width: 44px; height: 44px; }
.learn-btn.big svg { width: 21px; height: 21px; }
/* in the composer it sits with the other round buttons */
.comp-btn.learn-btn { width: 29px; height: 29px; background: none; border-color: var(--cl-line, rgba(20, 20, 19, .11)); color: var(--cl-muted, #7C7A72); }
.comp-btn.learn-btn svg { width: 16px; height: 16px; }
.comp-btn.learn-btn:hover { background: var(--cl-sand, #F0EEE6); color: #7B1E2E; }
.comp-btn.learn-btn[aria-pressed="true"], .comp-btn.learn-btn[aria-pressed="true"]:hover {
  background: linear-gradient(180deg, #6E1A29 0%, #8E2A3C 100%); border-color: transparent; color: #F5C518;
}
/* Learning picks the model (the newest Opus), so the model pill steps back */
body.learning-on #chat-model { opacity: .45; }
.ag-foot .learn-btn { margin-right: auto; }
.build-go, .s3d-go { display: flex; align-items: center; gap: 10px; }
.s3d-go { gap: 8px; }

/* ---- the learning team in the Agents tab -------------------------------------- */
.ag-team-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
  font: 700 9.5px var(--sans); letter-spacing: .06em; text-transform: uppercase;
  color: #7B1E2E; background: rgba(123, 30, 46, .08); border: 1px solid rgba(123, 30, 46, .18);
}
.ag-team-tag svg { width: 11px; height: 11px; }
.ag-group-k { margin-top: 10px; }
.ag-records { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ag-records li {
  display: flex; align-items: flex-start; gap: 9px; padding: 7px 6px 7px 9px; border-radius: 11px;
  background: rgba(255, 255, 255, .6); border: 1px solid var(--cl-line-soft);
}
.ag-records li.is-more { display: none; }
.ag-records.is-open li.is-more { display: flex; }
.ag-rec-body { flex: 1; min-width: 0; font-size: 12px; line-height: 1.45; color: var(--cl-ink); }
.ag-rec-body b { font-weight: 650; }
.ag-rec-did { display: block; margin-top: 2px; color: #2E2E2E; }
.ag-rec-learned { display: block; margin-top: 3px; color: #7B1E2E; }
.ag-records li:hover .ag-forget { opacity: 1; }
