/* ============================================================
 *  TicoShopping — Chat Widget v3.2 (Premium)
 *  ------------------------------------------------------------
 *  RENK: TEK DEĞİŞKEN → --tico-chat-accent
 *  JS admin panelden gelen rengi bu değişkene yazar.
 *  Launcher + Header + Balonlar + Butonlar = hepsi bu renk.
 *
 *  Yüksek specificity (#tico-chat-widget prefix) ile dış müdahale engellendi.
 * ============================================================ */

#tico-chat-widget {
    /* 🎨 TEK RENK DEĞİŞKENİ (JS override eder) */
    --tico-chat-accent: #3B82F6;
    --tico-chat-accent-dark: #1D4ED8;
    --tico-chat-accent-light: #60A5FA;
    --tico-chat-accent-soft: #EFF6FF;
    --tico-chat-accent-glow: rgba(59, 130, 246, 0.4);
    --tico-chat-accent-mesh: rgba(96, 165, 250, 0.35);

    /* Launcher metin rengi (JS override eder) */
    --tico-chat-launcher-text: #FFFFFF;

    /* Nötr */
    --tico-chat-text: #0B1220;
    --tico-chat-text-2: #334155;
    --tico-chat-text-muted: #64748B;
    --tico-chat-text-subtle: #94A3B8;

    --tico-chat-bg: #FFFFFF;
    --tico-chat-bg-soft: #F8FAFC;
    --tico-chat-bg-sunken: #F1F5F9;

    --tico-chat-border: #E5E7EB;
    --tico-chat-border-soft: #F1F5F9;

    --tico-chat-success: #10B981;
    --tico-chat-danger: #EF4444;

    --tico-chat-radius-panel: 22px;
    --tico-chat-radius-bubble: 20px;
    --tico-chat-radius-input: 14px;

    --tico-chat-shadow-panel:
        0 0 0 1px rgba(15, 23, 42, 0.04),
        0 1px 3px rgba(15, 23, 42, 0.04),
        0 12px 32px -8px rgba(15, 23, 42, 0.16),
        0 32px 80px -24px rgba(15, 23, 42, 0.22);

    --tico-chat-shadow-launcher:
        0 4px 12px -2px rgba(15, 23, 42, 0.12),
        0 12px 32px -6px rgba(15, 23, 42, 0.18);

    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--tico-chat-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

#tico-chat-widget *,
#tico-chat-widget *::before,
#tico-chat-widget *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

#tico-chat-widget button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
    outline: none;
}

/* ═══════════════════════════════════════════════════════════
 *  LAUNCHER — Admin panel rengi (--tico-chat-accent)
 *  Yüksek specificity: #tico-chat-widget #tico-chat-launcher
 * ═══════════════════════════════════════════════════════════ */
#tico-chat-widget #tico-chat-launcher {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--tico-chat-accent);
    color: var(--tico-chat-launcher-text);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--tico-chat-shadow-launcher);
    transition:
        transform .35s cubic-bezier(.16, 1, .3, 1),
        background-color .25s ease,
        box-shadow .35s ease;
    padding: 0;
    isolation: isolate;
}

#tico-chat-widget #tico-chat-launcher::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.25) 0%, transparent 60%);
    pointer-events: none;
}

#tico-chat-widget .tico-chat-launcher-ping,
#tico-chat-widget #tico-chat-launcher-ping {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--tico-chat-accent);
    opacity: .35;
    z-index: -1;
    animation: ticoChatPing 2.4s cubic-bezier(0, 0, .2, 1) infinite;
}

@keyframes ticoChatPing {
    0%   { transform: scale(1); opacity: .35; }
    75%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

#tico-chat-widget #tico-chat-launcher:hover {
    background: var(--tico-chat-accent-dark);
    transform: scale(1.07) translateY(-2px);
    box-shadow:
        0 6px 16px -2px rgba(15, 23, 42, 0.16),
        0 20px 44px -10px rgba(15, 23, 42, 0.22);
}

#tico-chat-widget #tico-chat-launcher:active {
    transform: scale(.94);
}

#tico-chat-widget #tico-chat-launcher svg {
    width: 28px;
    height: 28px;
    position: relative;
    z-index: 1;
}

