/* Chatboble — alt er præfikset .hb- så det ikke kolliderer med sidens egen CSS. Farver rettes i .hb-chat-blokken herunder. */
.hb-chat {
    --hb-farve: #052042;       /* Osbech-blå: top, bot-bobler, knapper */
    --hb-farve-mork: #052042;
    --hb-accent: #cba152;      /* Osbech-guld: chat-knappen og send */
    --hb-tekst-paa-farve: #fff;
    --hb-bg: #fff;
    --hb-flade: #f3f5f8;
    --hb-tekst: #1b2330;
    --hb-daempet: #5f6673;
    --hb-kant: #e1e5eb;
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--hb-tekst);
    position: fixed; right: 20px; bottom: 20px; z-index: 2147483000;
}
.hb-chat *, .hb-chat *::before, .hb-chat *::after { box-sizing: border-box; }

/* Knappen i hjørnet: en "pille" med ikon og tekst, så man kan se, hvad den kan. Bliver til et rundt X, når chatten er åben. */
.hb-boble {
    position: relative; margin-left: auto; height: 60px; padding: 6px 22px 6px 6px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--hb-accent); color: var(--hb-farve); font: inherit; text-align: left;
    box-shadow: 0 6px 20px rgb(5 32 66 / .25); display: flex; align-items: center; gap: 12px;
    transition: transform .15s, box-shadow .15s;
}
.hb-boble:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgb(5 32 66 / .3); }
.hb-boble:focus-visible { outline: 3px solid var(--hb-farve); outline-offset: 3px; }
.hb-ikon {
    position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%;
    background: var(--hb-farve); color: #fff; display: grid; place-items: center;
}
.hb-ikon svg { width: 24px; height: 24px; }
.hb-ikon::after {   /* "klar"-prik */
    content: ""; position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%;
    background: #3ecf5a; border: 2px solid var(--hb-accent);
}
.hb-etiket { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.hb-etiket b { font-size: 16px; font-weight: 700; }
.hb-etiket small { font-size: 12.5px; font-weight: 500; opacity: .8; margin-top: 2px; }
.hb-prik {          /* rødt "1" når hej-beskeden vises */
    position: absolute; top: -6px; left: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
    background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center;
    border: 2px solid #fff;
}
.hb-aaben .hb-boble { width: 60px; padding: 0; justify-content: center; background: var(--hb-farve); }
.hb-aaben .hb-etiket { display: none; }
.hb-aaben .hb-ikon::after { display: none; }

/* Hej-beskeden over knappen */
.hb-teaser {
    position: absolute; right: 0; bottom: 74px; width: 290px;
    background: var(--hb-farve); color: #fff; padding: 14px 16px 16px; border-radius: 16px 16px 4px 16px;
    box-shadow: 0 10px 30px rgb(5 32 66 / .3); cursor: pointer; font-size: 14.5px; line-height: 1.4;
    animation: hb-ind .3s ease-out;
}
.hb-teaser-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hb-teaser-top b { font-size: 16px; flex: 1; }
.hb-teaser-top span { font-size: 11px; font-weight: 700; letter-spacing: .06em; opacity: .75; }
.hb-teaser button {
    width: 26px; height: 26px; margin: -4px -6px -4px 0; border-radius: 6px; border: 0; background: none;
    color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
.hb-teaser button:hover { background: rgb(255 255 255 / .15); }

/* Vinduet */
.hb-vindue {
    position: absolute; right: 0; bottom: 76px; width: 420px; height: min(720px, calc(100vh - 110px));
    background: var(--hb-bg); border-radius: 18px; overflow: hidden;
    box-shadow: 0 12px 40px rgb(0 0 0 / .22); display: flex; flex-direction: column;
    animation: hb-ind .2s ease-out;
}
.hb-vindue[hidden], .hb-teaser[hidden] { display: none; }
@keyframes hb-ind { from { opacity: 0; transform: translateY(10px); } }

.hb-top {
    background: var(--hb-farve); color: var(--hb-tekst-paa-farve); padding: 16px 16px 14px;
    display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
}
.hb-avatar {
    grid-row: span 2; width: 46px; height: 46px; border-radius: 50%; background: #fff center/cover;
    position: relative; display: grid; place-items: center; font-weight: 700; color: var(--hb-farve); font-size: 18px;
    border: 2px solid var(--hb-accent);
}
.hb-avatar::after {
    content: ""; position: absolute; left: 0; top: 0; width: 12px; height: 12px; border-radius: 50%;
    background: #3ecf5a; border: 2px solid #fff;
}
.hb-avatar.hb-lukket::after { background: #aaa; }
.hb-titel { font-size: 18px; font-weight: 600; margin: 0; }
.hb-undertitel { font-size: 13px; opacity: .95; margin: 0; grid-column: 2 / 4; }
.hb-luk {
    grid-row: 1; grid-column: 3; background: none; border: 0; color: inherit; cursor: pointer;
    width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
}
.hb-luk:hover { background: rgb(255 255 255 / .2); }

.hb-log {
    flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px;
    background: var(--hb-flade); overscroll-behavior: contain;
}
.hb-msg { max-width: 85%; padding: 9px 13px; border-radius: 16px; white-space: pre-line; overflow-wrap: anywhere; }
/* Botten er lys og rolig; kundens egne beskeder står frem i Osbech-blå */
.hb-bot { align-self: flex-start; background: var(--hb-bg); color: var(--hb-tekst); border: 1px solid var(--hb-kant);
          border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgb(5 32 66 / .05); }
.hb-bruger { align-self: flex-end; background: var(--hb-farve); color: var(--hb-tekst-paa-farve); border-bottom-right-radius: 4px; }
.hb-msg a { color: inherit; font-weight: 600; }

.hb-skriver { align-self: flex-start; background: var(--hb-bg); border: 1px solid var(--hb-kant); border-radius: 16px; padding: 12px 14px; display: flex; gap: 4px; }
.hb-skriver i { width: 7px; height: 7px; border-radius: 50%; background: var(--hb-daempet); animation: hb-hop 1s infinite; }
.hb-skriver i:nth-child(2) { animation-delay: .15s; }
.hb-skriver i:nth-child(3) { animation-delay: .3s; }
@keyframes hb-hop { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.hb-knapper { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 100%; }
.hb-knap {
    border: 1.5px solid var(--hb-farve-mork); background: var(--hb-bg); color: var(--hb-farve-mork);
    border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer;
}
.hb-knap:hover, .hb-knap:focus-visible { background: var(--hb-farve-mork); color: var(--hb-tekst-paa-farve); outline: none; }
.hb-knap:disabled { opacity: .4; cursor: default; background: var(--hb-bg); color: var(--hb-farve-mork); }

.hb-biler { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.hb-bil {
    background: var(--hb-bg); border: 1px solid var(--hb-kant); border-radius: 12px; padding: 10px 12px;
    display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-decoration: none; color: inherit;
}
.hb-bil:hover { border-color: var(--hb-accent); }
.hb-bil:has(.hb-foto) { grid-template-columns: 64px 1fr auto; }
.hb-foto { grid-row: 1 / 3; width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--hb-flade); }
.hb-bil b { font-weight: 600; font-size: 14px; line-height: 1.3; }
.hb-bil small { color: var(--hb-daempet); font-size: 12.5px; }
.hb-bil .hb-pris { grid-row: 1 / 3; grid-column: -2; align-self: center; font-weight: 700; white-space: nowrap; font-size: 14px; }
.hb-bil .hb-vaelg { grid-column: 1 / -1; justify-self: start; margin-top: 6px; padding: 4px 10px; font-size: 13px; }

/* Tidligere samtaler (foldet sammen øverst) */
.hb-tidligere { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px dashed var(--hb-kant); }
.hb-tidligere-knap {
    align-self: center; background: var(--hb-bg); border: 1px solid var(--hb-kant); border-radius: 999px; cursor: pointer;
    padding: 5px 12px; font: inherit; font-size: 12.5px; color: var(--hb-daempet); max-width: 100%; text-align: center;
}
.hb-tidligere-knap::before { content: "▸ "; }
.hb-tidligere-knap[aria-expanded="true"]::before { content: "▾ "; }
.hb-tidligere-knap:hover { color: var(--hb-tekst); border-color: var(--hb-daempet); }
.hb-tidligere-log { display: flex; flex-direction: column; gap: 8px; opacity: .7; }
.hb-tidligere-log[hidden] { display: none; }

.hb-samtykke { font-size: 12px; color: var(--hb-daempet); align-self: stretch; padding: 0 4px; }

.hb-bund { border-top: 1px solid var(--hb-kant); padding: 10px 12px 6px; background: var(--hb-bg); }
.hb-form { display: flex; gap: 8px; align-items: center; }
.hb-input {
    flex: 1; border: 0; outline: none; font: inherit; padding: 10px 6px; background: transparent; color: var(--hb-tekst); min-width: 0;
}
.hb-send {
    width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--hb-accent); color: #fff;
    cursor: pointer; display: grid; place-items: center; flex: none;
}
.hb-send:disabled { opacity: .5; }
.hb-send svg { width: 20px; height: 20px; }
.hb-fod { text-align: center; font-size: 11px; color: var(--hb-daempet); padding-top: 4px; }
.hb-fod a { color: inherit; }
.hb-fod button { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.hb-skjult { position: absolute; left: -9999px; }

/* Store skærme: endnu mere plads til dage, tider og bilkort */
@media (min-width: 1280px) and (min-height: 860px) {
    .hb-vindue { width: 460px; height: min(800px, calc(100vh - 120px)); }
    .hb-chat { font-size: 15.5px; }
}

@media (max-width: 480px) {
    .hb-etiket small { display: none; }
    .hb-boble { height: 54px; padding-right: 18px; }
    .hb-ikon { width: 42px; height: 42px; }
    .hb-teaser { width: min(290px, calc(100vw - 24px)); bottom: 66px; }
    .hb-chat { right: 12px; bottom: 12px; }
    .hb-chat.hb-aaben { inset: 0; }
    .hb-chat.hb-aaben .hb-boble, .hb-chat.hb-aaben .hb-teaser { display: none; }
    .hb-vindue { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; }
}
