/* ============================================================================
   KRANZ Concierge — chatbot widget
   ============================================================================ */
.kc-fab {
    position: fixed; right: clamp(1rem, 2.5vw, 2rem); bottom: clamp(1rem, 2.5vw, 2rem);
    z-index: 240; display: inline-flex; align-items: center; gap: .6rem;
    padding: .85rem 1.25rem; border-radius: 999px;
    background: var(--ink); color: var(--bone);
    box-shadow: 0 14px 34px -12px rgba(22,20,18,.5); cursor: pointer;
    transition: transform .3s var(--ease), background .3s var(--ease);
}
.kc-fab:hover { transform: translateY(-2px); background: var(--noir); }
.kc-fab svg { color: var(--brass-soft); }
.kc-fab__txt { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
body.kc-open .kc-fab { opacity: 0; visibility: hidden; transform: scale(.9); }
@media (max-width: 520px) { .kc-fab__txt { display: none; } .kc-fab { padding: .9rem; } }

.kc-chat {
    position: fixed; right: clamp(1rem, 2.5vw, 2rem); bottom: clamp(1rem, 2.5vw, 2rem);
    z-index: 241; width: min(400px, calc(100vw - 2rem)); height: min(640px, calc(100vh - 2rem));
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
    opacity: 0; visibility: hidden; transform: translateY(16px) scale(.98);
    transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s;
}
body.kc-open .kc-chat { opacity: 1; visibility: visible; transform: none; }
@media (max-width: 520px) {
    .kc-chat { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
}

.kc-head { display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.1rem; background: var(--noir); color: var(--bone); }
.kc-head__lock { display: flex; align-items: center; gap: .7rem; }
.kc-head__t { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.kc-head__s { font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-soft); margin-top: 2px; }
.kc-close { color: var(--muted-dark); font-size: 1.1rem; width: 32px; height: 32px; border-radius: 999px; transition: color .2s, background .2s; }
.kc-close:hover { color: var(--bone); background: rgba(244,240,233,.08); }

.kc-disc { padding: 1rem 1.1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.kc-disc p { font-size: .78rem; line-height: 1.5; color: var(--text-soft); }
.kc-disc a { color: var(--brass-deep); text-decoration: underline; }
.kc-disc .btn { margin-top: .8rem; }
.btn.btn-sm { padding: .55rem 1.1rem; min-height: 0; font-size: .8rem; }
.kc-disc.is-hidden { display: none; }

.kc-body { flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: .8rem; scroll-behavior: smooth; }
.kc-msg { max-width: 86%; padding: .8rem 1rem; border-radius: 14px; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word;
    animation: kcmsg .28s var(--ease) both; }
@keyframes kcmsg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kc-msg.user { align-self: flex-end; background: var(--ink); color: var(--bone); border-bottom-right-radius: 4px; }
.kc-msg.bot { align-self: flex-start; background: var(--bone); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.kc-msg.bot strong { color: var(--ink); }
.kc-msg.bot a { color: var(--brass-deep); text-decoration: underline; }
.kc-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: .9rem 1rem; }
.kc-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: kcblink 1.2s infinite both; }
.kc-typing span:nth-child(2) { animation-delay: .2s; } .kc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes kcblink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

.kc-suggest { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0 1.1rem .6rem; }
.kc-chip { font-family: var(--mono); font-size: .68rem; letter-spacing: .04em; padding: .5rem .8rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-soft);
    cursor: pointer; transition: border-color .2s, color .2s; }
.kc-chip:hover { border-color: var(--brass); color: var(--brass-deep); }
.kc-suggest.is-hidden { display: none; }

.kc-form { display: flex; align-items: flex-end; gap: .5rem; padding: .8rem 1rem; border-top: 1px solid var(--line); background: var(--surface); }
.kc-input { flex: 1; resize: none; max-height: 110px; font-family: var(--sans); font-size: .92rem; color: var(--ink);
    background: var(--bone); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; line-height: 1.4; }
.kc-input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-glow); }
.kc-send { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--brass); color: var(--noir);
    font-size: 1.2rem; transition: background .2s, transform .2s; }
.kc-send:hover { background: var(--brass-deep); color: var(--bone); }
.kc-send:disabled { opacity: .5; cursor: not-allowed; }
/* Disclaimer gate — input/chips disabled until "Verstanden & fortfahren" */
.kc-input:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
.kc-chip:disabled { opacity: .4; cursor: not-allowed; }

.kc-retry { margin-top: .55rem; font-family: var(--mono); font-size: .68rem; letter-spacing: .06em;
    text-transform: uppercase; padding: .45rem .85rem; border: 1px solid var(--brass); border-radius: 999px;
    background: transparent; color: var(--brass-deep); cursor: pointer; transition: background .2s, color .2s; }
.kc-retry:hover { background: var(--brass); color: var(--noir); }
.kc-retry:focus-visible { outline: 2px solid var(--brass-deep); outline-offset: 2px; }

@media (max-width: 520px) {
    /* iPhone home indicator: il compose non deve finirci sotto */
    .kc-form { padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
    .kc-fab, .kc-chat { transition: none !important; }
    .kc-typing span { animation: none !important; }
    .kc-msg { animation: none !important; }
}

/* a11y: visually-hidden polite status region (announces the completed Concierge
   reply once, instead of re-announcing every streamed delta) */
.kc-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
