.ai-support-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 11000;
    font-family: inherit;
    --support-green: #7c21a3;
    --support-green-dark: #621882;
    --support-bg: #181818;
    --support-panel: #202020;
    --support-line: #303030;
    --support-text: #f5f5f5;
    --support-muted: #8e8e8e;
}

.ai-support-turnstile {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

body.ai-support-mobile-open {
    overflow: hidden;
}

.ai-support-status-bubble {
    position: absolute;
    right: -1px;
    bottom: 72px;
    padding: 9px 13px;
    border-radius: 11px;
    background: rgba(18, 22, 20, 0.72);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f9f0fd;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

html.light-theme .ai-support-status-bubble {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(17, 24, 39, 0.08);
    color: #111827;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

.ai-support-status-bubble::before {
    content: "";
    position: absolute;
    right: 16px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: rgba(18, 22, 20, 0.72);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    transform: rotate(45deg);
}

html.light-theme .ai-support-status-bubble::before {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(17, 24, 39, 0.08);
}

.ai-support-widget.open .ai-support-status-bubble {
    opacity: 0;
}

.ai-support-toggle {
    width: 60px;
    height: 60px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(18, 22, 20, 0.55);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 0 rgba(155, 23, 212, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform-origin: center;
    animation: ai-support-pulse 2.5s infinite;
    transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1), border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.ai-support-toggle__icon {
    width: 28px;
    height: 28px;
    fill: #fff;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

html.light-theme .ai-support-toggle {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(17, 24, 39, 0.08);
    box-shadow: 0 12px 36px rgba(17, 24, 39, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 0 0 0 rgba(155, 23, 212, 0.2);
}

html.light-theme .ai-support-toggle__icon {
    fill: #1f2937;
}

.ai-support-toggle:hover {
    border-color: rgba(155, 23, 212, 0.45);
    transform: scale(1.06);
}

.ai-support-toggle:hover .ai-support-toggle__icon {
    transform: scale(1.04);
}

.ai-support-widget.is-scrolling .ai-support-toggle {
    border-color: rgba(155, 23, 212, 0.55);
    box-shadow: 0 0 24px rgba(155, 23, 212, 0.35), 0 12px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(0.96);
    animation: none;
}

@keyframes ai-support-pulse {
    0%, 100% {
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 0 rgba(155, 23, 212, 0.28);
    }
    50% {
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 12px rgba(155, 23, 212, 0);
    }
}

html.light-theme .ai-support-widget.is-scrolling .ai-support-toggle {
    box-shadow: 0 0 22px rgba(155, 23, 212, 0.28), 0 12px 36px rgba(17, 24, 39, 0.14);
}

.ai-support-widget.open .ai-support-toggle {
    transform: scale(0.88);
    opacity: 0;
    pointer-events: none;
}

.ai-support-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(392px, calc(100vw - 28px));
    height: min(590px, calc(100vh - 120px));
    background: var(--support-bg);
    border: 1px solid var(--support-line);
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
}

.ai-support-widget.open .ai-support-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ai-support-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 16px 18px;
    color: #fff;
    background: var(--support-green);
}

.ai-support-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
    font-size: 1.45rem;
}

.ai-support-title {
    min-width: 0;
    flex: 1;
}

.ai-support-title strong,
.ai-support-title span {
    display: block;
}

.ai-support-title strong {
    font-size: 1.05rem;
    line-height: 1.15;
}

.ai-support-title span {
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.9rem;
    margin-top: 5px;
}

.ai-support-title span b {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 50%;
    background: #a334d2;
    margin-right: 6px;
    vertical-align: 1px;
    animation: aiSupportOnlinePulse 1.8s ease-in-out infinite;
}

.ai-support-title span em {
    font-style: normal;
    margin-left: 14px;
}

.ai-support-minimize,
.ai-support-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.35rem;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.ai-support-minimize:hover,
.ai-support-close:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.ai-support-prechat,
.ai-support-chat {
    flex: 1;
    min-height: 0;
    display: none;
    background: var(--support-bg);
}

.ai-support-widget.prechat .ai-support-prechat,
.ai-support-widget.chat .ai-support-chat {
    display: flex;
}

.ai-support-prechat {
    flex-direction: column;
    padding: 28px 24px 18px;
}

.ai-support-welcome h3 {
    color: var(--support-text);
    font-size: 1.35rem;
    margin: 0 0 8px;
}

.ai-support-welcome p {
    color: #b9b9b9;
    font-size: 0.92rem;
    line-height: 1.45;
    margin: 0 0 22px;
}

.ai-support-prechat label {
    display: block;
    margin-bottom: 17px;
}

.ai-support-prechat label span {
    display: block;
    color: #d9d9d9;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.ai-support-prechat input,
.ai-support-form input {
    width: 100%;
    border: 1px solid #383838;
    border-radius: 8px;
    color: var(--support-text);
    background: var(--support-panel);
    outline: none;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.ai-support-prechat input {
    height: 46px;
    padding: 0 14px;
}

.ai-support-prechat input:focus,
.ai-support-form input:focus {
    border-color: var(--support-green);
    background: #1d1d1d;
}

.ai-support-prechat button {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--support-green);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.ai-support-prechat button:hover {
    background: var(--support-green-dark);
    transform: translateY(-1px);
}

.ai-support-prechat small,
.ai-support-footnote {
    color: #5f5f5f;
    text-align: center;
    font-size: 0.68rem;
    margin-top: auto;
}

.ai-support-chat {
    flex-direction: column;
}

.ai-support-messages {
    flex: 1;
    padding: 16px 18px 14px;
    overflow-y: auto;
    background: var(--support-bg);
    border-bottom: 1px solid var(--support-line);
}

.ai-support-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-support-messages::-webkit-scrollbar-thumb {
    background: #3b3b3b;
    border-radius: 6px;
}

.ai-support-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
    animation: aiSupportMessageIn 0.24s ease both;
}

.ai-support-row.user {
    align-items: flex-end;
}

.ai-support-row.bot {
    align-items: flex-start;
}

.ai-support-message {
    width: fit-content;
    max-width: 86%;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-support-row.bot .ai-support-message {
    max-width: 94%;
}

.ai-support-message strong {
    color: inherit;
    font-weight: 700;
}

.ai-support-table-wrap {
    display: block;
    width: 100%;
    max-width: min(100%, 26rem);
    margin: 8px 0;
    overflow-x: auto;
    border: 1px solid #3a3a3a;
    border-radius: 7px;
    background: #222;
}

.ai-support-table {
    width: 100%;
    min-width: 18rem;
    border-collapse: collapse;
    white-space: normal;
    font-size: 0.82rem;
    line-height: 1.32;
}

.ai-support-table th,
.ai-support-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #383838;
    border-right: 1px solid #383838;
    text-align: left;
    vertical-align: top;
}

.ai-support-table th:last-child,
.ai-support-table td:last-child {
    border-right: 0;
}

.ai-support-table tr:last-child td {
    border-bottom: 0;
}

.ai-support-table th {
    color: #f4f4f4;
    background: #303030;
    font-weight: 700;
}

.ai-support-table td {
    color: #dedede;
}

.ai-support-rich-list {
    width: 100%;
    max-width: min(100%, 26rem);
    margin: 8px 0;
    overflow: hidden;
    border: 1px solid #3a3a3a;
    border-radius: 7px;
    background: #222;
    white-space: normal;
}

.ai-support-rich-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    padding: 9px 10px;
    border-bottom: 1px solid #343434;
}

.ai-support-rich-item:last-child {
    border-bottom: 0;
}

.ai-support-rich-index {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #f1d9fb;
    background: rgba(124, 33, 163, 0.18);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
}

.ai-support-rich-body {
    min-width: 0;
}

.ai-support-rich-title {
    color: #f0f0f0;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
}

.ai-support-rich-detail {
    margin-top: 3px;
    color: #c9c9c9;
    font-size: 0.82rem;
    line-height: 1.35;
}

.ai-support-row.bot .ai-support-message {
    color: #ededed;
    background: #2a2a2a;
}

.ai-support-row.bot .ai-support-message a {
    color: #64a8ff;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(100, 168, 255, 0.45);
}

.ai-support-row.bot .ai-support-message a:hover {
    color: #91c2ff;
    border-bottom-color: currentColor;
}

.ai-support-row.user .ai-support-message {
    color: #fff;
    background: var(--support-green);
}

.ai-support-meta {
    margin-top: 5px;
    color: #6f6f6f;
    font-size: 0.78rem;
}

.ai-support-row.user .ai-support-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.ai-support-read-status {
    color: rgba(255, 255, 255, 0.54);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1;
}

.ai-support-read-status.read {
    color: #e4bdf5;
}

.ai-support-typing {
    min-width: 106px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ai-support-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9d9d9d;
    animation: aiSupportTyping 1.05s ease-in-out infinite;
}

.ai-support-typing span:nth-child(2) {
    animation-delay: 0.16s;
}

.ai-support-typing span:nth-child(3) {
    animation-delay: 0.32s;
}

.ai-support-form {
    display: flex;
    gap: 10px;
    padding: 14px 16px 10px;
    background: var(--support-bg);
}

.ai-support-form input {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 15px;
    font-size: 1rem;
}

.ai-support-form button {
    width: 50px;
    height: 48px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--support-green);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    font-size: 1.45rem;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.ai-support-form button:hover {
    background: var(--support-green-dark);
    transform: translateY(-1px);
}

.ai-support-form button:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.ai-support-footnote {
    display: block;
    padding-bottom: 8px;
    margin-top: 0;
}

@keyframes aiSupportMessageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes aiSupportTyping {
    0%, 70%, 100% {
        transform: translateY(0);
        opacity: 0.45;
    }
    35% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@keyframes aiSupportOnlinePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.65;
        transform: scale(0.82);
    }
}

@media (max-width: 992px) {
    .ai-support-widget {
        right: 14px;
        bottom: 94px;
    }

    .ai-support-panel {
        bottom: 68px;
        width: min(386px, calc(100vw - 20px));
        height: min(560px, calc(100vh - 150px));
    }
}

@media (max-width: 640px) {
    .ai-support-widget {
        right: 14px;
        bottom: 94px;
    }

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

    .ai-support-widget.open {
        inset: 0;
        right: auto;
        bottom: auto;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    .ai-support-widget.open .ai-support-toggle {
        display: none;
    }

    .ai-support-panel {
        position: fixed;
        inset: 0;
        right: auto;
        bottom: auto;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        transform: translateY(100%);
        transform-origin: center;
    }

    .ai-support-widget.open .ai-support-panel {
        transform: translateY(0);
    }

    .ai-support-head {
        min-height: 78px;
        padding: max(14px, env(safe-area-inset-top, 0px) + 10px) 14px 14px;
    }

    .ai-support-avatar {
        width: 46px;
        height: 46px;
    }

    .ai-support-minimize,
    .ai-support-close {
        width: 40px;
        height: 40px;
    }

    .ai-support-messages {
        padding: 14px 12px 12px;
    }

    .ai-support-message {
        max-width: 88%;
        font-size: 0.92rem;
    }

    .ai-support-row.bot .ai-support-message {
        max-width: 96%;
    }

    .ai-support-form {
        padding: 12px 12px max(12px, env(safe-area-inset-bottom, 0px) + 8px);
    }

    .ai-support-footnote {
        display: none;
    }
}

/* Acik tema (2026-11-17): pencere acik temada da tamamen koyu aciliyordu (zemin #181818, kutular #202020).
   Yesil baslik ve yesil musteri balonu ayni kalir; zemin, kutular, yazilar ve tablolar acik tonlara gecer. */
html.light-theme .ai-support-widget {
    --support-bg: #ffffff;
    --support-panel: #f6f7f9;
    --support-line: #e5e7eb;
    --support-text: #111827;
    --support-muted: #6b7280;
}

/* Yesil baslik: genel "strong" rengi acik temada koyu oldugu icin "Canli Destek" yazisi siyaha donuyordu */
html.light-theme .ai-support-title strong {
    color: #ffffff;
}

html.light-theme .ai-support-panel {
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.06);
}

html.light-theme .ai-support-welcome p {
    color: #4b5563;
}

html.light-theme .ai-support-prechat label span {
    color: #374151;
}

html.light-theme .ai-support-prechat input,
html.light-theme .ai-support-form input {
    border-color: #d8dce3;
}

html.light-theme .ai-support-prechat input::placeholder,
html.light-theme .ai-support-form input::placeholder {
    color: #9ca3af;
}

html.light-theme .ai-support-prechat input:focus,
html.light-theme .ai-support-form input:focus {
    background: #ffffff;
}

html.light-theme .ai-support-prechat small,
html.light-theme .ai-support-footnote {
    color: #9ca3af;
}

html.light-theme .ai-support-messages {
    background: #f7f8fa;
}

html.light-theme .ai-support-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
}

html.light-theme .ai-support-row.bot .ai-support-message {
    color: #111827;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}

html.light-theme .ai-support-row.bot .ai-support-message a {
    color: #1d63c9;
    border-bottom-color: rgba(29, 99, 201, 0.35);
}

html.light-theme .ai-support-row.bot .ai-support-message a:hover {
    color: #174ea0;
}

html.light-theme .ai-support-table-wrap,
html.light-theme .ai-support-rich-list {
    border-color: #e5e7eb;
    background: #ffffff;
}

html.light-theme .ai-support-table th,
html.light-theme .ai-support-table td {
    border-color: #e5e7eb;
}

html.light-theme .ai-support-table th {
    color: #111827;
    background: #f3f4f6;
}

html.light-theme .ai-support-table td {
    color: #374151;
}

html.light-theme .ai-support-rich-item {
    border-bottom-color: #eef0f3;
}

html.light-theme .ai-support-rich-index {
    color: #601580;
    background: rgba(124, 33, 163, 0.12);
}

html.light-theme .ai-support-rich-title {
    color: #111827;
}

html.light-theme .ai-support-rich-detail {
    color: #4b5563;
}

html.light-theme .ai-support-meta {
    color: #6b7280;
}

/* Okundu isareti balonun altinda, pencere zemininde durur: koyu temadaki yari saydam beyaz acik zeminde kayboluyordu */
html.light-theme .ai-support-read-status {
    color: #9ca3af;
}

html.light-theme .ai-support-read-status.read {
    color: #7916a3;
}

html.light-theme .ai-support-typing span {
    background: #9ca3af;
}