/* İkon geçişleri */
#tico-chat-widget[data-state="closed"] #tico-chat-launcher .tico-chat-launcher-icon {
    display: flex;
    animation: ticoChatIconIn .4s cubic-bezier(.16, 1, .3, 1);
}
#tico-chat-widget[data-state="closed"] #tico-chat-launcher .tico-chat-launcher-close {
    display: none;
}
#tico-chat-widget[data-state="open"] #tico-chat-launcher .tico-chat-launcher-icon {
    display: none;
}
#tico-chat-widget[data-state="open"] #tico-chat-launcher .tico-chat-launcher-close {
    display: flex;
    animation: ticoChatIconIn .4s cubic-bezier(.16, 1, .3, 1);
}
#tico-chat-widget[data-state="open"] #tico-chat-launcher .tico-chat-launcher-ping {
    display: none;
}

@keyframes ticoChatIconIn {
    from { opacity: 0; transform: rotate(-90deg) scale(.6); }
    to   { opacity: 1; transform: rotate(0)      scale(1); }
}

/* Badge */
#tico-chat-widget .tico-chat-launcher-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--tico-chat-bg);
    box-shadow:
        0 2px 6px rgba(239, 68, 68, 0.35),
        0 0 0 3px rgba(239, 68, 68, 0.12);
    z-index: 2;
}
#tico-chat-widget .tico-chat-launcher-badge[hidden] { display: none; }

/* ═══════════════════════════════════════════════════════════
 *  PANEL
 * ═══════════════════════════════════════════════════════════ */
#tico-chat-widget #tico-chat-panel {
    position: absolute;
    bottom: 84px;
    right: 0;
    width: 400px;
    height: 620px;
    max-height: calc(100vh - 130px);
    background: var(--tico-chat-bg);
    border-radius: var(--tico-chat-radius-panel);
    box-shadow: var(--tico-chat-shadow-panel);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(.94);
    transform-origin: bottom right;
    transition:
        opacity .3s cubic-bezier(.16, 1, .3, 1),
        visibility .3s ease,
        transform .35s cubic-bezier(.16, 1, .3, 1);
    will-change: transform, opacity;
}

#tico-chat-widget[data-state="open"] #tico-chat-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ═══════════════════════════════════════════════════════════
 *  HEADER
 * ═══════════════════════════════════════════════════════════ */
#tico-chat-widget .tico-chat-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 18px 18px;
    background: linear-gradient(135deg, var(--tico-chat-accent) 0%, var(--tico-chat-accent-dark) 100%);
    color: #FFFFFF;
    flex-shrink: 0;
    overflow: hidden;
    isolation: isolate;
}

#tico-chat-widget .tico-chat-header-mesh {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .22) 0%, transparent 45%),
        radial-gradient(circle at 100% 100%, var(--tico-chat-accent-mesh) 0%, transparent 50%),
        linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, .04) 50%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

#tico-chat-widget .tico-chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    z-index: 1;
}

#tico-chat-widget .tico-chat-header-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

#tico-chat-widget .tico-chat-header-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

#tico-chat-widget .tico-chat-header-avatar-inner svg {
    width: 21px;
    height: 21px;
    color: #FFFFFF;
}

#tico-chat-widget .tico-chat-header-avatar-ping {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--tico-chat-success);
    border: 2.5px solid var(--tico-chat-accent-dark);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: ticoChatOnlinePulse 2.4s ease-in-out infinite;
}

@keyframes ticoChatOnlinePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    50%      { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
}

#tico-chat-widget .tico-chat-header-info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

#tico-chat-widget .tico-chat-header-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

#tico-chat-widget .tico-chat-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    opacity: .95;
    margin-top: 3px;
    font-weight: 500;
    letter-spacing: -0.005em;
}

#tico-chat-widget .tico-chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ADE80;
    flex-shrink: 0;
    position: relative;
}

#tico-chat-widget .tico-chat-status-dot::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: inherit;
    opacity: .5;
    animation: ticoChatDotPulse 2.2s ease-in-out infinite;
}

#tico-chat-widget .tico-chat-status-dot.is-offline {
    background: #94A3B8;
}
#tico-chat-widget .tico-chat-status-dot.is-offline::after {
    animation: none;
    opacity: 0;
}

@keyframes ticoChatDotPulse {
    0%, 100% { transform: scale(1);   opacity: .5; }
    50%      { transform: scale(2.2); opacity: 0; }
}

#tico-chat-widget .tico-chat-header-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.95);
    transition: background-color .2s ease, transform .2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.08);
}

