/* Hansehandel AI product advisor */
:root {
    --hh-ai-primary: var(--bs-primary, #0b539b);
    --hh-ai-text: var(--bs-body-color, #212529);
    --hh-ai-muted: #5f6b76;
    --hh-ai-border: var(--bs-border-color, #dee2e6);
    --hh-ai-bg: var(--bs-body-bg, #fff);
    --hh-ai-soft: #f3f6f9;
    --hh-ai-danger: #b00020;
    --hh-ai-radius: 10px;
}

.hh-ai-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hh-ai-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; opacity: 0; }
.hh-ai-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }

/* header trigger */
.hh-ai-header-wrap { display: flex; align-items: center; gap: 8px; }
.hh-ai-header-wrap > form, .hh-ai-header-wrap > .header-search { flex: 1 1 auto; min-width: 0; }
.hh-ai-trigger {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; height: 40px; padding: 0 12px;
    border: 1px solid var(--hh-ai-primary); border-radius: 6px; background: var(--hh-ai-bg); color: var(--hh-ai-primary);
    font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.hh-ai-trigger:hover, .hh-ai-trigger:focus-visible { background: var(--hh-ai-primary); color: #fff; }
.hh-ai-trigger:focus-visible { outline: 3px solid rgba(11, 83, 155, .35); outline-offset: 2px; }
@media (max-width: 575.98px) { .hh-ai-trigger { padding: 0 10px; } .hh-ai-trigger-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); } }

/* category teaser */
.hh-ai-teaser {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--hh-ai-border); border-left: 4px solid var(--hh-ai-primary);
    border-radius: var(--hh-ai-radius); background: var(--hh-ai-soft);
}
.hh-ai-teaser-text { display: flex; gap: 10px; align-items: flex-start; color: var(--hh-ai-text); }
.hh-ai-teaser-text .hh-ai-icon { color: var(--hh-ai-primary); margin-top: 2px; }
.hh-ai-teaser-text strong { display: block; }
.hh-ai-teaser-text span:not(.hh-ai-icon) { font-size: 14px; color: var(--hh-ai-muted); }
.hh-ai-teaser-form { display: flex; gap: 8px; flex: 1 1 340px; max-width: 560px; }
.hh-ai-teaser-input { flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--hh-ai-border); border-radius: 6px; font-size: 15px; }

/* modal */
html.hh-ai-open { overflow: hidden; }
.hh-ai-overlay { position: fixed; inset: 0; z-index: 1090; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 32, .55); }
.hh-ai-overlay[hidden] { display: none; }
.hh-ai-dialog {
    display: flex; flex-direction: column; width: 100%; max-width: 760px; height: min(86vh, 820px);
    background: var(--hh-ai-bg); color: var(--hh-ai-text); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden;
}
@media (max-width: 575.98px) { .hh-ai-overlay { padding: 0; } .hh-ai-dialog { height: 100%; max-width: none; border-radius: 0; } }
.hh-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--hh-ai-border); }
.hh-ai-head-title { display: flex; align-items: center; gap: 8px; color: var(--hh-ai-primary); }
.hh-ai-head h2 { margin: 0; font-size: 18px; color: var(--hh-ai-text); }
.hh-ai-badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 99px; background: var(--hh-ai-soft); color: var(--hh-ai-primary); border: 1px solid var(--hh-ai-border); }
.hh-ai-close { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 4px; color: var(--hh-ai-muted); cursor: pointer; }
.hh-ai-close:hover, .hh-ai-close:focus-visible { color: var(--hh-ai-text); }
.hh-ai-disclosure { margin: 0; padding: 8px 18px; font-size: 12px; line-height: 1.45; color: var(--hh-ai-muted); background: var(--hh-ai-soft); border-bottom: 1px solid var(--hh-ai-border); }
.hh-ai-body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.hh-ai-chat { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.hh-ai-chat[hidden], .hh-ai-lead[hidden] { display: none; }
.hh-ai-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }

