:root {
    --dps-ink: #12324a;
    --dps-muted: #5f7486;
    --dps-blue: #086a89;
    --dps-blue-dark: #07526d;
    --dps-teal: #12a59a;
    --dps-coral: #f06a4a;
    --dps-surface: #ffffff;
    --dps-soft: #eef7f8;
    --dps-line: #d7e6ea;
    --dps-shadow: 0 22px 58px rgba(9, 54, 76, .24);
}

.dps-widget,
.dps-widget * {
    box-sizing: border-box;
}

.dps-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1060;
    color: var(--dps-ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.dps-launcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 8px 18px 8px 8px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(125deg, var(--dps-blue-dark), var(--dps-blue) 58%, var(--dps-teal));
    box-shadow: 0 12px 30px rgba(4, 91, 120, .36);
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease;
}

.dps-launcher:hover,
.dps-launcher:focus-visible {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(4, 91, 120, .42);
}

.dps-launcher-pulse {
    position: absolute;
    inset: -4px;
    border: 1px solid rgba(18, 165, 154, .5);
    border-radius: inherit;
    animation: dps-pulse 2.8s ease-out infinite;
    pointer-events: none;
}

.dps-launcher-label {
    max-width: 160px;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.dps-header-avatar.dps-launcher-avatar {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(3, 59, 78, .22);
}

.dps-launcher-greeting {
    position: absolute;
    right: 4px;
    bottom: 72px;
    width: max-content;
    max-width: min(260px, calc(100vw - 40px));
    padding: 11px 16px 12px;
    border: 1px solid rgba(196, 220, 226, .95);
    border-radius: 17px 17px 5px 17px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(9, 54, 76, .2);
    color: var(--dps-ink);
    pointer-events: none;
    animation: dps-greeting-in .38s cubic-bezier(.2, .8, .2, 1);
}

.dps-launcher-greeting::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: -7px;
    width: 14px;
    height: 14px;
    border-right: 1px solid rgba(196, 220, 226, .95);
    border-bottom: 1px solid rgba(196, 220, 226, .95);
    background: #fff;
    transform: rotate(45deg);
}

.dps-launcher-greeting strong,
.dps-launcher-greeting span {
    display: block;
}

.dps-launcher-greeting strong {
    margin-bottom: 2px;
    color: var(--dps-blue-dark);
    font-size: 11px;
    line-height: 1.2;
}

.dps-launcher-greeting span {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.dps-launcher-greeting.dps-launcher-greeting--leaving {
    opacity: 0;
    transform: translateY(7px) scale(.96);
    transition: opacity .2s ease, transform .2s ease;
}

.dps-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    display: flex;
    width: 400px;
    height: min(650px, calc(100vh - 120px));
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(194, 220, 226, .9);
    border-radius: 24px;
    background:
        radial-gradient(circle at 100% 0, rgba(18, 165, 154, .12), transparent 34%),
        var(--dps-surface);
    box-shadow: var(--dps-shadow);
    animation: dps-panel-in .26s cubic-bezier(.2, .8, .2, 1);
}

.dps-panel-header {
    display: flex;
    min-height: 78px;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    color: #fff;
    background:
        linear-gradient(115deg, rgba(255,255,255,.08), transparent 40%),
        linear-gradient(125deg, var(--dps-blue-dark), var(--dps-blue) 62%, #0d938d);
}

.dps-header-avatar {
    display: grid;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    place-items: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .52);
    border-radius: 17px;
    background: rgba(255, 255, 255, .16);
}

.dps-header-avatar[data-emotion] {
    background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(220, 245, 247, .94));
    transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.dps-header-avatar[data-emotion="angry"] {
    border-color: rgba(255, 214, 204, .9);
    background: linear-gradient(145deg, #fff, #ffe6df);
    box-shadow: 0 0 0 3px rgba(240, 106, 74, .14);
}

.dps-header-avatar[data-emotion] img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.24);
    transition: opacity .14s ease, transform .22s cubic-bezier(.2, .8, .2, 1), filter .25s ease;
}

.dps-header-avatar.dps-emotion--changing img {
    opacity: 0;
    transform: scale(.92);
}

.dps-header-avatar[data-emotion="thinking"] img {
    animation: dps-boris-thinking 2.2s ease-in-out infinite;
}

