/* ============================ HERMES ============================ */
.hermes { display: grid; gap: 14px; }
.hermes-shell { min-height: 640px; display: flex; flex-direction: column; position: relative; }
.hermes-drop { position: absolute; inset: 8px; z-index: 30; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center; pointer-events: none;
  border: 2.5px dashed color-mix(in srgb, var(--accent) 70%, var(--border)); border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel)); backdrop-filter: blur(2px); color: var(--text);
  animation: bIn .12s ease both; }
.hermes-drop.hidden { display: none; }
.hermes-drop .ico { color: var(--accent); }
.hermes-drop-h { font-size: 17px; font-weight: 650; }
.hermes-drop-sub { font-size: 13px; }
.hermes-tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.hermes-tabs button { border-color: var(--border); }
.hermes-tabs button.active { color: var(--accent-fg); background: var(--accent); border-color: transparent; }
.hermes-pane { display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0; }
.hermes-chat-top { align-items: center; gap: 10px; padding: 2px 0 4px; }
.grow { flex: 1; min-width: 0; }

/* layout sidebar + main */
.hermes-layout {
  flex-direction: row; gap: 0; align-items: stretch; position: relative;
  height: min(860px, calc(100dvh - 104px)); max-height: none;
  background: color-mix(in srgb, var(--bg) 62%, var(--panel));
}
.hermes-sidebar { width: 300px; flex: none; display: flex; flex-direction: column; gap: 11px;
  border-right: 1px solid var(--border); padding: 20px 18px; min-height: 0;
  background: var(--panel-2); }
