/* SmallMan canlı destek (ziyaretçi). Renk: --smc-accent (admin → Canlı Destek → Ayarlar). */
.smc-root {
    --smc-accent: #1f4fa3;
    --smc-accent-ink: #ffffff;
    --smc-bg: #f4f6fa;
    --smc-surface: #ffffff;
    --smc-ink: #1b2330;
    --smc-muted: #5d6878;
    --smc-line: #e2e6ee;
    --smc-radius: 16px;
    --smc-shadow: 0 18px 48px rgba(15, 30, 60, .22), 0 2px 8px rgba(15, 30, 60, .10);
    position: fixed;
    bottom: calc(18px + var(--smc-lift, 0px) + env(safe-area-inset-bottom, 0px));
    right: 18px;
    z-index: 9990;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    color: var(--smc-ink);
    -webkit-font-smoothing: antialiased;
}
.smc-root.smc-left { right: auto; left: 18px; }
.smc-root *, .smc-root *::before, .smc-root *::after { box-sizing: border-box; }
.smc-root button { font-family: inherit; }

/* ---- balon ---- */
.smc-launcher {
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 56px; padding: 0 20px 0 16px;
    border: 0; border-radius: 999px; cursor: pointer;
    background: var(--smc-accent); color: var(--smc-accent-ink);
    box-shadow: 0 10px 28px rgba(15, 30, 60, .28);
    font-size: 15px; font-weight: 600; letter-spacing: .1px;
    transition: transform .18s ease, box-shadow .18s ease;
    position: relative;
}
.smc-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(15, 30, 60, .32); }
.smc-launcher:focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }
.smc-launcher svg { width: 26px; height: 26px; flex: none; }
.smc-launcher .smc-dot { position: absolute; top: 10px; left: 34px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid var(--smc-accent); display: none; }
.smc-root.smc-online .smc-launcher .smc-dot { display: block; }
.smc-badge {
    position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 11px; background: #e11d48; color: #fff; font-size: 12px; font-weight: 700;
    display: none; align-items: center; justify-content: center; border: 2px solid #fff;
}
.smc-badge.smc-show { display: inline-flex; }
.smc-root.smc-open .smc-launcher { display: none; }