.dps-header-avatar[data-emotion="answering"] img {
    animation: dps-boris-answer .48s cubic-bezier(.2, .8, .2, 1);
}

.dps-header-avatar[data-emotion="angry"] img {
    filter: drop-shadow(0 3px 5px rgba(181, 55, 35, .2));
    animation: dps-boris-angry .38s ease-out;
}

.dps-mascot-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dps-header-copy {
    min-width: 0;
    flex: 1;
}

.dps-header-copy strong {
    display: block;
    overflow: hidden;
    font-size: 17px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dps-header-copy span {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: rgba(255,255,255,.82);
    font-size: 12px;
}

.dps-header-copy i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7df3bf;
    box-shadow: 0 0 0 4px rgba(125, 243, 191, .14);
}

.dps-icon-button {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, .09);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.dps-icon-button:hover,
.dps-icon-button:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .18);
}

.dps-home {
    flex: 1;
    overflow-y: auto;
    padding: 25px 21px 18px;
}

.dps-welcome {
    padding: 21px;
    border: 1px solid var(--dps-line);
    border-radius: 20px;
    background:
        linear-gradient(140deg, rgba(255,255,255,.92), rgba(238,247,248,.88)),
        repeating-linear-gradient(135deg, transparent 0 12px, rgba(8,106,137,.04) 12px 13px);
}

.dps-eyebrow {
    display: inline-flex;
    margin-bottom: 9px;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--dps-blue-dark);
    background: #d9f0f1;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .13em;
}

.dps-welcome h3 {
    margin: 0 0 8px;
    color: var(--dps-ink);
    font-size: 24px;
    font-weight: 900;
    line-height: 1.15;
}

.dps-welcome p {
    margin: 0;
    color: var(--dps-muted);
    font-size: 14px;
    line-height: 1.55;
}

.dps-mode-list {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}

.dps-mode-card {
    display: grid;
    grid-template-columns: 48px 1fr 20px;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 15px;
    border: 1px solid var(--dps-line);
    border-radius: 18px;
    color: var(--dps-ink);
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.dps-mode-card:hover,
.dps-mode-card:focus-visible {
    color: var(--dps-ink);
    transform: translateY(-2px);
    border-color: #9ecfd3;
    box-shadow: 0 10px 25px rgba(11, 80, 101, .11);
}

.dps-mode-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
}

.dps-mode-card--boris .dps-mode-icon {
    background: linear-gradient(145deg, var(--dps-blue), var(--dps-teal));
}

.dps-mode-card--support .dps-mode-icon {
    background: linear-gradient(145deg, #de593c, #f49b56);
}

.dps-mode-card strong,
.dps-mode-card small {
    display: block;
}

.dps-mode-card strong {
    font-size: 15px;
    font-weight: 900;
}

.dps-mode-card small {
    margin-top: 4px;
    color: var(--dps-muted);
    font-size: 12px;
    line-height: 1.35;
}

.dps-mode-card > b {
    color: var(--dps-blue);
    font-size: 18px;
}

.dps-privacy-note {
    margin-top: 16px;
    color: #738895;
    font-size: 11px;
    text-align: center;
}

.dps-conversation {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.dps-context-strip {
    padding: 8px 14px;
    border-bottom: 1px solid var(--dps-line);
    color: var(--dps-blue-dark);
    background: #edf8f7;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.dps-messages {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 17px 15px;
    scroll-behavior: smooth;
}

.dps-empty-message {
    display: grid;
    gap: 6px;
    margin: auto 14px;
    padding: 22px;
    border: 1px dashed #b9d5da;
    border-radius: 18px;
    color: var(--dps-muted);
    background: rgba(238, 247, 248, .65);
    text-align: center;
}

.dps-empty-message strong {
    color: var(--dps-ink);
    font-size: 16px;
}

.dps-empty-message span {
    font-size: 13px;
    line-height: 1.45;
}

.dps-message {
    align-self: flex-start;
    width: min(88%, 315px);
    padding: 10px 12px 12px;
    border: 1px solid var(--dps-line);
    border-radius: 6px 17px 17px 17px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(15, 71, 91, .06);
    animation: dps-message-in .22s ease-out;
}

.dps-message--own {
    align-self: flex-end;
    border-color: #b8dfdc;
    border-radius: 17px 6px 17px 17px;
    background: #e9f8f5;
}

.dps-message--ai {
    border-left: 3px solid var(--dps-teal);
}

.dps-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    color: #6c818f;
    font-size: 10px;
}

.dps-message-meta strong {
    color: var(--dps-blue-dark);
    font-size: 11px;
}

.dps-message-body {
    color: #263f50;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.dps-sources {
    display: grid;
    gap: 5px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #e4eef0;
}

.dps-sources > span {
    color: #6d8290;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.dps-source-link {
    color: var(--dps-blue-dark);
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.dps-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 15px 10px;
    padding: 9px 12px;
    border-radius: 13px;
    color: var(--dps-muted);
    background: #edf5f6;
    font-size: 11px;
}

.dps-typing > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dps-teal);
    animation: dps-dot 1s ease-in-out infinite;
}