.hermes-newchat { width: 100%; }
.hermes-side-label { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 3px 4px; font-weight: 600; }
.hermes-convs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 0; padding-right: 2px; }
.hermes-conv-empty { padding: 12px 6px; font-size: 13px; }
.hermes-conv {
  display: flex; align-items: center; gap: 6px; padding: 10px 11px; border-radius: 11px;
  cursor: pointer; border: 1px solid transparent; transition: background .16s, border-color .16s, transform .16s;
}
.hermes-conv:hover { background: var(--panel); transform: translateX(2px); }
.hermes-conv.active { background: var(--panel); border-color: color-mix(in srgb, var(--accent) 36%, var(--border)); box-shadow: inset 3px 0 0 var(--accent); }
.hermes-conv-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hermes-conv-meta { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hermes-conv-act {
  background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
  padding: 0; width: 28px; height: 28px; opacity: 0; flex: none; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; transition: opacity .16s, color .16s, background .16s, transform .16s;
}
.hermes-conv:hover .hermes-conv-act { opacity: 1; }
.hermes-conv-act:hover { color: var(--text); background: var(--bg); transform: translateY(-1px); }
.hermes-usage-mini { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--panel); cursor: pointer; display: grid; gap: 6px; transition: border-color .16s, transform .16s; }
.hermes-usage-mini:hover { border-color: var(--accent); transform: translateY(-1px); }
.hermes-usage-mini-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.hermes-usage-mini-row b, .hermes-usage-mini-row strong { font-family: var(--font-mono); color: var(--text); font-weight: 600; }
.hermes-ubar { display: grid; gap: 5px; margin: 8px 0; }
.hermes-ubar-top { display: flex; justify-content: space-between; font-size: 13px; }
.hermes-side-footer { display: flex; flex-direction: column; gap: 7px; border-top: 1px solid var(--border); padding-top: 12px; }
.hermes-side-footer button { width: 100%; text-align: left; }
.hermes-side-footer button.active { color: var(--accent); border-color: var(--accent); }
.hermes-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; overflow: hidden; }
.hermes-scroll { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.hermes-dash-frame { width: 100%; flex: 1; min-height: 500px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.hermes-layout .hermes-messages { max-height: none; }
.hermes-burger { display: none; }
.hermes-backdrop { display: none; }
.hermes-mobilebar { display: none; }

@media (max-width: 760px) {
  .hermes-layout { height: 82vh; max-height: 86vh; }
  .hermes-burger { display: inline-flex; }
  .hermes-sidebar { position: absolute; left: 0; top: 0; bottom: 0; z-index: 30; width: 86%; max-width: 320px;
    background: var(--panel); padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); margin: 0;
    border-right: 1px solid var(--border); border-radius: 0 16px 16px 0;
    transform: translateX(-103%); transition: transform .24s cubic-bezier(.22,.61,.36,1);
    box-shadow: 0 0 50px rgba(0,0,0,.55); }
  .hermes-sidebar.open { transform: translateX(0); }
  .hermes-backdrop { display: block; position: absolute; inset: 0; z-index: 20;
    background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .24s; }
  .hermes-backdrop.show { opacity: 1; pointer-events: auto; }
  .hermes-conv { padding: 11px 11px; }
  .hermes-conv-act { opacity: 1; }
  .hermes-main { width: 100%; gap: 10px; }
  .hermes-mobilebar { display: flex; align-items: center; gap: 7px; padding: 0 0 9px;
    border-bottom: 1px solid var(--border); flex-wrap: nowrap; }
  .hermes-mobilebar-title { font-size: 16px; font-weight: 650; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
  .hermes-mobilebar .hermes-model-btn { max-width: 128px; }
  .hermes-mobilebar .sm { padding: 7px 9px; }
  .hermes-chat-top { display: none; }
  .hermes-main .hermes-banner,
  .hermes-main .hermes-banner.ok,
  .hermes-main .hermes-banner.warn { display: none; }
  .hermes-messages { border: none; border-radius: 0; padding: 6px 2px 10px; gap: 20px;
    background: transparent; max-height: none; }
  .hermes-avatar { display: none; }
  .hermes-msg { max-width: 100%; gap: 0; }
  .hermes-msg .hermes-role { display: none; }
  .hermes-msg .hermes-meta { margin-bottom: 2px; }
  .hermes-msg.assistant { max-width: 100%; }
  .hermes-msg.assistant .hermes-bubble { border: none; background: transparent; padding: 0; box-shadow: none; }
  .hermes-msg.user { max-width: 86%; }
  .hermes-msg.user .hermes-bubble { border-radius: 18px 18px 5px 18px; padding: 10px 14px;
    background: color-mix(in srgb, var(--accent) 22%, var(--panel)); border-color: transparent; }
  .hermes-msg.user .hermes-meta { display: none; }
  .hermes-msg-foot { margin-top: 9px; }
  .hermes-input-wrap { padding-bottom: 2px; }
  .hermes-input { padding: 5px 6px 5px 6px; }
  .hermes-input textarea { padding: 9px 6px; }
  .hermes-send, .hermes-cmd, .hermes-mic { width: 40px; height: 40px; }
  .hermes-hint { display: none; }
  .hermes-fab { bottom: 16px; }
}
@media (max-width: 400px) {
  .hermes-mobilebar { gap: 6px; }
  .hermes-mobilebar .hermes-model-btn { max-width: 104px; }
}

/* status banner */
.hermes-banner { display: none; }
.hermes-banner.ok, .hermes-banner.warn {
  display: flex; align-items: center; gap: 9px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 11px; padding: 9px 13px; background: var(--panel-2);
}
.hermes-banner .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.hermes-banner.ok .dot { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.hermes-banner.warn { border-color: color-mix(in srgb, var(--yellow) 45%, var(--border)); }
.hermes-banner.warn .dot { background: var(--yellow); }

/* model popover */
.hermes-model-menu {
  position: fixed; z-index: 120; display: grid; gap: 4px; padding: 8px;
  max-height: min(420px, calc(100dvh - 32px)); overflow-y: auto;
  background: color-mix(in srgb, var(--panel) 94%, var(--bg)); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(16px);
  animation: hermesSlideUp .12s ease both;
}
.hermes-model-menu-label {
  padding: 4px 8px 3px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
}
.hermes-model-option {
  width: 100%; min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; text-align: left;
}
.hermes-model-option:hover,
.hermes-model-option.active { background: var(--panel-2); }
.hermes-model-option.active { color: var(--text); }
.hermes-model-option .ico { color: var(--accent); flex: none; }
.hermes-model-option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hermes-model-loading { padding: 8px 10px 6px; font-size: 12px; border-top: 1px solid var(--border); margin-top: 3px; }

/* onboarding card */
.hermes-onboard { display: flex; align-items: center; gap: 14px; padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-2)); }
.hermes-onboard-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); }

