/* Non-critical CSS — bisher nur Chat-Widget (Below-the-fold).
   Main-Site-Styles bleiben aktuell inline; nach Stabilitätstest kann hier
   weiter ausgelagert werden. */

/* === Chat-Widget === */
:root {
  --c-bg:       #0a0a0a;
  --c-surface:  #141414;
  --c-surface2: #1c1c1c;
  --c-border:   #2a2a2a;
  --c-accent:   #ffffff;
  --c-text:     #e8e8e8;
  --c-muted:    #666666;
  --c-user-bg:  #ffffff;
  --c-user-text:#0a0a0a;
  --radius:     12px;
  --font:       system-ui, -apple-system, "Segoe UI", sans-serif;
}

#one1-toggle {
  position: fixed; bottom: 32px; right: 32px; width: 44px; height: 44px;
  border-radius: 50%; background: #22C55E; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  transition: transform .2s ease, background .2s ease;
  box-shadow: 0 4px 20px rgba(34,197,94,.4);
}
#one1-toggle:hover { transform: scale(1.07); background: #16a34a; }
@media (max-width: 768px) {
  #one1-toggle { bottom: 20px; right: 20px; width: 50px; height: 50px; }
}
#one1-chat-root.chat-open #one1-toggle { display: none; }
#one1-toggle svg { display: block; }

#one1-badge {
  position: absolute; top: -3px; right: -3px; width: 11px; height: 11px;
  border-radius: 50%; background: #fff; border: 2px solid #0a0a0a; display: none;
}
#one1-badge.visible { display: block; }

#one1-window {
  position: fixed; bottom: 88px; right: 24px; width: 360px; height: 520px;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: var(--radius); display: flex; flex-direction: column;
  z-index: 9998; overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,.7);
  transform: translateY(16px) scale(.97); opacity: 0; pointer-events: none;
  transition: transform .22s cubic-bezier(.4,0,.2,1), opacity .22s ease;
  font-family: var(--font);
}
#one1-window.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }

#one1-header {
  display: flex; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--c-border); gap: 10px; flex-shrink: 0;
}
#one1-header-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--c-surface2);
  border: 1px solid var(--c-border); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
#one1-header-info { flex: 1; min-width: 0; }
#one1-header-title {
  font-size: 13px; font-weight: 600; color: var(--c-accent);
  letter-spacing: .04em; text-transform: uppercase;
}
#one1-header-sub { font-size: 11px; color: var(--c-muted); margin-top: 1px; }
#one1-close {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--c-muted); display: flex; align-items: center; border-radius: 6px;
  transition: color .15s, background .15s;
}
#one1-close:hover { color: var(--c-text); background: var(--c-surface2); }

#one1-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column;
  gap: 10px; scroll-behavior: smooth;
}
#one1-messages::-webkit-scrollbar { width: 4px; }
#one1-messages::-webkit-scrollbar-track { background: transparent; }
#one1-messages::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 4px; }

.one1-msg {
  max-width: 82%; padding: 9px 13px; border-radius: 10px; font-size: 13.5px;
  line-height: 1.55; color: var(--c-text); word-break: break-word;
}
.one1-msg.bot {
  background: var(--c-surface2); border: 1px solid var(--c-border);
  align-self: flex-start; border-bottom-left-radius: 3px;
}
.one1-msg.user {
  background: var(--c-user-bg); color: var(--c-user-text); align-self: flex-end;
  border-bottom-right-radius: 3px; font-weight: 500;
}
#one1-dsgvo {
  font-size: 10px; color: var(--c-muted); text-align: center; padding: 6px 16px;
  border-bottom: 1px solid var(--c-border); flex-shrink: 0;
}
#one1-dsgvo a { color: var(--c-muted); text-decoration: underline; }

.one1-msg.bot strong { color: var(--c-accent); font-weight: 600; }
.one1-bullet { display: block; padding-left: 12px; position: relative; }
.one1-bullet::before { content: '–'; position: absolute; left: 0; color: var(--c-muted); }

#one1-typing {
  display: none; align-self: flex-start; background: var(--c-surface2);
  border: 1px solid var(--c-border); border-radius: 10px;
  border-bottom-left-radius: 3px; padding: 11px 14px; gap: 5px; align-items: center;
}
#one1-typing.visible { display: flex; }
.one1-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-muted);
  animation: one1bounce .9s infinite ease-in-out;
}
.one1-dot:nth-child(2) { animation-delay: .15s; }
.one1-dot:nth-child(3) { animation-delay: .3s; }
@keyframes one1bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40%            { transform: translateY(-5px); opacity: 1; }
}

#one1-footer {
  border-top: 1px solid var(--c-border); padding: 12px 12px 12px;
  display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; background: var(--c-bg);
}
#one1-input {
  flex: 1; background: var(--c-surface2); border: 1px solid var(--c-border);
  border-radius: 8px; padding: 9px 12px; color: var(--c-text);
  font-family: var(--font); font-size: 13.5px; line-height: 1.45; resize: none;
  outline: none; min-height: 38px; max-height: 90px; overflow-y: auto;
  transition: border-color .15s;
}
#one1-input::placeholder { color: var(--c-muted); }
#one1-input:focus { border-color: #444; }

#one1-send {
  width: 36px; height: 36px; border-radius: 8px; background: var(--c-accent);
  border: none; cursor: pointer; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: opacity .15s, transform .1s;
}
#one1-send:hover { opacity: .85; }
#one1-send:active { transform: scale(.93); }
#one1-send:disabled { opacity: .3; cursor: not-allowed; }

@media (max-width: 420px) {
  #one1-window {
    right: 0; bottom: 0; width: 100%; height: 100dvh; border-radius: 0;
    border-left: none; border-right: none; border-bottom: none;
  }
  #one1-toggle { bottom: 16px; right: 16px; }
}

#one1-tooltip {
  position: fixed; bottom: 28px; right: 88px; background: #fff; color: #0a0a0a;
  font-family: var(--font); font-size: 13px; font-weight: 500; padding: 9px 13px;
  border-radius: 10px; white-space: nowrap; pointer-events: none; opacity: 0;
  transform: translateX(6px); transition: opacity .2s ease, transform .2s ease;
  z-index: 9998; box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
#one1-tooltip::after {
  content: ''; position: absolute; right: -7px; top: 50%;
  transform: translateY(-50%); border: 7px solid transparent;
  border-right: none; border-left-color: #fff;
}
#one1-chat-root:hover #one1-tooltip { opacity: 1; transform: translateX(0); }
#one1-chat-root.chat-open #one1-tooltip { opacity: 0 !important; pointer-events: none; }
@media (max-width: 768px) {
  #one1-tooltip { bottom: 24px; right: 82px; font-size: 12px; }
}
