.str-chat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
    border: 1px solid var(--str-color-border);
    border-radius: 14px;
    padding: 10px;
    background: var(--str-color-surface);
    min-height: 0;
    flex: 1 1 auto;
}

.str-chat__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--str-color-text);
    line-height: 1.15;
}

.str-chat__hint {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--str-color-text-muted);
}

.str-chat__toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border: 1px solid var(--str-color-primary-soft);
    background: var(--str-color-primary-soft);
    border-radius: 10px;
    padding: 8px 10px;
    margin: 0;
    flex: 0 0 auto;
}

.str-chat__toolbar-summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--str-color-text);
}

.str-chat__toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.str-chat__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.str-chat__action-btn {
    border: 1px solid var(--str-color-border);
    background: var(--str-color-surface);
    color: var(--str-color-text-muted);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all var(--str-duration-fast) var(--str-ease-out);
}

.str-chat__action-btn:hover,
.str-chat__action-btn:active,
.str-chat__action-btn:focus-visible {
    border-color: var(--str-color-text-disabled);
    background: var(--str-color-surface-2);
    color: var(--str-color-text);
}

.str-chat__action-btn:focus-visible {
    outline: none;
    box-shadow: var(--str-focus-ring);
}

.str-chat__action-btn:disabled {
    background: var(--str-color-surface-2);
    border-color: var(--str-color-surface-3);
    color: var(--str-color-text-disabled);
    opacity: 1;
    cursor: not-allowed;
}

.str-chat__action-btn--primary {
    border-color: var(--str-color-primary);
    background: var(--str-color-primary);
    color: var(--str-color-text-inverse);
}

.str-chat__action-btn--primary:hover,
.str-chat__action-btn--primary:active,
.str-chat__action-btn--primary:focus-visible {
    border-color: var(--str-color-primary-hover);
    background: var(--str-color-primary-hover);
    color: var(--str-color-text-inverse);
}

.str-chat__state {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid var(--str-color-primary-soft);
    background: var(--str-color-primary-soft);
    color: var(--str-color-primary);
    text-transform: uppercase;
}

.str-chat__state.is-active {
    border-color: var(--str-color-success-soft);
    background: var(--str-color-success-soft);
    color: var(--str-color-success);
}

.str-chat__state.is-post_match,
.str-chat__state.is-closed,
.str-chat__state.is-disputa {
    border-color: var(--str-color-border);
    background: var(--str-color-surface-2);
    color: var(--str-color-text-muted);
}

.str-chat__lifecycle-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.str-chat__lifecycle-btn {
    border: 1px solid var(--str-color-border);
    background: var(--str-color-surface);
    color: var(--str-color-text-muted);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.str-chat__schedule {
    display: none;
}

.str-chat__status {
    min-height: 18px;
    font-size: 13px;
    color: var(--str-color-text-muted);
}

.str-chat__status.is-error {
    color: var(--str-color-error-hover);
}

.str-chat__status.is-warning {
    color: var(--str-color-warning);
}

.str-chat__status--lock {
    background: var(--str-color-warning-soft);
    border: 1px solid var(--str-color-warning);
    color: var(--str-color-warning);
    border-radius: 9px;
    padding: 8px 10px;
}

.str-chat__messages {
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--str-color-surface-3);
    border-radius: 12px;
    padding: 10px;
    overflow: auto;
    background: var(--str-color-surface-2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.str-chat__day-separator {
    align-self: center;
    background: var(--str-color-surface-3);
    color: var(--str-color-text-muted);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    margin: 4px 0;
}

.str-chat__empty {
    font-size: 13px;
    color: var(--str-color-text-muted);
    text-align: center;
    padding: 24px 8px;
}

.str-chat__message {
    width: 100%;
    display: flex;
}

.str-chat__message--system {
    justify-content: center;
}

.str-chat__system-pill {
    max-width: 88%;
    background: var(--str-color-surface-3);
    color: var(--str-color-text-muted);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.str-chat__message--mine {
    justify-content: flex-start;
}

.str-chat__message--other {
    justify-content: flex-end;
}

.str-chat__bubble {
    max-width: 78%;
    border-radius: 16px;
    border: 1px solid var(--str-color-border);
    background: var(--str-color-surface);
    padding: 8px 10px;
}

.str-chat__message--mine .str-chat__bubble {
    border-color: var(--str-color-primary-soft);
    background: var(--str-color-primary-soft);
}

.str-chat__message--other .str-chat__bubble {
    border-color: var(--str-color-border);
    background: var(--str-color-surface);
}

.str-chat__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 11px;
}

.str-chat__author {
    font-weight: 700;
    color: var(--str-color-text);
}

.str-chat__time {
    color: var(--str-color-text-muted);
}

.str-chat__delete {
    margin-left: auto;
    border: 1px solid var(--str-color-error-soft);
    background: var(--str-color-error-soft);
    color: var(--str-color-error-hover);
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 7px;
    cursor: pointer;
}

.str-chat__body {
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--str-color-text);
    font-size: 16px;
    line-height: 1.4;
}

.str-chat__form {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.str-chat__input {
    flex: 1 1 auto;
    border: 1px solid var(--str-color-border);
    border-radius: 10px;
    padding: 10px 12px;
    min-height: 46px;
    max-height: 110px;
    resize: vertical;
    font-size: 14px;
    background: var(--str-color-surface);
}

.str-chat__send {
    flex: 0 0 auto;
    border: 1px solid var(--str-color-primary);
    background: var(--str-color-primary);
    color: var(--str-color-text-inverse);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.str-chat__send:disabled,
.str-chat__delete:disabled,
.str-chat__schedule-save:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.str-chat__h2h {
    border: 1px solid var(--str-color-primary-soft);
    border-radius: 12px;
    background: var(--str-color-primary-soft);
    padding: 12px;
}

.str-chat__h2h-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--str-color-primary-hover);
    margin-bottom: 10px;
}

.str-chat__h2h-content {
    font-size: 15px;
    color: var(--str-color-text);
    font-weight: 600;
    line-height: 1.45;
}

.str-chat__h2h-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.str-chat__h2h-kpi {
    background: var(--str-color-surface);
    border: 1px solid var(--str-color-primary-soft);
    border-radius: 10px;
    padding: 10px 12px;
}

.str-chat__h2h-kpi-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--str-color-text-muted);
    margin-bottom: 4px;
}

