/* Chat Web Soporte — compacto, abajo a la derecha, compatible con #notification-container */
#chatweb-root {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2147483646;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 8px;
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    pointer-events: none;
    max-width: calc(100vw - 24px);
}

#chatweb-root > * {
    pointer-events: auto;
}

/* Botón compacto (siempre visible salvo que el panel ocupe todo en móvil) */
#chatweb-launcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px 0 12px;
    border: 1px solid rgba(100, 160, 220, 0.55);
    border-radius: 999px;
    cursor: pointer;
    background: linear-gradient(180deg, #2f3b4a 0%, #232a34 100%);
    color: #e8f4ff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#chatweb-launcher:hover {
    transform: translateY(-1px);
    border-color: #5aa0e8;
    box-shadow: 0 6px 20px rgba(46, 139, 224, 0.28);
}

#chatweb-launcher .chatweb-fab-icon {
    font-size: 15px;
    line-height: 1;
}

#chatweb-launcher .chatweb-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7dffa8;
    box-shadow: 0 0 6px rgba(125, 255, 168, 0.75);
    flex-shrink: 0;
}

#chatweb-launcher .chatweb-fab-label {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.chatweb-unread-badge {
    color: #7dffa8;
    font-weight: 700;
    font-size: 11px;
    text-shadow: 0 0 8px rgba(125, 255, 168, 0.45);
}

.chatweb-sound-el {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.chatweb-screen-kicker {
    margin: 0 0 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7dffa8;
}

.chatweb-subject-screen,
.chatweb-otro-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 11px 8px;
    overflow-y: auto;
    text-align: left;
    gap: 0;
}

.chatweb-subject-title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
    color: #eef5ff;
    letter-spacing: -0.01em;
}

.chatweb-subject-hint {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.35;
    color: #8fa3bc;
}

.chatweb-subject-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.chatweb-subject-option {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    text-align: left;
    padding: 8px 9px;
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(90, 120, 155, 0.45);
    background: rgba(12, 18, 28, 0.55);
    color: #dce9f8;
    font-size: 11px;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.chatweb-subject-option.is-otro {
    grid-column: 1 / -1;
}

.chatweb-subject-option-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(46, 139, 224, 0.15);
    font-size: 12px;
}

.chatweb-subject-option-label {
    flex: 1;
    min-width: 0;
}

.chatweb-subject-option:hover {
    border-color: rgba(125, 255, 168, 0.55);
    background: rgba(46, 139, 224, 0.12);
    transform: translateY(-1px);
}

.chatweb-otro-screen .chatweb-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.chatweb-otro-screen .chatweb-field > span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8fa3bc;
}

.chatweb-field-input,
.chatweb-field-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 9px;
    border-radius: 7px;
    border: 1px solid rgba(90, 120, 155, 0.5);
    background: rgba(8, 12, 20, 0.75);
    color: #eef4fc;
    font: inherit;
    font-size: 12px;
    line-height: 1.35;
    resize: vertical;
}

.chatweb-field-input:focus,
.chatweb-field-textarea:focus {
    outline: none;
    border-color: rgba(125, 255, 168, 0.65);
    box-shadow: 0 0 0 2px rgba(125, 255, 168, 0.12);
}

.chatweb-inline-error {
    margin: 0 0 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(220, 80, 80, 0.12);
    border: 1px solid rgba(248, 120, 120, 0.35);
    color: #ffb4b4;
    font-size: 11px;
    line-height: 1.35;
}

.chatweb-btn-block {
    width: 100%;
    margin-bottom: 6px;
}

.chatweb-btn-ghost {
    width: 100%;
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #8eb8e8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.chatweb-btn-ghost:hover {
    color: #d7ecff;
    background: rgba(255, 255, 255, 0.06);
}

.chatweb-history-subject {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #9dffc4;
    margin: 2px 0 4px;
    line-height: 1.25;
}

/* Panel: solo visible al expandir */
#chatweb-panel {
    display: none;
    flex-direction: column;
    position: relative;
    width: min(320px, calc(100vw - 28px));
    height: min(420px, var(--chatweb-panel-max-h, 68vh));
    max-height: var(--chatweb-panel-max-h, 70vh);
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, #2a2f38 0%, #1e2229 100%);
    border: 1px solid #4a5568;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transform-origin: bottom right;
    animation: chatweb-panel-in 0.22s ease;
}

@keyframes chatweb-panel-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#chatweb-root.is-open #chatweb-panel {
    display: flex;
}

#chatweb-root.is-open #chatweb-launcher {
    opacity: 0.92;
    padding: 0 12px;
    min-height: 36px;
}

#chatweb-root.is-open #chatweb-launcher .chatweb-fab-label::after {
    content: ' · minimizar';
    font-weight: normal;
    opacity: 0.85;
    font-size: 11px;
}

