/* Shared chat + canvas workspace (AI Chat, Scriber). Namespaced with ac- to coexist with site styles. */
.ac-shell {
  --ac-bg: #f4f7fb;
  --ac-panel: #ffffff;
  --ac-panel-2: #f8fafc;
  --ac-line: #dfe6ee;
  --ac-ink: #0f1c2b;
  --ac-muted: #4a5a6b;
  --ac-primary: #0f72c7;
  --ac-primary-dark: #0b5fa7;
  --ac-user: #e8f2fc;
  --ac-ok: #1a8f5a;
  --ac-warn: #b7791f;
  --ac-err: #c0392b;
  --ac-radius: 14px;
  --ac-header-h: 56px;
  color: var(--ac-ink);
  background: var(--ac-bg);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: var(--ac-header-h) minmax(0, 1fr);
  grid-template-areas: "header header" "sidebar chat";
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  position: relative;
}
.ac-shell.is-wide { grid-template-columns: 250px minmax(0, 1.15fr) minmax(360px, 0.95fr); grid-template-areas: "header header header" "sidebar chat canvas"; }
.ac-shell *, .ac-shell *::before, .ac-shell *::after { box-sizing: border-box; }
.ac-hidden { display: none !important; }
.ac-muted { color: var(--ac-muted); font-size: 13.5px; }
.ac-err { color: var(--ac-err); }
.ac-inline { display: inline; margin: 0; }
.ac-block { width: 100%; }