.str-chat__h2h-kpi-value {
    display: block;
    font-size: 18px;
    line-height: 1.1;
    color: var(--str-color-text);
}

.str-chat__h2h-bars {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.str-chat__h2h-bar-line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.str-chat__h2h-bar-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--str-color-text-muted);
    min-width: 62px;
}

.str-chat__h2h-bar-track {
    height: 8px;
    border-radius: 999px;
    background: var(--str-color-primary-soft);
    overflow: hidden;
}

.str-chat__h2h-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--str-color-info) 0%, var(--str-color-primary) 100%);
}

.str-chat__h2h-bar-fill--default {
    width: 50%;
}

.str-chat__h2h-bar-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--str-color-primary);
    min-width: 38px;
    text-align: right;
}

.str-chat__h2h-form {
    margin-top: 12px;
    border-top: 1px dashed var(--str-color-primary-soft);
    padding-top: 10px;
}

.str-chat__h2h-form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--str-color-text-muted);
    margin-bottom: 8px;
}

.str-chat__h2h-form-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.str-chat__h2h-chip {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid var(--str-color-border);
    color: var(--str-color-text-muted);
    background: var(--str-color-surface);
}

.str-chat__h2h-chip.is-win {
    border-color: var(--str-color-success-soft);
    background: var(--str-color-success-soft);
    color: var(--str-color-success);
}

.str-chat__h2h-chip.is-loss {
    border-color: var(--str-color-error-soft);
    background: var(--str-color-error-soft);
    color: var(--str-color-error-hover);
}

.str-chat__h2h-chip.is-empty {
    border-style: dashed;
    color: var(--str-color-text-disabled);
}

.str-chat__modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
}

.str-chat__modal[hidden] {
    display: none !important;
}

.str-chat__modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--str-color-overlay);
    backdrop-filter: blur(2px);
}

.str-chat__modal-panel {
    position: relative;
    width: min(760px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--str-color-border);
    background: var(--str-color-surface);
    box-shadow: var(--str-shadow-xl);
}

.str-chat__modal-panel--details {
    width: min(560px, calc(100vw - 24px));
}

.str-chat__modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--str-color-surface-3);
    background: linear-gradient(180deg, var(--str-color-surface) 0%, var(--str-color-primary-soft) 100%);
}

.str-chat__modal-head h5 {
    margin: 0;
    font-size: 27px;
    font-weight: 700;
    color: var(--str-color-text);
}

.str-chat__modal-close {
    position: static;
    width: 40px;
    height: 36px;
    border: 1px solid var(--str-color-error-soft);
    border-radius: 12px;
    background: var(--str-color-surface);
    color: var(--str-color-error);
    font-size: 0;
    line-height: 0;
    padding: 0;
    cursor: pointer;
    transition: all var(--str-duration-normal) var(--str-ease-out);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--str-shadow-xs);
}

.str-chat__modal-close::before {
    content: "\00d7";
    font-size: 24px;
    line-height: 1;
    font-weight: 500;
    transform: translateY(-1px);
}

.str-chat__modal-close:hover {
    background: var(--str-color-error-soft);
    border-color: var(--str-color-error);
    color: var(--str-color-error-hover);
    box-shadow: var(--str-shadow-md);
}

.str-chat__modal-close:focus-visible {
    outline: none;
    box-shadow: var(--str-focus-ring);
}

.str-chat__modal-body {
    max-height: calc(100vh - 170px);
    overflow: auto;
    padding: 14px 16px 16px;
}

.str-chat__modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.str-chat__schedule-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.str-chat__schedule-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.str-chat__schedule-field--wide {
    grid-column: 1 / -1;
}

.str-chat__schedule-field span {
    font-size: 13px;
    font-weight: 600;
    color: var(--str-color-text-muted);
}

.str-chat__schedule-field input {
    border: 1px solid var(--str-color-border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--str-color-text);
}

@media (max-width: 768px) {
    .str-chat {
        padding: 8px;
    }

    .str-chat__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .str-chat__toolbar-right {
        margin-left: 0;
        justify-content: space-between;
    }

    .str-chat__actions {
        width: 100%;
    }

    .str-chat__action-btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .str-chat__bubble {
        max-width: 92%;
    }

    .str-chat__form {
        flex-direction: column;
    }

    .str-chat__send {
        width: 100%;
    }

    .str-chat__schedule-fields {
        grid-template-columns: 1fr;
    }

    .str-chat__h2h-kpis {
        grid-template-columns: 1fr;
    }
}