.chatweb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 9px;
    background: rgba(29, 61, 95, 0.92);
    border-bottom: 1px solid #3d5a7a;
    color: #e8f4ff;
    flex-shrink: 0;
}

.chatweb-header h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.chatweb-header-actions {
    display: flex;
    gap: 2px;
}

.chatweb-header-actions button {
    background: transparent;
    border: none;
    color: #b9d4f0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 4px;
}

.chatweb-header-actions button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.chatweb-messages-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.chatweb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.12);
    min-height: 120px;
}

.chatweb-prior-link-bar {
    flex-shrink: 0;
    padding: 6px 10px 0;
    text-align: center;
}

.chatweb-btn-prior-chats {
    width: 100%;
    border: 1px dashed rgba(90, 143, 196, 0.55);
    border-radius: 8px;
    background: rgba(46, 139, 224, 0.08);
    color: #9ec8f0;
    font-size: 11px;
    font-weight: 600;
    padding: 7px 10px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chatweb-btn-prior-chats:hover {
    background: rgba(46, 139, 224, 0.18);
    border-color: #5a8fc4;
    color: #d7ecff;
}

.chatweb-prior-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1a2330 0%, #141c28 100%);
    border-top: 1px solid rgba(90, 143, 196, 0.25);
}

.chatweb-prior-overlay-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(90, 143, 196, 0.2);
    flex-shrink: 0;
}

.chatweb-prior-overlay-title {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: #b8d4ef;
}

.chatweb-prior-back,
.chatweb-prior-close {
    border: none;
    background: transparent;
    color: #8eb8e8;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
}

.chatweb-prior-back:hover,
.chatweb-prior-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.chatweb-prior-overlay-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chatweb-prior-overlay-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 10px 8px;
}

.chatweb-btn-prior-active {
    flex-shrink: 0;
    margin: 8px 0;
    width: 100%;
    border: 1px solid #5a8fc4;
    border-radius: 6px;
    background: rgba(46, 139, 224, 0.15);
    color: #c5e0ff;
    font-size: 11px;
    padding: 6px 8px;
    cursor: pointer;
}

.chatweb-btn-prior-active:hover {
    background: rgba(46, 139, 224, 0.28);
}

.chatweb-prior-view-msgs {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.chatweb-prior-empty {
    font-size: 12px;
    color: #8a9bb0;
    text-align: center;
    margin: 12px 0;
}

.chatweb-history-relative {
    display: block;
    font-size: 10px;
    color: #6d8fad;
    margin: 0 0 4px;
    font-style: italic;
}

.chatweb-typing-bar {
    flex-shrink: 0;
    padding: 4px 12px 6px;
    font-size: 11px;
    color: #8ec7ff;
    font-style: italic;
    background: rgba(46, 139, 224, 0.1);
    border-bottom: 1px solid rgba(90, 143, 196, 0.2);
    animation: chatweb-typing-pulse 1.4s ease-in-out infinite;
}

@keyframes chatweb-typing-pulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

.chatweb-sound-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: #9eb4cc;
    cursor: pointer;
    user-select: none;
}

.chatweb-sound-toggle input {
    accent-color: #4e8fda;
    width: 14px;
    height: 14px;
    margin: 0;
}

.chatweb-msg {
    max-width: 92%;
    padding: 7px 9px;
    border-radius: 9px;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.4;
}

