
.dk-chat-entry { display:flex; justify-content:center; margin:16px auto 30px; padding:0 12px; }
.dk-chat-entry button {
    display:flex; align-items:center; gap:12px; width:min(100%,345px); min-height:72px;
    padding:12px 16px; text-align:left; font:inherit; color:#225b84; background:#fff;
    border:1px solid #d7e3ec; box-shadow:0 3px 8px #173b543b; cursor:pointer;
}
.dk-chat-entry button:hover { background:#f3f8fb; border-color:#8ba8bc; }
.dk-chat-entry strong,.dk-chat-entry small { display:block; }
.dk-chat-entry small { margin-top:3px; }
.dk-chat-icon {
    display:grid; place-items:center; flex:0 0 40px; height:40px; border-radius:50%;
    background:#2b6a95; color:#fff; font-size:20px; font-weight:700;
}
.dk-chat {
    box-sizing:border-box; width:min(620px,calc(100% - 24px)); max-height:calc(100dvh - 24px);
    padding:0; overflow:auto; border:1px solid #b5c8d6; border-radius:8px;
    background:#fff; color:#173b54; font:inherit; box-shadow:0 14px 42px #102d4966;
}
.dk-chat:not([open]) { display:none; }
.dk-chat::backdrop { background:#162b3a66; }
.dk-chat header,.dk-chat footer {
    display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 16px;
}
.dk-chat header { background:#2b6a95; color:#fff; }
.dk-chat h2 { margin:0; color:inherit; font-size:1.12em; }
.dk-chat-close {
    width:34px; height:34px; border:1px solid #ffffff70; border-radius:4px;
    background:transparent; color:#fff; font-size:23px; cursor:pointer;
}
.dk-chat-log {
    display:flex; flex-direction:column; gap:12px; min-height:150px;
    height:clamp(150px,36vh,360px); padding:16px; overflow:auto; background:#f3f8fb;
}
.dk-chat-bubble {
    flex:none; max-width:88%; padding:10px 12px; overflow-wrap:anywhere;
    border:1px solid #d4e2eb; border-radius:8px; background:#fff; line-height:1.5;
}
.dk-chat-bubble p { margin:0; white-space:pre-wrap; }
.dk-chat-bubble ul { margin:8px 0 0; padding-left:18px; }
.dk-chat-user { align-self:flex-end; background:#e4f1fa; }
.dk-chat-assistant { align-self:flex-start; }
.dk-chat-status { margin:8px 16px 0; font-size:.9em; }
.dk-chat-status:empty { display:none; }
.dk-chat form { margin:0; padding:10px 16px 14px; }
.dk-chat label { display:block; margin:0 0 5px; font-weight:600; }
.dk-chat-compose { display:flex; align-items:end; gap:8px; }
.dk-chat-compose textarea {
    box-sizing:border-box; flex:1; min-width:0; padding:8px 10px; border:1px solid #8ba8bc;
    border-radius:4px; font:inherit; color:#173b54; resize:vertical;
}
.dk-chat-compose button {
    min-height:40px; padding:8px 14px; border:1px solid #225a80; border-radius:4px;
    background:#2b6a95; color:#fff; font:inherit; font-weight:600; cursor:pointer;
}
.dk-chat-compose button:disabled { opacity:.6; cursor:wait; }
.dk-chat footer { flex-wrap:wrap; background:#eef5fa; font-size:.88em; }
.dk-chat a { color:#225b84; text-decoration:underline; }
.dk-chat-entry button:focus-visible,.dk-chat :is(button,a,textarea):focus-visible {
    outline:2px solid #2b6a95; outline-offset:2px;
}
.dk-chat .dk-chat-close:focus-visible { outline-color:#fff; }
@media (max-width:480px) {
    .dk-chat-compose { align-items:stretch; flex-direction:column; }
    .dk-chat-compose button { align-self:flex-end; }
}

/* HESK public assistant layout v2 */

.dk-chat-action-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
}
.dk-chat-action-grid > .dk-chat-action-item {
    box-sizing: border-box;
    width: auto !important;
    min-width: 0;
    max-width: none !important;
    margin: 0 !important;
}
.dk-chat-action-grid .dk-chat-native-action {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
    max-width: none !important;
    height: 100%;
    margin: 0 !important;
}
.dk-chat-action-grid > .dk-chat-entry {
    display: flex;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
}
.dk-chat-action-grid > .dk-chat-entry button {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 72px;
}

dialog.dk-chat[open] {
    display: flex;
    flex-direction: column;
    width: min(940px, calc(100% - 40px));
    height: min(760px, calc(100dvh - 40px));
    max-height: calc(100dvh - 40px);
    overflow: hidden;
}
.dk-chat > header,
.dk-chat > footer,
.dk-chat > form,
.dk-chat > .dk-chat-status {
    flex: 0 0 auto;
}
.dk-chat > .dk-chat-log {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: 18px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.dk-chat .dk-chat-bubble { max-width: min(86%, 740px); }
.dk-chat-compose textarea {
    width: 100%;
    min-height: 76px;
    max-height: 160px;
}
@media (max-width: 860px) {
    .dk-chat-action-grid { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 600px) {
    dialog.dk-chat[open] {
        width: calc(100% - 16px);
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
    }
    .dk-chat > .dk-chat-log { padding: 12px; }
    .dk-chat .dk-chat-bubble { max-width: 92%; }
}

.dk-chat-rating {
    display:flex; flex-wrap:wrap; align-items:center; gap:7px;
    margin-top:10px; padding-top:8px; border-top:1px solid #d4e2eb;
    font-size:.85em; color:#225b84;
}
.dk-chat-rating button {
    min-width:42px; min-height:30px; padding:3px 9px;
    border:1px solid #8ba8bc; border-radius:4px; background:#fff;
    color:#225b84; font:inherit; cursor:pointer;
}
.dk-chat-rating button:hover:not(:disabled) { background:#e4f1fa; }
.dk-chat-rating button:disabled { opacity:.6; cursor:wait; }

/* HESK public chat side panel */
dialog.dk-chat[open] {
    position: fixed;
    inset: 0 0 0 auto;
    display: flex;
    flex-direction: column;
    width: min(680px, 100%);
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: -12px 0 36px rgba(15, 41, 60, .24);
    animation: dk-chat-enter .22s ease-out;
}
@keyframes dk-chat-enter {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
.dk-chat::backdrop { background: rgba(16, 38, 55, .36); }

.dk-chat > header,
.dk-chat > form,
.dk-chat > footer,
.dk-chat > .dk-chat-status { flex: 0 0 auto; }

.dk-chat > header {
    min-height: 60px;
    box-sizing: border-box;
    padding: 10px 20px;
    background: #245d83;
    color: #fff;
    border: 0;
}
.dk-chat > header h2 { font-size: 18px; font-weight: 700; }
.dk-chat .dk-chat-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #fff;
    font-size: 26px;
    line-height: 1;
}
.dk-chat .dk-chat-close:hover { background: rgba(255, 255, 255, .16); }
.dk-chat .dk-chat-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.dk-chat > .dk-chat-log {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    padding: 20px;
    gap: 14px;
    overflow: auto;
    overscroll-behavior: contain;
    background: #eff5f9;
}
.dk-chat .dk-chat-bubble {
    max-width: 88%;
    padding: 11px 14px;
    border-color: #d6e4ed;
    border-radius: 9px;
}
.dk-chat .dk-chat-user { background: #dcecf8; }
.dk-chat .dk-chat-assistant { background: #fff; }
.dk-chat > .dk-chat-status {
    margin: 0;
    padding: 9px 20px 0;
    color: #225b84;
}
.dk-chat > .dk-chat-status:empty { display: none; }
.dk-chat > form {
    padding: 12px 20px 10px;
    background: #fff;
    border-top: 1px solid #d6e4ed;
}
.dk-chat .dk-chat-compose { align-items: end; gap: 10px; }
.dk-chat .dk-chat-compose textarea {
    min-height: 64px;
    max-height: min(160px, 25dvh);
    padding: 10px 12px;
    border-radius: 6px;
    background: #fff;
}
.dk-chat .dk-chat-shortcuts {
    margin: 6px 0 0;
    color: #526b7e;
    font-size: 12px;
}
.dk-chat > footer {
    padding: 10px 20px max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid #d6e4ed;
    background: #f6f9fb;
}
@media (max-width: 600px) {
    .dk-chat > header,
    .dk-chat > form,
    .dk-chat > footer,
    .dk-chat > .dk-chat-log { padding-left: 12px; padding-right: 12px; }
    .dk-chat .dk-chat-bubble { max-width: 94%; }
    .dk-chat .dk-chat-compose textarea { width: 100%; }
    .dk-chat .dk-chat-shortcuts { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    dialog.dk-chat[open] { animation: none; }
}