#tico-chat-widget .tico-chat-header-close:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
    transform: rotate(90deg);
}

#tico-chat-widget .tico-chat-header-close:active { transform: rotate(90deg) scale(.9); }

#tico-chat-widget .tico-chat-header-close svg {
    width: 16px;
    height: 16px;
}

/* ═══════════════════════════════════════════════════════════
 *  BODY
 * ═══════════════════════════════════════════════════════════ */
#tico-chat-widget .tico-chat-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--tico-chat-bg);
    scrollbar-width: thin;
    scrollbar-color: var(--tico-chat-bg-sunken) transparent;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

#tico-chat-widget .tico-chat-body::-webkit-scrollbar { width: 6px; }
#tico-chat-widget .tico-chat-body::-webkit-scrollbar-track { background: transparent; }
#tico-chat-widget .tico-chat-body::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 3px;
    transition: background-color .2s ease;
}
#tico-chat-widget .tico-chat-body::-webkit-scrollbar-thumb:hover { background: #CBD5E1; }

/* Skeleton loading */
#tico-chat-widget .tico-chat-loading {
    padding: 24px 22px;
}

#tico-chat-widget .tico-chat-loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#tico-chat-widget .tico-chat-skeleton-line {
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 50%, #F1F5F9 100%);
    background-size: 200% 100%;
    animation: ticoChatShimmer 1.6s ease-in-out infinite;
}

#tico-chat-widget .tico-chat-skeleton-line-lg {
    height: 46px;
    border-radius: var(--tico-chat-radius-input);
    margin-top: 8px;
}

@keyframes ticoChatShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════
 *  FORM
 * ═══════════════════════════════════════════════════════════ */
#tico-chat-widget #tico-chat-start-form {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#tico-chat-widget .tico-chat-welcome {
    position: relative;
    padding: 15px 17px;
    background: var(--tico-chat-accent-soft);
    color: var(--tico-chat-accent-dark);
    border-radius: var(--tico-chat-radius-input);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: -0.005em;
    border: 1px solid var(--tico-chat-accent-glow);
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.04);
}

#tico-chat-widget .tico-chat-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#tico-chat-widget .tico-chat-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tico-chat-text);
    letter-spacing: -0.005em;
    padding-left: 2px;
}

#tico-chat-widget .tico-chat-required { color: var(--tico-chat-danger); font-weight: 700; }
#tico-chat-widget .tico-chat-optional {
    color: var(--tico-chat-text-subtle);
    font-weight: 400;
    font-size: 12px;
}

#tico-chat-widget .tico-chat-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

#tico-chat-widget input,
#tico-chat-widget select,
#tico-chat-widget textarea {
    font: inherit;
    color: inherit;
    outline: none;
    background: var(--tico-chat-bg-soft);
    border: 1.5px solid transparent;
    border-radius: var(--tico-chat-radius-input);
    padding: 12px 14px;
    width: 100%;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
    font-size: 14.5px;
    line-height: 1.4;
    letter-spacing: -0.005em;
}

#tico-chat-widget input:hover,
#tico-chat-widget select:hover,
#tico-chat-widget textarea:hover {
    background: var(--tico-chat-bg-sunken);
}

#tico-chat-widget input:focus,
#tico-chat-widget select:focus,
#tico-chat-widget textarea:focus {
    background: var(--tico-chat-bg);
    border-color: var(--tico-chat-accent);
    box-shadow: 0 0 0 4px var(--tico-chat-accent-glow);
}

#tico-chat-widget input::placeholder,
#tico-chat-widget textarea::placeholder {
    color: var(--tico-chat-text-subtle);
    opacity: 1;
}

#tico-chat-widget select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
 *  SUBMIT BUTONU — Admin panel rengi (--tico-chat-accent)
 *  Yüksek specificity: #tico-chat-widget .tico-chat-submit
 * ═══════════════════════════════════════════════════════════ */
#tico-chat-widget .tico-chat-submit {
    margin-top: 4px;
    height: 50px;
    padding: 0 22px;
    background: linear-gradient(135deg, var(--tico-chat-accent) 0%, var(--tico-chat-accent-dark) 100%);
    color: #FFFFFF;
    border-radius: var(--tico-chat-radius-input);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: transform .2s ease, box-shadow .25s ease, filter .2s ease;
    width: 100%;
    box-shadow:
        0 4px 14px -2px var(--tico-chat-accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

#tico-chat-widget .tico-chat-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left .6s ease;
}