/* welcome / suggestions */
.hermes-welcome {
  margin: auto; width: min(760px, 100%); display: grid; gap: 14px; align-content: center;
  justify-items: center; text-align: center; padding: 32px 16px;
}
.hermes-welcome-h { display: flex; align-items: center; gap: 12px; }
.hermes-suggestions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chip { font-size: 12.5px; padding: 8px 13px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); cursor: pointer; transition: all .12s; }
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* messages */
.hermes-messages {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; flex: 1 1 auto;
  min-width: 0; min-height: 0; max-height: 52vh; overflow-y: auto; overflow-x: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent); border-radius: 20px; padding: 24px;
  background: color-mix(in srgb, var(--bg) 76%, var(--panel));
  scroll-behavior: smooth;
}
.hermes-empty { color: var(--muted); align-self: center; justify-self: center; }
.hermes-msg { display: flex; gap: 11px; max-width: min(860px, 88%); min-width: 0; animation: fadeStagger .35s both; }
.hermes-msg.user { flex-direction: row-reverse; justify-self: end; }
.hermes-msg.assistant { justify-self: start; }
.hermes-avatar { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; }
.hermes-avatar.assistant { background: var(--accent); color: var(--accent-fg); }
.hermes-avatar.user { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.hermes-bubble {
  border: 1px solid var(--border); border-radius: 16px; padding: 13px 15px;
  background: var(--panel); min-width: 0; max-width: 100%; overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.hermes-msg.user .hermes-bubble {
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  box-shadow: none;
}
.hermes-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 5px; }
.hermes-role { font-size: 10px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.hermes-time { font-size: 10px; color: var(--faint); opacity: .8; }
.hermes-text { line-height: 1.6; word-wrap: break-word; overflow-wrap: anywhere; }
.hermes-msg-foot { margin-top: 6px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.hermes-msg-foot .ico { opacity: .8; }

/* icons + icon buttons */
.ico { display: inline-flex; align-items: center; justify-content: center; }
.ico svg { display: block; }
button:has(> .ico), .chip:has(> .ico) { display: inline-flex; align-items: center; gap: 6px; }
.hermes-copy { opacity: 0; padding: 2px 5px !important; color: var(--muted); transition: opacity .12s, color .12s; }
.hermes-msg:hover .hermes-copy, .hermes-copy:focus { opacity: 1; }
.hermes-copy:hover { color: var(--text); }

/* streaming caret + message entrance */
.hermes-caret { display: inline-block; width: 7px; height: 1.05em; background: var(--accent); margin-left: 2px;
  vertical-align: text-bottom; border-radius: 1px; animation: hermesCaret 1.05s steps(1) infinite; }
@keyframes hermesCaret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.hermes-in { animation: hermesIn .22s cubic-bezier(.22,.61,.36,1) both; }
@keyframes hermesIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.hermes-pane:not(.hidden) { animation: bIn .2s ease both; }
.hermes-slash:not(.hidden) { animation: hermesSlideUp .14s ease both; }
@keyframes hermesSlideUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* scroll-to-bottom FAB */
.hermes-msgs-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.hermes-fab { position: absolute; right: 18px; bottom: 16px; width: 38px; height: 38px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; background: var(--panel);
  border: 1px solid var(--border); box-shadow: var(--shadow-soft); z-index: 3; }
.hermes-fab:hover { border-color: var(--accent); color: var(--accent); }

/* model button truncation */
.hermes-model-btn { max-width: 220px; font-family: var(--font-mono); font-size: 12px; }
.hermes-model-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .hermes-in, .hermes-pane:not(.hidden), .hermes-slash:not(.hidden) { animation: none; }
  .hermes-caret { animation: none; }
}
.hermes-text:not(.md) { white-space: pre-wrap; }

/* typing dots */
.hermes-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.hermes-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .5;
  animation: dotty 1.1s infinite both; }
.hermes-typing span:nth-child(2) { animation-delay: .15s; }
.hermes-typing span:nth-child(3) { animation-delay: .3s; }

/* live activity line */
.hermes-activity { display: flex; align-items: center; gap: 7px; margin: 2px 0 6px;
  min-width: 0; font-size: 12.5px; color: var(--muted); animation: bIn .2s ease both; }
.hermes-activity-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: statusPulse 1.3s infinite; }
.hermes-activity-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hermes-activity-txt.think { font-style: italic; opacity: .85; }
@media (prefers-reduced-motion: reduce) { .hermes-activity-dot { animation: none; } }