/* header */
.ac-header { grid-area: header; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--ac-panel); border-bottom: 1px solid var(--ac-line); min-width: 0; }
.ac-brand { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.ac-brand strong { font-size: 15px; white-space: nowrap; }
.ac-brand .ac-muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-header__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ac-badge { border: 1px solid var(--ac-line); background: var(--ac-panel-2); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; color: var(--ac-muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.ac-badge.is-ok { border-color: #bfe6cf; color: var(--ac-ok); background: #edf9f2; }
.ac-badge-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ac-model-select { border: 1px solid var(--ac-line); background: var(--ac-panel); color: var(--ac-ink); border-radius: 999px; padding: 4px 8px; font: inherit; font-size: 12px; max-width: 30vw; }
.ac-model-select:disabled { opacity: 0.8; }
.ac-badge.is-down { border-color: #f3c8c2; color: var(--ac-err); background: #fdf1ef; }

/* buttons */
.ac-btn { border: 1px solid var(--ac-line); background: var(--ac-panel); color: var(--ac-ink); border-radius: 10px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.ac-btn:hover { background: var(--ac-panel-2); }
.ac-btn--primary { background: var(--ac-primary); border-color: var(--ac-primary); color: #fff; }
.ac-btn--primary:hover { background: var(--ac-primary-dark); }
.ac-btn--ghost { border-color: transparent; background: transparent; }
.ac-btn--danger { color: var(--ac-err); }
.ac-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ac-icon { border: 1px solid var(--ac-line); background: var(--ac-panel); border-radius: 10px; width: 38px; height: 38px; font: inherit; font-size: 18px; cursor: pointer; flex: 0 0 auto; }
.ac-link { border: 0; background: transparent; color: var(--ac-primary); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0; }
.ac-link:hover { text-decoration: underline; }
.ac-only-mobile { display: none; }
.ac-sidebar__links .ac-btn { margin-bottom: 6px; justify-content: center; }

/* sidebar */
.ac-sidebar { grid-area: sidebar; background: var(--ac-panel); border-right: 1px solid var(--ac-line); padding: 14px; overflow-y: auto; min-height: 0; }
.ac-sidebar h4 { margin: 18px 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ac-muted); }
.ac-sessions, .ac-tools { list-style: none; margin: 0; padding: 0; }
.ac-session { display: flex; align-items: stretch; border-radius: 10px; margin-bottom: 4px; }
.ac-session.is-active { background: var(--ac-user); }
.ac-session__open { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 8px 10px; font: inherit; cursor: pointer; display: flex; flex-direction: column; border-radius: 10px; }
.ac-session__open:hover { background: var(--ac-panel-2); }
.ac-session__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.ac-session__delete { border: 0; background: transparent; color: var(--ac-muted); cursor: pointer; padding: 0 8px; font-size: 16px; }
.ac-session__delete:hover { color: var(--ac-err); }
.ac-tools li { padding: 7px 0; border-bottom: 1px dashed var(--ac-line); font-size: 13.5px; line-height: 1.4; }
.ac-tools code { background: var(--ac-panel-2); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; color: var(--ac-ink); }
.ac-sidebar__extra { margin-top: 18px; font-size: 13px; }

/* chat column */
.ac-chat { grid-area: chat; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ac-modes { display: flex; gap: 6px; padding: 10px 16px 0; flex-wrap: wrap; }
.ac-mode { border: 1px solid var(--ac-line); background: var(--ac-panel); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.ac-mode.is-active { background: var(--ac-primary); color: #fff; border-color: var(--ac-primary); }
.ac-mode__hint { margin: 6px 16px 0; }
.ac-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.ac-welcome { margin: auto; max-width: 560px; text-align: center; }
.ac-welcome h2 { margin: 0 0 8px; font-size: 24px; }
.ac-msg { max-width: min(860px, 100%); border-radius: var(--ac-radius); padding: 12px 16px 10px; background: var(--ac-panel); border: 1px solid var(--ac-line); }
.ac-msg--user { align-self: flex-end; background: var(--ac-user); border-color: #cfe3f7; }
.ac-msg--system { align-self: center; background: #fff7e6; border-color: #f2dfb3; font-size: 13.5px; }
.ac-msg__head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.ac-msg__who { font-weight: 600; font-size: 13.5px; }
.ac-msg__attach, .ac-msg__canvas, .ac-attach { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.ac-msg__actions { display: flex; gap: 14px; margin-top: 8px; }
.ac-pill { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--ac-line); background: var(--ac-panel-2); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
.ac-pill--link { cursor: pointer; color: var(--ac-primary); font: inherit; font-size: 12.5px; }
.ac-pill__x { border: 0; background: transparent; cursor: pointer; font-size: 14px; color: var(--ac-muted); padding: 0 0 0 4px; }
.ac-toolsused { margin-top: 8px; font-size: 13.5px; color: var(--ac-muted); }
.ac-toolsused summary { cursor: pointer; }
.ac-toolsused ul { margin: 6px 0 0; padding-left: 18px; }
.ac-typing { display: flex; align-items: center; gap: 5px; padding: 6px 12px; color: var(--ac-muted); font-size: 13px; }
.ac-typing__row > span { width: 7px; height: 7px; border-radius: 50%; background: var(--ac-primary); opacity: 0.35; animation: ac-blink 1.2s infinite; }
.ac-typing__row > span:nth-child(2) { animation-delay: 0.2s; }
.ac-typing__row > span:nth-child(3) { animation-delay: 0.4s; }
.ac-typing em { margin-left: 6px; font-style: normal; }
@keyframes ac-blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* markdown */
.ac-md { overflow-wrap: anywhere; }
.ac-md p { margin: 0 0 8px; }
.ac-md p:last-child { margin-bottom: 0; }
.ac-md h1, .ac-md h2, .ac-md h3, .ac-md h4 { margin: 10px 0 6px; line-height: 1.25; }
.ac-md h1 { font-size: 20px; } .ac-md h2 { font-size: 17px; } .ac-md h3 { font-size: 15px; }
.ac-md ul, .ac-md ol { margin: 4px 0 8px; padding-left: 22px; }
.ac-md li { margin: 2px 0; }
.ac-md blockquote { margin: 6px 0; padding: 4px 12px; border-left: 3px solid var(--ac-line); color: var(--ac-muted); }
.ac-md code { background: var(--ac-panel-2); border: 1px solid var(--ac-line); border-radius: 5px; padding: 1px 5px; font-size: 13px; }
.ac-md a { color: var(--ac-primary); }
.ac-md hr { border: 0; border-top: 1px solid var(--ac-line); margin: 10px 0; }
.ac-table { overflow-x: auto; margin: 6px 0; }
.ac-table table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.ac-table th, .ac-table td { border: 1px solid var(--ac-line); padding: 5px 8px; text-align: left; }
.ac-code { margin: 8px 0; border: 1px solid var(--ac-line); border-radius: 10px; overflow: hidden; background: #0f172a; color: #e2e8f0; }
.ac-code__bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; background: #1e293b; font-size: 12px; color: #cbd5e1; }
.ac-code pre { margin: 0; padding: 10px 12px; overflow-x: auto; font-size: 13px; line-height: 1.45; }
.ac-code code { background: transparent; border: 0; padding: 0; color: inherit; font-size: inherit; }
.ac-copy { border: 0; background: transparent; color: #93c5fd; cursor: pointer; font: inherit; font-size: 12px; }
.ac-code--full { margin: 0; height: 100%; display: flex; flex-direction: column; }
.ac-code--full pre { flex: 1; overflow: auto; }

/* composer */
.ac-composer { border-top: 1px solid var(--ac-line); background: var(--ac-panel); padding: 10px 16px 8px; }
.ac-composer__row { display: flex; align-items: flex-end; gap: 8px; }
.ac-composer__input { flex: 1; resize: none; border: 1px solid var(--ac-line); border-radius: 12px; padding: 9px 12px; font: inherit; line-height: 1.4; min-height: 38px; max-height: 200px; background: var(--ac-panel-2); }
.ac-composer__input:focus { outline: 2px solid #bcd9f6; border-color: var(--ac-primary); }
.ac-send { height: 38px; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ac-chips[hidden] { display: none; }
.ac-chip { border: 1px solid var(--ac-line); background: var(--ac-panel-2); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12.5px; cursor: pointer; }
.ac-chip:hover { border-color: var(--ac-primary); color: var(--ac-primary); }
.ac-composer__hint { margin: 6px 0 0; }

/* canvas column */
.ac-canvas-col { grid-area: canvas; background: var(--ac-panel-2); border-left: 1px solid var(--ac-line); min-height: 0; display: flex; }
.ac-canvas { display: flex; flex-direction: column; min-height: 0; width: 100%; }
.ac-canvas__tabs { display: flex; gap: 4px; padding: 8px 10px 0; overflow-x: auto; border-bottom: 1px solid var(--ac-line); background: var(--ac-panel); }
.ac-tab { border: 1px solid var(--ac-line); border-bottom: 0; background: var(--ac-panel-2); border-radius: 10px 10px 0 0; padding: 6px 10px; font: inherit; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; max-width: 200px; white-space: nowrap; }
.ac-tab.is-active { background: var(--ac-panel); color: var(--ac-primary); border-color: var(--ac-primary); }
.ac-tab__kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ac-muted); }
.ac-tab__title { overflow: hidden; text-overflow: ellipsis; }
.ac-tab--new { max-width: none; }
.ac-tab--panel .ac-tab__kind { color: var(--ac-primary); }
.ac-panel { gap: 10px; }
.ac-panel__inner { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.ac-panel h3 { margin: 0; font-size: 16px; }
.ac-panel p { margin: 0; }
.ac-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ac-muted); }
.ac-panel textarea, .ac-panel input, .ac-panel select { border: 1px solid var(--ac-line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; background: var(--ac-panel-2); color: var(--ac-ink); }
.ac-panel textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
.ac-panel .ac-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ac-panel pre { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; overflow: auto; max-height: 360px; margin: 0; white-space: pre-wrap; }
.ac-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.ac-list button { text-align: left; border: 1px solid var(--ac-line); background: var(--ac-panel); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12.5px; cursor: pointer; }
.ac-list button:hover { border-color: var(--ac-primary); }
.ac-sidebar__extra label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ac-muted); margin-bottom: 6px; }
.ac-sidebar__extra input, .ac-sidebar__extra select { border: 1px solid var(--ac-line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; background: var(--ac-panel-2); color: var(--ac-ink); }

.ac-canvas__empty { margin: auto; padding: 24px; max-width: 460px; text-align: center; color: var(--ac-muted); font-size: 14.5px; }
.ac-canvas__empty h3 { color: var(--ac-ink); margin: 0 0 6px; }
.ac-canvas__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--ac-line); background: var(--ac-panel); flex-wrap: wrap; }
.ac-canvas__meta { display: flex; flex-direction: column; min-width: 0; }
.ac-canvas__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-canvas__body { flex: 1; min-height: 0; overflow: auto; padding: 14px; background: var(--ac-panel); display: flex; flex-direction: column; }
.ac-canvas__body .ac-md { max-width: 760px; }
.ac-frame { border: 1px solid var(--ac-line); border-radius: 10px; width: 100%; flex: 1; min-height: 360px; background: #fff; }
.ac-svg { max-width: 100%; height: auto; margin: auto; }
.ac-editor { flex: 1; min-height: 320px; width: 100%; resize: vertical; border: 1px solid var(--ac-line); border-radius: 10px; padding: 10px; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ac-editor__row { display: flex; gap: 8px; margin-bottom: 8px; }
.ac-input { flex: 1; border: 1px solid var(--ac-line); border-radius: 10px; padding: 7px 10px; font: inherit; }
.ac-toast { position: absolute; bottom: 18px; left: 50%; transform: translate(-50%, 20px); background: #0f172a; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 30; }
.ac-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* narrow layouts: sidebar and canvas become overlays */
@media (max-width: 1099px) {
  .ac-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "header" "chat"; }
  .ac-only-mobile { display: inline-flex; }
  .ac-sidebar { position: absolute; top: var(--ac-header-h); bottom: 0; left: 0; width: min(320px, 86vw); z-index: 20; transform: translateX(-104%); transition: transform 0.2s; box-shadow: 0 10px 30px rgba(15, 28, 43, 0.18); }
  .ac-shell.show-sidebar .ac-sidebar { transform: translateX(0); }
  .ac-canvas-col { position: absolute; top: var(--ac-header-h); bottom: 0; right: 0; width: min(720px, 100vw); z-index: 20; transform: translateX(104%); transition: transform 0.2s; box-shadow: 0 10px 30px rgba(15, 28, 43, 0.18); }
  .ac-shell.show-canvas .ac-canvas-col { transform: translateX(0); }
  .ac-brand .ac-muted { display: none; }
  .ac-brand strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
  .ac-hide-mobile { display: none !important; }
  .ac-sidebar__links.ac-only-mobile { display: block; }
  .ac-badge { max-width: 30vw; font-size: 11px; padding: 4px 8px; }
  .ac-model-select { max-width: 26vw; font-size: 11px; }
  .ac-msg { max-width: 100%; }
  .ac-composer__hint { display: none; }
  .ac-chips { max-height: 92px; overflow-y: auto; }
}
@media (max-width: 600px) {
  .ac-header { gap: 8px; padding: 0 10px; }
  .ac-badge { max-width: 34vw; }
  .ac-messages { padding: 12px 10px 6px; }
  .ac-composer { padding: 8px 10px 6px; }
  .ac-canvas__actions .ac-btn { padding: 6px 9px; font-size: 12px; }
}
@media (prefers-color-scheme: dark) {
  .ac-shell[data-theme="auto"] { --ac-bg: #0f1520; --ac-panel: #172033; --ac-panel-2: #202c45; --ac-line: #33415c; --ac-ink: #eef3fa; --ac-muted: #c3cfe0; --ac-user: #24395a; }
  .ac-shell[data-theme="auto"] .ac-badge.is-ok { background: #123b2a; border-color: #1f6b48; color: #8ee0b3; }
  .ac-shell[data-theme="auto"] .ac-badge.is-down { background: #4a1f1c; border-color: #8a3a34; color: #f5a79f; }
  .ac-shell[data-theme="auto"] .ac-msg--system { background: #3d3115; border-color: #6b5620; color: #f3e6c4; }
  .ac-shell[data-theme="auto"] .ac-md code { color: #f2f6fb; }
}

/* Models panel */
.ac-ops h4 { margin: 12px 0 6px; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ac-muted); }
.ac-ops__row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--ac-line); font-size: 14px; }
.ac-ops__k { color: var(--ac-muted); }
.ac-ops__v.is-ok { color: var(--ac-ok); font-weight: 600; }
.ac-ops__v.is-down { color: var(--ac-err); font-weight: 600; }
.ac-ops__lane { padding: 8px 10px; border: 1px solid var(--ac-line); border-radius: 10px; margin-bottom: 6px; font-size: 14px; }
.ac-ops__lane.is-active { border-color: var(--ac-primary); box-shadow: inset 3px 0 0 var(--ac-primary); }
.ac-ops__tools { margin: 0; padding-left: 18px; font-size: 13.5px; }
.ac-ops__tools li { margin: 4px 0; }
.ac-ops__tools code { background: var(--ac-panel-2); border-radius: 6px; padding: 1px 6px; }

/* Memory panel */
.ac-memory__row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--ac-line); font-size: 14px; }
.ac-memory__kind { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ac-muted); padding-top: 3px; }
.ac-memory__text { white-space: pre-wrap; }

/* Agent mode: grants, audit trail, machine-tool chips */
.ac-pill--run { margin-left: 6px; color: var(--ac-primary); border-color: #bcd9f6; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }
.ac-tool--refused code { border-left: 3px solid var(--ac-err); }
.ac-grant { border: 1px solid var(--ac-line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; font-size: 13.5px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: start; }
.ac-grant.is-selected { border-color: var(--ac-primary); box-shadow: inset 3px 0 0 var(--ac-primary); }
.ac-grant.is-inactive { opacity: 0.6; }
.ac-grant__title { font-weight: 600; }
.ac-grant__meta { grid-column: 1 / -1; color: var(--ac-muted); font-size: 12.5px; word-break: break-word; }
.ac-grant__actions { display: flex; gap: 6px; }
.ac-grant__status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; border-radius: 999px; padding: 2px 8px; border: 1px solid var(--ac-line); color: var(--ac-muted); }
.ac-grant__status.is-active { color: var(--ac-ok); border-color: #bfe6cf; }
.ac-grant__status.is-revoked, .ac-grant__status.is-expired { color: var(--ac-err); border-color: #f3c8c2; }
.ac-agent-banner { border: 1px solid #bcd9f6; background: var(--ac-user); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 8px 16px 0; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.ac-agent-banner code { background: var(--ac-panel); border-radius: 6px; padding: 1px 6px; }
.ac-audit { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.ac-audit th, .ac-audit td { border-bottom: 1px dashed var(--ac-line); padding: 4px 6px; text-align: left; vertical-align: top; }
.ac-audit th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ac-muted); }
.ac-audit td.is-refused { color: var(--ac-err); }
.ac-audit td.is-ok { color: var(--ac-ok); }
.ac-audit__wrap { overflow-x: auto; max-height: 340px; overflow-y: auto; border: 1px solid var(--ac-line); border-radius: 10px; }
.ac-checks { display: flex; gap: 14px; flex-wrap: wrap; }
.ac-checks label { flex-direction: row; align-items: center; gap: 6px; color: var(--ac-ink); font-size: 13px; }

/* readability repairs: placeholders and the working bubble were too faint */
.ac-composer__input::placeholder, .ac-shell input::placeholder, .ac-shell textarea::placeholder { color: var(--ac-muted); opacity: 1; }
.ac-typing { display: flex; flex-direction: column; gap: 6px; }
.ac-typing__row { display: flex; align-items: center; gap: 6px; }
.ac-typing em { font-style: normal; color: var(--ac-ink); font-size: 14px; }
.ac-typing__row > span { width: 7px; height: 7px; border-radius: 50%; background: var(--ac-primary); display: inline-block; animation: ac-bounce 1.2s infinite ease-in-out; }
.ac-typing__row > span:nth-child(2) { animation-delay: 0.15s; } .ac-typing__row > span:nth-child(3) { animation-delay: 0.3s; }
/* elapsed-of-estimate while the model reads the prompt / writes: a thin bar the kit widens from its `model` phase */
.ac-progress { height: 4px; border-radius: 2px; background: var(--ac-line); overflow: hidden; max-width: 320px; }
.ac-progress > span { display: block; height: 100%; width: 0; background: var(--ac-primary); transition: width 0.9s linear; }
@keyframes ac-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-4px); opacity: 1; } }
/* what the model is doing, step by step */
.ac-steps { list-style: none; margin: 2px 0 0; padding: 0 0 0 2px; display: flex; flex-direction: column; gap: 3px; max-height: 160px; overflow: auto; }
.ac-step { display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--ac-muted); animation: ac-fade 0.25s ease-out; }
.ac-step__icon { width: 1.2em; text-align: center; }
.ac-step--result { color: var(--ac-ink); } .ac-step--done { color: var(--ac-ok); font-weight: 600; } .ac-step--steer { color: var(--ac-primary); }
@keyframes ac-fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.ac-msg { animation: ac-fade 0.22s ease-out; }
.ac-msg--steer .ac-msg__body::before { content: 'steer · '; color: var(--ac-primary); font-weight: 600; font-size: 12px; }
/* sessions: working spinner + unread dot */
.ac-spin { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid var(--ac-line); border-top-color: var(--ac-primary); border-radius: 50%; animation: ac-rotate 0.9s linear infinite; vertical-align: -1px; }
@keyframes ac-rotate { to { transform: rotate(360deg); } }
.ac-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--ac-primary); vertical-align: 1px; }
.ac-stop { margin-right: 6px; }
.ac-btn { transition: transform 0.08s ease, background 0.15s ease; } .ac-btn:active { transform: scale(0.97); }

/* ============================================================================================
   Aero layer — the mid-2000s glass look, done with restraint: sky-to-aqua gradients, frosted
   panels, glossy pills with a top highlight, soft green "ready" accents, bubbly radii, real
   scrollbars, and layouts that hold together on a folded phone (344 px) and an unfolded one (904 px).
   Everything below overrides the base tokens/components above; nothing changes the kit's markup.
   ============================================================================================ */
.ac-shell {
  --ac-bg: #dbeeff;
  --ac-panel: rgba(255, 255, 255, 0.72);
  --ac-panel-2: rgba(255, 255, 255, 0.55);
  --ac-line: rgba(78, 132, 190, 0.28);
  --ac-ink: #10263d;
  --ac-muted: #3f5f80;
  --ac-primary: #1c7ed6;
  --ac-primary-dark: #1364b3;
  --ac-user: rgba(214, 238, 255, 0.85);
  --ac-ok: #17904f;
  --ac-radius: 18px;
  --ac-glass: rgba(255, 255, 255, 0.62);
  --ac-glass-strong: rgba(255, 255, 255, 0.82);
  --ac-gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.35) 48%, rgba(255, 255, 255, 0.08) 52%, rgba(255, 255, 255, 0.25) 100%);
  --ac-shadow: 0 10px 30px rgba(20, 60, 110, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --ac-aqua: linear-gradient(180deg, #7cc8ff 0%, #38a2ee 45%, #1c7ed6 52%, #2b8fe0 100%);
  --ac-green: linear-gradient(180deg, #a6ec9c 0%, #55c55c 45%, #2fa845 52%, #47b957 100%);
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(151, 232, 190, 0.55), transparent 60%),
    linear-gradient(160deg, #e8f5ff 0%, #cfe7ff 40%, #b9dcfb 70%, #cbeee0 100%);
  font-family: "Segoe UI", "Trebuchet MS", system-ui, -apple-system, Roboto, sans-serif;
}
/* --- glass surfaces --- */
.ac-header, .ac-sidebar, .ac-composer, .ac-canvas__tabs, .ac-canvas__bar, .ac-canvas__body, .ac-canvas-col {
  background: var(--ac-glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.ac-header { border-bottom: 1px solid rgba(255, 255, 255, 0.7); box-shadow: 0 1px 0 var(--ac-line), 0 6px 18px rgba(20, 60, 110, 0.10); position: relative; z-index: 5; }
.ac-header::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)); pointer-events: none; }
.ac-brand strong { font-size: 16px; letter-spacing: 0.01em; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); }
.ac-sidebar { border-right: 1px solid rgba(255, 255, 255, 0.6); box-shadow: inset -1px 0 0 var(--ac-line); }
.ac-canvas-col { border-left: 1px solid rgba(255, 255, 255, 0.6); box-shadow: inset 1px 0 0 var(--ac-line); }
.ac-composer { border-top: 1px solid rgba(255, 255, 255, 0.75); box-shadow: 0 -6px 18px rgba(20, 60, 110, 0.08); }

/* --- glossy controls --- */
.ac-btn, .ac-icon, .ac-mode, .ac-chip, .ac-tab, .ac-badge, .ac-model-select, .ac-pill, .ac-list button {
  background-color: var(--ac-glass-strong);
  background-image: var(--ac-gloss);
  border: 1px solid rgba(70, 130, 200, 0.35);
  box-shadow: 0 2px 4px rgba(20, 60, 110, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: var(--ac-ink);
  transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.ac-btn:hover, .ac-icon:hover, .ac-mode:hover, .ac-chip:hover, .ac-tab:hover, .ac-list button:hover { filter: brightness(1.04); box-shadow: 0 3px 8px rgba(20, 60, 110, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.95); }
.ac-btn:active, .ac-icon:active, .ac-mode:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(20, 60, 110, 0.18); }
.ac-btn--primary, .ac-mode.is-active, .ac-tab.is-active { background-color: var(--ac-primary); background-image: var(--ac-aqua); color: #fff; border-color: #1568b8; text-shadow: 0 1px 1px rgba(0, 40, 90, 0.35); box-shadow: 0 3px 8px rgba(28, 126, 214, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.ac-btn--primary:hover { background-image: linear-gradient(180deg, #8fd3ff 0%, #45adf5 45%, #2288de 52%, #3399e8 100%); }
.ac-btn--danger { color: #b3261e; }
.ac-btn--danger:hover { background-image: linear-gradient(180deg, #ffd9d3 0%, #ffb3a8 48%, #ff9d90 52%, #ffb9ad 100%); border-color: #d97b6e; }
.ac-badge.is-ok { background-color: #2fa845; background-image: var(--ac-green); color: #fff; border-color: #2a8d3d; text-shadow: 0 1px 1px rgba(0, 60, 20, 0.35); }
.ac-badge.is-down { background-image: linear-gradient(180deg, #ffd6cf 0%, #ff9f92 48%, #f7826f 52%, #fb9b8b 100%); color: #5c1a12; border-color: #d97b6e; }
.ac-badge, .ac-model-select { font-weight: 600; }
.ac-chip { border-radius: 999px; }
.ac-icon { border-radius: 12px; }
.ac-tab { border-radius: 12px 12px 0 0; }

/* --- messages: bubbles with a soft sheen --- */
.ac-msg { background: var(--ac-glass-strong); border: 1px solid rgba(255, 255, 255, 0.85); box-shadow: 0 4px 14px rgba(20, 60, 110, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.95); position: relative; }
.ac-msg::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 46%; border-radius: var(--ac-radius) var(--ac-radius) 0 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)); pointer-events: none; }
.ac-msg > * { position: relative; }
.ac-msg--user { background: linear-gradient(180deg, #e9f6ff 0%, #cfe9ff 100%); border-color: rgba(120, 180, 240, 0.7); }
.ac-msg--assistant .ac-msg__who { color: var(--ac-primary-dark); }
.ac-msg--system { background: linear-gradient(180deg, #fff9e8 0%, #fdefc6 100%); border-color: #efd39a; }
.ac-msg__who { font-weight: 700; }
.ac-welcome h2 { font-size: 26px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9); color: #12395e; }
.ac-md code { background: rgba(255, 255, 255, 0.7); border-color: var(--ac-line); }
.ac-code { border-radius: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 16px rgba(10, 30, 60, 0.25); }

/* --- composer --- */
.ac-composer__input { background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(70, 130, 200, 0.4); border-radius: 16px; box-shadow: inset 0 2px 4px rgba(20, 60, 110, 0.10), 0 1px 0 rgba(255, 255, 255, 0.9); font-size: 15px; padding: 10px 14px; }
.ac-composer__input:focus { outline: 0; border-color: var(--ac-primary); box-shadow: inset 0 2px 4px rgba(20, 60, 110, 0.10), 0 0 0 4px rgba(56, 162, 238, 0.28); }
.ac-composer__input::placeholder { color: #5a7a9a; opacity: 1; }
.ac-send { border-radius: 14px; min-width: 76px; font-weight: 700; }
.ac-stop { border-radius: 14px; font-weight: 700; }

/* --- sessions + sidebar --- */
.ac-session { border-radius: 12px; }
.ac-session.is-active { background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(214, 238, 255, 0.9)); box-shadow: 0 2px 6px rgba(20, 60, 110, 0.12), inset 0 1px 0 #fff; border: 1px solid rgba(120, 180, 240, 0.6); }
.ac-session__open:hover { background: rgba(255, 255, 255, 0.55); }
.ac-sidebar h4 { color: #2f5a86; }
.ac-tools li { border-bottom-color: rgba(78, 132, 190, 0.22); }
.ac-tools code { background: rgba(255, 255, 255, 0.75); }

/* --- working bubble + steps --- */
.ac-typing { background: var(--ac-glass-strong); border: 1px solid rgba(255, 255, 255, 0.85); border-radius: var(--ac-radius); padding: 10px 14px; box-shadow: 0 4px 14px rgba(20, 60, 110, 0.10), inset 0 1px 0 #fff; max-width: min(860px, 100%); }
.ac-typing__row > span { background: var(--ac-primary); box-shadow: 0 0 6px rgba(56, 162, 238, 0.8); }
.ac-typing em { color: #12395e; font-weight: 600; }
.ac-step { color: #2f5a86; }
.ac-step--done { color: var(--ac-ok); }

/* --- canvas --- */
.ac-canvas__body { background: rgba(255, 255, 255, 0.55); }
.ac-frame, .ac-editor { border-radius: 14px; border-color: var(--ac-line); box-shadow: inset 0 1px 0 #fff, 0 4px 12px rgba(20, 60, 110, 0.10); background: #fff; }
.ac-panel textarea, .ac-panel input, .ac-panel select, .ac-sidebar__extra input, .ac-sidebar__extra select, .ac-input { background: rgba(255, 255, 255, 0.85); border-radius: 12px; box-shadow: inset 0 2px 4px rgba(20, 60, 110, 0.08); }
.ac-toast { background: linear-gradient(180deg, #2c4a6b, #12304f); border: 1px solid rgba(255, 255, 255, 0.35); box-shadow: 0 8px 24px rgba(10, 30, 60, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35); font-weight: 600; }

/* --- scrollbars: thin, translucent, rounded (WebKit + Firefox) --- */
.ac-shell * { scrollbar-width: thin; scrollbar-color: rgba(60, 120, 190, 0.45) transparent; }
.ac-shell *::-webkit-scrollbar { width: 10px; height: 10px; }
.ac-shell *::-webkit-scrollbar-track { background: transparent; }
.ac-shell *::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(120, 180, 240, 0.9), rgba(56, 130, 210, 0.9)); border: 2px solid transparent; background-clip: padding-box; border-radius: 999px; }
.ac-shell *::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(100, 170, 240, 1), rgba(28, 126, 214, 1)); background-clip: padding-box; }
.ac-shell *::-webkit-scrollbar-corner { background: transparent; }

/* --- narrow displays: a folded phone (≈344 px) must not overflow, wrap, or hide the controls --- */
@media (max-width: 1099px) {
  .ac-sidebar { width: min(320px, 92vw); border-radius: 0 18px 18px 0; }
  .ac-canvas-col { width: min(720px, 100vw); }
}
@media (max-width: 480px) {
  .ac-shell { --ac-header-h: 52px; --ac-radius: 16px; font-size: 14.5px; }
  .ac-header { gap: 6px; padding: 0 8px; }
  .ac-brand strong { max-width: 30vw; font-size: 13.5px; }
  .ac-badge { max-width: 30vw; font-size: 10.5px; padding: 4px 7px; }
  .ac-model-select { max-width: 24vw; font-size: 10.5px; padding: 3px 6px; }
  .ac-header__actions { gap: 4px; }
  .ac-header__actions .ac-btn { padding: 6px 8px; font-size: 12px; }
  .ac-modes { padding: 8px 8px 0; gap: 4px; }
  .ac-mode { padding: 4px 10px; font-size: 12px; }
  .ac-messages { padding: 10px 8px 6px; gap: 10px; }
  .ac-msg { padding: 10px 12px 8px; border-radius: 14px; }
  .ac-msg__head { flex-wrap: wrap; gap: 4px 10px; }
  .ac-composer { padding: 8px 8px 6px; }
  .ac-composer__row { gap: 6px; }
  .ac-composer__input { padding: 9px 11px; font-size: 14.5px; min-height: 40px; }
  .ac-send { min-width: 60px; padding: 7px 10px; }
  .ac-stop { padding: 7px 9px; }
  .ac-icon { width: 36px; height: 36px; }
  .ac-chips { gap: 4px; max-height: 70px; }
  .ac-chip { font-size: 11.5px; padding: 3px 9px; }
  .ac-welcome h2 { font-size: 21px; }
  .ac-canvas__bar { padding: 8px; }
  .ac-canvas__actions .ac-btn { padding: 5px 8px; font-size: 11.5px; }
  .ac-canvas__tabs { padding: 6px 6px 0; }
  .ac-tab { padding: 5px 8px; font-size: 11.5px; max-width: 140px; }
  .ac-typing { padding: 8px 10px; }
  .ac-step { font-size: 12px; }
  .ac-toast { max-width: 92vw; white-space: normal; text-align: center; }
}
@media (max-width: 380px) {
  .ac-brand strong { max-width: 26vw; }
  .ac-badge { max-width: 26vw; }
  .ac-model-select { display: none; }
  .ac-header__actions .ac-btn:not(.ac-icon) { display: none; }
  .ac-mode__hint { display: none; }
}
/* the unfolded phone (≈904 px) sits between phone and desktop: overlays stay, but bubbles and panels use the room */
@media (min-width: 700px) and (max-width: 1099px) {
  .ac-messages { padding: 18px 28px 8px; }
  .ac-msg { max-width: 92%; }
  .ac-composer { padding: 10px 28px 8px; }
  .ac-canvas-col { width: min(640px, 80vw); }
}
/* touch: bigger targets, no hover-only affordances */
@media (hover: none) and (pointer: coarse) {
  .ac-btn, .ac-mode, .ac-chip { min-height: 38px; }
  .ac-session__delete { padding: 0 12px; font-size: 18px; }
}
/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ac-shell *, .ac-shell *::before, .ac-shell *::after { animation: none !important; transition: none !important; }
}

/* --- dark Aero: deep sea glass instead of black --- */
@media (prefers-color-scheme: dark) {
  .ac-shell[data-theme="auto"] {
    --ac-bg: #0d2238;
    --ac-panel: rgba(18, 44, 72, 0.7);
    --ac-panel-2: rgba(22, 52, 84, 0.6);
    --ac-line: rgba(120, 180, 240, 0.28);
    --ac-ink: #eaf4ff;
    --ac-muted: #b9d3ee;
    --ac-user: rgba(30, 90, 150, 0.6);
    --ac-glass: rgba(16, 40, 66, 0.66);
    --ac-glass-strong: rgba(24, 56, 92, 0.78);
    --ac-gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.08) 48%, rgba(255, 255, 255, 0.02) 52%, rgba(255, 255, 255, 0.06) 100%);
    background:
      radial-gradient(1000px 600px at 10% -10%, rgba(80, 160, 240, 0.35), transparent 60%),
      radial-gradient(800px 500px at 100% 110%, rgba(50, 170, 120, 0.3), transparent 60%),
      linear-gradient(160deg, #0b1d33 0%, #0f2b48 45%, #0d3550 75%, #0f3a3a 100%);
  }
  .ac-shell[data-theme="auto"] .ac-btn, .ac-shell[data-theme="auto"] .ac-icon, .ac-shell[data-theme="auto"] .ac-mode, .ac-shell[data-theme="auto"] .ac-chip, .ac-shell[data-theme="auto"] .ac-tab, .ac-shell[data-theme="auto"] .ac-badge, .ac-shell[data-theme="auto"] .ac-model-select, .ac-shell[data-theme="auto"] .ac-pill, .ac-shell[data-theme="auto"] .ac-list button { color: var(--ac-ink); border-color: rgba(140, 190, 240, 0.35); box-shadow: 0 2px 6px rgba(0, 10, 30, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
  .ac-shell[data-theme="auto"] .ac-msg { background: var(--ac-glass-strong); border-color: rgba(140, 190, 240, 0.3); box-shadow: 0 4px 14px rgba(0, 10, 30, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
  .ac-shell[data-theme="auto"] .ac-msg::before { background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)); }
  .ac-shell[data-theme="auto"] .ac-msg--user { background: linear-gradient(180deg, rgba(40, 110, 180, 0.7), rgba(24, 80, 140, 0.7)); border-color: rgba(120, 180, 240, 0.5); }
  .ac-shell[data-theme="auto"] .ac-msg--system { background: linear-gradient(180deg, #4a3a14, #3a2c10); border-color: #7a5e22; color: #f6e8c8; }
  .ac-shell[data-theme="auto"] .ac-composer__input { background: rgba(10, 30, 52, 0.75); color: var(--ac-ink); border-color: rgba(140, 190, 240, 0.4); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35); }
  .ac-shell[data-theme="auto"] .ac-composer__input::placeholder { color: #9ec0e6; }
  .ac-shell[data-theme="auto"] .ac-typing { background: var(--ac-glass-strong); border-color: rgba(140, 190, 240, 0.3); }
  .ac-shell[data-theme="auto"] .ac-typing em, .ac-shell[data-theme="auto"] .ac-welcome h2, .ac-shell[data-theme="auto"] .ac-sidebar h4, .ac-shell[data-theme="auto"] .ac-step { color: #dbeaff; }
  .ac-shell[data-theme="auto"] .ac-session.is-active { background: linear-gradient(180deg, rgba(60, 130, 200, 0.5), rgba(30, 90, 150, 0.5)); border-color: rgba(140, 190, 240, 0.5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); }
  .ac-shell[data-theme="auto"] .ac-session__open:hover { background: rgba(255, 255, 255, 0.08); }
  .ac-shell[data-theme="auto"] .ac-md code { background: rgba(255, 255, 255, 0.10); color: #f2f6fb; }
  .ac-shell[data-theme="auto"] .ac-tools code { background: rgba(255, 255, 255, 0.10); }
  .ac-shell[data-theme="auto"] .ac-frame { background: #fff; }
  .ac-shell[data-theme="auto"] .ac-editor, .ac-shell[data-theme="auto"] .ac-panel textarea, .ac-shell[data-theme="auto"] .ac-panel input, .ac-shell[data-theme="auto"] .ac-panel select, .ac-shell[data-theme="auto"] .ac-sidebar__extra input, .ac-shell[data-theme="auto"] .ac-sidebar__extra select, .ac-shell[data-theme="auto"] .ac-input { background: rgba(10, 30, 52, 0.75); color: var(--ac-ink); }
  .ac-shell[data-theme="auto"] .ac-canvas__body { background: rgba(12, 32, 56, 0.6); }
  .ac-shell[data-theme="auto"] * { scrollbar-color: rgba(120, 180, 240, 0.5) transparent; }
}

/* the model's plan, as a checklist while it works */
.ac-plan { list-style: none; margin: 2px 0 4px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(70, 130, 200, 0.25); display: flex; flex-direction: column; gap: 4px; }
.ac-plan__step { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; color: var(--ac-muted); }
.ac-plan__mark { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(70, 130, 200, 0.5); flex: 0 0 auto; position: relative; top: 2px; background: #fff; }
.ac-plan__step.is-current { color: var(--ac-ink); font-weight: 600; }
.ac-plan__step.is-current .ac-plan__mark { border-color: var(--ac-primary); box-shadow: 0 0 0 3px rgba(56, 162, 238, 0.25); animation: ac-pulse 1.4s infinite; }
.ac-plan__step.is-done { color: var(--ac-ok); }
.ac-plan__step.is-done .ac-plan__mark { background: var(--ac-ok); border-color: var(--ac-ok); }
.ac-plan__step.is-done .ac-plan__mark::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@keyframes ac-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(56, 162, 238, 0.25); } 50% { box-shadow: 0 0 0 6px rgba(56, 162, 238, 0.12); } }
@media (prefers-color-scheme: dark) { .ac-shell[data-theme="auto"] .ac-plan { background: rgba(10, 30, 52, 0.55); border-color: rgba(140, 190, 240, 0.3); } .ac-shell[data-theme="auto"] .ac-plan__mark { background: rgba(10, 30, 52, 0.9); } }
/* mobile: the status becomes a dot + word, buttons go icon-only, suggestions scroll sideways */
@media (max-width: 480px) {
  .ac-badge { font-size: 0; padding: 0 8px 0 6px; height: 26px; display: inline-flex; align-items: center; gap: 5px; max-width: none; }
  .ac-badge::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
  .ac-badge::after { content: attr(data-short); font-size: 12px; font-weight: 700; }
  .ac-chips { flex-wrap: nowrap; overflow-x: auto; max-height: none; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .ac-chip { flex: 0 0 auto; }
  .ac-msg__head .ac-muted { font-size: 11.5px; }
  .ac-msg__actions { gap: 10px; }
  .ac-welcome { padding: 0 8px; }
  .ac-welcome p { font-size: 14px; }
}
@media (max-width: 380px) {
  .ac-send, .ac-stop { min-width: 0; width: 42px; padding: 0; font-size: 0; }
  .ac-send::before { content: '➤'; font-size: 16px; }
  .ac-stop::before { content: '■'; font-size: 14px; }
  .ac-icon { width: 34px; height: 34px; font-size: 16px; }
  .ac-composer__input { padding: 8px 10px; }
}

/* tool timeline: one card per step, in words */
.ac-timeline { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ac-timeline--live { max-height: 220px; overflow: auto; padding-right: 4px; }
.ac-tcard { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 8px; align-items: start; padding: 7px 10px; border: 1px solid var(--ac-line); border-radius: 12px; background: var(--ac-panel-2); font-size: 13.5px; animation: ac-fade 0.25s ease-out; }
.ac-tcard__icon { font-size: 15px; line-height: 1.3; text-align: center; }
.ac-tcard__label { color: var(--ac-ink); font-weight: 600; line-height: 1.35; }
.ac-tcard__summary { color: var(--ac-muted); margin-top: 2px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.ac-tcard__status { font-size: 12px; color: var(--ac-muted); white-space: nowrap; padding-top: 2px; }
.ac-tcard--running { border-color: var(--ac-primary); box-shadow: inset 3px 0 0 var(--ac-primary); }
.ac-tcard--running .ac-tcard__status { color: var(--ac-primary); }
.ac-tcard--running .ac-tcard__status::after { content: ''; display: inline-block; width: 9px; height: 9px; margin-left: 6px; border: 2px solid var(--ac-line); border-top-color: var(--ac-primary); border-radius: 50%; animation: ac-rotate 0.9s linear infinite; vertical-align: -1px; }
.ac-tcard--done .ac-tcard__status { color: var(--ac-ok); }
.ac-tcard--failed { border-color: var(--ac-err); } .ac-tcard--failed .ac-tcard__status { color: var(--ac-err); }
.ac-tcard--note { background: transparent; border-style: dashed; }
.ac-toolsused summary { list-style: none; display: flex; align-items: center; gap: 4px; font-size: 13.5px; }
.ac-toolsused summary::-webkit-details-marker { display: none; }
.ac-toolsused summary::before { content: '▸'; color: var(--ac-muted); transition: transform 0.15s ease; }
.ac-toolsused[open] summary::before { transform: rotate(90deg); }
.ac-toolsused__title { font-weight: 600; color: var(--ac-ink); }
.ac-steps, .ac-step { display: none; }