#tico-chat-widget .tico-chat-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 8px 22px -4px var(--tico-chat-accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    filter: brightness(1.02);
}

#tico-chat-widget .tico-chat-submit:hover:not(:disabled)::before {
    left: 100%;
}

#tico-chat-widget .tico-chat-submit:active:not(:disabled) {
    transform: translateY(0) scale(.985);
}

#tico-chat-widget .tico-chat-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
    box-shadow: none;
}

#tico-chat-widget .tico-chat-submit-text {
    position: relative;
    z-index: 1;
}

#tico-chat-widget .tico-chat-submit-icon {
    width: 17px;
    height: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s cubic-bezier(.16, 1, .3, 1);
    position: relative;
    z-index: 1;
}

#tico-chat-widget .tico-chat-submit:hover:not(:disabled) .tico-chat-submit-icon {
    transform: translateX(4px);
}

#tico-chat-widget .tico-chat-error {
    padding: 12px 15px;
    background: linear-gradient(135deg, #FEF2F2 0%, #FFF5F5 100%);
    color: #991B1B;
    border-radius: var(--tico-chat-radius-input);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid #FECACA;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    animation: ticoChatShake .4s ease;
}

#tico-chat-widget .tico-chat-error::before {
    content: '⚠';
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

@keyframes ticoChatShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-4px); }
    40%      { transform: translateX(4px); }
    60%      { transform: translateX(-2px); }
    80%      { transform: translateX(2px); }
}

/* ═══════════════════════════════════════════════════════════
 *  SOHBET EKRANI
 * ═══════════════════════════════════════════════════════════ */
#tico-chat-widget .tico-chat-chat-screen {
    background:
        radial-gradient(circle at 0% 0%, var(--tico-chat-accent-soft) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, var(--tico-chat-accent-soft) 0%, transparent 40%),
        var(--tico-chat-bg-soft);
}

#tico-chat-widget .tico-chat-messages {
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 100%;
}

#tico-chat-widget .tico-chat-date-sep {
    align-self: center;
    padding: 5px 14px;
    background: rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--tico-chat-text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 999px;
    margin: 14px 0 8px;
}

#tico-chat-widget .tico-chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: ticoChatMsgIn .35s cubic-bezier(.16, 1, .3, 1);
    will-change: transform, opacity;
}

#tico-chat-widget .tico-chat-msg.group-start {
    margin-top: 10px;
}

@keyframes ticoChatMsgIn {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

#tico-chat-widget .tico-chat-msg.from-user  { align-self: flex-end;   align-items: flex-end; }
#tico-chat-widget .tico-chat-msg.from-admin { align-self: flex-start; align-items: flex-start; }
#tico-chat-widget .tico-chat-msg.from-system {
    align-self: center;
    align-items: center;
    max-width: 90%;
}

#tico-chat-widget .tico-chat-msg.from-admin {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

#tico-chat-widget .tico-chat-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tico-chat-accent) 0%, var(--tico-chat-accent-dark) 100%);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px -1px var(--tico-chat-accent-glow);
    letter-spacing: -0.02em;
    margin-bottom: 22px;
}

#tico-chat-widget .tico-chat-msg-avatar.is-hidden {
    visibility: hidden;
    opacity: 0;
}

#tico-chat-widget .tico-chat-msg-body {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

#tico-chat-widget .tico-chat-msg.from-user .tico-chat-msg-body { align-items: flex-end; }
#tico-chat-widget .tico-chat-msg.from-admin .tico-chat-msg-body { align-items: flex-start; }

#tico-chat-widget .tico-chat-msg-bubble {
    padding: 11px 15px;
    border-radius: var(--tico-chat-radius-bubble);
    font-size: 14.5px;
    line-height: 1.5;
    letter-spacing: -0.005em;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    position: relative;
}

#tico-chat-widget .tico-chat-msg.from-user .tico-chat-msg-bubble {
    background: linear-gradient(135deg, var(--tico-chat-accent-light) 0%, var(--tico-chat-accent) 50%, var(--tico-chat-accent-dark) 100%);
    color: #FFFFFF;
    border-bottom-right-radius: 6px;
    box-shadow:
        0 2px 8px -2px var(--tico-chat-accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

#tico-chat-widget .tico-chat-msg.from-admin .tico-chat-msg-bubble {
    background: var(--tico-chat-bg);
    color: var(--tico-chat-text);
    border: 1px solid var(--tico-chat-border);
    border-bottom-left-radius: 6px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.03),
        0 2px 8px -2px rgba(15, 23, 42, 0.06);
}