/* markdown */
.hermes-text.md { min-width: 0; max-width: 100%; line-height: 1.6; }
.hermes-text.md > :first-child { margin-top: 0; }
.hermes-text.md > :last-child { margin-bottom: 0; }
.md-p { margin: 8px 0; overflow-wrap: anywhere; }
.md-h { font-weight: 650; margin: 14px 0 6px; line-height: 1.3; }
.md-h.h1 { font-size: 17px; } .md-h.h2 { font-size: 15px; } .md-h.h3 { font-size: 13.5px; }
.md-h.h4 { font-size: 13px; color: var(--text); } .md-h.h5, .md-h.h6 { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.md-list { margin: 8px 0; padding-left: 22px; display: grid; gap: 4px; }
.md-list li { padding-left: 2px; }
.md-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.md-link:hover { color: var(--accent-2); }
.md-strike { text-decoration: line-through; opacity: .7; }
.md-hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.md-quote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent); color: var(--text); border-radius: 0 8px 8px 0; }
.md-code { font-family: var(--font-mono); font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.md-pre { background: var(--console-bg); border: 1px solid #1d2026; border-radius: 10px; padding: 10px 12px;
  overflow-x: auto; max-width: 100%; margin: 8px 0; }
.md-pre code { font-family: var(--font-mono); font-size: 12px; color: #d6dae3; white-space: pre; }

/* tablas GFM */
.md-table-wrap { max-width: 100%; overflow-x: auto; margin: 10px 0; border: 1px solid var(--border);
  border-radius: 10px; -webkit-overflow-scrolling: touch; }
.md-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.md-table th, .md-table td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; vertical-align: top; white-space: nowrap; }
.md-table thead th { background: var(--panel-2); font-weight: 650; color: var(--text); position: sticky; top: 0; }
.md-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel-2) 45%, transparent); }
.md-table .md-code { white-space: nowrap; }

/* tool runs */
.hermes-runs { display: grid; gap: 8px; }
.hermes-runs-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.hermes-run { display: grid; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--panel-2); }
.hermes-run.pending { border-color: color-mix(in srgb, var(--yellow) 50%, var(--border)); background: color-mix(in srgb, var(--yellow) 7%, var(--panel-2)); }
.hermes-run-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hermes-run-name { font-size: 12.5px; }
.hermes-run-out { font-size: 12px; }
.hermes-phrase { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hermes-confirm-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hermes-confirm-row input { flex: 1; min-width: 180px; }
.pill { font-family: var(--font-mono); font-size: 10.5px; padding: 3px 8px; border-radius: var(--radius-pill); border: 1px solid var(--border); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.pill.risk-read { color: var(--muted); }
.pill.risk-write { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.pill.risk-dest { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.pill.st-ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, var(--border)); }
.pill.st-err { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.pill.st-warn { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 50%, var(--border)); }
.pill.st-run { color: var(--accent); }
.pill.st-mut { color: var(--muted); }

/* tarjetas de acciones del bridge */
.hermes-action-intro {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; position: sticky; top: 0; z-index: 4;
  padding: 0 0 12px; background: color-mix(in srgb, var(--bg) 76%, var(--panel));
  backdrop-filter: blur(12px);
}
.hermes-action-intro-h { font-size: 18px; font-weight: 750; margin-bottom: 1px; }
.hermes-action-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 2px 9px; }
.hermes-action-empty { display: grid; gap: 6px; justify-items: center; text-align: center;
  padding: 30px 18px; border: 1px dashed var(--border); border-radius: 14px; background: var(--panel-2); }
.hermes-action-empty .ico { color: var(--muted); }
.hermes-action { display: grid; gap: 13px; border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; background: var(--panel-2); margin-bottom: 12px;
  box-shadow: var(--shadow-soft); }
.hermes-action.pending { border-color: color-mix(in srgb, var(--yellow) 30%, var(--border));
  background: color-mix(in srgb, var(--yellow) 3%, var(--panel-2)); box-shadow: inset 3px 0 0 var(--yellow), var(--shadow-soft); }
.hermes-action-top { display: flex; align-items: flex-start; gap: 12px; }
.hermes-action-icon { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted); }
.hermes-action-icon.risk-dest { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--border));
  background: color-mix(in srgb, var(--red) 9%, var(--panel)); }
.hermes-action-icon.risk-write { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.hermes-action-head { flex: 1; min-width: 0; }
.hermes-action-title { font-size: 16px; font-weight: 720; line-height: 1.25; }
.hermes-action-sub { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.hermes-action-pills { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; flex: none; }
.hermes-action-desc { font-size: 13px; line-height: 1.5; opacity: .92; }
.hermes-action-files { display: grid; gap: 6px; border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 12px; background: var(--bg); }
.hermes-action-files-h { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.hermes-action-file { display: flex; align-items: center; gap: 7px; font-size: 12.5px; min-width: 0; }
.hermes-action-file .ico { color: var(--muted); flex: none; }
.hermes-action-file .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hermes-action-confirm { display: grid; gap: 10px; border-top: 1px solid var(--border); padding-top: 13px; }
.hermes-action-confirm-lbl { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.hermes-action-confirm-lbl .ico { color: var(--yellow); flex: none; }
.hermes-phrase .md-code { flex: 1; min-width: 160px; white-space: normal; word-break: break-word; }
.hermes-confirm-row .primary { min-width: 156px; justify-content: center; }
.hermes-confirm-row .danger { min-width: 92px; justify-content: center; }
.hermes-action-out { font-size: 12.5px; padding: 9px 11px; border-radius: 9px; }
.hermes-action-out.ok { color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--panel)); }
.hermes-action-out.err { color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--panel)); }

