#uzts-ai-root,
#uzts-ai-root * {
    box-sizing: border-box;
}

.uzts-ai {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    font-family: Arial, Helvetica, sans-serif;
}

.uzts-ai-toggle {
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #083f8c, #138cdc);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 14px 35px rgba(8, 63, 140, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.uzts-ai-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(8, 63, 140, 0.38);
}

.uzts-ai-toggle-mark {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.uzts-ai-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: min(390px, calc(100vw - 32px));
    height: min(610px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(8, 63, 140, 0.12);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(21, 41, 74, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(0.98);
    transform-origin: bottom right;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}

.uzts-ai[data-state="open"] .uzts-ai-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.uzts-ai-header {
    min-height: 76px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, #073b80, #138cdc);
    color: #fff;
}

.uzts-ai-header > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.uzts-ai-title {
    font-size: 17px;
    line-height: 1.2;
}

.uzts-ai-status {
    position: relative;
    padding-left: 12px;
    font-size: 12px;
    opacity: 0.9;
}

.uzts-ai-status::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #61e294;
    transform: translateY(-50%);
}

.uzts-ai-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.uzts-ai-language {
    height: 34px;
    max-width: 112px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 12px;
    outline: none;
}

.uzts-ai-language option {
    color: #172033;
    background: #fff;
}

.uzts-ai-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.uzts-ai-messages {
    flex: 1;
    min-height: 0;
    padding: 18px;
    overflow-y: auto;
    background:
        radial-gradient(circle at top right, rgba(19, 140, 220, 0.07), transparent 32%),
        #f7f9fc;
}

.uzts-ai-message {
    width: 100%;
    margin: 0 0 14px;
    display: flex;
    flex-direction: column;
}

.uzts-ai-message-user {
    align-items: flex-end;
}

.uzts-ai-message-assistant {
    align-items: flex-start;
}

.uzts-ai-bubble {
    max-width: 86%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.48;
    white-space: pre-wrap;
    word-break: break-word;
}

.uzts-ai-message-assistant .uzts-ai-bubble {
    border: 1px solid #e5eaf1;
    border-bottom-left-radius: 5px;
    background: #fff;
    color: #172033;
}

.uzts-ai-message-user .uzts-ai-bubble {
    border-bottom-right-radius: 5px;
    background: #0b6fbe;
    color: #fff;
}

.uzts-ai-links {
    width: 86%;
    margin-top: 7px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.uzts-ai-links a {
    display: block;
    padding: 9px 11px;
    border: 1px solid #d7e7f5;
    border-radius: 10px;
    background: #fff;
    color: #075da5;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}

.uzts-ai-links a:hover {
    border-color: #138cdc;
    color: #083f8c;
}

.uzts-ai-loading {
    min-width: 54px;
    font-size: 17px;
    letter-spacing: 3px;
}

.uzts-ai-quick-actions {
    padding: 10px 14px 4px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    background: #fff;
}

.uzts-ai-quick-actions button {
    flex: 0 0 auto;
    padding: 7px 9px;
    border: 1px solid #dce8f3;
    border-radius: 999px;
    background: #f8fbfe;
    color: #075da5;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.uzts-ai-form {
    padding: 10px 14px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #fff;
}

.uzts-ai-input {
    min-height: 44px;
    max-height: 120px;
    flex: 1;
    resize: none;
    padding: 11px 13px;
    border: 1px solid #d9e1ea;
    border-radius: 12px;
    background: #fff;
    color: #172033;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
}

.uzts-ai-input:focus {
    border-color: #138cdc;
    box-shadow: 0 0 0 3px rgba(19, 140, 220, 0.1);
}

.uzts-ai-send {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 0;
    border-radius: 12px;
    background: #0b6fbe;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
}

.uzts-ai-send:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.uzts-ai-disclaimer {
    padding: 0 14px 11px;
    background: #fff;
    color: #7a8595;
    font-size: 10px;
    line-height: 1.35;
    text-align: center;
}

@media (max-width: 600px) {
    .uzts-ai {
        right: 14px;
        bottom: 14px;
    }

    .uzts-ai-toggle {
        width: 56px;
        height: 56px;
    }

    .uzts-ai-panel {
        position: fixed;
        right: 10px;
        bottom: 80px;
        left: 10px;
        width: auto;
        height: min(650px, calc(100vh - 96px));
        border-radius: 18px;
    }
}

/* UZTS AI 1.1 — lead form */

.uzts-ai-lead-card {
    margin: 8px 0 16px;
    padding: 14px;
    border: 1px solid #d7e4f0;
    border-radius: 14px;
    background: #fff;
}

.uzts-ai-lead-title {
    display: block;
    margin-bottom: 10px;
    color: #17324d;
    font-size: 14px;
}

.uzts-ai-lead-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uzts-ai-lead-form input,
.uzts-ai-lead-form textarea {
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border: 1px solid #d8e0e8;
    border-radius: 9px;
    background: #fff;
    color: #172033;
    font: inherit;
    font-size: 13px;
    line-height: 1.4;
    outline: none;
}

.uzts-ai-lead-form input:focus,
.uzts-ai-lead-form textarea:focus {
    border-color: #138cdc;
    box-shadow: 0 0 0 3px rgba(19, 140, 220, 0.1);
}

.uzts-ai-lead-form textarea {
    min-height: 78px;
    resize: vertical;
}

.uzts-ai-lead-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 3px;
}

.uzts-ai-lead-actions button {
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    background: #0b6fbe;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.uzts-ai-lead-actions .uzts-ai-lead-cancel {
    border: 1px solid #d8e0e8;
    background: #fff;
    color: #4b5968;
}

.uzts-ai-lead-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* UZTS AI 1.3.1 — company cards */

.uzts-ai-company-cards {
    width: 100%;
    margin: 10px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.uzts-ai-company-card {
    width: 100%;
    padding: 13px;
    border: 1px solid #d7e5f2;
    border-radius: 13px;
    background: #fff;
    box-sizing: border-box;
    box-shadow: 0 7px 20px rgba(16, 54, 92, 0.07);
}

.uzts-ai-company-name {
    display: block;
    margin-bottom: 8px;
    color: #073b80;
    font-size: 14px;
    line-height: 1.35;
}

.uzts-ai-company-field {
    margin: 5px 0;
    color: #405064;
    font-size: 12px;
    line-height: 1.45;
    word-break: break-word;
}

.uzts-ai-company-label {
    color: #172b42;
    font-weight: 700;
}

.uzts-ai-company-region {
    color: #0b6fbe;
    font-weight: 700;
}

.uzts-ai-company-phone a {
    color: #0b6fbe;
    text-decoration: none;
}

.uzts-ai-company-open {
    display: inline-flex;
    margin-top: 9px;
    padding: 8px 11px;
    border-radius: 8px;
    background: #0b6fbe;
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
}

.uzts-ai-company-open:hover {
    background: #073b80;
}

/* UZTS AI 1.4.0 — compact directory cards */

.uzts-ai-directory-results {
    width: 100%;
    margin-top: 9px;
}

.uzts-ai-company-cards {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uzts-ai-company-card {
    width: 100%;
    min-height: 0;
    padding: 11px 12px;
    border: 1px solid #d7e5f2;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
    box-shadow: 0 5px 15px rgba(16, 54, 92, 0.06);
}

.uzts-ai-company-name {
    display: block;
    margin: 0 0 6px;
    color: #073b80;
    font-size: 13px;
    line-height: 1.32;
    font-weight: 800;
}

.uzts-ai-company-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 7px;
    margin-bottom: 7px;
}

.uzts-ai-company-meta > span {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    background: #f0f6fc;
    color: #405064;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 700;
}

.uzts-ai-company-meta .uzts-ai-company-region {
    background: #e9f5ff;
    color: #0b6fbe;
}

.uzts-ai-company-field {
    margin: 4px 0;
    color: #405064;
    font-size: 11px;
    line-height: 1.4;
    word-break: break-word;
}

.uzts-ai-company-label {
    color: #172b42;
    font-weight: 700;
}

.uzts-ai-company-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    margin-top: 8px;
}

.uzts-ai-company-phone-link {
    color: #0b6fbe;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
    text-decoration: none;
}

.uzts-ai-company-open {
    display: inline-flex;
    margin: 0;
    padding: 7px 9px;
    border-radius: 7px;
    background: #0b6fbe;
    color: #fff !important;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
}

.uzts-ai-company-open:hover {
    background: #073b80;
}

.uzts-ai-company-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-top: 9px;
}

.uzts-ai-company-page-button {
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid #cfe0ef;
    border-radius: 8px;
    background: #fff;
    color: #0b5fa8;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
    cursor: pointer;
}

.uzts-ai-company-page-button:last-child {
    justify-self: end;
}

.uzts-ai-company-page-button:disabled {
    cursor: default;
    opacity: 0.4;
}

.uzts-ai-company-page-status {
    color: #667789;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

/* UZTS AI 1.5.1 — suggestions and wrapped actions */

.uzts-ai-quick-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    overflow-x: visible !important;
    scrollbar-width: none;
}

.uzts-ai-quick-actions::-webkit-scrollbar {
    display: none;
}

.uzts-ai-quick-actions button {
    flex: 0 1 auto;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
}

.uzts-ai-suggestion-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0 4px;
}

.uzts-ai-suggestion-button {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cfe0ef;
    border-radius: 9px;
    background: #f7fbff;
    color: #0b5fa8;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.uzts-ai-suggestion-button:hover {
    border-color: #0b6fbe;
    background: #eaf5ff;
}

.uzts-ai-suggestion-button:focus-visible {
    outline: 2px solid #0b6fbe;
    outline-offset: 2px;
}