.dps-typing > span:nth-child(2) { animation-delay: .12s; }
.dps-typing > span:nth-child(3) { animation-delay: .24s; }
.dps-typing em {
    margin-left: 5px;
    font-style: normal;
}

.dps-compose {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    padding: 11px 12px 13px;
    border-top: 1px solid var(--dps-line);
    background: rgba(255,255,255,.96);
}

.dps-compose textarea {
    min-height: 42px;
    max-height: 112px;
    flex: 1;
    resize: none;
    padding: 10px 12px;
    border: 1px solid #bfd3d8;
    border-radius: 14px;
    color: var(--dps-ink);
    background: #f9fcfc;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
    outline: none;
}

.dps-compose textarea:focus {
    border-color: var(--dps-teal);
    box-shadow: 0 0 0 3px rgba(18, 165, 154, .12);
}

.dps-compose button {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, var(--dps-blue), var(--dps-teal));
    font-size: 21px;
    font-weight: 900;
    cursor: pointer;
}

.dps-compose button:disabled,
.dps-compose textarea:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.dps-loading {
    position: absolute;
    inset: 78px 0 0;
    z-index: 3;
    display: grid;
    place-content: center;
    gap: 12px;
    color: var(--dps-muted);
    background: rgba(255, 255, 255, .82);
    text-align: center;
    backdrop-filter: blur(3px);
}

.dps-loader-ring {
    width: 34px;
    height: 34px;
    margin: auto;
    border: 3px solid #dcebed;
    border-top-color: var(--dps-teal);
    border-radius: 50%;
    animation: dps-spin .75s linear infinite;
}

.dps-inline-error {
    padding: 10px 12px;
    border: 1px solid #f1c3b7;
    border-radius: 13px;
    color: #8b3e2d;
    background: #fff2ee;
    font-size: 12px;
}

.dps-robot {
    position: relative;
    display: block;
}

.dps-robot--small {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
}

.dps-robot--header {
    width: 42px;
    height: 42px;
}

.dps-robot-antenna {
    position: absolute;
    top: 3px;
    left: 50%;
    width: 2px;
    height: 7px;
    border-radius: 2px;
    background: var(--dps-coral);
    transform: translateX(-50%);
}

.dps-robot-antenna::before {
    position: absolute;
    top: -3px;
    left: -2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff9a70;
    content: "";
}