/* provider config */
.hermes-status { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--panel-2); }
.hermes-status.ok { border-color: color-mix(in srgb, var(--green) 40%, var(--border)); }
.hermes-status.warn { border-color: color-mix(in srgb, var(--yellow) 45%, var(--border)); }
.hermes-status-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: var(--radius-pill); border: 1px solid var(--border); }
.hermes-status-mark.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, var(--border)); background: color-mix(in srgb, var(--green) 9%, var(--panel)); }
.hermes-status-mark.err { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); background: color-mix(in srgb, var(--red) 9%, var(--panel)); }
.hermes-provider-form { display: grid; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--panel-2); }
.hermes-form-title { font-size: 13px; font-weight: 600; }

/* slash command menu */
.hermes-input-wrap { position: relative; flex: none; }
.hermes-slash { position: absolute; bottom: 100%; left: 0; right: 0; margin-bottom: 8px; z-index: 5;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  max-height: 240px; overflow-y: auto; box-shadow: var(--shadow-pop); }
.hermes-slash-item { display: flex; align-items: baseline; gap: 10px; padding: 9px 13px; cursor: pointer; }
.hermes-slash-item:hover, .hermes-slash-item.active { background: var(--panel-2); }
.hermes-slash-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.hermes-slash-cmd { font-family: var(--font-mono); font-size: 13px; color: var(--accent); min-width: 96px; }

/* input — pill integrado */
.hermes-input { display: flex; flex-direction: column; gap: 2px;
  border: 1.5px solid var(--border); border-radius: 16px; background: var(--panel-2);
  padding: 6px 7px; transition: border-color .15s, box-shadow .15s; box-shadow: var(--shadow-soft); }
.hermes-input:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px var(--ring); }
.hermes-input-row { display: flex; align-items: flex-end; gap: 8px; }

/* menú del + */
.hermes-attach { position: relative; flex: none; align-self: flex-end; }
.hermes-attach-menu { position: absolute; bottom: calc(100% + 10px); left: -2px; z-index: 8; min-width: 210px;
  background: color-mix(in srgb, var(--panel) 94%, var(--bg)); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px; padding: 6px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 2px; animation: hermesSlideUp .12s ease both; }
.hermes-attach-menu .hermes-attach-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 13px; border: none; background: transparent; color: var(--text); border-radius: 11px;
  font-size: 14.5px; cursor: pointer; }
.hermes-attach-menu .hermes-attach-item:hover, .hermes-attach-menu .hermes-attach-item:active { background: var(--panel-2); }
.hermes-attach-menu .hermes-attach-item .ico { color: var(--muted); flex: none; }

/* preview de adjuntos en cola */
.hermes-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 4px 2px; }
.hermes-att { position: relative; }
.hermes-attachments .hermes-att.image img { width: 54px; height: 54px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--border); display: block; }
.hermes-attachments .hermes-att.doc { display: flex; align-items: center; gap: 7px; max-width: 200px;
  padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; }
.hermes-att .hermes-att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hermes-att-rm { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; padding: 0; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text); }
.hermes-att-rm:hover { border-color: var(--red); color: var(--red); }
.hermes-att.uploading { opacity: .55; pointer-events: none; }
.hermes-att.uploading::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  animation: hermesShimmer 1.2s infinite; }
@keyframes hermesShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* adjuntos dentro de un mensaje */
.hermes-att-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 8px; }
.hermes-att-list a { text-decoration: none; color: inherit; }
.hermes-att-list .hermes-att.image img { max-width: 240px; max-height: 240px; border-radius: 12px;
  border: 1px solid var(--border); display: block; }
.hermes-att-list .hermes-att.doc { display: inline-flex; align-items: center; gap: 7px; max-width: 240px;
  padding: 8px 11px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; font-size: 12.5px; }
