/* ==========================================================================
   HALO Fitness – Cookie-Hinweis (.cc) und Support-Chat (.aki)
   Beide werden von consent.js bzw. chat.js erzeugt.
   ========================================================================== */

/* ---------- Cookie-Hinweis: Desktop kleine Karte oben rechts, Handy schmale Leiste unter der Kopfzeile ---------- */
.cc { position: fixed; top: 88px; right: 24px; z-index: 300; display: flex; justify-content: flex-end; pointer-events: none; }
.cc, .cc *, .cc *::before, .cc *::after { box-sizing: border-box; }
.cc__card { pointer-events: auto; cursor: pointer; width: 430px; max-width: calc(100vw - 32px); background: #fffdfb; color: #2d2622; border-radius: 18px; padding: 14px 16px 12px; box-shadow: 0 24px 50px -24px rgba(45, 38, 34, .45), 0 0 0 1px rgba(45, 38, 34, .07); font: 300 .82rem/1.45 "Poppins", system-ui, sans-serif; opacity: 0; transform: translateY(-10px); transition: opacity .3s cubic-bezier(.22, 1, .36, 1), transform .3s cubic-bezier(.22, 1, .36, 1); }
.cc.is-open .cc__card { opacity: 1; transform: none; }
.cc__card:has(.cc__details:not([hidden])) .cc__btns { flex-wrap: wrap; }
.cc__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cc__text { margin: 0 0 10px; color: #554a44; max-width: none; }
.cc__text a { color: #6f520d; }
.cc__details { display: grid; gap: 10px; margin: 0 0 12px; padding: 12px 0 0; border-top: 1px solid #e3d8cf; }
.cc__opt { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; color: #554a44; cursor: pointer; }
.cc__opt b { display: block; font-weight: 500; color: #2d2622; }
.cc__opt input { accent-color: #16130f; width: 18px; height: 18px; margin-top: 2px; flex: none; }
.cc__btns { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.cc__btn { flex: 1 1 auto; white-space: nowrap; border: 0; border-radius: 999px; padding: 10px 14px; background: #16130f; color: #fff; font: 500 .8rem/1 "Poppins", system-ui, sans-serif; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .cc__btn:hover { background: #3a3128; } }
.cc__link { border: 0; background: none; padding: 4px 2px; font: 400 .76rem/1 "Poppins", system-ui, sans-serif; color: #554a44; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 760px) {
  .cc { top: calc(env(safe-area-inset-top, 0px) + 70px); left: 8px; right: 8px; justify-content: stretch; }
  .cc__card { width: 100%; max-width: none; padding: 10px 12px 9px; border-radius: 14px; font-size: .74rem; line-height: 1.4; }
  .cc__text { margin-bottom: 8px; }
  .cc__btn { flex: 1 1 0; min-width: 0; padding: 9px 8px; font-size: .74rem; }
  .cc__link { flex: none; font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) { .cc__card { transition: none; transform: none; } }

/* ---------- Support-Chat unten rechts ---------- */
.aki { --aki-paper: #f7f2ed; --aki-white: #fffdfb; --aki-ink: #1a1714; --aki-ink2: #4a433d; --aki-mute: #7a6d65; --aki-line: #e3d8cf; --aki-or: #8a6714; --aki-or2: #16130f; --aki-blush: #f2e8d0; --aki-ease: cubic-bezier(.22, 1, .36, 1); font: 300 .92rem/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--aki-ink); }
.aki *, .aki *::before, .aki *::after { box-sizing: border-box; }

/* Knopf */
.aki-fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 20px 0 8px; border: 0; border-radius: 999px; background: var(--aki-ink); color: #fff; font: 400 .9rem/1 "Poppins", system-ui, sans-serif; cursor: pointer; box-shadow: 0 18px 40px -16px rgba(45, 38, 34, .55); transition: transform .5s var(--aki-ease), bottom .5s var(--aki-ease), opacity .3s; }
@media (hover: hover) and (pointer: fine) { .aki-fab:hover { transform: translateY(-2px); } }
.aki-fab:focus-visible { outline: 2px solid var(--aki-or); outline-offset: 3px; }
.aki-fab__dot { width: 38px; height: 38px; border-radius: 50%; background: var(--aki-or); display: grid; place-items: center; flex: none; }
.aki-fab__dot svg { width: 19px; height: 19px; }
.aki-fab__t b { font-weight: 500; }
.aki.is-open .aki-fab { opacity: 0; pointer-events: none; transform: translateY(10px); }
body:has(.bar.show) .aki-fab { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.menu-open .aki-fab { opacity: 0; visibility: hidden; pointer-events: none; }

/* Fenster */
.aki-panel { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 95; width: min(400px, calc(100vw - 24px)); height: min(620px, calc(100dvh - 36px)); display: flex; flex-direction: column; background: var(--aki-paper); border-radius: 24px; box-shadow: 0 40px 80px -30px rgba(45, 38, 34, .5), 0 0 0 1px rgba(45, 38, 34, .07); overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(16px) scale(.98); transform-origin: bottom right; transition: opacity .35s var(--aki-ease), transform .45s var(--aki-ease), visibility .35s; }
.aki.is-open .aki-panel { opacity: 1; visibility: visible; transform: none; }

.aki-hd { display: flex; align-items: center; gap: 12px; padding: 16px 14px 14px 20px; border-bottom: 1px solid var(--aki-line); background: var(--aki-white); }
.aki-hd__t { flex: 1; min-width: 0; }
.aki-hd__t strong { display: block; font: 400 1.55rem/1 "Cormorant Garamond", Georgia, serif; letter-spacing: -.01em; }
.aki-hd__t strong em { font-style: italic; color: var(--aki-or); }
.aki-hd__t span { display: block; font-size: .74rem; color: var(--aki-mute); margin-top: 4px; }
.aki-ic { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--aki-ink2); display: grid; place-items: center; cursor: pointer; flex: none; }
@media (hover: hover) and (pointer: fine) { .aki-ic:hover { background: var(--aki-paper); } }
.aki-ic:focus-visible { outline: 2px solid var(--aki-or); outline-offset: 1px; }
.aki-ic svg { width: 18px; height: 18px; }

/* Verlauf */
.aki-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.aki-m { max-width: 88%; padding: 10px 14px; border-radius: 18px; word-wrap: break-word; }
.aki-m p { margin: 0; max-width: none; }
.aki-m p + p { margin-top: 8px; }
.aki-m a { color: var(--aki-or2); text-decoration: underline; text-underline-offset: 2px; font-weight: 400; }
.aki-m b { font-weight: 500; }
.aki-m--a { align-self: flex-start; background: var(--aki-white); border-bottom-left-radius: 6px; box-shadow: 0 0 0 1px rgba(45, 38, 34, .05); }
.aki-m--u { align-self: flex-end; background: var(--aki-or2); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.aki-m--hello, .aki-note, .aki-fill { cursor: text; }
.aki-note a { cursor: pointer; }
.aki-fill { order: 1; flex: 1 1 0; min-height: 0; margin-top: -10px; }
.aki-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.aki-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--aki-mute); animation: aki-dot 1.1s infinite ease-in-out; }
.aki-typing i:nth-child(2) { animation-delay: .15s; }
.aki-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aki-dot { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

/* Vorschläge */
.aki-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.aki-chip { border: 1px solid var(--aki-line); background: transparent; border-radius: 999px; padding: 7px 13px; font: 300 .82rem/1.3 "Poppins", system-ui, sans-serif; color: var(--aki-ink); cursor: pointer; text-align: left; }
@media (hover: hover) and (pointer: fine) { .aki-chip:hover { border-color: var(--aki-or); color: var(--aki-or2); } }
.aki-chip:focus-visible { outline: 2px solid var(--aki-or); outline-offset: 2px; }

/* Eingabe */
.aki-ft { padding: 10px 12px 12px; background: var(--aki-white); border-top: 1px solid var(--aki-line); }
.aki-in { display: flex; align-items: flex-end; gap: 8px; background: var(--aki-paper); border-radius: 18px; padding: 6px 6px 6px 14px; }
.aki-in:focus-within { box-shadow: 0 0 0 2px var(--aki-or); }
.aki-in textarea { flex: 1; border: 0; background: transparent; resize: none; font: 300 .95rem/1.45 "Poppins", system-ui, sans-serif; color: var(--aki-ink); padding: 7px 0; max-height: 120px; outline: none; }
.aki-in textarea::placeholder { color: var(--aki-mute); }
.aki-send { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--aki-or2); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; transition: background .2s; }
.aki-send[disabled] { background: #cdbfb5; cursor: default; }
.aki-send svg { width: 17px; height: 17px; }
.aki-send:focus-visible { outline: 2px solid var(--aki-ink); outline-offset: 2px; }
.aki-note { margin: 8px 4px 0; font-size: .68rem; line-height: 1.45; color: var(--aki-mute); max-width: none; }
.aki-note a { color: inherit; }

@media (max-width: 560px) {
  .aki-fab { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); height: 50px; padding: 0 6px; }
  .aki-fab__t { display: none; }
  body:has(.bar.show) .aki-fab { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  .aki-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
  .aki-in textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .aki-fab, .aki-panel { transition: none; }
  .aki-typing i { animation: none; opacity: .6; }
  .aki-log { scroll-behavior: auto; }
}

/* ---------- Dunkles Design ---------- */
[data-theme="dark"] .cc__card { background: #282521; color: #f4eee3; box-shadow: 0 0 0 1px #3a352e, 0 30px 60px -30px #000; }
[data-theme="dark"] .cc__text, [data-theme="dark"] .cc__opt, [data-theme="dark"] .cc__link { color: #cdc4b6; }
[data-theme="dark"] .cc__text a { color: #e2c170; }
[data-theme="dark"] .cc__details { border-top-color: #3a352e; }
[data-theme="dark"] .cc__opt input { accent-color: #c9a24b; }
[data-theme="dark"] .cc__btn { background: #c9a24b; color: #15120c; }
[data-theme="dark"] .aki { --aki-paper: #1c1a17; --aki-white: #282521; --aki-ink: #f4eee3; --aki-ink2: #cdc4b6; --aki-mute: #a1988a; --aki-line: #3a352e; --aki-or: #c9a24b; --aki-or2: #c9a24b; --aki-blush: #302815; }
[data-theme="dark"] .aki-m--u, [data-theme="dark"] .aki-send { color: #15120c; }
[data-theme="dark"] .aki-fab { background: #282521; color: #f4eee3; box-shadow: 0 0 0 1px #3a352e, 0 18px 40px -18px #000; }
@media (hover: hover) and (pointer: fine) { [data-theme="dark"] .cc__btn:hover { background: #e2c170; } }