.dps-robot-face {
    position: absolute;
    inset: 10px 5px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 10px;
    background: linear-gradient(145deg, #d9f6f2, #fff);
    box-shadow: inset 0 0 0 2px rgba(8, 106, 137, .28);
}

.dps-robot-face i {
    width: 5px;
    height: 7px;
    border-radius: 50%;
    background: var(--dps-blue-dark);
    animation: dps-blink 4.5s infinite;
}

.dps-robot-face b {
    position: absolute;
    bottom: 5px;
    left: 50%;
    width: 12px;
    height: 5px;
    border-bottom: 2px solid var(--dps-teal);
    border-radius: 50%;
    transform: translateX(-50%);
}

.dps-widget [hidden],
.dps-admin [hidden] {
    display: none !important;
}

@keyframes dps-panel-in {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dps-message-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes dps-pulse {
    0%, 55% { opacity: 0; transform: scale(.94); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.12); }
}

@keyframes dps-dot {
    0%, 60%, 100% { opacity: .35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

@keyframes dps-spin { to { transform: rotate(360deg); } }

@keyframes dps-blink {
    0%, 44%, 48%, 100% { transform: scaleY(1); }
    46% { transform: scaleY(.1); }
}

@keyframes dps-boris-thinking {
    0%, 100% { transform: translateY(0) rotate(-.6deg) scale(1.24); }
    50% { transform: translateY(-2px) rotate(.6deg) scale(1.27); }
}

@keyframes dps-boris-answer {
    from { opacity: .3; transform: translateY(4px) scale(1.05); }
    to { opacity: 1; transform: translateY(0) scale(1.24); }
}

@keyframes dps-boris-angry {
    0%, 100% { transform: translateX(0) scale(1.24); }
    30% { transform: translateX(-3px) scale(1.24); }
    60% { transform: translateX(3px) scale(1.24); }
}

@keyframes dps-greeting-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 600px) {
    .dps-widget {
        right: 12px;
        bottom: 12px;
    }

    .dps-panel {
        position: fixed;
        inset: 8px;
        width: auto;
        height: auto;
        border-radius: 20px;
    }

    .dps-launcher-label {
        display: none;
    }

    .dps-launcher {
        width: 58px;
        padding: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dps-widget *,
    .dps-widget *::before,
    .dps-widget *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Support staff workspace. Scoped to avoid conflicts with Moodle and Moove. */
.dps-admin,
.dps-admin * {
    box-sizing: border-box;
}

.dps-admin {
    --dps-admin-border: #d8e5ea;
    color: var(--dps-ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.dps-admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 25px 27px;
    overflow: hidden;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 12%, rgba(44, 213, 188, .3), transparent 25%),
        linear-gradient(125deg, #083e59, #076e88 64%, #159c93);
    box-shadow: 0 16px 38px rgba(8, 65, 88, .18);
}

.dps-admin-kicker {
    display: inline-block;
    margin-bottom: 7px;
    padding: 4px 9px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .14em;
}

.dps-admin-hero h2 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 28px;
    font-weight: 900;
}

.dps-admin-hero p {
    max-width: 680px;
    margin: 0;
    color: rgba(255,255,255,.82);
}

.dps-admin-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.dps-admin-hero-actions .btn {
    border-color: rgba(255,255,255,.66);
    color: #fff;
}

.dps-admin-hero-actions .btn:hover {
    color: var(--dps-blue-dark);
    background: #fff;
}

.dps-unread-pill {
    padding: 8px 11px;
    border-radius: 999px;
    color: #06455e;
    background: #c9f5e8;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.dps-sound-state {
    padding: 6px 9px;
    border-radius: 999px;
    color: rgba(255,255,255,.86);
    background: rgba(255,255,255,.12);
    font-size: 10px;
    font-weight: 800;
}

.dps-sound-state[data-tone="ok"] { color: #d9ffeb; background: rgba(21,113,75,.48); }
.dps-sound-state[data-tone="warn"] { color: #fff1cd; background: rgba(145,82,19,.5); }

.dps-agent-manager {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(280px, 1fr) minmax(300px, 1.4fr);
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 14px 15px;
    border: 1px solid #bddbd7;
    border-radius: 16px;
    background: linear-gradient(135deg, #f2fbf9, #f8fbff);
}

.dps-agent-manager-copy strong,
.dps-agent-manager-copy span { display: block; }
.dps-agent-manager-copy strong { color: var(--dps-ink); font-size: 14px; }
.dps-agent-manager-copy span { margin-top: 3px; color: var(--dps-muted); font-size: 10px; line-height: 1.4; }

.dps-agent-add-form { display: flex; gap: 7px; }
.dps-agent-add-form input {
    min-width: 0;
    flex: 1;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #b9d3d6;
    border-radius: 9px;
}

.dps-agent-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.dps-agent-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px 6px 10px;
    border: 1px solid #b9ddd6;
    border-radius: 12px;
    background: #fff;
}
.dps-agent-chip span,
.dps-agent-chip strong,
.dps-agent-chip small { display: block; }
.dps-agent-chip strong { max-width: 180px; overflow: hidden; color: #174b5a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dps-agent-chip small { color: #708691; font-size: 9px; }
.dps-agent-chip button {
    display: grid;
    width: 24px;
    height: 24px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #9b3f36;
    background: #fff0ed;
    cursor: pointer;
}
.dps-agent-empty { color: var(--dps-muted); font-size: 10px; }

.dps-admin-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 13px;
    padding: 11px 15px;
    border: 1px solid #f3c79f;
    border-radius: 14px;
    color: #754113;
    background: #fff4e8;
    font-weight: 800;
}

.dps-admin-alert button {
    border: 0;
    color: #086a89;
    background: transparent;
    font-weight: 900;
    cursor: pointer;
}

.dps-admin-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 11px;
    margin-top: 15px;
}

.dps-stat-card {
    position: relative;
    min-height: 100px;
    padding: 15px;
    overflow: hidden;
    border: 1px solid var(--dps-admin-border);
    border-radius: 17px;
    background: #fff;
}

.dps-stat-card::after {
    position: absolute;
    right: -14px;
    bottom: -24px;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: var(--dps-stat-color, #1b7891);
    content: "";
    opacity: .11;
}

.dps-stat-card span {
    display: block;
    min-height: 32px;
    color: var(--dps-muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}

.dps-stat-card strong {
    display: block;
    margin-top: 6px;
    color: var(--dps-stat-color, var(--dps-ink));
    font-size: 27px;
    line-height: 1;
}

.dps-stat-card--blue { --dps-stat-color: #087395; }
.dps-stat-card--teal { --dps-stat-color: #098d82; }
.dps-stat-card--amber { --dps-stat-color: #c97820; }
.dps-stat-card--green { --dps-stat-color: #318757; }
.dps-stat-card--coral { --dps-stat-color: #c6533b; }
.dps-stat-card--ink { --dps-stat-color: #29495f; }

.dps-service-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 12px;
    padding: 13px 15px;
    border: 1px solid var(--dps-admin-border);
    border-radius: 15px;
    background: #f7fbfb;
}

.dps-service-status > div:first-child strong,
.dps-service-status > div:first-child span {
    display: block;
}

.dps-service-status > div:first-child span {
    margin-top: 3px;
    color: var(--dps-muted);
    font-size: 11px;
}

.dps-service-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.dps-service-chip {
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.dps-service-chip--ok { color: #20623d; background: #ddf4e6; }
.dps-service-chip--warn { color: #8b4a18; background: #fff0dc; }

.dps-admin-filters {
    display: grid;
    grid-template-columns: 150px 165px 145px 145px minmax(190px, 1fr) auto auto auto;
    align-items: end;
    gap: 9px;
    margin-top: 12px;
    padding: 13px;
    border: 1px solid var(--dps-admin-border);
    border-radius: 16px;
    background: #fff;
}

.dps-admin-filters label,
.dps-ticket-routing label {
    min-width: 0;
    margin: 0;
}

.dps-admin-filters label > span,
.dps-ticket-routing label > span {
    display: block;
    margin-bottom: 4px;
    color: #617886;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.dps-admin-filters input,
.dps-admin-filters select,
.dps-ticket-routing select,
.dps-reply-grid textarea {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid #c5d8dc;
    border-radius: 9px;
    color: var(--dps-ink);
    background: #fff;
}

.dps-support-grid {
    display: grid;
    grid-template-columns: minmax(290px, 34%) minmax(0, 1fr);
    min-height: 610px;
    margin-top: 13px;
    overflow: hidden;
    border: 1px solid var(--dps-admin-border);
    border-radius: 20px;
    background: #fff;
}

.dps-ticket-list {
    min-width: 0;
    border-right: 1px solid var(--dps-admin-border);
    background: #f7fafb;
}

.dps-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px 10px;
}

.dps-section-title h3 {
    margin: 0;
    color: var(--dps-ink);
    font-size: 16px;
    font-weight: 900;
}

.dps-section-title > span {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--dps-blue-dark);
    background: #dff0f3;
    font-size: 11px;
    font-weight: 900;
}

.dps-ticket-scroll {
    max-height: 710px;
    overflow-y: auto;
    padding: 5px 9px 10px;
    scroll-behavior: smooth;
}

.dps-ticket-row {
    display: grid;
    gap: 5px;
    margin-bottom: 7px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--dps-ink);
    background: #fff;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.dps-ticket-row:hover,
.dps-ticket-row:focus,
.dps-ticket-row--active {
    border-color: #9ecfd3;
    color: var(--dps-ink);
    background: #edf8f7;
    text-decoration: none;
}

.dps-ticket-row--unread {
    box-shadow: inset 4px 0 var(--dps-coral);
}

.dps-ticket-row--status-open { border-left: 4px solid #df6649; background: #fff8f5; }
.dps-ticket-row--status-inprogress { border-left: 4px solid #168fa0; background: #f2fbfc; }
.dps-ticket-row--status-waiting { border-left: 4px solid #d59231; background: #fffbf2; }
.dps-ticket-row--status-closed { border-left: 4px solid #4b9b67; background: #f5fbf7; opacity: .82; }

.dps-ticket-topline,
.dps-ticket-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dps-ticket-state {
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-style: normal;
    font-weight: 900;
}
.dps-ticket-state--open { color: #8b3d2c; background: #fee5dd; }
.dps-ticket-state--inprogress { color: #075d70; background: #d8f0f3; }
.dps-ticket-state--waiting { color: #82521a; background: #ffedcb; }
.dps-ticket-state--closed { color: #2d6d45; background: #dcf0e2; }

.dps-ticket-topline strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dps-ticket-topline b {
    display: grid;
    min-width: 19px;
    height: 19px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--dps-coral);
    font-size: 9px;
}

.dps-ticket-subject {
    overflow: hidden;
    color: var(--dps-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dps-ticket-meta {
    justify-content: flex-start;
    color: #718591;
    font-size: 9px;
}

.dps-ticket-meta em {
    margin-left: auto;
    font-style: normal;
}

.dps-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6e8693;
}

.dps-status-dot--open { background: #e56c4f; }
.dps-status-dot--inprogress { background: #168fa0; }
.dps-status-dot--waiting { background: #d59231; }
.dps-status-dot--closed { background: #4b9b67; }

.dps-admin-paging {
    padding: 7px 10px 12px;
    overflow-x: auto;
}

.dps-ticket-workspace {
    min-width: 0;
    padding: 17px;
}

.dps-ticket-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--dps-admin-border);
}

.dps-ticket-header span,
.dps-ticket-header p {
    color: var(--dps-muted);
    font-size: 11px;
}

.dps-ticket-header h3 {
    margin: 3px 0;
    color: var(--dps-ink);
    font-size: 20px;
    font-weight: 900;
}

.dps-ticket-header p { margin: 0; }

.dps-ticket-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.dps-ticket-status--open { color: #8b3d2c; background: #fee9e3; }
.dps-ticket-status--inprogress { color: #075d70; background: #daf1f3; }
.dps-ticket-status--waiting { color: #82521a; background: #fff0d7; }
.dps-ticket-status--closed { color: #2d6d45; background: #e0f3e6; }

.dps-ticket-routing {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
    align-items: end;
    gap: 8px;
    margin: 13px 0;
    padding: 11px;
    border-radius: 13px;
    background: #f4f8f9;
}

.dps-admin-chat {
    display: flex;
    max-height: 520px;
    min-height: 260px;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid var(--dps-admin-border);
    border-radius: 15px;
    background: #fbfdfd;
    scroll-behavior: smooth;
}

.dps-admin-message {
    align-self: flex-start;
    width: min(82%, 680px);
    padding: 10px 12px;
    border: 1px solid #d4e3e7;
    border-radius: 5px 14px 14px 14px;
    background: #fff;
}

.dps-admin-message--staff {
    align-self: flex-end;
    border-color: #b4ded9;
    border-radius: 14px 5px 14px 14px;
    background: #e9f7f4;
}

.dps-admin-message--internal {
    align-self: stretch;
    width: auto;
    border: 1px dashed #e0b36d;
    color: #694515;
    background: #fff6df;
}

.dps-admin-message header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
    color: #6f8490;
    font-size: 9px;
}

.dps-admin-message header strong {
    color: var(--dps-blue-dark);
}

.dps-admin-message > div {
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.dps-reply-grid {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 11px;
    margin-top: 12px;
}

.dps-reply-grid form {
    padding: 12px;
    border: 1px solid var(--dps-admin-border);
    border-radius: 14px;
    background: #fff;
}

.dps-reply-grid label strong,
.dps-reply-grid label small {
    display: block;
}

.dps-reply-grid label small {
    margin-top: 2px;
    color: var(--dps-muted);
    font-size: 10px;
}

.dps-reply-grid textarea {
    margin: 7px 0;
    resize: vertical;
}

.dps-note-form { background: #fffaf0 !important; }

.dps-select-ticket,
.dps-admin-empty {
    display: grid;
    min-height: 180px;
    place-items: center;
    padding: 30px;
    color: var(--dps-muted);
    text-align: center;
}

@media (max-width: 1250px) {
    .dps-admin-stats { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
    .dps-admin-filters { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
    .dps-filter-search { grid-column: span 2; }
    .dps-ticket-routing { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .dps-agent-manager { grid-template-columns: 1fr 1.4fr; }
    .dps-agent-list { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 850px) {
    .dps-admin-hero,
    .dps-service-status { align-items: flex-start; flex-direction: column; }
    .dps-admin-stats { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .dps-admin-filters { grid-template-columns: 1fr 1fr; }
    .dps-filter-search { grid-column: 1 / -1; }
    .dps-support-grid { grid-template-columns: 1fr; }
    .dps-ticket-list { border-right: 0; border-bottom: 1px solid var(--dps-admin-border); }
    .dps-ticket-scroll { max-height: 330px; }
    .dps-reply-grid { grid-template-columns: 1fr; }
    .dps-agent-manager { grid-template-columns: 1fr; }
    .dps-agent-list { grid-column: auto; }
}

@media (max-width: 520px) {
    .dps-admin-stats,
    .dps-admin-filters,
    .dps-ticket-routing { grid-template-columns: 1fr; }
    .dps-filter-search { grid-column: auto; }
    .dps-admin-hero-actions { align-items: flex-start; flex-direction: column; }
    .dps-ticket-workspace { padding: 10px; }
    .dps-admin-message { width: 94%; }
}

.dps-knowledge-grid {
    display: grid;
    grid-template-columns: minmax(280px, 35%) minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.dps-knowledge-list,
.dps-knowledge-form {
    padding: 15px;
    border: 1px solid var(--dps-admin-border);
    border-radius: 18px;
    background: #fff;
}

.dps-knowledge-list .dps-section-title { padding: 0 0 10px; }

.dps-knowledge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    padding: 11px;
    border: 1px solid #dfebee;
    border-radius: 12px;
    color: var(--dps-ink);
    background: #f9fcfc;
    text-decoration: none;
}

.dps-knowledge-row:hover { border-color: #94cbd0; color: var(--dps-ink); text-decoration: none; }
.dps-knowledge-row strong,
.dps-knowledge-row small { display: block; }
.dps-knowledge-row small { margin-top: 3px; color: var(--dps-muted); font-size: 10px; }
.dps-knowledge-row em { color: #478063; font-size: 10px; font-style: normal; font-weight: 900; }

.dps-knowledge-form h3 { margin: 0 0 13px; color: var(--dps-ink); font-size: 18px; font-weight: 900; }
.dps-knowledge-form label { display: block; margin-bottom: 11px; }
.dps-knowledge-form label > span { display: block; margin-bottom: 4px; color: #617886; font-size: 11px; font-weight: 900; }
.dps-knowledge-form input[type="text"],
.dps-knowledge-form input[type="number"],
.dps-knowledge-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c5d8dc;
    border-radius: 9px;
    color: var(--dps-ink);
    background: #fff;
}
.dps-knowledge-form label > small { display: block; margin-top: 4px; color: var(--dps-muted); }
.dps-knowledge-form-row { display: grid; grid-template-columns: 1fr 130px; align-items: end; gap: 12px; }
.dps-knowledge-form .dps-check { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.dps-knowledge-form .dps-check span { margin: 0; }
.dps-delete-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid #edf1f2; }

@media (max-width: 780px) {
    .dps-knowledge-grid { grid-template-columns: 1fr; }
}

/* Support queue controls and learner rating. */
.dps-overdue-pill {
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 999px;
    color: #fff;
    background: rgba(123, 48, 28, .28);
    font-size: 10px;
    font-weight: 900;
}

.dps-agent-position {
    display: grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 8px;
    color: #0d6674;
    background: #dff2f4;
    font-size: 10px;
}

.dps-agent-chip .dps-agent-controls {
    display: flex;
    align-items: center;
    gap: 3px;
}

.dps-agent-controls button {
    display: grid;
    width: 25px;
    height: 25px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 7px;
    color: #315b68;
    background: #edf5f6;
    line-height: 1;
}

.dps-agent-controls button:hover { color: #fff; background: #177f90; }

.dps-queue-settings {
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(0, 2fr);
    gap: 18px;
    margin: 12px 0;
    padding: 15px;
    border: 1px solid var(--dps-admin-border);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff 0%, #f3faf9 100%);
}

.dps-queue-settings-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(145px, 1fr)) auto;
    align-items: end;
    gap: 10px;
}

.dps-queue-settings-form label > span,
.dps-queue-settings-form label > small {
    display: block;
}

.dps-queue-settings-form label > span {
    margin-bottom: 4px;
    color: #385764;
    font-size: 10px;
    font-weight: 900;
}

.dps-queue-settings-form label > small {
    margin-top: 4px;
    color: var(--dps-muted);
    font-size: 9px;
    line-height: 1.25;
}

.dps-queue-settings-form input[type="number"] {
    width: 100%;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid #bfd2d7;
    border-radius: 9px;
    background: #fff;
}

.dps-queue-check {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 8px;
    padding: 9px;
    border-radius: 11px;
    background: #e8f6f4;
}

.dps-queue-check > span { margin: 0 !important; }

.dps-ticket-rating {
    margin: 10px 0;
    padding: 9px 12px;
    border: 1px solid #efd38f;
    border-radius: 11px;
    color: #725011;
    background: #fff8df;
    font-size: 11px;
}

.dps-rating {
    margin: 0 13px 9px;
    padding: 11px 13px;
    border: 1px solid #ead394;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff9e7, #fff3cb);
    box-shadow: 0 7px 18px rgba(98, 75, 19, .08);
}

.dps-rating > strong,
.dps-rating > span { display: block; }
.dps-rating > strong { color: #4f4018; font-size: 13px; }
.dps-rating > span { margin-top: 2px; color: #7b692f; font-size: 10px; }
.dps-rating-stars { display: flex; gap: 3px; margin-top: 6px; }
.dps-rating-stars button {
    padding: 0 2px;
    border: 0;
    color: #d5c69b;
    background: transparent;
    font-size: 25px;
    line-height: 1;
    transition: color .16s ease, transform .16s ease;
}
.dps-rating-stars button:not(:disabled):hover,
.dps-rating-stars button:not(:disabled):focus-visible {
    color: #e3a316;
    outline: none;
    transform: translateY(-2px) scale(1.08);
}
.dps-rating-stars .dps-rating-star--active,
.dps-rating-stars .dps-rating-star--preview {
    color: #e3a316;
}
.dps-rating-stars button:not(:disabled):focus-visible {
    border-radius: 5px;
    box-shadow: 0 0 0 2px rgba(227, 163, 22, .3);
}

/* Compact alert injected into Boost/Moove-compatible top navigation. */
.dps-navbar-support {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-right: 7px;
    padding: 3px;
    border: 1px solid #d4e3e7;
    border-radius: 12px;
    background: #f6fafb;
}

.dps-navbar-ticket-link,
.dps-navbar-sound {
    position: relative;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: #175f70;
    background: transparent;
}

.dps-navbar-ticket-link:hover,
.dps-navbar-sound:hover { color: #fff; background: #147d8f; text-decoration: none; }
.dps-navbar-ticket-link svg,
.dps-navbar-sound svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.dps-navbar-sound { width: 28px; color: #8299a2; }
.dps-navbar-sound--ready { color: #2f8a5d; }
.dps-navbar-badge {
    position: absolute;
    top: -4px;
    right: -5px;
    min-width: 18px;
    padding: 2px 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: #de593d;
    font-size: 8px;
    font-weight: 900;
    line-height: 12px;
    text-align: center;
}
.dps-navbar-support--active .dps-navbar-ticket-link { color: #fff; background: #c95339; }

@media (max-width: 1250px) {
    .dps-queue-settings { grid-template-columns: 1fr; }
    .dps-queue-settings-form { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}

@media (max-width: 620px) {
    .dps-queue-settings-form { grid-template-columns: 1fr; }
    .dps-navbar-sound { display: none; }
}
