.dk-sc {
    --sc-brand: var(--dk-primary, #00598a);
    --sc-ink: #14181d;
    --sc-muted: #5b6b78;
    --sc-paper: #ffffff;
    --sc-soft: #f3f5f8;
    --sc-rule: #e3e7ec;
    position: fixed; right: 20px; bottom: 20px; z-index: 9995;
    font-family: inherit; color: var(--sc-ink);
}
@media (prefers-color-scheme: dark) {
    html.dark .dk-sc { --sc-ink: #e8edf2; --sc-muted: #9aa8b5; --sc-paper: #161b21; --sc-soft: #20262e; --sc-rule: #2c343d; }
}

.has-dk-sc .dk-guide-replay { right: 150px; }
@media (max-width: 40rem) { body:has(.dk-bottom-nav) .dk-sc { bottom: calc(76px + env(safe-area-inset-bottom)); } }

.dk-sc-launcher {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    height: 52px; padding: 0 18px 0 16px; border: 0; border-radius: 999px;
    background: var(--sc-brand); color: #fff; font-weight: 700; font-size: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18); cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.dk-sc-launcher:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(0, 0, 0, .22); }
.dk-sc-launcher:focus-visible { outline: 3px solid rgba(0, 89, 138, .35); outline-offset: 3px; }
.dk-sc.is-open .dk-sc-launcher { display: none; }
/* Out of the way while a dialog is on screen (enrolment, top-up,
   confirmations): on a phone it sat on top of the dialog's buttons.
   support-chat.js sets the class. */
.dk-sc.is-behind-dialog:not(.is-open) { display: none; }
.dk-sc-dot { position: absolute; top: 6px; right: 8px; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: #e5484d; }
.dk-sc-dot[hidden] { display: none; }

.dk-sc-panel {
    display: flex; flex-direction: column;
    width: 370px; height: min(600px, calc(100vh - 40px));
    border: 1px solid var(--sc-rule); border-radius: 16px; overflow: hidden;
    background: var(--sc-paper); box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
    animation: dk-sc-in .16s ease-out;
}
.dk-sc-panel[hidden] { display: none; }
@keyframes dk-sc-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.dk-sc-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; background: var(--sc-brand); color: #fff; }
.dk-sc-head-main { flex: 1; min-width: 0; display: grid; }
.dk-sc-head strong { font-size: 15px; }
.dk-sc-mode { font-size: 12px; opacity: .85; }
.dk-sc-end { height: 30px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; background: transparent; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.dk-sc-end[hidden] { display: none; }
.dk-sc-x { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.dk-sc-x:hover, .dk-sc-end:hover { background: rgba(255, 255, 255, .15); }

.dk-sc-log { flex: 1; overflow-y: auto; padding: 14px; background: var(--sc-soft); overscroll-behavior: contain; }
.dk-sc-msg { max-width: 85%; margin-bottom: 10px; }
.dk-sc-text { padding: 9px 12px; border-radius: 14px; background: var(--sc-paper); border: 1px solid var(--sc-rule); font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.dk-sc-msg.is-member { margin-left: auto; }
.dk-sc-msg.is-member .dk-sc-text { background: var(--sc-brand); border-color: var(--sc-brand); color: #fff; border-bottom-right-radius: 4px; }
.dk-sc-msg.is-bot .dk-sc-text, .dk-sc-msg.is-support .dk-sc-text { border-bottom-left-radius: 4px; }
.dk-sc-msg.is-system { max-width: none; text-align: center; }
.dk-sc-msg.is-system .dk-sc-text { display: inline-block; padding: 2px 8px; border: 0; background: transparent; font-size: 12px; color: var(--sc-muted); }
.dk-sc-meta { margin-top: 3px; font-size: 11px; color: var(--sc-muted); }
.dk-sc-msg.is-member .dk-sc-meta { text-align: right; }

.dk-sc-links, .dk-sc-previous { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dk-sc-links a { padding: 5px 10px; border: 1px solid var(--sc-rule); border-radius: 999px; background: var(--sc-paper); color: var(--sc-brand); font-size: 13px; font-weight: 600; text-decoration: none; }
.dk-sc-links a:hover { border-color: var(--sc-brand); }
.dk-sc-previous { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--sc-rule); border-radius: 10px; background: var(--sc-paper); }
.dk-sc-previous > span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sc-muted); }
.dk-sc-previous a { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--sc-ink); text-decoration: none; }
.dk-sc-previous a:hover { color: var(--sc-brand); }
.dk-sc-previous em { flex: none; font-style: normal; font-size: 11px; color: var(--sc-muted); }

.dk-sc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.dk-sc-chip { min-height: 34px; padding: 0 12px; border: 1px solid var(--sc-brand); border-radius: 999px; background: var(--sc-paper); color: var(--sc-brand); font-size: 13px; font-weight: 600; cursor: pointer; }
.dk-sc-chip:hover { background: rgba(0, 89, 138, .06); }
.dk-sc-chip.is-primary { background: var(--sc-brand); color: #fff; }

.dk-sc-image img { display: block; max-width: 220px; max-height: 220px; margin-top: 6px; border-radius: 10px; }
.dk-sc-msg audio { display: block; width: 240px; margin-top: 6px; }
.dk-sc-filelink { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--sc-brand); overflow-wrap: anywhere; }

.dk-sc-typing { display: inline-flex; gap: 4px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--sc-rule); border-radius: 14px; background: var(--sc-paper); }
.dk-sc-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--sc-muted); animation: dk-sc-dots 1s infinite ease-in-out; }
.dk-sc-typing span:nth-child(2) { animation-delay: .15s; }
.dk-sc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dk-sc-dots { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.dk-sc-closed { padding: 14px; border-top: 1px solid var(--sc-rule); text-align: center; font-size: 14px; color: var(--sc-muted); }
.dk-sc-closed[hidden] { display: none; }
.dk-sc-closed p { margin: 0 0 8px; }
.dk-sc-btn { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--sc-brand); color: #fff; font-weight: 700; cursor: pointer; }

.dk-sc-form { padding: 10px; border-top: 1px solid var(--sc-rule); background: var(--sc-paper); }
.dk-sc-form[hidden] { display: none; }
.dk-sc-compose { display: flex; align-items: flex-end; gap: 6px; }
.dk-sc-compose textarea {
    flex: 1; min-height: 40px; max-height: 120px; padding: 9px 12px;
    border: 1px solid var(--sc-rule); border-radius: 20px; background: var(--sc-soft);
    color: var(--sc-ink); font: inherit; font-size: 14px; resize: none; outline: none;
}
.dk-sc-compose textarea:focus { border-color: var(--sc-brand); background: var(--sc-paper); }
.dk-sc-send, .dk-sc-attach { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer; }
.dk-sc-send { background: var(--sc-brand); color: #fff; font-size: 16px; }
.dk-sc-send:disabled { opacity: .5; cursor: wait; }
.dk-sc-attach { background: var(--sc-soft); font-size: 18px; }
.dk-sc-attach[hidden] { display: none; }
.dk-sc-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dk-sc-attach:focus-within { outline: 2px solid var(--sc-brand); }
.dk-sc-file { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; padding: 4px 10px; border-radius: 8px; background: var(--sc-soft); font-size: 12px; }
.dk-sc-file[hidden] { display: none; }
.dk-sc-file button { border: 0; background: transparent; font-size: 16px; cursor: pointer; color: var(--sc-muted); }
.dk-sc-error { margin: 0 0 6px; font-size: 12px; color: #c8372d; }
.dk-sc-error[hidden] { display: none; }
/* Out of the way while someone types elsewhere on the page. */
.dk-sc.is-tucked:not(.is-open) .dk-sc-launcher { opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; }
.dk-sc-launcher { transition: opacity .18s ease, transform .18s ease; }
.dk-sc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 480px) {
    .dk-sc { right: 16px; bottom: 16px; }
    .dk-sc.is-open { inset: auto 0 auto 0; top: var(--sc-top, 0); height: var(--sc-vh, 100dvh); }
    .dk-sc-panel { width: 100vw; height: var(--sc-vh, 100dvh); border-radius: 0; border: 0; }
    /* The page behind the open chat stays put (so the keyboard cannot scroll it away). */
    html.dk-sc-locked, html.dk-sc-locked body { overflow: hidden; overscroll-behavior: none; }
    .dk-sc-launcher-label { display: none; }
    .dk-sc-launcher { width: 52px; padding: 0; justify-content: center; }
    .has-dk-sc .dk-guide-replay { right: 80px; }
}

@media (prefers-reduced-motion: reduce) {
    .dk-sc-panel, .dk-sc-typing span { animation: none; }
    .dk-sc-launcher { transition: none; }
}
