/* Hermes chat panel — reading-first typography and a chat-service layout. */
.hc { --hc-font: 15px; --hc-lh: 1.72; font-family: var(--font);
  letter-spacing: -0.005em; background: var(--bg); }
.hc-head { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 12px; border-bottom: 1px solid var(--line); flex: none; }
.hc-sess { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: transparent; color: var(--fg); font-weight: 600; font-size: 14px;
  padding: 6px 8px; border-radius: 8px; text-align: left; }
.hc-sess:hover { background: var(--bg3); } .hc-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hc-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--acc); background: var(--acc-bg);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.hc-drawer { border-bottom: 1px solid var(--line); max-height: 50%; overflow: auto; flex: none; background: var(--bg2); }
.hc-dhead { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; font-size: 13px; position: sticky; top: 0; background: var(--bg2); }
.hc-list { list-style: none; margin: 0; padding: 0 0 8px; } .hc-list li { display: flex; align-items: center; } .hc-list li.on { background: var(--sel); }
.hc-list a { flex: 1; min-width: 0; padding: 7px 14px; color: var(--fg); text-decoration: none; } .hc-list a:hover { background: var(--bg3); }
.hc-list .t { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hc-list .s { font-size: 12px; color: var(--mut); }
.hc-list .x { visibility: hidden; } .hc-list li:hover .x { visibility: visible; }

.hc-log { flex: 1; overflow-y: auto; min-height: 0; padding: 18px 0 24px; }
.hc-log > * { max-width: 820px; margin-left: auto; margin-right: auto; padding-left: 18px; padding-right: 18px; }
.hc-empty { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; padding-top: 12vh !important; color: var(--mut); font-size: 14px; }
.hc-empty b { font-size: 20px; color: var(--fg); }

.hm { margin-bottom: 22px; font-size: var(--hc-font); line-height: var(--hc-lh); position: relative; }
.hm-user { display: flex; flex-direction: column; align-items: flex-end; }
.hm-bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px 18px 4px 18px; background: var(--bg3); white-space: pre-wrap; overflow-wrap: anywhere; }
.hm-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; } .hm-meta .mut { font-size: 12px; }
.hm-av { width: 22px; height: 22px; border-radius: 6px; background: var(--acc); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.hm-body { overflow-wrap: anywhere; }
.hm-act { display: flex; gap: 2px; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.hm:hover .hm-act, .hm-act:focus-within { opacity: 1; }
.hm-act button { background: transparent; color: var(--mut); font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 6px; }
.hm-act button:hover { background: var(--bg3); color: var(--fg); }
.hm-flag { font-size: 12px; color: var(--mut); margin-top: 4px; } .hm-flag.err { color: var(--no); }
.hm-edit { margin-bottom: 22px; } .hm-edit textarea { font-size: var(--hc-font); line-height: var(--hc-lh); border-radius: 12px; padding: 10px 12px; min-height: 80px; }
.hm-edit-b { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* markdown */
.md > div > :first-child { margin-top: 0; } .md p { margin: .55em 0; } .md ul, .md ol { padding-left: 1.4em; margin: .5em 0; } .md li { margin: .2em 0; }
.md h1, .md h2, .md h3, .md h4 { line-height: 1.35; margin: 1.1em 0 .45em; } .md h1 { font-size: 1.35em; } .md h2 { font-size: 1.2em; } .md h3 { font-size: 1.08em; }
.md blockquote { margin: .7em 0; padding: .2em 1em; border-left: 3px solid var(--acc); color: var(--mut); background: var(--bg2); border-radius: 0 8px 8px 0; }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "D2Coding", monospace; font-size: .88em; background: var(--bg3); padding: .1em .35em; border-radius: 5px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; } .md a { text-decoration: underline; text-underline-offset: 2px; }
.md-table { overflow-x: auto; margin: .7em 0; border: 1px solid var(--line); border-radius: 10px; }
.md table { border-collapse: collapse; width: 100%; font-size: .93em; } .md th, .md td { padding: 7px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { background: var(--bg2); font-weight: 600; } .md tr:last-child td { border-bottom: 0; }
.code-wrap { margin: .8em 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg2); }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; font-size: 12px; color: var(--mut); border-bottom: 1px solid var(--line); }
.code-bar button { background: transparent; color: var(--mut); font-size: 12px; padding: 2px 6px; } .code-bar button:hover { color: var(--fg); }
.md pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.55; }
.md pre code { background: transparent; padding: 0; font-size: inherit; } .md pre code.hljs { background: transparent; padding: 0; }
.hm-body.cursor > div > :last-child::after { content: "▍"; color: var(--acc); animation: blink 1s steps(2) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

/* next steps checklist */
.steps-list { list-style: none; padding-left: 0 !important; } .steps-list > li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; margin: 5px 0;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; } .steps-list > li:hover { border-color: var(--acc); }
.steps-list > li:has(input:checked) { border-color: var(--acc); background: var(--acc-bg); } .steps-list input { margin-top: .4em; flex: none; width: 16px; height: 16px; }
.steps-go { margin: 4px 0 8px; padding: 7px 14px; border-radius: 9px; } .steps-go:disabled { opacity: .45; cursor: default; }