.hh-ai-msg { display: flex; }
.hh-ai-user { justify-content: flex-end; }
.hh-ai-bubble { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.hh-ai-bubble p { margin: 0 0 6px; }
.hh-ai-bubble p:last-child { margin-bottom: 0; }
.hh-ai-user .hh-ai-bubble { background: var(--hh-ai-primary); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.hh-ai-bot .hh-ai-bubble { background: var(--hh-ai-soft); border: 1px solid var(--hh-ai-border); border-bottom-left-radius: 4px; width: 100%; }
.hh-ai-msg-files { font-size: 12px; opacity: .9; margin-top: 4px; }
.hh-ai-typing .hh-ai-bubble { color: var(--hh-ai-muted); width: auto; }
.hh-ai-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.hh-ai-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--hh-ai-muted); animation: hh-ai-blink 1.2s infinite ease-in-out; }
.hh-ai-dots i:nth-child(2) { animation-delay: .2s; } .hh-ai-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes hh-ai-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hh-ai-dots i { animation: none; opacity: .6; } }

.hh-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.hh-ai-chip { border: 1px solid var(--hh-ai-primary); color: var(--hh-ai-primary); background: var(--hh-ai-bg); border-radius: 99px; padding: 4px 12px; font-size: 14px; cursor: pointer; }
.hh-ai-chip:hover, .hh-ai-chip:focus-visible { background: var(--hh-ai-primary); color: #fff; }

.hh-ai-subtitle { font-size: 15px; font-weight: 700; margin: 10px 0 8px; }
.hh-ai-products { display: grid; gap: 10px; }
.hh-ai-product { display: flex; gap: 12px; padding: 10px; background: var(--hh-ai-bg); border: 1px solid var(--hh-ai-border); border-radius: var(--hh-ai-radius); }
.hh-ai-product-img { flex: 0 0 96px; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 6px; overflow: hidden; }
.hh-ai-product-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hh-ai-noimg { width: 100%; height: 100%; background: var(--hh-ai-soft); }
.hh-ai-product-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hh-ai-product-man { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--hh-ai-muted); }
.hh-ai-product-name { font-weight: 600; color: var(--hh-ai-text); text-decoration: none; line-height: 1.35; }
.hh-ai-product-name:hover { color: var(--hh-ai-primary); text-decoration: underline; }
.hh-ai-product-reason { margin: 0; font-size: 14px; color: var(--hh-ai-text); }
.hh-ai-product-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.hh-ai-price { font-weight: 700; font-size: 14px; }
.hh-ai-price.is-request { font-weight: 600; color: var(--hh-ai-muted); }
@media (max-width: 420px) { .hh-ai-product-img { flex-basis: 64px; width: 64px; height: 64px; } }