.hermes-input textarea { flex: 1; min-width: 0; border: none !important; background: transparent !important;
  resize: none; min-height: 42px; max-height: 190px; line-height: 1.5; padding: 10px 6px; overflow-y: auto;
  outline: none !important; box-shadow: none !important; border-radius: 0; }
.hermes-input .hermes-cmd { flex: none; width: 42px; height: 42px; padding: 0; border: none; background: transparent;
  border-radius: 0; color: var(--muted); gap: 0; display: flex; align-items: center; justify-content: center;
  transition: color .15s; }
.hermes-input .hermes-cmd:hover { color: var(--text); background: transparent; }
.hermes-input .hermes-send { flex: none; width: 38px; height: 38px; padding: 0; border-radius: 11px; gap: 0;
  background: var(--accent); border-color: transparent; color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center; transition: background .15s, transform .15s, box-shadow .15s, filter .15s; }
.hermes-input .hermes-send:not(:disabled):hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 10px 24px var(--ring); }
.hermes-send:disabled { opacity: .5; }
.hermes-send.is-stop { background: var(--red); border-color: var(--red); color: #fff; animation: hermesSendBreathe 1.25s ease-in-out infinite; }
@keyframes hermesSendBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(.94); } }
.hermes-hint { font-size: 11px; text-align: right; margin-top: 4px; color: var(--faint); }

/* modo voz */
.hermes-input .hermes-mic { flex: none; width: 42px; height: 42px; padding: 0; border: none; background: transparent;
  border-radius: 50%; color: var(--muted); gap: 0; display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s; }
.hermes-input .hermes-mic:hover { color: var(--text); }
.hermes-input .hermes-voice-model { flex: none; align-self: flex-end; max-width: 160px; height: 34px; font-size: 12px;
  padding: 0 8px; border-radius: 9px; background: var(--panel); color: var(--text); border: 1px solid var(--border); cursor: pointer;
  font-family: var(--font-mono); }
.hermes-input .hermes-voice-model:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.hermes-input .hermes-mic.rec { color: #fff; background: var(--red); animation: hermesMicPulse 1.2s ease-in-out infinite; }
@keyframes hermesMicPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.hermes-voice-status { display: flex; align-items: center; gap: 8px; padding: 7px 12px; margin: 2px 2px 0;
  border-radius: 12px; font-size: 12.5px; color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border)); }
.hermes-voice-status.hidden { display: none; }
.hermes-voice-status .hermes-voice-label { flex: 1; min-width: 0; }
.hermes-voice-status .hermes-voice-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--accent);
  animation: hermesVoiceBlink 1s ease-in-out infinite; }
.hermes-voice-status.state-listening { background: color-mix(in srgb, var(--red) 12%, var(--panel)); border-color: color-mix(in srgb, var(--red) 30%, var(--border)); }
.hermes-voice-status.state-listening .hermes-voice-dot { background: var(--red); }
.hermes-voice-status.state-error { background: color-mix(in srgb, var(--red) 16%, var(--panel)); border-color: var(--red); }
.hermes-voice-status.state-error .hermes-voice-dot { background: var(--red); animation: none; }
.hermes-voice-status .hermes-voice-cancel { flex: none; width: 26px; height: 26px; padding: 0; border: none; background: transparent; color: var(--muted); border-radius: 50%; }
.hermes-voice-status .hermes-voice-cancel:hover { color: var(--text); background: var(--panel-2); }
@keyframes hermesVoiceBlink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* aprobación inline en el chat */
.hermes-pending { display: flex; flex-direction: column; gap: 8px; margin: 4px 2px 10px;
  flex: none; max-height: 40vh; overflow-y: auto; }
.hermes-pending.hidden { display: none; }
.hermes-pending-h { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text); }
.hermes-pending-card { border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border)); border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel)); padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; }
.hermes-pending-top { display: flex; align-items: center; gap: 10px; }
.hermes-pending-head { flex: 1; min-width: 0; }
.hermes-pending-title { font-weight: 600; font-size: 13.5px; }
.hermes-pending-where { font-size: 12px; }
.hermes-pending-desc { font-size: 12.5px; color: var(--muted); }
.hermes-pending-btns { display: flex; gap: 8px; }
.hermes-pending-btns button { flex: 1; justify-content: center; }

/* chip de descarga de PDF */
.hermes-file-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; margin: 3px 0;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); color: var(--text);
  text-decoration: none; font-size: 13px; font-weight: 500; transition: background .15s, border-color .15s; }
.hermes-file-chip:hover { background: var(--panel); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.hermes-file-chip .ico { color: var(--accent); flex: none; }