/* tools / notes */
.hc-steps details { margin: 4px 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); font-size: 13px; }
.hc-steps summary { cursor: pointer; padding: 6px 12px; color: var(--mut); font-weight: 500; list-style: none; } .hc-steps summary::-webkit-details-marker { display: none; }
.hc-steps summary::before { content: "▸ "; } .hc-steps details[open] summary::before { content: "▾ "; }
.st { border-top: 1px solid var(--line); } .st-line { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer; } .st-line:hover { background: var(--bg3); }
.st-ic { width: 16px; text-align: center; color: var(--ok); } .st-error .st-ic { color: var(--no); } .st-stopped .st-ic { color: var(--mut); }
.st-arg { flex: 1; min-width: 0; color: var(--mut); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.st-dur { color: var(--mut); font-size: 11px; } .st-detail { padding: 2px 12px 10px 36px; } .st-k { font-size: 11px; color: var(--mut); margin: 6px 0 2px; }
.st-detail pre { margin: 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; font-size: 12px; max-height: 260px; overflow: auto; }
.st-note { padding: 6px 12px; color: var(--mut); font-style: italic; } .st-steer { padding: 6px 12px; color: var(--acc); }
.spin { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--acc); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* live status + approval */
.hm-working { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--acc); font-weight: 600; }
.hm-live .hm-act { display: none; }
.hm-approval { margin: 6px 0 10px; padding: 12px 14px; border: 1px solid var(--warn); border-radius: 12px; background: color-mix(in srgb, var(--warn) 10%, var(--bg)); }
.hm-approval .ap-h { font-weight: 700; margin-bottom: 4px; } .hm-approval .ap-d { font-size: 14px; margin-bottom: 6px; }
.hm-approval pre { margin: 0 0 8px; padding: 8px 10px; background: var(--bg); border-radius: 8px; font-size: 12px; white-space: pre-wrap; }
.ap-b { display: flex; gap: 6px; flex-wrap: wrap; } .hm-approval.sent .ap-b { opacity: .5; pointer-events: none; }
[data-atab="hermes"].busy::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--acc); animation: pulse 1.2s infinite; vertical-align: middle; }
@keyframes pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* composer */
.hc-composer { flex: none; padding: 8px 14px 14px; }
.hc-box { max-width: 820px; margin: 0 auto; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); box-shadow: 0 2px 10px rgba(0,0,0,.05); padding: 8px 10px 6px; transition: border-color .15s; }
.hc-box:focus-within { border-color: var(--acc); } .hc.busy .hc-box { border-color: color-mix(in srgb, var(--acc) 55%, var(--line)); }
.hc-ctx { font-size: 12px; color: var(--mut); padding: 0 4px 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hc-input { width: 100%; border: 0 !important; outline: none !important; background: transparent; resize: none; min-height: 26px; max-height: 40vh;
  font-size: var(--hc-font); line-height: 1.6; padding: 4px; font-family: inherit; }
.hc-bar { display: flex; align-items: center; gap: 8px; }
.hc-model { font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); color: var(--fg); max-width: 55%; }
.hc-hint { flex: 1; font-size: 11px; color: var(--mut); text-align: right; white-space: nowrap; overflow: hidden; }
.hc-send, .hc-stop { width: 34px; height: 34px; border-radius: 50%; padding: 0; font-size: 16px; display: inline-grid; place-items: center; flex: none; }
.hc-stop { background: var(--fg); color: var(--bg); }
.hc-ctx { display: flex; align-items: center; gap: 8px; } .hc-ctx-l { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hc.other-doc .hc-ctx-l { color: var(--warn); }
.hc-here { flex: none; background: var(--bg3); color: var(--fg); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.hc-here:hover { background: var(--acc); color: #fff; }
.hc-newmenu { position: absolute; right: 10px; top: 44px; z-index: 20; display: flex; flex-direction: column; min-width: 260px; padding: 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: fadein .15s ease; }
.hc-newmenu button { text-align: left; background: transparent; color: var(--fg); font-weight: 500; padding: 9px 10px; border-radius: 8px; font-size: 14px; }
.hc-newmenu button:hover { background: var(--bg3); } .hc-newmenu .mut { font-size: 12px; }
.hc { position: relative; }
.hc-scope { display: inline-flex; gap: 4px; } .hc-scope a { padding: 2px 10px; border-radius: 999px; background: var(--bg3); color: var(--fg); font-size: 12px; text-decoration: none; }
.hc-scope a.on { background: var(--acc); color: #fff; }
.hc.general .hc-ctx-l { color: var(--acc); }

/* context meter in the composer bar */
.hc-ctxm { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px var(--mono); color: var(--mut); white-space: nowrap; cursor: help; }
.hc-ctxm i { position: relative; width: 54px; height: 6px; border-radius: 3px; background: var(--bg3); overflow: hidden; display: inline-block; }
.hc-ctxm b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok); border-radius: 3px; transition: width .3s ease; }
.hc-ctxm u { position: absolute; top: -1px; bottom: -1px; width: 2px; background: var(--fg); opacity: .45; }
.hc-ctxm.warn { color: var(--warn); } .hc-ctxm.warn b { background: var(--warn); }
.hc-ctxm.err { color: var(--no); } .hc-ctxm.err b { background: var(--no); }