.chatweb-msg.visitor {
    align-self: flex-end;
    background: linear-gradient(135deg, #3a7fc4, #2a6aa8);
    color: #fff;
    border-bottom-right-radius: 3px;
}

.chatweb-msg.admin {
    align-self: flex-start;
    background: linear-gradient(135deg, #3d4f63, #2f3d4d);
    color: #e8f4ff;
    border: 1px solid #5a7a9e;
    border-bottom-left-radius: 3px;
}

.chatweb-msg.admin.staff-brand {
    background: linear-gradient(135deg, #1d4a3a 0%, #2a5c48 50%, #1a4032 100%);
    color: #e8fff4;
    border: 1px solid #7dffa8;
    box-shadow: 0 2px 12px rgba(125, 255, 168, 0.18);
}

.chatweb-msg.admin.staff-brand .chatweb-msg-meta {
    color: #b8f5d4;
    font-weight: 600;
}

.chatweb-msg-file-link {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    color: #d7e8ff;
    text-decoration: none;
    font-size: 12px;
}

.chatweb-msg-file-link:hover {
    color: #fff;
}

.chatweb-compose-attach-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.chatweb-file-input-offscreen {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.chatweb-link-attach {
    display: inline-block;
    border: none;
    background: none;
    color: #8ab4e8;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    position: relative;
    z-index: 3;
}

.chatweb-link-attach:hover {
    color: #c5e0ff;
}

.chatweb-link-attach.chatweb-is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.chatweb-attach-meta {
    font-size: 10px;
    color: #8a9bb0;
}

.chatweb-compose-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    z-index: 3;
}

.chatweb-compose-actions .chatweb-btn-send {
    pointer-events: auto;
}

.chatweb-btn-send-secondary {
    background: linear-gradient(180deg, #6b8a9e, #4f6d80);
    color: #eef6ff;
    padding: 6px 10px;
    font-size: 11px;
}

.chatweb-btn-send-secondary:hover {
    filter: brightness(1.08);
}

.chatweb-pending-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.chatweb-pending-thumb {
    position: relative;
    display: inline-block;
}

.chatweb-pending-thumb img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #4a5568;
    display: block;
}

.chatweb-resolved-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    text-align: center;
    color: #c5d4e8;
}

.chatweb-resolved-icon {
    width: 48px;
    height: 48px;
    line-height: 48px;
    border-radius: 50%;
    background: rgba(125, 255, 168, 0.15);
    color: #7dffa8;
    font-size: 24px;
    margin-bottom: 10px;
}

.chatweb-resolved-hint {
    font-size: 12px;
    opacity: 0.85;
    margin: 8px 0 14px;
}

.chatweb-msg-meta {
    font-size: 10px;
    opacity: 0.78;
    margin-bottom: 3px;
}

.chatweb-compose {
    padding: 8px 9px;
    border-top: 1px solid rgba(90, 120, 155, 0.35);
    background: rgba(18, 24, 34, 0.98);
    flex-shrink: 0;
}

.chatweb-compose textarea {
    width: 100%;
    min-height: 42px;
    max-height: 88px;
    resize: none;
    box-sizing: border-box;
    padding: 7px 8px;
    border-radius: 7px;
    border: 1px solid rgba(90, 120, 155, 0.45);
    background: rgba(8, 12, 20, 0.85);
    color: #eef4fc;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.35;
}

.chatweb-compose textarea:focus {
    outline: none;
    border-color: #2e8be0;
}

.chatweb-compose-row,
.chatweb-compose-toolbar {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
}

.chatweb-compose-toolbar {
    flex-wrap: wrap;
}

.chatweb-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #4a5568;
    background: #1a1d23;
    color: #b9d4f0;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

.chatweb-upload-btn:hover {
    border-color: #2e8be0;
    color: #fff;
}

.chatweb-upload-preview {
    margin-top: 6px;
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.chatweb-upload-preview img {
    max-width: 120px;
    max-height: 80px;
    border-radius: 6px;
    border: 1px solid #4a5568;
    display: block;
}

.chatweb-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: #c45c5c;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.chatweb-msg-image-link {
    display: block;
    margin-top: 4px;
}

.chatweb-msg-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    display: block;
    cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.chatweb-msg-text {
    margin-top: 4px;
}

.chatweb-blocked-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
    color: #a8b8cc;
}

.chatweb-blocked-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.chatweb-blocked-screen p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    max-width: 260px;
}

.chatweb-busy-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    text-align: center;
    color: #c5d4e8;
    background: linear-gradient(180deg, rgba(30, 38, 52, 0.35) 0%, transparent 100%);
    border-radius: 8px;
    margin: 6px 8px;
}

.chatweb-busy-icon {
    font-size: 28px;
    margin-bottom: 10px;
    opacity: 0.95;
}

.chatweb-busy-screen p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    max-width: 240px;
    color: #b8c9de;
}

.chatweb-login-gate {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    text-align: center;
    background: linear-gradient(165deg, rgba(26, 35, 52, 0.95) 0%, rgba(15, 20, 30, 0.98) 100%);
}

.chatweb-login-gate-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.chatweb-login-gate-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #e8f0ff;
    letter-spacing: 0.02em;
}

.chatweb-login-gate-text {
    margin: 0 0 18px;
    font-size: 12px;
    line-height: 1.55;
    color: #9fb0c8;
    max-width: 260px;
}

.chatweb-login-gate-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 220px;
}

.chatweb-login-gate-btn {
    display: block;
    width: 100%;
    text-decoration: none;
    box-sizing: border-box;
    text-align: center;
}

.chatweb-btn-login-secondary {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: transparent;
    color: #c5d4e8;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s;
}

.chatweb-btn-login-secondary:hover {
    border-color: rgba(168, 209, 138, 0.65);
    background: rgba(168, 209, 138, 0.08);
    color: #e8f5e0;
}

.chatweb-compose-row input[type="text"] {
    flex: 1;
    padding: 7px 8px;
    border-radius: 6px;
    border: 1px solid #4a5568;
    background: #1a1d23;
    color: #eee;
    font-size: 12px;
}

