.cm-toast-stack {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    z-index: 2147483000;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 28px));
    pointer-events: none;
}

.cm-toast {
    position: relative;
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 54px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(24, 26, 39, 0.96);
    color: #f7f9ff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
    pointer-events: auto;
    transform-origin: top right;
    animation: cm-toast-in 180ms ease-out;
}

.cm-toast.is-leaving {
    animation: cm-toast-out 180ms ease-in forwards;
}

.cm-toast__bar {
    width: 4px;
    height: 100%;
    background: #2687ff;
}

.cm-toast__body {
    padding: 12px 0;
    color: #f7f9ff;
    font-weight: 850;
    line-height: 1.35;
}

.cm-toast__close {
    width: 34px;
    height: 34px;
    margin-right: 8px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    color: #d8e0ee;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.cm-toast__close:hover,
.cm-toast__close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    outline: none;
}

.cm-toast-success .cm-toast__bar {
    background: #22c55e;
}

.cm-toast-error .cm-toast__bar,
.cm-toast-danger .cm-toast__bar {
    background: #ff4f6d;
}

.cm-toast-warning .cm-toast__bar {
    background: #f59e0b;
}

.cm-toast-info .cm-toast__bar,
.cm-toast-debug .cm-toast__bar {
    background: #38bdf8;
}

body.public-mode.color-mode-light .cm-toast,
.dashboard-shell.dashboard-light .cm-toast {
    background: rgba(255, 255, 255, 0.96);
    color: #172033;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

body.public-mode.color-mode-light .cm-toast__body,
.dashboard-shell.dashboard-light .cm-toast__body {
    color: #172033;
}

body.public-mode.color-mode-light .cm-toast__close,
.dashboard-shell.dashboard-light .cm-toast__close {
    color: #475569;
    background: rgba(15, 23, 42, 0.06);
}

@keyframes cm-toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cm-toast-out {
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
}

@media (max-width: 640px) {
    .cm-toast-stack {
        top: max(12px, env(safe-area-inset-top));
        right: 12px;
        left: 12px;
        width: auto;
    }
}

.cm-chip-select {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 42px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: #303142;
}

.cm-chip-select > div {
    display: contents;
}

.cm-chip-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    cursor: pointer;
    user-select: none;
}

.cm-chip-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cm-chip-option span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 4px;
    color: #dbe7f7;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1;
}

.cm-chip-option input:checked + span {
    color: #08224a;
    background: #eaf2ff;
    border-color: #8bbcff;
    box-shadow: 0 0 0 1px rgba(47, 130, 255, 0.18);
}

.cm-chip-option input:focus-visible + span {
    outline: 2px solid rgba(47, 130, 255, 0.75);
    outline-offset: 2px;
}

body.public-mode.color-mode-light .cm-chip-select,
.dashboard-shell.dashboard-light .cm-chip-select {
    background: #f3f6fb;
    border-color: rgba(17, 24, 39, 0.12);
}

body.public-mode.color-mode-light .cm-chip-option span,
.dashboard-shell.dashboard-light .cm-chip-option span {
    color: #243044;
    background: #ffffff;
    border-color: rgba(17, 24, 39, 0.12);
}

body.public-mode.color-mode-light .cm-chip-option input:checked + span,
.dashboard-shell.dashboard-light .cm-chip-option input:checked + span {
    color: #0c3d7c;
    background: #dcecff;
    border-color: #7bb6ff;
}
