/* Storefront support-chat widget — dark Komi-style panel.
   Hand-authored (front CSS has no SCSS pipeline). */

.schat {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1200;
    font-family: 'Inter', system-ui, sans-serif;
}

.schat__launcher {
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 999px;
    background: #131316;
    color: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
    transition: transform .15s;
}

.schat__launcher:hover { transform: scale(1.06); }
.schat.is-open .schat__launcher { display: none; }

.schat__panel[hidden] { display: none; }

.schat__panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 372px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #131316;
    color: #fafafa;
    border: 1px solid #26262b;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
    overflow: hidden;
}

.schat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #1f1f23;
    flex: 0 0 auto;
}

.schat__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.schat__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, .8);
}

.schat__dot--pulse { animation: schatPulse 1.4s ease-in-out infinite; }
@keyframes schatPulse { 50% { opacity: .35; } }

.schat__min {
    background: none;
    border: 0;
    color: #a1a1aa;
    cursor: pointer;
    display: flex;
    padding: 4px;
    border-radius: 6px;
}
.schat__min:hover { color: #fafafa; background: #1f1f23; }

.schat__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
}

.schat__msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.schat__msg--customer {
    align-self: flex-end;
    background: #fafafa;
    color: #131316;
    border-bottom-right-radius: 5px;
}

.schat__msg--assistant,
.schat__msg--team {
    align-self: flex-start;
    background: #1f1f23;
    color: #e4e4e7;
    border-bottom-left-radius: 5px;
}

.schat__msg--team { border: 1px solid #2c2c31; }

.schat__note {
    align-self: center;
    font-size: 11.5px;
    color: #71717a;
    text-align: center;
    padding: 2px 8px;
}

.schat__waiting {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #d4d4d8;
    border: 1px solid #2c2c31;
    border-radius: 999px;
    padding: 7px 14px;
    margin: 4px 0;
}

.schat__emailCard {
    align-self: stretch;
    background: #1a1a1e;
    border: 1px solid #2c2c31;
    border-radius: 14px;
    padding: 14px;
}

.schat__emailTitle {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.schat__emailRow {
    display: flex;
    gap: 8px;
}

.schat__emailRow input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid #2c2c31;
    background: #131316;
    color: #fafafa;
    font: inherit;
    font-size: 13px;
}
.schat__emailRow input:focus { outline: 0; border-color: #4ade80; }

.schat__emailRow button {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 9px;
    background: #fafafa;
    color: #131316;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.schat__suggest[hidden] { display: none; }

.schat__suggest {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 0 14px 10px;
    flex: 0 0 auto;
}

.schat__chip {
    border: 1px solid #2c2c31;
    background: #1f1f23;
    color: #e4e4e7;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 999px;
    padding: 7px 13px;
    cursor: pointer;
    text-align: left;
}
.schat__chip:hover { background: #26262b; }

.schat__inputRow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #1f1f23;
    flex: 0 0 auto;
}

.schat__input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border-radius: 999px;
    border: 1px solid #2c2c31;
    background: #fafafa;
    color: #131316;
    padding: 0 16px;
    font: inherit;
    font-size: 13.5px;
}
.schat__input:focus { outline: 0; border-color: #4ade80; }

.schat__send {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: #fafafa;
    color: #131316;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .12s;
}
.schat__send:hover { transform: scale(1.05); }

.schat__typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.schat__typing i {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #71717a;
    animation: schatTyping 1.1s infinite;
}
.schat__typing i:nth-child(2) { animation-delay: .18s; }
.schat__typing i:nth-child(3) { animation-delay: .36s; }
@keyframes schatTyping { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

@media (max-width: 480px) {
    .schat { right: 12px; bottom: 12px; }
    .schat__panel { height: 74vh; }
}