#tico-chat-widget .tico-chat-msg.from-system .tico-chat-msg-bubble {
    background: var(--tico-chat-bg);
    color: var(--tico-chat-text-muted);
    border: 1px solid var(--tico-chat-border);
    font-size: 12.5px;
    font-style: italic;
    text-align: center;
    padding: 8px 16px;
    border-radius: 999px;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

#tico-chat-widget .tico-chat-msg-meta {
    font-size: 11px;
    color: var(--tico-chat-text-subtle);
    margin-top: 5px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    letter-spacing: -0.005em;
}

#tico-chat-widget .tico-chat-msg-meta .tico-chat-msg-read {
    color: var(--tico-chat-accent);
    font-size: 10px;
    display: inline-flex;
    animation: ticoChatCheckIn .3s ease;
}

@keyframes ticoChatCheckIn {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

#tico-chat-widget .tico-chat-msg.is-optimistic .tico-chat-msg-bubble {
    opacity: .78;
}

#tico-chat-widget .tico-chat-msg.is-optimistic .tico-chat-msg-meta {
    opacity: .6;
}

#tico-chat-widget .tico-chat-typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
    background: var(--tico-chat-bg);
    border: 1px solid var(--tico-chat-border);
    border-radius: var(--tico-chat-radius-bubble);
    border-bottom-left-radius: 6px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.03),
        0 2px 8px -2px rgba(15, 23, 42, 0.06);
    margin-top: 8px;
}

#tico-chat-widget .tico-chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tico-chat-text-subtle);
    animation: ticoChatTypingBounce 1.3s ease-in-out infinite;
}

#tico-chat-widget .tico-chat-typing span:nth-child(1) { animation-delay: 0ms; }
#tico-chat-widget .tico-chat-typing span:nth-child(2) { animation-delay: 160ms; }
#tico-chat-widget .tico-chat-typing span:nth-child(3) { animation-delay: 320ms; }

@keyframes ticoChatTypingBounce {
    0%, 60%, 100% { transform: translateY(0);    opacity: .4; }
    30%           { transform: translateY(-6px); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
 *  FOOTER
 * ═══════════════════════════════════════════════════════════ */
#tico-chat-widget .tico-chat-footer {
    flex-shrink: 0;
    padding: 14px 14px 12px;
    background: var(--tico-chat-bg);
    border-top: 1px solid var(--tico-chat-border-soft);
    position: relative;
}

#tico-chat-widget .tico-chat-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15,23,42,.06), transparent);
}

#tico-chat-widget .tico-chat-footer form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

#tico-chat-widget .tico-chat-footer .tico-chat-input-wrap {
    flex: 1;
}

#tico-chat-widget #tico-chat-message {
    flex: 1;
    min-height: 46px;
    max-height: 132px;
    padding: 12px 18px;
    border-radius: 23px;
    resize: none;
    font-size: 14.5px;
    line-height: 1.45;
    overflow-y: auto;
    scrollbar-width: thin;
    background: var(--tico-chat-bg-soft);
    border-color: transparent;
    letter-spacing: -0.005em;
}

#tico-chat-widget #tico-chat-message:hover { background: var(--tico-chat-bg-sunken); }

#tico-chat-widget #tico-chat-message:focus {
    background: var(--tico-chat-bg);
    border-color: var(--tico-chat-accent);
}

#tico-chat-widget #tico-chat-message::-webkit-scrollbar { width: 4px; }
#tico-chat-widget #tico-chat-message::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 2px; }

#tico-chat-widget #tico-chat-send-btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tico-chat-accent-light) 0%, var(--tico-chat-accent) 50%, var(--tico-chat-accent-dark) 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s cubic-bezier(.16, 1, .3, 1), box-shadow .25s ease, filter .2s ease;
    box-shadow:
        0 4px 12px -2px var(--tico-chat-accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

#tico-chat-widget #tico-chat-send-btn:hover:not(:disabled) {
    transform: scale(1.08) translateY(-1px);
    box-shadow:
        0 8px 20px -3px var(--tico-chat-accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    filter: brightness(1.03);
}

#tico-chat-widget #tico-chat-send-btn:active:not(:disabled) {
    transform: scale(.94);
}