.hh-ai-hint { font-size: 14px; margin: 10px 0 0; padding: 8px 10px; background: #fff8e6; border: 1px solid #f0d58a; border-radius: 6px; }
.hh-ai-checked { font-size: 12px; color: #1d6b3a; margin: 8px 0 0; }
.hh-ai-team-note { font-size: 14px; margin: 8px 0 0; }
.hh-ai-bot .hh-ai-btn-secondary { margin-top: 10px; }

.hh-ai-composer { border-top: 1px solid var(--hh-ai-border); padding: 10px 14px 8px; background: var(--hh-ai-bg); }
.hh-ai-composer-row { display: flex; align-items: flex-end; gap: 8px; }
.hh-ai-input { flex: 1 1 auto; min-width: 0; resize: none; max-height: 140px; padding: 9px 12px; border: 1px solid var(--hh-ai-border); border-radius: 8px; font: inherit; font-size: 15px; }
.hh-ai-input:focus, .hh-ai-teaser-input:focus, .hh-ai-field input:focus, .hh-ai-field textarea:focus { outline: 2px solid var(--hh-ai-primary); outline-offset: 0; border-color: var(--hh-ai-primary); }
.hh-ai-composer .hh-ai-link { margin-top: 6px; }

.hh-ai-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 6px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.hh-ai-btn:disabled { opacity: .55; cursor: not-allowed; }
.hh-ai-btn-icon { width: 42px; padding: 0; flex: 0 0 auto; }
.hh-ai-btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.hh-ai-btn-primary { background: var(--hh-ai-primary); color: #fff; }
.hh-ai-btn-primary:hover, .hh-ai-btn-primary:focus-visible { filter: brightness(1.1); color: #fff; }
.hh-ai-btn-secondary, label.hh-ai-btn-icon { background: var(--hh-ai-bg); color: var(--hh-ai-primary); border-color: var(--hh-ai-primary); }
.hh-ai-btn-secondary:hover, label.hh-ai-btn-icon:hover { background: var(--hh-ai-soft); }
.hh-ai-btn:focus-visible, .hh-ai-link:focus-visible, .hh-ai-chip:focus-visible { outline: 3px solid rgba(11, 83, 155, .35); outline-offset: 2px; }
.hh-ai-link { display: inline-block; border: 0; background: none; padding: 2px 0; color: var(--hh-ai-primary); text-decoration: underline; font-size: 13px; cursor: pointer; }

.hh-ai-files { display: flex; flex-wrap: wrap; gap: 6px; }
.hh-ai-files:not(:empty) { margin-bottom: 8px; }
.hh-ai-file { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; font-size: 13px; background: var(--hh-ai-soft); border: 1px solid var(--hh-ai-border); border-radius: 99px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hh-ai-file-remove { border: 0; background: none; font-size: 16px; line-height: 1; cursor: pointer; color: var(--hh-ai-muted); }
.hh-ai-error { width: 100%; color: var(--hh-ai-danger); font-size: 13px; }

.hh-ai-lead { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 18px; }
.hh-ai-form .hh-ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 575.98px) { .hh-ai-form .hh-ai-grid { grid-template-columns: 1fr; } }
.hh-ai-field { margin-bottom: 12px; }
.hh-ai-field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.hh-ai-field label.hh-ai-btn { display: inline-flex; }
.hh-ai-field input, .hh-ai-field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--hh-ai-border); border-radius: 6px; font: inherit; font-size: 15px; }
.hh-ai-field .is-invalid { border-color: var(--hh-ai-danger); background: #fff5f6; }
.hh-ai-req { color: var(--hh-ai-danger); }
.hh-ai-muted { color: var(--hh-ai-muted); font-size: 14px; }
.hh-ai-small { font-size: 12px; margin: 6px 0; }
.hh-ai-status { min-height: 20px; font-size: 14px; color: var(--hh-ai-danger); margin-bottom: 6px; }
.hh-ai-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hh-ai-sent { padding: 24px; font-size: 16px; color: #1d6b3a; text-align: center; }
.hh-ai-trigger-col { display: flex; align-items: center; padding-left: 0; }
.hh-ai-disclosure p { margin: 0; }
.hh-ai-disclosure .hh-ai-liability { margin-top: 4px; }
.hh-ai-liability { font-size: 11px; line-height: 1.4; color: var(--hh-ai-muted); margin: 8px 0 0; }
/* data transfer notice in teasers (always visible) */
.hh-ai-teaser-side { flex: 1 1 340px; max-width: 560px; display: flex; flex-direction: column; gap: 6px; }
.hh-ai-teaser-side .hh-ai-teaser-form { max-width: none; flex: 0 0 auto; }
.hh-ai-teaser-notice { margin: 0; font-size: 12px; line-height: 1.45; color: var(--hh-ai-muted); }
/* homepage band above the hero */
.hh-ai-home { padding: 14px 0 0; }
.hh-ai-home .hh-ai-teaser { margin-bottom: 14px; }
/* warning directly above the chat input */
.hh-ai-input-notice { margin: 0 0 8px; padding: 6px 10px; font-size: 12px; line-height: 1.4; color: #7a4b00; background: #fff6e0; border: 1px solid #f1d38a; border-radius: 6px; }
.hh-ai-teaser-notice { padding: 6px 10px; color: #7a4b00; background: #fff6e0; border: 1px solid #f1d38a; border-radius: 6px; }