.chatweb-btn-send {
    padding: 7px 12px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(180deg, #a8d18a, #7fa866);
    color: #1a2414;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.chatweb-btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#chatweb-root.chatweb-widget-unavailable {
    display: none !important;
}

.chatweb-start-screen {
    padding: 8px 10px 6px;
    text-align: center;
    color: #c5d4e8;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    min-height: 0;
    overflow-y: auto;
}

.chatweb-start-intro {
    flex-shrink: 0;
    padding: 2px 0 6px;
}

.chatweb-welcome-text {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.35;
    color: #9eb4cc;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chatweb-staff-online-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 auto;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #bbf7d0;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(15, 23, 20, 0.5));
    border: 1px solid rgba(74, 222, 128, 0.38);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.15);
}

.chatweb-staff-online-badge.chatweb-hidden {
    display: none !important;
}

.chatweb-staff-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.75);
    animation: chatweb-staff-dot-pulse 1.6s ease-in-out infinite;
}

@keyframes chatweb-staff-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.88); }
}

.chatweb-start-screen .chatweb-new-chat-form {
    margin-top: 4px;
}

.chatweb-start-screen .chatweb-new-chat-label {
    margin: 0 0 4px;
    font-size: 10px;
    color: #8fa3bc;
}

.chatweb-start-screen .chatweb-btn-block {
    padding: 7px 12px;
    font-size: 11px;
}

.chatweb-input-start {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #4a5568;
    background: #1a1d23;
    color: #eee;
    font-size: 12px;
    box-sizing: border-box;
}

.chatweb-btn-primary {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(180deg, #4e8fda, #2d6bb4);
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
}

.chatweb-compose .chatweb-status-bar {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #e8a87c;
    min-height: 14px;
}

.chatweb-status-bar.is-cooldown {
    color: #9ec8f0;
    font-style: normal;
}

.chatweb-status-bar {
    flex: 1;
    font-size: 10px;
    color: #8a919e;
    text-align: left;
    padding: 0;
    min-width: 0;
}

.chatweb-history-section {
    margin: 10px 0 12px;
    text-align: left;
}

.chatweb-history-title {
    font-size: 11px;
    font-weight: 600;
    color: #9eb4cc;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chatweb-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.chatweb-history-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid #3d4a5a;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    color: #d7e8ff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.chatweb-history-item:hover {
    border-color: #5a8fc4;
    background: rgba(46, 139, 224, 0.12);
}

.chatweb-history-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.chatweb-history-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
}

.chatweb-history-badge.is-open {
    background: rgba(125, 255, 168, 0.18);
    color: #9dffc4;
}

.chatweb-history-badge.is-closed {
    background: rgba(150, 160, 175, 0.2);
    color: #b8c5d8;
}

.chatweb-history-date {
    font-size: 10px;
    color: #8a9bb0;
}

.chatweb-history-preview {
    display: block;
    font-size: 12px;
    line-height: 1.35;
    color: #c5d4e8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatweb-new-chat-form {
    margin-top: 4px;
}

.chatweb-new-chat-label {
    font-size: 12px;
    margin: 0 0 8px;
}

.chatweb-archive-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(29, 74, 58, 0.35);
    border-bottom: 1px solid rgba(125, 255, 168, 0.25);
    flex-shrink: 0;
}

.chatweb-btn-back-hub {
    border: 1px solid #5a8fc4;
    border-radius: 6px;
    background: rgba(46, 139, 224, 0.15);
    color: #b9d4f0;
    font-size: 11px;
    padding: 4px 8px;
    cursor: pointer;
}

.chatweb-btn-back-hub:hover {
    color: #fff;
    background: rgba(46, 139, 224, 0.28);
}

.chatweb-archive-label {
    font-size: 11px;
    color: #b8f5d4;
    line-height: 1.3;
}

.chatweb-msg.system {
    align-self: center;
    max-width: 95%;
    background: rgba(29, 74, 58, 0.45);
    border: 1px solid rgba(125, 255, 168, 0.35);
    color: #d4f5e4;
    text-align: center;
    font-size: 12px;
    border-radius: 8px;
    padding: 10px 12px;
}

.chatweb-msg-system-text {
    line-height: 1.45;
}

.chatweb-msg-image-wrap {
    margin-top: 4px;
}

.chatweb-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.62);
    cursor: zoom-out;
}

.chatweb-image-lightbox.is-open {
    cursor: zoom-out;
    display: flex;
}

.chatweb-image-lightbox img {
    max-width: min(92vw, 960px);
    max-height: min(82vh, 720px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: zoom-out;
    background: #1a1d23;
}

.chatweb-hidden {
    display: none !important;
}

@media (max-width: 480px) {
    #chatweb-root {
        right: 12px;
        left: 12px;
        align-items: stretch;
    }

    #chatweb-panel {
        width: auto;
    }

    #chatweb-launcher {
        align-self: flex-end;
    }
}
