.hermes-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #4b8ada;
  border-radius: 7px;
  background: linear-gradient(#245ba3, #193d72);
  color: #f4f8ff;
  font-weight: 680;
  white-space: nowrap;
}
.hermes-button:hover:not(:disabled) { background: #275ba1; border-color: #83b4f5; }
.hermes-button .icon { width: 16px; height: 16px; }

.hermes-panel {
  --chat-width: 880px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.hermes-header, .hermes-form { padding-inline: max(16px, calc((100% - var(--chat-width)) / 2)); }
.hermes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-block: 14px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--line);
}
.hermes-header h2 { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.7rem); letter-spacing: -.02em; }
.hermes-header p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.hermes-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  padding: 18px max(12px, calc((100% - var(--chat-width)) / 2));
}
.hermes-welcome { max-width: 650px; margin: clamp(12px, 6vh, 54px) auto 0; }
.hermes-welcome .metric-icon { color: var(--accent); background: #17323a; border-color: #315557; }
.hermes-welcome h3 { margin: 12px 0 6px; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.025em; }
.hermes-welcome p { margin: 0 0 17px; color: var(--muted); line-height: 1.55; }
.hermes-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.hermes-suggestions button {
  text-align: start;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #354e66;
  border-radius: 7px;
  background: var(--panel);
}
.hermes-suggestions button:hover { border-color: var(--accent); }
.hermes-messages { display: flex; flex-direction: column; gap: 16px; }
.hermes-message {
  min-width: 0;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.hermes-message--user { align-self: flex-end; max-width: 88%; background: #172d49; border-color: #35577b; }
.hermes-message-label { display: block; margin-bottom: 8px; font-size: .8rem; color: #a8c7ef; }
.hermes-message--user p { margin: 0; white-space: pre-wrap; }
.hermes-message--user p, .hermes-reply { overflow-wrap: anywhere; line-height: 1.65; }
.hermes-reply > * { margin: 0; }
.hermes-reply > * + * { margin-block-start: .7em; }
.hermes-reply h3 { font-size: 1.24em; line-height: 1.3; letter-spacing: -.015em; }
.hermes-reply h4 { font-size: 1.06em; line-height: 1.4; color: #aee9da; }
.hermes-reply > :is(h3,h4):not(:first-child) { margin-block-start: 1.25em; }
.hermes-reply strong { color: #f3f8ff; }
.hermes-reply :is(ul, ol) { padding-inline-start: 1.5em; }
.hermes-reply ul { list-style: disc; }
.hermes-reply ol { list-style: decimal; }
.hermes-reply li + li { margin-block-start: .35em; }
.hermes-message-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 12px; }
.hermes-download { background: var(--panel); font-size: .8rem; }
.hermes-message-actions [role="status"] { color: #ffadb6; font-size: .8rem; }
.hermes-status { margin: 12px 0 0; color: var(--muted); }
#hermes-elapsed { margin-inline-start: 5px; font-variant-numeric: tabular-nums; }
.hermes-status.is-error { color: #ffadb6; }
.hermes-form { flex: none; border-top: 1px solid var(--line); background: var(--panel-alt); padding-block: 10px 12px; }
.hermes-form label { display: block; margin-bottom: 8px; font-weight: 620; }
.hermes-form textarea {
  display: block;
  width: 100%;
  min-height: 70px;
  max-height: 25dvh;
  resize: vertical;
  padding: 9px 10px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid #38536f;
  border-radius: 7px;
  font: inherit;
}
.hermes-form textarea:focus-visible { outline-color: #70a9fa; }
.hermes-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.hermes-controls span { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.hermes-controls .hermes-button { min-width: 68px; }

@media (min-width: 621px) and (max-width: 760px) {
  .masthead { height: 80px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; padding-block: 5px; }
  .mast-title { grid-area: 1 / 1 / 2 / -1; }
  .brand-slot { grid-area: 2 / 1; width: 30px; height: 30px; }
  .mast-actions { grid-area: 2 / 2; }
}
@media (max-width: 620px) {
  .hermes-header { padding-block: 10px; }
  .mast-actions .hermes-button { min-height: 30px; padding: 0 8px; font-size: .8rem; }
  .hermes-form textarea { font-size: 16px; }
}
