/* Support Desk widget — SnugDates. No CDN, no build step. Served from public/css/. */

#sd-root * { box-sizing: border-box; }

.sd-fab {
    position: fixed; z-index: 9997; width: 62px; height: 62px; border: 0; border-radius: 50%;
    background: linear-gradient(135deg, var(--sd-a), var(--sd-b)); color: #fff; cursor: pointer;
    box-shadow: 0 10px 26px rgba(20, 20, 60, .28);
    display: flex; align-items: center; justify-content: center;
}
.sd-fab:hover { filter: brightness(1.06); }
.sd-fab:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.sd-fab-dot {
    position: absolute; top: 6px; right: 6px; width: 13px; height: 13px;
    border-radius: 50%; background: #22C55E; border: 2.5px solid #fff;
}

.sd-pos-bottom-right { right: 22px; bottom: 22px; }
.sd-pos-bottom-left  { left: 22px;  bottom: 22px; }
.sd-pos-middle-right { right: 22px; top: 50%; transform: translateY(-50%); }
.sd-pos-middle-left  { left: 22px;  top: 50%; transform: translateY(-50%); }

.sd-panel {
    position: fixed; z-index: 9998; width: 376px; max-width: calc(100vw - 32px);
    height: min(620px, calc(100vh - 130px)); background: #fff; border-radius: 20px; overflow: hidden;
    display: none; flex-direction: column; box-shadow: 0 24px 60px rgba(16, 16, 50, .30);
    font-family: inherit; color: var(--sd-ink);
}
.sd-panel.sd-on { display: flex; }
.sd-panel-right { right: 22px; bottom: 100px; }
.sd-panel-left  { left: 22px;  bottom: 100px; }

