@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-VariableFont_wght.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Serif Display";
  src: url("fonts/DMSerifDisplay-Italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f2eee5;
  --paper-light: #fbf8f1;
  --ink: #26242a;
  --anthracite: #3f3d42;
  --text: #47434a;
  --muted: #6f6a70;
  --orange: #ff8c00;
  --orange-deep: #a65300;
  --line: #cdc6ba;
  --line-soft: #e0d9cd;
  --focus: #a65300;
  --hm-size: 1.125rem;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
}
a { color: var(--orange-deep); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Demo-Seite */
.demo-head { padding: 24px 16px; max-width: 900px; margin: 0 auto; }
.demo-main { padding: 0 16px 160px; max-width: 900px; margin: 0 auto; }
.demo-kicker { color: var(--orange-deep); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .9rem; }
.demo-main h1 { font-family: "DM Serif Display", Georgia, serif; font-style: italic; font-weight: 400; color: var(--ink); font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; margin: .2em 0 .5em; }

/* Launcher */
.hm-chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 12px 22px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: #fff;
  font: 700 1.0625rem/1.2 "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer; box-shadow: 0 6px 20px rgba(38, 36, 42, .25);
}
.hm-chat-launcher:hover { background: var(--anthracite); }
.hm-launcher-icon {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--orange); color: var(--ink); font-weight: 800;
}

/* Fenster */
.hm-chat {
  position: fixed; right: 20px; bottom: 92px; z-index: 60;
  width: min(440px, calc(100vw - 40px)); max-height: min(720px, calc(100vh - 120px));
  display: flex; flex-direction: column;
  background: var(--paper-light); color: var(--text);
  border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(38, 36, 42, .28);
  font-size: var(--hm-size); line-height: 1.55;
}
.hm-chat[hidden] { display: none; }
.hm-chat.hm-gross { --hm-size: 1.3125rem; }

.hm-chat-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; background: var(--ink); color: #fff; border-radius: 12px 12px 0 0;
}
.hm-chat-head h2 { margin: 0; font-size: 1.05em; line-height: 1.3; }
.hm-badge-ki {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--orange); color: var(--ink); font-size: .75em; font-weight: 800; vertical-align: middle;
}
.hm-head-actions { display: flex; gap: 6px; }
.hm-icon-btn {
  min-height: 44px; padding: 6px 12px; border-radius: 8px;
  border: 2px solid #fff; background: transparent; color: #fff;
  font: 600 .85em/1.2 inherit; font-family: inherit; cursor: pointer;
}
.hm-icon-btn[aria-pressed="true"] { background: #fff; color: var(--ink); }
.hm-chat-head :focus-visible { outline-color: var(--orange); }

.hm-notice { margin: 0; padding: 10px 14px; font-size: .85em; color: var(--anthracite); background: var(--paper); border-bottom: 1px solid var(--line); }

.hm-log { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 160px; }
.hm-msg { max-width: 92%; padding: 10px 14px; border-radius: 12px; }
.hm-msg p { margin: 0; }
.hm-msg-bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.hm-msg-user { align-self: flex-end; background: var(--ink); color: #fff; }
.hm-msg-status { align-self: center; color: var(--muted); font-style: italic; background: none; padding: 0; }
.hm-source { margin-top: 8px !important; font-size: .85em; color: var(--anthracite); }
.hm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hm-actions a {
  display: inline-block; min-height: 44px; padding: 9px 14px; border-radius: 8px;
  background: var(--orange-deep); color: #fff; font-weight: 700; text-decoration: none; font-size: .9em;
}
.hm-actions a.hm-sekundaer { background: transparent; color: var(--orange-deep); border: 2px solid var(--orange-deep); }

.hm-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 10px; }
.hm-chip {
  min-height: 44px; padding: 8px 12px; border-radius: 999px;
  border: 2px solid var(--anthracite); background: #fff; color: var(--ink);
  font: 600 .85em/1.2 inherit; font-family: inherit; cursor: pointer;
}
.hm-chip:hover { background: var(--paper); }

.hm-form { padding: 10px 14px 4px; border-top: 1px solid var(--line); }
.hm-form label { display: block; font-weight: 700; color: var(--ink); font-size: .9em; margin-bottom: 4px; }
.hm-form-row { display: flex; gap: 8px; align-items: stretch; }
.hm-form textarea {
  flex: 1; min-height: 56px; resize: vertical; padding: 10px 12px;
  border: 2px solid var(--anthracite); border-radius: 8px; background: #fff; color: var(--ink);
  font: inherit;
}
.hm-send {
  min-width: 96px; min-height: 56px; padding: 0 16px; border: 0; border-radius: 8px;
  background: var(--orange-deep); color: #fff; font: 700 1em/1 inherit; font-family: inherit; cursor: pointer;
}
.hm-send[disabled] { opacity: .6; cursor: wait; }
.hm-counter { margin: 4px 0 0; font-size: .8em; color: var(--muted); }
.hm-counter.hm-warn { color: var(--orange-deep); font-weight: 700; }
.hm-tech { margin: 0; padding: 6px 14px 12px; font-size: .8em; color: var(--muted); }

.hm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 560px) {
  .hm-chat { inset: 0; width: 100%; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .hm-chat-head { border-radius: 0; }
  .hm-chat-launcher { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media (forced-colors: active) { .hm-msg, .hm-chip, .hm-send, .hm-actions a { border: 1px solid CanvasText; } }
