.hermes-widget {
  --hermes-orange: #ef7f01; /* Bruckner-Markenfarbe: --primary in src/index.css */
  --hermes-ink: #262626;
  --hermes-muted: #72777f;
  --hermes-line: #e5e7eb;
  color: var(--hermes-ink);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2147483000;
}

.hermes-widget *,
.hermes-widget *::before,
.hermes-widget *::after { box-sizing: border-box; }

.hermes-sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.hermes-widget button,
.hermes-widget input,
.hermes-widget textarea { font: inherit; }
.hermes-widget button { cursor: pointer; }

.hermes-widget button:focus-visible,
.hermes-widget input:focus-visible,
.hermes-widget textarea:focus-visible,
.hermes-widget a:focus-visible,
.hermes-widget summary:focus-visible,
.hermes-file-label:focus-within {
  outline: 3px solid #f6b84f;
  outline-offset: 2px;
}

.hermes-launcher {
  align-items: center;
  background: var(--hermes-orange);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgb(38 38 38 / 24%);
  color: #262626;
  display: flex;
  font-size: 0 !important;
  height: 58px;
  justify-content: center;
  padding: 0;
  position: relative;
  transition: transform 140ms ease, box-shadow 140ms ease;
  width: 58px;
}

.hermes-launcher::before {
  content: "";
  width: 23px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 7px;
  position: absolute;
}
.hermes-launcher::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  transform: skew(-25deg) rotate(-35deg);
  left: calc(50% - 10px);
  bottom: 17px;
  background: var(--hermes-orange);
}
.hermes-launcher[aria-expanded="true"]::before,
.hermes-launcher[aria-expanded="true"]::after {
  background: currentColor;
  border: 0;
  border-radius: 2px;
  bottom: auto;
  height: 2px;
  left: 50%;
  top: 50%;
  width: 24px;
}
.hermes-launcher[aria-expanded="true"]::before { transform: translate(-50%, -50%) rotate(45deg); }
.hermes-launcher[aria-expanded="true"]::after { transform: translate(-50%, -50%) rotate(-45deg); }
.hermes-launcher:hover { box-shadow: 0 6px 20px rgb(38 38 38 / 30%); transform: translateY(-2px); }
.hermes-unread-badge { align-items: center; background: #c92d23; border: 2px solid #fff; border-radius: 999px; color: #fff; display: flex; font-size: 10px; font-weight: 700; height: 20px; justify-content: center; min-width: 20px; padding: 0 4px; position: absolute; right: -4px; top: -4px; }
.hermes-greeting { align-items: center; background: #fff; border: 1px solid #eceef0; border-radius: 12px; bottom: 72px; box-shadow: 0 6px 20px rgb(22 28 35 / 16%); display: flex; gap: 5px; max-width: min(360px, calc(100vw - 24px)); padding: 8px 8px 8px 10px; position: absolute; right: 0; width: max-content; }
.hermes-greeting[hidden] { display: none; }
.hermes-greeting-open { align-items: center; background: transparent; border: 0; color: #31363c; cursor: pointer; display: flex; flex: 1 1 auto; gap: 10px; min-width: 0; padding: 1px 0; text-align: left; }
.hermes-greeting-avatar { align-items: center; background: #fff3da; border: 1px solid #f5d99e; border-radius: 50%; color: #72500f; display: flex; flex: 0 0 38px; font-size: 15px; font-weight: 700; height: 38px; justify-content: center; overflow: hidden; width: 38px; }
.hermes-greeting-avatar img { height: 100%; object-fit: contain; width: 100%; }
.hermes-greeting-copy { display: grid; gap: 2px; min-width: 0; }
.hermes-greeting-title { -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: #30363c; display: -webkit-box; font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; }
.hermes-greeting-subtitle { color: #767d84; font-size: 11px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hermes-greeting-close { align-items: center; background: transparent; border: 0; border-radius: 50%; color: #777d84; display: flex; flex: 0 0 26px; font-size: 19px !important; height: 26px; justify-content: center; line-height: 1; padding: 0; width: 26px; }

.hermes-panel {
  background: #fff;
  border: 1px solid rgb(30 35 40 / 8%);
  border-radius: 12px;
  bottom: 72px;
  box-shadow: 0 12px 36px rgb(22 28 35 / 19%);
  display: flex;
  flex-direction: column;
  height: min(600px, calc(100dvh - 108px));
  max-height: calc(100vh - 108px);
  overflow: hidden;
  position: absolute;
  right: 0;
  width: min(370px, calc(100vw - 28px));
}
.hermes-panel[hidden] { display: none; }

.hermes-header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #f0f1f2;
  color: var(--hermes-ink);
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  min-height: 62px;
  padding: 10px 14px;
}
.hermes-heading { align-items: center; display: flex; gap: 10px; }
.hermes-avatar {
  align-items: center;
  background: #f1f2f3;
  border-radius: 50%;
  color: #61666d;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  overflow: hidden;
  width: 38px;
}
.hermes-avatar img { background: #fff; height: 100%; object-fit: contain; padding: 4px; width: 100%; }
.hermes-heading-copy { display: grid; gap: 1px; }
.hermes-heading strong { font-size: 15px; font-weight: 650; }
.hermes-heading-copy span { color: var(--hermes-muted); font-size: 12px; }
.hermes-close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: #62676d;
  display: flex;
  font-size: 26px !important;
  height: 38px;
  justify-content: center;
  line-height: 1;
  width: 38px;
}
.hermes-close:hover { background: #f3f4f5; }
.hermes-new-chat { background: transparent; border: 0; color: #707780; font-size: 12px !important; margin-left: auto; padding: 8px; }
.hermes-menu-button { background: transparent; border: 0; border-radius: 7px; color: #656b72; font-size: 24px !important; height: 36px; line-height: 1; padding: 0 8px; width: 36px; }
.hermes-menu-button:hover { background: #f4f5f6; }
.hermes-menu { background: #fff; border: 1px solid #e2e5e8; border-radius: 9px; box-shadow: 0 8px 24px rgb(22 28 35 / 16%); display: grid; gap: 2px; padding: 5px; position: absolute; right: 48px; top: 54px; width: 230px; z-index: 6; }
.hermes-menu[hidden] { display: none; }
.hermes-menu-item { background: transparent; border: 0; border-radius: 6px; color: #343a40; cursor: pointer; font-size: 12px !important; padding: 9px 10px; text-align: left; }
.hermes-menu-item:hover { background: #f4f5f6; }

.hermes-content { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.hermes-error {
  background: #fff5f3;
  border: 1px solid #f0c9c3;
  border-radius: 8px;
  color: #8a2d20;
  flex: 0 0 auto;
  font-size: 13px;
  margin: 8px 12px 0;
  padding: 7px 9px;
}
.hermes-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  padding: 14px 16px 10px;
  overscroll-behavior: contain;
}
.hermes-intro { color: #3e4349; margin: 0; }
.hermes-gate-note { color: var(--hermes-muted); font-size: 12px; margin: -5px 0 2px; }
.hermes-staging-notice {
  background: #fff8e8;
  border: 1px solid #f2dfb5;
  border-radius: 7px;
  color: #655329;
  flex: 0 0 auto;
  font-size: 11px;
  margin: 0;
  padding: 5px 7px;
}

.hermes-form { display: grid; gap: 10px; }
.hermes-field { display: grid; gap: 5px; }
.hermes-field > span { color: #3b4148; font-size: 13px; font-weight: 600; }
.hermes-field input,
.hermes-field textarea {
  background: #fff;
  border: 1px solid #d8dbe0;
  border-radius: 8px;
  color: var(--hermes-ink);
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}
.hermes-field textarea { min-height: 72px; resize: vertical; }
.hermes-field input::placeholder,
.hermes-field textarea::placeholder { color: #9298a0; }
.hermes-primary {
  background: var(--hermes-orange);
  border: 1px solid var(--hermes-orange);
  border-radius: 8px;
  color: #292929;
  font-weight: 650 !important;
  min-height: 42px;
  padding: 8px 13px;
  width: 100%;
}
.hermes-primary:hover { background: #f39808; }
.hermes-initial-choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 3px; }
.hermes-initial-choice { background: #fff; border: 1px solid #d8dbe0; border-radius: 999px; color: #343a40; cursor: pointer; font-size: 12px; font-weight: 600; line-height: 1.3; min-height: 34px; padding: 7px 10px; text-align: left; }
.hermes-initial-choice:hover { background: #fff8eb; border-color: #efc06b; }
.hermes-initial-choice:focus-visible { outline: 2px solid #185a9d; outline-offset: 2px; }
.hermes-initial-choices-status { color: #62686f; display: block; font-size: 11px; min-height: 0; }
.hermes-initial-choices-status:empty { display: none; }
.hermes-primary:disabled,
.hermes-widget input:disabled,
.hermes-widget textarea:disabled,
.hermes-widget button:disabled { cursor: wait; opacity: .65; }

.hermes-messages { display: flex; flex: 0 0 auto; flex-direction: column; gap: 9px; min-height: 0; }
.hermes-message {
  align-self: flex-start;
  background: #f1f2f3;
  border: 1px solid #eceef0;
  border-radius: 12px;
  max-width: 88%;
  overflow-wrap: anywhere;
  padding: 9px 11px;
}
.hermes-message-user { align-self: flex-end; background: var(--hermes-orange); border-color: #f5a01c; }
.hermes-message-label { color: #747980; display: block; font-size: 10px; font-weight: 600; margin-bottom: 2px; }
.hermes-message-user .hermes-message-label { color: #55401f; }
.hermes-message p { margin: 0; white-space: pre-wrap; }
.hermes-feedback { align-items: center; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.hermes-feedback-prompt,
.hermes-feedback-status { color: #626970; font-size: 11px; }
.hermes-feedback-button { background: #fff; border: 1px solid #d8dbe0; border-radius: 6px; color: #343a40; cursor: pointer; font-size: 11px !important; min-height: 28px; padding: 3px 8px; }
.hermes-feedback-button[aria-pressed="true"] { background: #eaf3ff; border-color: #9fc3ec; color: #174d80; }
.hermes-feedback-button:disabled { cursor: wait; opacity: .65; }
.hermes-answer-link { color: #185a9d; text-decoration: underline; }
.hermes-category-links { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 3px; }
.hermes-category-chip { background: #eaf3ff; border: 1px solid #c9def8; border-radius: 999px; color: #17528a; display: inline-flex; font-size: 12px; font-weight: 600; line-height: 1.3; padding: 6px 10px; text-decoration: none; }
.hermes-category-chip:hover { background: #dcecff; border-color: #abcdf4; text-decoration: none; }
.hermes-message-file { color: #666c73; display: block; font-size: 12px; margin-top: 5px; }
.hermes-product-context { color: #565d64; font-size: 12px; margin-top: 7px !important; }
.hermes-confirmation { background: #f0f8f1; border: 1px solid #cfe6d2; border-radius: 9px; color: #245b35; margin: 2px 0; padding: 9px 11px; }
.hermes-handoff-pending { background: #fff8e8; border: 1px solid #f2dfb5; border-radius: 9px; color: #655329; margin: 2px 0; padding: 9px 11px; }
.hermes-handoff-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.hermes-handoff-actions button { background: #fff; border: 1px solid #d8dbe0; border-radius: 8px; color: #343a40; font-size: 12px; font-weight: 600; min-height: 36px; padding: 7px 10px; }
.hermes-handoff-actions .hermes-handoff-accept { background: var(--hermes-orange); border-color: var(--hermes-orange); color: #292929; }
.hermes-handoff-actions button:hover { filter: brightness(.97); }
.hermes-contact-prompt { background: #fff8eb; border: 2px solid #e8a933; border-radius: 10px; color: #3d3528; display: grid; gap: 8px; margin: 10px 0; padding: 12px; }
.hermes-contact-prompt > p { font-size: 12px; margin: 0; }
.hermes-contact-form { align-items: end; display: flex; flex-wrap: wrap; gap: 8px; }
.hermes-contact-label { color: #343a40; display: grid; flex: 1 1 210px; font-size: 12px; font-weight: 700; gap: 5px; }
.hermes-contact-label input { border: 1px solid #aeb4bb; border-radius: 7px; box-sizing: border-box; font: inherit; font-size: 14px; min-height: 40px; padding: 8px 10px; width: 100%; }
.hermes-contact-prompt .hermes-primary { min-height: 40px; }
.hermes-contact-status { color: #245b35; font-size: 12px; margin: 0; }
.hermes-history-back { align-self: flex-start; background: transparent; border: 0; color: #545b63; cursor: pointer; font-size: 12px !important; padding: 2px 0; text-decoration: underline; }
.hermes-history-title { color: #30363c; font-size: 16px; margin: 0; }
.hermes-history-empty,
.hermes-history-loading { color: var(--hermes-muted); font-size: 13px; margin: 0; }
.hermes-history-list { display: grid; gap: 7px; }
.hermes-history-entry { background: #fff; border: 1px solid #e1e4e7; border-radius: 9px; color: #30363c; cursor: pointer; display: grid; gap: 3px; padding: 10px 11px; text-align: left; width: 100%; }
.hermes-history-entry:hover,
.hermes-history-entry[aria-current="true"] { background: #fff9ee; border-color: #f1c36e; }
.hermes-history-entry-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hermes-history-entry-meta { color: #737a82; font-size: 11px; }

.hermes-composer-slot { background: #fff; flex: 0 0 auto; padding: 8px 16px 11px; }
.hermes-live-status { background: #fff8eb; border: 1px solid #f1cf8e; border-radius: 8px; color: #60430f; font-size: 12px; margin: 0 0 8px; padding: 8px 10px; }
.hermes-live-status[hidden] { display: none; }
.hermes-message-staff { background: #f0f7ff; border-color: #d7e7f7; }
.hermes-message-system { background: #f5f5f5; border-color: #e3e5e7; color: #62686f; }
.hermes-compose { border-top: 1px solid var(--hermes-line); display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); padding-top: 9px; }
.hermes-compose-row { align-items: end; display: flex; gap: 9px; min-width: 0; }
.hermes-compose-row textarea {
  background: #fff;
  border: 0;
  color: var(--hermes-ink);
  flex: 1 1 auto;
  max-height: 100px;
  min-height: 40px;
  outline: 0;
  padding: 8px 0;
  resize: none;
  width: 0;
}
.hermes-compose-row textarea:focus-visible { outline: 0; }
.hermes-compose-row textarea::placeholder { color: #8a9098; }
.hermes-file-label {
  align-items: center;
  color: #62686f;
  cursor: pointer;
  display: flex;
  flex: 0 0 36px;
  font-size: 21px;
  height: 38px;
  justify-content: center;
  width: 36px;
}
.hermes-file-label svg { display: block; flex: 0 0 auto; }
.hermes-file-input { clip: rect(0, 0, 0, 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.hermes-send {
  align-items: center;
  background: var(--hermes-orange);
  border: 0;
  border-radius: 50%;
  color: #262626;
  display: flex;
  flex: 0 0 36px;
  font-size: 21px !important;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 2px 2px;
  width: 36px;
}
.hermes-send:hover { background: #f39808; }
.hermes-attachments { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.hermes-attachment { align-items: center; background: #f4f5f6; border-radius: 6px; display: flex; font-size: 12px; gap: 8px; justify-content: space-between; min-width: 0; padding: 5px 7px; }
.hermes-attachment > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hermes-remove-file { background: none; border: 0; color: #7f3029; flex: 0 0 auto; font-size: 12px !important; padding: 4px; text-decoration: underline; }
.hermes-progress { color: var(--hermes-muted); font-size: 11px; min-height: 0; }
.hermes-progress:empty { display: none; }
.hermes-submit-details { border-top: 1px solid var(--hermes-line); padding-top: 9px; }
.hermes-submit-details summary { color: #50565d; cursor: pointer; font-size: 13px; font-weight: 600; }
.hermes-submit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
.hermes-submit-form .hermes-intro,
.hermes-submit-form .hermes-field-wide,
.hermes-submit-form .hermes-primary { grid-column: 1 / -1; }
.hermes-privacy { border-top: 1px solid #f0f1f2; color: var(--hermes-muted); flex: 0 0 auto; font-size: 11px; margin: 0; min-height: 32px; padding: 7px 16px; }
.hermes-privacy a { color: #5a6067; }

.hermes-discovery-context { margin: 5px 0 11px; min-width: 0; }
.hermes-discovery-title { color: #40464d; font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.hermes-product-rail { display: flex; gap: 9px; margin: 7px -2px 9px; overflow-x: auto; overscroll-behavior-x: contain; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.hermes-product-card { background: #fff; border: 1px solid #e5e7e9; border-radius: 10px; display: flex; flex: 0 0 174px; flex-direction: column; gap: 5px; min-width: 0; padding: 8px; scroll-snap-align: start; }
.hermes-product-image-link { align-items: center; background: #fafafa; border-radius: 7px; display: flex; height: 94px; justify-content: center; overflow: hidden; }
.hermes-product-image-link img { height: 100%; object-fit: contain; width: 100%; }
.hermes-product-name { color: #30363c; font-size: 12px; font-weight: 600; line-height: 1.35; text-decoration: none; }
.hermes-product-name:hover { text-decoration: underline; }
.hermes-product-number,
.hermes-product-reason { color: #747b82; font-size: 10px; line-height: 1.35; }
.hermes-product-price { color: #1f2a37; font-size: 13px; font-weight: 600; }
.hermes-product-delivery { color: #4b5563; font-size: 11px; }
.hermes-product-cta { background: #fff8eb; border: 1px solid #f1cf8e; border-radius: 7px; color: #6e4b11; font-size: 11px; font-weight: 600; margin-top: 2px; padding: 6px 7px; text-align: center; text-decoration: none; }
.hermes-cart-form { margin: 4px 0 0; }
.hermes-product-cart { background: #1f3a5f; border: 1px solid #1f3a5f; border-radius: 7px; color: #fff; cursor: pointer; font-size: 11px; font-weight: 600; padding: 6px 7px; width: 100%; }
.hermes-product-cart:hover, .hermes-product-cart:focus-visible { background: #16304f; }
.hermes-product-note { color: #777e85; font-size: 10px; line-height: 1.35; margin: 0; }
.hermes-quick-action { background: #fff8eb; border: 1px solid #f1cf8e; border-radius: 8px; color: #60430f; cursor: pointer; font-size: 12px !important; font-weight: 600; padding: 8px 10px; }
.hermes-quick-status { color: #687078; display: inline-block; font-size: 11px; margin-left: 8px; }
.hermes-message .hermes-product-rail { margin-top: 10px; }

@media (max-width: 480px) {
  .hermes-widget { bottom: max(10px, env(safe-area-inset-bottom)); right: max(10px, env(safe-area-inset-right)); }
  .hermes-panel {
    bottom: calc(66px + var(--hermes-kb, 0px));
    height: min(640px, calc(var(--hermes-vvh, 100dvh) - 90px));
    max-height: calc(var(--hermes-vvh, 100vh) - 90px);
    width: calc(100vw - 32px);
  }
  /* Keyboard open: pin the panel to the visible area, independent of the widget's own offset/safe area. */
  .hermes-widget.hermes-kb-open .hermes-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    top: auto;
    width: auto;
    bottom: calc(var(--hermes-kb) + 8px);
    height: calc(var(--hermes-vvh) - 16px);
    max-height: calc(var(--hermes-vvh) - 16px);
  }
  .hermes-widget.hermes-kb-open .hermes-launcher,
  .hermes-widget.hermes-kb-open .hermes-greeting { pointer-events: none; visibility: hidden; }
  .hermes-body { padding: 12px 13px 8px; }
  .hermes-composer-slot { padding: 7px 13px 10px; }
  .hermes-header { gap: 2px; padding-left: 11px; padding-right: 8px; }
  .hermes-heading { gap: 7px; min-width: 0; }
  .hermes-heading-copy span { font-size: 11px; }
  .hermes-new-chat { padding: 7px 5px; }
  .hermes-menu { right: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .hermes-launcher { transition: none; }
  .hermes-history-list,
  .hermes-greeting { scroll-behavior: auto; }
}
.hermes-restore-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Bruckner Stapler: Position oberhalb des WhatsApp-Buttons (src/components/FloatingActions.tsx, 60 px bei 30 px Abstand).
   Rein positionsbezogen; kann entfallen, falls der WhatsApp-Button entfernt wird. */
.hermes-widget { right: max(30px, env(safe-area-inset-right)); bottom: max(104px, env(safe-area-inset-bottom)); }
.hermes-panel { height: min(600px, calc(100dvh - 184px)); max-height: calc(100vh - 184px); }
@media (max-width: 768px) {
  .hermes-widget { right: max(20px, env(safe-area-inset-right)); bottom: max(82px, env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .hermes-panel { height: min(640px, calc(var(--hermes-vvh, 100dvh) - 168px)); max-height: calc(var(--hermes-vvh, 100vh) - 168px); }
  .hermes-widget.hermes-kb-open .hermes-panel { height: calc(var(--hermes-vvh) - 16px); max-height: calc(var(--hermes-vvh) - 16px); }
}

/* Bruckner Stapler: Die Website setzt global section { padding: 40px 0 }; das Panel ist ein <section> (leerer Streifen oben und unten). */
.hermes-widget .hermes-panel { padding: 0; }