/* ---- pencere ---- */
.smc-panel {
    position: absolute; bottom: 0; right: 0;
    width: 380px; height: min(620px, calc(100vh - 40px));
    display: none; flex-direction: column; overflow: hidden;
    background: var(--smc-bg); border-radius: var(--smc-radius); box-shadow: var(--smc-shadow);
    transform-origin: bottom right;
}
.smc-left .smc-panel { right: auto; left: 0; transform-origin: bottom left; }
.smc-root.smc-open .smc-panel { display: flex; animation: smc-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes smc-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

.smc-head {
    display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px;
    background: var(--smc-accent); color: var(--smc-accent-ink); flex: none;
}
.smc-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex: none; position: relative; }
.smc-avatar svg { width: 22px; height: 22px; }
.smc-avatar .smc-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--smc-accent); background: #9aa3af; }
.smc-root.smc-online .smc-avatar .smc-dot { background: #22c55e; }
.smc-head-text { min-width: 0; flex: 1; }
.smc-title { font-weight: 700; font-size: 16px; margin: 0; line-height: 1.25; }
.smc-sub { font-size: 13px; opacity: .88; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smc-icon-btn {
    width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: inherit;
    display: grid; place-items: center; cursor: pointer; flex: none;
}
.smc-icon-btn:hover { background: rgba(255, 255, 255, .14); }
.smc-icon-btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.smc-icon-btn svg { width: 20px; height: 20px; }

.smc-menu {
    position: absolute; top: 60px; right: 12px; z-index: 3; min-width: 200px; padding: 6px;
    background: var(--smc-surface); border-radius: 12px; box-shadow: var(--smc-shadow); display: none;
}
.smc-left .smc-menu { right: 12px; }
.smc-menu.smc-show { display: block; }
.smc-menu button {
    display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none;
    border-radius: 8px; font-size: 14px; color: var(--smc-ink); cursor: pointer; min-height: 40px;
}
.smc-menu button:hover, .smc-menu button:focus-visible { background: var(--smc-bg); outline: none; }

.smc-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; scroll-behavior: smooth; overscroll-behavior: contain; }
.smc-day { text-align: center; font-size: 12px; color: var(--smc-muted); margin: 6px 0 12px; }
.smc-row { display: flex; margin: 0 0 10px; }
.smc-row.smc-me { justify-content: flex-end; }
.smc-bubble-wrap { max-width: 84%; display: flex; flex-direction: column; }
.smc-me .smc-bubble-wrap { align-items: flex-end; }
.smc-name { font-size: 12px; color: var(--smc-muted); margin: 0 0 3px 4px; font-weight: 600; }
.smc-bubble {
    padding: 10px 13px; border-radius: 16px 16px 16px 6px; background: var(--smc-surface);
    border: 1px solid var(--smc-line); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.smc-me .smc-bubble { background: var(--smc-accent); color: var(--smc-accent-ink); border-color: transparent; border-radius: 16px 16px 6px 16px; }
.smc-bubble a { color: inherit; text-decoration: underline; }
.smc-time { font-size: 11px; color: var(--smc-muted); margin: 3px 6px 0; }
.smc-system { text-align: center; font-size: 12.5px; color: var(--smc-muted); margin: 4px 12px 12px; }

.smc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.smc-chip {
    min-height: 38px; padding: 8px 14px; border-radius: 999px; cursor: pointer; text-decoration: none;
    border: 1.5px solid var(--smc-accent); background: var(--smc-surface); color: var(--smc-accent);
    font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2;
}
.smc-chip:hover { background: var(--smc-accent); color: var(--smc-accent-ink); }
.smc-chip:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.smc-chip[disabled] { opacity: .45; cursor: default; background: var(--smc-surface); color: var(--smc-accent); }
.smc-chip svg { width: 14px; height: 14px; }

.smc-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; width: 100%; }
.smc-product {
    display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--smc-surface);
    border: 1px solid var(--smc-line); color: var(--smc-ink); text-decoration: none; min-height: 64px;
}
.smc-product:hover { border-color: var(--smc-accent); }
.smc-product img, .smc-product .smc-noimg { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: #fff; flex: none; }
.smc-product .smc-pname { font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.smc-product .smc-price { font-weight: 700; font-size: 14px; margin-top: 2px; }
.smc-product .smc-stock { font-size: 12px; color: #b42318; font-weight: 600; }

.smc-order { padding: 12px; border-radius: 12px; background: var(--smc-surface); border: 1px solid var(--smc-line); font-size: 13.5px; }
.smc-order-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.smc-order-no { font-weight: 700; font-size: 14px; }
.smc-order-date { color: var(--smc-muted); font-size: 12px; }
.smc-status { display: inline-block; margin: 8px 0 6px; padding: 4px 10px; border-radius: 999px; background: #e8effc; color: #1d3f84; font-weight: 700; font-size: 13px; }
.smc-order-meta { color: var(--smc-muted); }
.smc-order a { display: inline-flex; margin-top: 8px; font-weight: 700; color: var(--smc-accent); }

.smc-form { margin-top: 8px; padding: 12px; border-radius: 12px; background: var(--smc-surface); border: 1px solid var(--smc-line); width: 100%; }
.smc-form label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 4px; }
.smc-form input {
    width: 100%; min-height: 44px; padding: 10px 12px; margin: 0 0 10px; border: 1.5px solid var(--smc-line);
    border-radius: 10px; font-size: 16px; font-family: inherit; color: var(--smc-ink); background: #fff;
}
.smc-form input:focus { outline: none; border-color: var(--smc-accent); box-shadow: 0 0 0 3px rgba(31, 79, 163, .15); }
.smc-form .smc-hint { font-size: 12px; color: var(--smc-muted); margin: -4px 0 10px; }
.smc-form .smc-err { font-size: 13px; color: #b42318; margin: 0 0 8px; min-height: 0; }
.smc-btn {
    width: 100%; min-height: 44px; border: 0; border-radius: 10px; background: var(--smc-accent); color: var(--smc-accent-ink);
    font-weight: 700; font-size: 15px; cursor: pointer;
}
.smc-btn:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.smc-btn[disabled] { opacity: .6; cursor: default; }
.smc-btn-ghost { background: transparent; color: var(--smc-accent); border: 1.5px solid var(--smc-accent); margin-top: 8px; }

.smc-typing { display: none; align-items: center; gap: 8px; padding: 0 16px 8px; font-size: 12.5px; color: var(--smc-muted); flex: none; }
.smc-typing.smc-show { display: flex; }
.smc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--smc-muted); display: inline-block; animation: smc-blink 1.2s infinite ease-in-out; }
.smc-typing i:nth-child(2) { animation-delay: .15s; }
.smc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes smc-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.smc-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 12px; background: var(--smc-surface); border-top: 1px solid var(--smc-line); flex: none; }
.smc-compose textarea {
    flex: 1 1 auto; width: auto; min-width: 0; margin: 0; box-shadow: none; resize: none; border: 1.5px solid var(--smc-line); border-radius: 12px; padding: 11px 12px;
    font-size: 16px; font-family: inherit; line-height: 1.35; max-height: 120px; min-height: 46px; color: var(--smc-ink); background: #fff;
}
.smc-compose textarea:focus { outline: none; border-color: var(--smc-accent); }
.smc-send {
    margin: 0; padding: 0;
    width: 46px; height: 46px; flex: none; border: 0; border-radius: 12px; background: var(--smc-accent); color: var(--smc-accent-ink);
    display: grid; place-items: center; cursor: pointer;
}
.smc-send[disabled] { opacity: .45; cursor: default; }
.smc-send:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.smc-send svg { width: 20px; height: 20px; }

.smc-rate { padding: 16px; background: var(--smc-surface); border-top: 1px solid var(--smc-line); text-align: center; flex: none; }
.smc-rate p { margin: 0 0 8px; font-weight: 600; }
.smc-stars { display: inline-flex; gap: 4px; margin-bottom: 10px; }
.smc-stars button { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; color: #c4cad3; padding: 0; }
.smc-stars button.smc-on { color: #f5a524; }
.smc-stars button svg { width: 30px; height: 30px; }
.smc-rate textarea { width: 100%; min-height: 60px; border: 1.5px solid var(--smc-line); border-radius: 10px; padding: 8px 10px; font-size: 15px; font-family: inherit; margin-bottom: 8px; }
.smc-status-line { padding: 6px 14px; font-size: 12.5px; text-align: center; color: #7a4d00; background: #fff6e0; flex: none; display: none; }
.smc-status-line.smc-show { display: block; }

@media (max-width: 600px) {
    .smc-root { right: 12px; bottom: calc(12px + var(--smc-lift, 0px) + env(safe-area-inset-bottom, 0px)); }
    .smc-root.smc-left { left: 12px; }
    .smc-launcher { min-height: 52px; padding: 0 14px; }
    .smc-launcher .smc-label { display: none; }
    .smc-launcher .smc-dot { left: 30px; top: 8px; }
    .smc-root.smc-open { inset: 0; }
    .smc-root.smc-open .smc-panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; }
    .smc-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
    .smc-compose { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
    .smc-root.smc-open .smc-panel { animation: none; }
    .smc-launcher { transition: none; }
    .smc-log { scroll-behavior: auto; }
    .smc-typing i { animation: none; opacity: .6; }
}
.smc-root [hidden] { display: none !important; }

/* emoji, dosya, mesaj bırakma formu */
.smc-tool {
    width: 40px; height: 46px; flex: none; margin: 0; padding: 0; border: 0; border-radius: 10px;
    background: transparent; color: var(--smc-muted); display: grid; place-items: center; cursor: pointer;
}
.smc-tool:hover { color: var(--smc-accent); background: var(--smc-bg); }
.smc-tool:focus-visible { outline: 3px solid #ffbf47; outline-offset: 1px; }
.smc-tool[disabled] { opacity: .4; cursor: default; }
.smc-tool svg { width: 22px; height: 22px; }
.smc-compose { gap: 4px; }
.smc-emoji {
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; flex: none;
    background: var(--smc-surface); border-top: 1px solid var(--smc-line);
}
.smc-emoji button { height: 40px; border: 0; background: none; border-radius: 8px; font-size: 22px; cursor: pointer; padding: 0; margin: 0; }
.smc-emoji button:hover, .smc-emoji button:focus-visible { background: var(--smc-bg); outline: none; }
.smc-file-card {
    display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; max-width: 240px;
    border-radius: 12px; background: var(--smc-surface); border: 1px solid var(--smc-line); color: var(--smc-ink); text-decoration: none; font-size: 13.5px;
}
.smc-file-card img { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; object-fit: contain; }
.smc-file-card svg { width: 22px; height: 22px; flex: none; color: var(--smc-accent); }
.smc-me .smc-file-card { align-self: flex-end; }
.smc-form textarea {
    width: 100%; min-height: 84px; padding: 10px 12px; margin: 0 0 10px; border: 1.5px solid var(--smc-line);
    border-radius: 10px; font-size: 16px; font-family: inherit; color: var(--smc-ink); background: #fff; resize: vertical;
}
.smc-form textarea:focus { outline: none; border-color: var(--smc-accent); box-shadow: 0 0 0 3px rgba(31, 79, 163, .15); }

/* önceki görüşme ayırıcısı */
.smc-divider {
    display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; font-size: 12px; font-weight: 600; color: var(--smc-muted);
}
.smc-divider::before, .smc-divider::after { content: ''; flex: 1; height: 1px; background: var(--smc-line); }