#tico-chat-widget #tico-chat-send-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#tico-chat-widget #tico-chat-send-btn svg {
    width: 18px;
    height: 18px;
    margin-left: 1px;
}

#tico-chat-widget .tico-chat-footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 10.5px;
    color: var(--tico-chat-text-subtle);
    letter-spacing: -0.005em;
    font-weight: 500;
}

#tico-chat-widget .tico-chat-footer-note svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
 *  MOBİL
 * ═══════════════════════════════════════════════════════════ */
@media (max-width: 520px) {
    #tico-chat-widget {
        bottom: 16px;
        right: 16px;
    }

    #tico-chat-widget #tico-chat-launcher {
        width: 60px;
        height: 60px;
    }

    #tico-chat-widget #tico-chat-launcher svg { width: 26px; height: 26px; }

    #tico-chat-widget #tico-chat-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        transform: translateY(100%);
        transform-origin: center bottom;
    }

    #tico-chat-widget[data-state="open"] #tico-chat-panel {
        transform: translateY(0);
    }

    #tico-chat-widget #tico-chat-panel {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    #tico-chat-widget #tico-chat-start-form { padding: 20px 18px; }
    #tico-chat-widget .tico-chat-messages  { padding: 18px 14px; }
    #tico-chat-widget .tico-chat-msg       { max-width: 88%; }
}

/* ═══════════════════════════════════════════════════════════
 *  DARK MODE
 * ═══════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    #tico-chat-widget {
        --tico-chat-text: #F1F5F9;
        --tico-chat-text-2: #CBD5E1;
        --tico-chat-text-muted: #94A3B8;
        --tico-chat-text-subtle: #64748B;
        --tico-chat-bg: #1E293B;
        --tico-chat-bg-soft: #172033;
        --tico-chat-bg-sunken: #0F172A;
        --tico-chat-border: #334155;
        --tico-chat-border-soft: #1E293B;

        --tico-chat-shadow-panel:
            0 0 0 1px rgba(255, 255, 255, 0.04),
            0 12px 32px -8px rgba(0, 0, 0, 0.5),
            0 32px 80px -24px rgba(0, 0, 0, 0.7);
        --tico-chat-shadow-launcher:
            0 4px 12px -2px rgba(0, 0, 0, 0.4),
            0 12px 32px -6px rgba(0, 0, 0, 0.5);
    }

    #tico-chat-widget .tico-chat-msg.from-admin .tico-chat-msg-bubble {
        background: #1E293B;
        color: #F1F5F9;
        border-color: #334155;
    }

    #tico-chat-widget .tico-chat-welcome {
        background: var(--tico-chat-accent-soft);
        color: var(--tico-chat-accent-light);
        border-color: var(--tico-chat-accent-glow);
    }

    #tico-chat-widget #tico-chat-message {
        background: #172033;
        color: #F1F5F9;
    }
    #tico-chat-widget #tico-chat-message:hover { background: #1E293B; }
    #tico-chat-widget #tico-chat-message:focus { background: #0F172A; }

    #tico-chat-widget .tico-chat-chat-screen {
        background:
            radial-gradient(circle at 0% 0%, var(--tico-chat-accent-soft) 0%, transparent 40%),
            radial-gradient(circle at 100% 100%, var(--tico-chat-accent-soft) 0%, transparent 40%),
            var(--tico-chat-bg-soft);
    }

    #tico-chat-widget .tico-chat-launcher-badge { border-color: #1E293B; }
    #tico-chat-widget .tico-chat-date-sep { background: rgba(255, 255, 255, 0.08); }

    #tico-chat-widget .tico-chat-body::-webkit-scrollbar-thumb { background: #334155; }
}

/* ═══════════════════════════════════════════════════════════
 *  ERİŞİLEBİLİRLİK
 * ═══════════════════════════════════════════════════════════ */
#tico-chat-widget button:focus-visible,
#tico-chat-widget input:focus-visible,
#tico-chat-widget select:focus-visible,
#tico-chat-widget textarea:focus-visible {
    outline: 2px solid var(--tico-chat-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    #tico-chat-widget *,
    #tico-chat-widget *::before,
    #tico-chat-widget *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    #tico-chat-widget .tico-chat-launcher-ping,
    #tico-chat-widget .tico-chat-header-avatar-ping { animation: none !important; }
}

@media print {
    #tico-chat-widget { display: none !important; }
}