.hermes-chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.hermes-chat-head button { min-height: 30px; padding: 4px 9px; font-size: 11px; }
.hermes-log { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.hermes-log:empty::before { content: "Hi 👋 Ask a question or give a task, e.g. \"Summarise this page\" · TM Assist uses the tab you have open"; color: var(--muted); font-size: 12px; }
.hermes-msg { max-width: 100%; padding: 8px 10px; border-radius: 10px; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.hermes-msg.user { white-space: pre-wrap; }
.hermes-msg.user { justify-self: end; background: var(--brand); color: #fff; }
.hermes-msg.hermes { justify-self: stretch; border: 1px solid var(--line); background: var(--surface); }
.hermes-msg p { margin: 0; }
.hermes-msg p + p, .hermes-msg p + div, .hermes-msg div + p { margin-top: 6px; }
.hermes-tool, .hermes-status { color: var(--muted); font-size: 11.5px; }
.hermes-tool[data-status="running"]::after { content: " …"; }
.hermes-tool[data-status="completed"]::after { content: " ✓"; color: var(--green); }
.hermes-error { color: var(--red); font-size: 12px; }
.hermes-approval { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--amber); border-radius: 8px; background: var(--amber-soft); }
.hermes-approval code { display: block; overflow-x: auto; white-space: pre; font-size: 11px; }
.hermes-approval-actions { display: flex; gap: 6px; }
.hermes-approval-where { color: var(--muted); font-size: 11px; }
.hermes-approval-actions button { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.hermes-composer button[type="submit"] { border-color: var(--brand); background: var(--brand); color: #fff; }
.hermes-composer textarea:disabled { opacity: .7; }
.hermes-view { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid #b9c4f5; border-radius: 9px; background: var(--brand-soft); white-space: normal; }
.hermes-view > div { display: grid; min-width: 0; }
.hermes-view small { color: var(--brand); font-size: 9.5px; }
.hermes-view strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.hermes-view button, .hermes-view a { flex: none; min-height: 30px; padding: 4px 11px; border: 1px solid var(--brand); border-radius: 8px; background: var(--surface); color: var(--brand); font-size: 12px; font-weight: 700; text-decoration: none; }
.hermes-shot { margin: 6px 0 0; }
.hermes-shot img { display: block; max-width: 100%; max-height: 140px; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; }
.hermes-shot.expanded img { max-height: none; cursor: zoom-out; }
.hermes-shot figcaption { color: var(--muted); font-size: 11px; }
.work-tab-button { margin-left: 6px; min-height: 24px; padding: 1px 8px; font-size: 11px; }
.hermes-usage { color: var(--muted); font-size: 11px; margin-top: 6px; opacity: .85; }
.hermes-usage.heavy { color: #b45309; opacity: 1; }

/* Steps box: one per answer, capped so a long run never fills the chat (Owner, 2026-09-26). */
.hermes-steps { margin: 0 0 6px; border: 1px solid var(--line); border-radius: 8px; background: #f6f8fc; font-size: 11.5px; }
.hermes-steps > summary { padding: 5px 9px; color: var(--muted); cursor: pointer; list-style: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hermes-steps > summary::-webkit-details-marker { display: none; }
.hermes-steps > summary::after { content: " ▾"; }
.hermes-steps:not([open]) > summary::after { content: " ▸"; }
.hermes-steps:not(.finished) > summary { color: var(--brand); font-weight: 600; }
.hermes-steps-list { max-height: 7.8em; margin: 0; padding: 0 9px 6px 26px; overflow-y: auto; }
.hermes-steps-list .hermes-tool { padding: 1px 0; }
.hermes-steps-list .hermes-shot img { max-height: 90px; }
/* Answers: Markdown from view-render.js. */
.hermes-answer > :first-child { margin-top: 0; }
.hermes-answer > :last-child { margin-bottom: 0; }
.hermes-answer p { margin: 0 0 7px; }
.hermes-answer h2, .hermes-answer h3, .hermes-answer h4, .hermes-answer h5, .hermes-answer h6 { margin: 10px 0 5px; font-size: 13.5px; color: var(--tm-navy, var(--ink)); }
.hermes-answer h2 { font-size: 14.5px; }
.hermes-answer ul, .hermes-answer ol { margin: 0 0 7px; padding-left: 20px; }
.hermes-answer ul { list-style: disc; }
.hermes-answer li + li { margin-top: 2px; }
.hermes-answer li.nested { margin-left: 16px; }
.hermes-answer strong { color: var(--tm-navy, var(--ink)); }
.hermes-answer a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.hermes-answer code { padding: 1px 4px; border-radius: 4px; background: #eef2f8; font-size: 12px; }
.hermes-answer pre { margin: 0 0 7px; padding: 8px 10px; overflow-x: auto; border-radius: 7px; background: #0f1b2d; color: #e6edf7; font-size: 12px; white-space: pre; }
.hermes-answer blockquote { margin: 0 0 7px; padding: 4px 10px; border-left: 3px solid var(--brand); background: var(--brand-soft); color: var(--ink); }
.hermes-answer hr { margin: 9px 0; border: 0; border-top: 1px solid var(--line); }
.hermes-answer .view-table-wrap { margin: 0 0 7px; overflow-x: auto; }
.hermes-answer table { border-collapse: collapse; font-size: 12px; }
.hermes-answer th, .hermes-answer td { padding: 4px 7px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.hermes-answer th { background: #eef2f8; }
/* Input box: drag its corner to resize (height remembered per browser). */
.hermes-composer textarea { resize: vertical; min-height: 44px; max-height: 45vh; }
.hermes-steps-list .hermes-thought { padding: 1px 0; list-style: none; margin-left: -14px; color: var(--muted); font-style: italic; }
.hermes-actions { display: flex; gap: 4px; margin-top: 4px; }
.hermes-actions button { min-height: 24px; padding: 1px 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.hermes-actions button:hover { border-color: var(--line); background: var(--surface); }
.hermes-actions .hermes-rate[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.hermes-quick { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.hermes-quick button { min-height: 26px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--brand); font-size: 11px; cursor: pointer; }
.hermes-quick button:hover { border-color: var(--brand); background: var(--brand-soft); }
.hermes-attachments { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.hermes-attachments[hidden] { display: none; }
.hermes-thumb { position: relative; display: inline-block; }
.hermes-thumb img { display: block; width: 52px; height: 52px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.hermes-thumb button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; min-height: 18px; padding: 0; border: 0; border-radius: 50%; background: #333; color: #fff; font-size: 11px; line-height: 18px; cursor: pointer; }
.hermes-attach-note { flex-basis: 100%; color: var(--muted); font-size: 10.5px; }
.hermes-attach, .hermes-remember { min-width: 32px; }
.hermes-composer.dropping { outline: 2px dashed var(--brand); outline-offset: -4px; }
.hermes-msg-images { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.hermes-msg-images img { max-width: 120px; max-height: 90px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .5); }
.hermes-handoff { margin-top: 4px; min-height: 26px; padding: 2px 10px; border: 1px solid #f0b36d; border-radius: 999px; background: #fff7ed; color: #b45309; font-size: 11px; cursor: pointer; }
.hermes-memory { display: grid; gap: 6px; margin-top: 6px; padding: 8px; border: 1px solid #b9c4f5; border-radius: 8px; background: var(--brand-soft); white-space: normal; }
.hermes-memory-note { margin: 0; color: var(--muted); font-size: 11px; }
.hermes-memory-lines { width: 100%; box-sizing: border-box; min-height: 52px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12.5px; resize: vertical; }
.hermes-memory-lines:read-only { background: var(--surface); opacity: .85; }
.hermes-memory-status { margin: 0; font-size: 12px; }
.hermes-memory-status:empty { display: none; }
.hermes-memory[data-status="APPLIED"] .hermes-memory-status { color: #15803d; }
.hermes-memory[data-status="FULL"] .hermes-memory-status, .hermes-memory[data-status="FAILED"] .hermes-memory-status,
.hermes-memory[data-status="PARTIAL"] .hermes-memory-status, .hermes-memory[data-status="UNKNOWN"] .hermes-memory-status { color: #b45309; }
.hermes-memory-replace { display: grid; gap: 6px; }
.hermes-memory-replace p { margin: 0; font-size: 12px; font-weight: 700; }
.hermes-memory-choice { display: grid; gap: 3px; font-size: 12px; }
.hermes-memory-choice select { max-width: 100%; font-size: 12px; }
.hermes-memory-check { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hermes-memory-check button { flex: none; min-height: 26px; padding: 2px 10px; font-size: 11.5px; }
.hermes-memory[data-status="UNEXPECTED"] .hermes-memory-status, .hermes-memory[data-status="STAGED"] .hermes-memory-status { color: #b45309; }