.sd-head {
    background: linear-gradient(135deg, var(--sd-a), var(--sd-b)); color: #fff;
    padding: 16px 14px; display: flex; align-items: center; gap: 12px;
}
.sd-ava {
    width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .18);
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.sd-head-t { flex: 1 1 auto; min-width: 0; }
.sd-head-t b {
    display: block; font-size: 18px; line-height: 1.2; font-weight: 800;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sd-status { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: .95; margin-top: 3px; }
.sd-dot { width: 9px; height: 9px; border-radius: 50%; background: #22C55E; flex: 0 0 auto; }
.sd-dot.sd-off { background: #FBBF24; }
.sd-hbtn {
    width: 40px; height: 40px; border: 0; border-radius: 11px; background: rgba(255, 255, 255, .16);
    color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.sd-hbtn:hover { background: rgba(255, 255, 255, .28); }
.sd-hbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.sd-body { flex: 1 1 auto; overflow-y: auto; background: var(--sd-bg); padding: 18px 16px; }
.sd-empty {
    height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 10px 6px;
}
.sd-empty-ico {
    width: 82px; height: 82px; border-radius: 50%; background: #E4E4FA; color: var(--sd-a);
    display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.sd-empty h3 { margin: 0 0 10px; font-size: 21px; font-weight: 800; line-height: 1.25; color: var(--sd-ink); }
.sd-empty p { margin: 0; font-size: 14.5px; line-height: 1.55; color: #4B5563; max-width: 290px; }

.sd-msg { display: flex; margin-bottom: 12px; }
.sd-msg .sd-bub {
    max-width: 82%; padding: 11px 14px; border-radius: 15px; font-size: 14.5px; line-height: 1.55;
    white-space: pre-wrap; word-wrap: break-word;
}
.sd-msg.sd-me { justify-content: flex-end; }
.sd-msg.sd-me .sd-bub {
    background: linear-gradient(135deg, var(--sd-a), var(--sd-b)); color: #fff; border-bottom-right-radius: 5px;
}
.sd-msg.sd-them .sd-bub { background: #fff; border: 1px solid var(--sd-line); border-bottom-left-radius: 5px; }
.sd-msg.sd-sys .sd-bub { background: #FFF7ED; border: 1px solid #FED7AA; color: #7C2D12; max-width: 100%; }
.sd-msg.sd-agent .sd-bub { background: #ECFDF5; border: 1px solid #A7F3D0; border-bottom-left-radius: 5px; }
.sd-who {
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--sd-mut); margin: 0 0 4px 2px;
}

.sd-typing {
    display: flex; gap: 4px; padding: 12px 14px; background: #fff;
    border: 1px solid var(--sd-line); border-radius: 15px; width: 56px;
}
.sd-typing i { width: 7px; height: 7px; border-radius: 50%; background: #B9BACB; animation: sd-blink 1.2s infinite; }
.sd-typing i:nth-child(2) { animation-delay: .18s; }
.sd-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes sd-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.sd-acts { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--sd-line); background: #fff; }
.sd-act {
    flex: 1 1 0; border: 0; border-radius: 12px; background: var(--sd-soft); color: var(--sd-deep);
    font-size: 14.5px; font-weight: 700; padding: 13px 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 9px; font-family: inherit;
}
.sd-act:hover { background: #E2E2F8; }
.sd-act:focus-visible { outline: 2px solid var(--sd-a); outline-offset: 2px; }

.sd-foot { padding: 12px 16px 14px; background: #fff; border-top: 1px solid var(--sd-line); }
.sd-row { display: flex; gap: 10px; align-items: center; }
.sd-in {
    flex: 1 1 auto; border: 1.6px solid #C9C8F2; border-radius: 14px; padding: 13px 15px;
    font-size: 14.5px; font-family: inherit; color: var(--sd-ink); background: #fff; outline: none; min-width: 0;
}
.sd-in:focus { border-color: var(--sd-a); }
.sd-send {
    width: 54px; height: 50px; border: 0; border-radius: 13px; color: #fff; cursor: pointer; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--sd-a), var(--sd-b));
    display: flex; align-items: center; justify-content: center;
}
.sd-send:disabled { opacity: .5; cursor: not-allowed; }
.sd-send:focus-visible { outline: 2px solid var(--sd-a); outline-offset: 2px; }
.sd-note { margin: 9px 0 0; text-align: center; font-size: 12.5px; line-height: 1.45; color: #9CA3AF; }

.sd-form { padding: 16px; background: #fff; border-top: 1px solid var(--sd-line); display: none; }
.sd-form.sd-on { display: block; }
.sd-form label {
    display: block; font-size: 12.5px; font-weight: 700; color: var(--sd-mut);
    text-transform: uppercase; letter-spacing: .04em; margin: 0 0 5px;
}
.sd-form input, .sd-form textarea {
    width: 100%; border: 1.6px solid #C9C8F2; border-radius: 11px; padding: 11px 13px;
    font-size: 14.5px; font-family: inherit; margin-bottom: 12px; color: var(--sd-ink); outline: none;
}
.sd-form textarea { min-height: 96px; resize: vertical; }
.sd-form input:focus, .sd-form textarea:focus { border-color: var(--sd-a); }
.sd-form-row { display: flex; gap: 10px; }

.sd-btn { flex: 1 1 0; border: 0; border-radius: 12px; padding: 12px; font-size: 14.5px; font-weight: 700; cursor: pointer; font-family: inherit; }
.sd-btn-p { background: linear-gradient(135deg, var(--sd-a), var(--sd-b)); color: #fff; }
.sd-btn-s { background: var(--sd-soft); color: var(--sd-deep); }
.sd-err { color: #B91C1C; font-size: 13px; margin: 0 0 10px; display: none; }
.sd-err.sd-on { display: block; }

@media (max-width: 480px) {
    .sd-panel { left: 12px; right: 12px; bottom: 92px; width: auto; max-width: none; height: calc(100vh - 120px); }
    .sd-fab { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .sd-typing i { animation: none; opacity: .6; }
}
