/* Wedding Admin - минимальные стили (без фреймворков) */

:root {
    --bg: #0b0e14;
    --card: #121826;
    --card2: #0f1420;
    --text: #e6eaf2;
    --muted: #aab3c5;
    --border: rgba(255,255,255,.10);
    --primary: #4b7bec;
    --danger: #ff5d5d;
    --ok: #2ecc71;
    --radius: 14px;
}

* { box-sizing: border-box; }

/* Атрибут hidden: сильнее чем display у .btn / прочих компонентов — иначе «скрытые» кнопки остаются на экране */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: inherit; }

code {
    background: rgba(255,255,255,.08);
    padding: 2px 6px;
    border-radius: 6px;
}

/* ── Sidebar layout ───────────────────────────────────────── */

body.has-sidebar {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    --sidebar-collapsed: 56px;
    --sidebar-expanded: 230px;
    width: var(--sidebar-collapsed);
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.22s ease;
    z-index: 20;
}

.sidebar:hover {
    width: var(--sidebar-expanded);
}

@media (min-width: 1200px) {
    .sidebar {
        width: var(--sidebar-expanded);
    }

    .sidebar:hover {
        width: var(--sidebar-expanded);
    }

}

.sidebar__brand {
    display: block;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    flex-shrink: 0;
    overflow: hidden;
    line-height: 0;
}

.sidebar__logo-img {
    display: block;
    height: 32px;
    width: auto;
    max-width: none;
    object-fit: cover;
    object-position: left center;
    filter: brightness(1.1);
}

.sidebar__nav {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    flex: 1;
    overflow: hidden;
}

.sidebar__item {
    display: block;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 17px;
    text-decoration: none;
    color: var(--muted);
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.sidebar__link:hover {
    background: rgba(255, 255, 255, .07);
    color: var(--text);
}

.sidebar__link.is-active {
    background: rgba(75, 123, 236, .13);
    color: var(--primary);
}

.sidebar__icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar__icon svg {
    width: 18px;
    height: 18px;
}

.sidebar__text {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.sidebar__badge {
    flex-shrink: 0;
    min-width: 1.25rem;
    padding: 0 0.35rem;
    height: 1.25rem;
    line-height: 1.25rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    background: #c62828;
    color: #fff;
}

.sidebar__link.is-active .sidebar__badge {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary, #4b7bec);
}

.sidebar__logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 17px;
    text-decoration: none;
    color: var(--danger);
    white-space: nowrap;
    border-top: 1px solid var(--border);
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.sidebar__logout:hover {
    background: rgba(255, 93, 93, .10);
    color: #ff7a7a;
}

.sidebar-page {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.has-sidebar main.container {
    flex: 1;
    min-height: 0;
    width: 100%;
}

body.is-embed .sidebar {
    display: none !important;
}

.admin-nav-loading {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 10, 18, 0.72);
    backdrop-filter: blur(4px);
}

.admin-nav-loading[hidden] {
    display: none !important;
}

.admin-nav-loading__box {
    text-align: center;
    padding: 24px 32px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.admin-nav-loading__spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--primary, #4b7bec);
    animation: admin-nav-spin 0.75s linear infinite;
}

.admin-nav-loading__text {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
}

@keyframes admin-nav-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Topbar ───────────────────────────────────────────────── */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,.25);
    position: sticky;
    top: 0;
    backdrop-filter: blur(8px);
    z-index: 10;
}

body.has-sidebar .topbar {
    justify-content: flex-end;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.topbar__left { display: flex; flex-direction: column; }
.topbar__right { display: flex; align-items: center; gap: 12px; }

.userbox { display: flex; align-items: baseline; gap: 8px; }
.userbox__label { font-size: 12px; color: var(--muted); }
.userbox__email { font-weight: 700; }

.brand__logo {
    height: 28px;
    width: auto;
}

.brand__text {
    font-weight: 800;
    letter-spacing: .3px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    grid-template-areas:
        "user meta"
        "comments meta";
    gap: 16px;
    margin-top: 16px;
    align-items: start;
}

@media (max-width: 980px) {
    .grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "user"
            "meta"
            "comments";
    }
}

.card {
    background: linear-gradient(180deg, var(--card), var(--card2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.card--sub {
    background: rgba(255,255,255,.02);
    border-style: dashed;
    margin-top: 12px;
}

.card--narrow { max-width: 520px; margin: 40px auto; }

.card#userCard { grid-area: user; align-self: start; }
.card#metaCard { grid-area: meta; }
.card#commentsCard { grid-area: comments; align-self: start; }

.card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.card__header--user { align-items: center; margin-bottom: 6px; padding-bottom: 0; }
.user-header__left { display: inline-flex; gap: 8px; align-items: center; }
.user-header__title { margin: 0; font-size: 18px; }
.user-header__icon { width: 24px; height: 32px; display: flex; align-items: center; }
.who-icon--header { width: 20px; height: 28px; }

.user-card__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-summary {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 12px;
    background: rgba(255,255,255,.03);
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}
.user-summary__who {
    color: var(--muted);
    font-size: 13px;
}
.who-icon {
    width: 18px;
    height: 26px;
    vertical-align: middle;
}
.user-summary__row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
}
.user-summary__row--meta {
    color: var(--muted);
    font-size: 12px;
}
.user-summary__label {
    color: var(--muted);
    font-size: 12px;
}
.user-summary__status {
    font-weight: 700;
}
.user-summary__status--blocked {
    color: #ff7b7b;
}

.user-card-preview {
    margin-bottom: 12px;
}

.user-card-preview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.user-card-preview__modes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.user-card-preview__modes .btn.is-active {
    background: rgba(75,123,236,.2);
    border-color: rgba(75,123,236,.45);
}

.user-card-preview__iframe-scaler {
    width: 180px;
    height: 252px;
    overflow: hidden;
    border-radius: 8px;
    background: #0f172a;
    border: 1px solid var(--border);
}

.user-card-preview__iframe-scaler iframe {
    width: 360px;
    height: 504px;
    border: 0;
    display: block;
    transform: scale(0.5);
    transform-origin: 0 0;
    background: #fff;
}

.is-hidden-force {
    display: none !important;
}

h1, h2 { margin: 0 0 12px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

.alert {
    border-radius: 12px;
    padding: 10px 12px;
    margin: 10px 0 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.06);
}

.alert--error {
    border-color: rgba(255,93,93,.35);
    background: rgba(255,93,93,.08);
}

.alert--success {
    border-color: rgba(46,204,113,.35);
    background: rgba(46,204,113,.08);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.06);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    font-weight: 650;
}

.btn:hover { background: rgba(255,255,255,.09); }
.btn:active { transform: translateY(1px); }

.btn--primary {
    background: rgba(75,123,236,.18);
    border-color: rgba(75,123,236,.45);
}

.btn--ghost {
    background: transparent;
}

.btn--danger {
    background: rgba(231,76,60,.12);
    border-color: rgba(231,76,60,.4);
    color: #ffb3a9;
}

.btn--green {
    background: rgba(46, 197, 134, .25);
    border-color: rgba(46, 197, 134, .65);
    color: #b5f5d5;
}

.btn--green:hover {
    background: rgba(46, 197, 134, .35);
}

.btn--restore {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.btn--restore:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.btn--credit {
    background: rgba(255,255,255,.05);
    border-color: var(--border);
    color: var(--text);
}
.btn--credit.is-active {
    background: rgba(46,204,113,.42) !important;
    border-color: rgba(46,204,113,.85) !important;
    color: #e7fff0 !important;
}
.btn--debit {
    background: rgba(255,255,255,.05);
    border-color: var(--border);
    color: var(--text);
}
.btn--debit.is-active, .btn--danger.is-active {
    background: rgba(231,76,60,.45) !important;
    border-color: rgba(231,76,60,.85) !important;
    color: #ffe6e2 !important;
}

.btn--sm {
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.btn--icon {
    width: 32px;
    height: 32px;
    padding: 0;
}

.btn.is-active {
    background: rgba(75,123,236,.25);
    border-color: rgba(75,123,236,.5);
}

.toggle-row {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 680px) {
    .form--grid { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; color: var(--muted); }

.input, .select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,.25);
    color: var(--text);
    padding: 10px 12px;
    outline: none;
    appearance: none;
}

select.input, select.select {
    background: #1e293b;
    color: var(--text);
    color-scheme: dark;
}

select.input option, select.select option {
    background: #1e293b;
    color: var(--text);
}

.input:focus, .select:focus {
    border-color: rgba(75,123,236,.55);
    box-shadow: 0 0 0 3px rgba(75,123,236,.15);
}

.input:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.select--dark {
    background: #0b0e14;
    color: #fff;
}

.select--dark option {
    background: #111827;
    color: #fff;
}

.actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.checkbox-inline {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.checkbox-inline--small {
    align-items: flex-start;
    gap: 6px;
}

.searchbar {
    display: grid;
    grid-template-columns: 180px 1fr 120px;
    gap: 10px;
    align-items: center;
}

@media (max-width: 680px) {
    .searchbar {
        grid-template-columns: 1fr;
    }
}

.results {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    cursor: pointer;
}

.result:hover { background: rgba(255,255,255,.06); }

.result__top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.badge { display:inline-flex; align-items:center; justify-content:center; min-width:18px; padding:0 8px; border-radius:999px; background: rgba(255,140,73,.18); color: #ff7f30; font-size: 12px; font-weight: 700; border:1px solid rgba(255,140,73,.35); }

.badge--role { border-color: rgba(75,123,236,.4); color: rgba(75,123,236,1); }
.badge--domain { border-color: rgba(255,255,255,.25); }

.quicklinks {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.quicklinks .btn {
    padding: 8px 10px;
    font-size: 12px;
}

.sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

.meta { display: grid; gap: 10px; }
.meta__row { display: grid; grid-template-columns: 220px 1fr; gap: 12px; }
.meta__label { color: var(--muted); font-size: 12px; }
.meta__label--with-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.meta__info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
    user-select: none;
}
.meta__value { font-weight: 650; }
.meta__limit { display: inline-flex; gap: 6px; align-items: center; }

.input-with-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.expiry__value {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    min-width: 140px;
}

.orders__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.orders__filters {
    display: inline-flex;
    gap: 6px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 780px;
    overflow: auto;
}
.history-row {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,.03);
    font-size: 13px;
}
.history-row__meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
}
.history-row__type {
    margin: 4px 0;
}
.history-row__msg {
    font-size: 13px;
    line-height: 1.4;
    display: inline;
}

.balance-current-row, .balance-future-row {
    font-size: 12px;
    color: var(--muted);
}

.order-links__list {
    margin: 8px 0;
    padding-left: 16px;
    display: grid;
    gap: 4px;
}

.order-links__rows {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-links__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.03);
}

.order-links__name {
    flex: 1 1 0;
    min-width: 0;
    font-size: 14px;
    overflow-wrap: break-word;
}

.order-links__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.order-links__btn {
    white-space: nowrap;
    font-size: 13px;
}

.order-links__zip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 650;
    box-sizing: border-box;
}
.history-row__reason {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

@media (max-width: 680px) {
    .meta__row { grid-template-columns: 1fr; }
}

.tablewrap { overflow: auto; border-radius: 12px; border: 1px solid var(--border); }
.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}
.table th, .table td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.table th {
    text-align: left;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.th-log { display: none; }
.table th:last-child, .table td:last-child {
    width: 70px;
    text-align: right;
}
.tab-hidden { display: none !important; }
.table tr:hover td { background: rgba(255,255,255,.03); }

/* Выделение / hover кликабельных строк таблицы (тёмная тема) */
.table tbody tr.is-expanded td,
.table tbody tr.is-selected td,
.rev-table tbody tr.is-expanded td,
.rev-table tbody tr.is-selected td {
    background: rgba(75, 123, 236, 0.32);
    color: #fff;
    font-weight: 600;
}
.table tbody tr.is-expanded:hover td,
.table tbody tr.is-selected:hover td,
.rev-table tbody tr.is-expanded:hover td,
.rev-table tbody tr.is-selected:hover td {
    background: rgba(75, 123, 236, 0.4);
}
.table tbody tr.rev-row-group:hover td,
.rev-table tbody tr.rev-row-group:hover td,
.table tbody tr[data-group]:hover td,
.table tbody tr[data-selectable]:hover td {
    background: rgba(75, 123, 236, 0.18);
}
.table tbody tr.rev-row-group:focus-visible td,
.rev-table tbody tr.rev-row-group:focus-visible td {
    background: rgba(75, 123, 236, 0.24);
    outline: none;
}

.resetbox {
    margin-top: 14px;
    padding: 12px;
    border: 1px dashed rgba(255,255,255,.25);
    border-radius: 14px;
    background: rgba(0,0,0,.18);
}

.resetbox__title { font-weight: 800; margin-bottom: 10px; }
.resetbox__row { display: grid; grid-template-columns: 1fr 140px; gap: 10px; }

@media (max-width: 680px) {
    .resetbox__row { grid-template-columns: 1fr; }
}

.logs-admin-picker {
    margin-bottom: 12px;
}
.logs-admin-picker__label {
    display: block;
    margin-bottom: 4px;
}
.logs-admin-picker .input {
    max-width: 28rem;
}

.logs-search-bar {
    margin-bottom: 14px;
}
.logs-search-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.logs-search-input {
    flex: 1 1 260px;
    min-width: 180px;
}
.logs-search-date {
    flex: 0 0 auto;
    width: 10rem;
}

/* --- Date Picker --- */
.datepicker-wrap {
    position: relative;
    flex: 0 0 auto;
}
.datepicker-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: 10rem;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: var(--text);
    justify-content: flex-start;
}
.datepicker-trigger.is-active {
    background: rgba(75,123,236,.18);
    border-color: rgba(75,123,236,.45);
    color: #a8c4ff;
}
.datepicker-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    background: var(--card-bg, #1a1f2e);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    width: 232px;
    box-shadow: 0 8px 32px rgba(0,0,0,.45);
}
.datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.datepicker-month-label {
    font-size: 13px;
    font-weight: 650;
    color: var(--text);
}
.datepicker-nav {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
}
.datepicker-nav:hover { color: var(--text); background: rgba(255,255,255,.07); }
.datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}
.datepicker-weekdays span {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    padding: 2px 0;
}
.datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.dp-day {
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    padding: 5px 2px;
    text-align: center;
    transition: background .12s;
}
.dp-day:hover { background: rgba(255,255,255,.08); }
.dp-day--today {
    color: #7aaeff;
    font-weight: 650;
}
.dp-day--selected {
    background: rgba(75,123,236,.35) !important;
    color: #c2d8ff !important;
    border: 1px solid rgba(75,123,236,.6);
}
.datepicker-clear {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    padding: 6px;
    cursor: pointer;
    text-align: center;
}
.datepicker-clear:hover { color: var(--text); background: rgba(255,255,255,.05); }
.logs-search-type {
    flex: 0 1 180px;
    min-width: 130px;
}

.log-table {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0,0,0,.2);
    padding: 8px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
}

.log-date {
    text-align: center;
    font-weight: 800;
    margin: 10px 0 6px;
}

.log-row {
    padding: 6px 12px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    display: grid;
    grid-template-columns: auto auto auto 1fr;
    gap: 10px;
    align-items: center;
}

.log-row:last-child { border-bottom: none; }

.client-chats-log__row {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.client-chats-log__row:last-child {
    border-bottom: none;
}

.client-chats-log__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: baseline;
    margin-bottom: 6px;
}

.client-chats-log__name {
    color: var(--text);
    font-weight: 600;
    flex: 1 1 200px;
    min-width: 0;
    word-break: break-word;
}

.client-chats-log .log-date:first-child {
    margin-top: 4px;
}

.client-chats-log__date {
    margin-top: 14px;
}

.client-chats-log__details {
    margin: 0;
}

.client-chats-log__summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
    user-select: none;
}

.client-chats-log__summary:hover {
    color: var(--text);
}

.client-chats-log__preview {
    margin: 8px 0 0;
    padding: 10px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 280px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.45;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.log-device {
    border: none;
    background: rgba(255,255,255,.05);
    border-radius: 10px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text);
}

.log-time {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    color: var(--muted);
}

.log-message {
    white-space: normal;
    word-break: break-word;
    display: grid;
    gap: 4px;
}

.type-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,.12);
}

.type-login { background: rgba(46, 204, 113, .4); }
.type-search { background: rgba(75,123,236,.4); }
.type-update_user { background: rgba(255, 149, 0, .4); }
.type-update_user_fail { background: rgba(255,93,93,.5); }
.type-update_expiry { background: rgba(155, 89, 182, .45); }
.type-add_balance { background: rgba(46, 204, 113, .45); }
.type-add_comment { background: rgba(52, 152, 219, .45); }
.type-delete_order { background: rgba(231, 76, 60, .5); }

.log-extra { font-size: 12px; color: var(--muted); }
.log-diff { font-size: 12px; }
.diff-field { font-weight: 700; margin-right: 4px; }
.diff-old { color: #ff7b7b; margin-right: 6px; }
.diff-new { color: #7be07b; }
.delta-pos { color: #7be07b; font-weight: 700; }
.delta-neg { color: #ff7b7b; font-weight: 700; }
.log-reason { color: var(--muted); margin-top: 4px; }

.comments-list { display: flex; flex-direction: column; gap: 10px; }
.comment-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: rgba(255,255,255,.03); }
.comment-row__meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.comment-row__meta-text { display: inline-flex; gap: 6px; align-items: center; }
.comment-row__status { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 700; border: 1px solid var(--border); background: rgba(255,255,255,.08); color: #fff; }
.comment-row--done { background: #0b0e14; border-color: #2e7d4f; }
.comment-row--done .comment-row__meta { color: #00ff7a; }
.comment-row__status--done { background: #2e7d4f; border-color: #1b5e20; color: #fff; }
.comment-row--done .comment-row__alarm { background: rgba(0,255,122,.14) !important; color: #00ff7a !important; }
.comment-row--done .comment-row__text { color: #d7f2e4; }
.comment-row--done .comment-row__meta-text,
.comment-row--done .muted,
.comment-row--done .muted.small { color: #00ff7a !important; }
.comment-row__top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.comment-row__left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.comment-row__right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.comment-row__alarm { padding: 2px 6px; border-radius: 8px; background: rgba(52,152,219,.15); color: #bfe4ff; }
.comment-row__alarm.alarm--future,
.comment-row__alarm.future { background: rgba(52,152,219,.25) !important; color: #d6ecff !important; }
.comment-row__alarm.alarm--soon,
.comment-row__alarm.alarm--tomorrow,
.comment-row__alarm.soon,
.comment-row__alarm.tomorrow { background: rgba(241,196,15,.25) !important; color: #fff3c4 !important; }
.comment-row__alarm.alarm--today,
.comment-row__alarm.alarm--overdue,
.comment-row__alarm.today,
.comment-row__alarm.overdue { background: rgba(231,76,60,.28) !important; color: #ffd6d1 !important; }
.comment-row__alarm.alarm--done { background: rgba(0,255,122,.14) !important; color: #00ff7a !important; }
.comment-done-highlight { color: #00ff7a !important; font-weight: 600; }

.notification-card {
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.notification-card__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.notification-card__title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}
.notification-card__icon { font-size: 16px; }
.notification-card__time { font-size: 12px; color: var(--muted); }
.notification-card__meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
}
.notification-card__badge {
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(52,152,219,.2);
    color: #d6ecff;
}
.notification-card__link { color: var(--muted); }
.notification-card__text { font-size: 14px; line-height: 1.45; }
.notification-card__actions { display: flex; justify-content: flex-end; }
.notification-card.alarm-overdue .notification-card__badge,
.notification-card.alarm-today .notification-card__badge { background: rgba(231,76,60,.25); color: #ffd6d1; }
.notification-card.alarm-tomorrow .notification-card__badge,
.notification-card.alarm-soon .notification-card__badge { background: rgba(241,196,15,.25); color: #fff3c4; }
.comment-row__text { margin-top: 6px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.4; }

.toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
.toolbar__bell {
    position: relative;
}
.alarm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.alarm-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 70vh;
    overflow-y: auto;
}

.backups-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.backups-modal__title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.backups-modal__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.backups-modal__title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(75, 123, 236, .15);
    color: #7ba7ff;
    flex-shrink: 0;
}

.backups-modal__subtitle {
    font-size: 12px;
    padding-left: 46px;
}

.backups-modal__header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.backups-modal__open-site {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.backups-modal__body {
    display: grid !important;
    grid-template-columns: minmax(300px, 420px) minmax(280px, 1fr);
    flex: 1;
    min-height: 520px;
    overflow: hidden;
}

.backups-modal__left {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
    min-width: 0;
    background: rgba(0, 0, 0, .12);
}

.backups-modal__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 14px 10px;
    flex-shrink: 0;
}

.backups-filter-pill {
    appearance: none;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.backups-filter-pill:hover {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
}

.backups-filter-pill.is-active {
    background: rgba(37, 99, 235, .22);
    border-color: rgba(37, 99, 235, .55);
    color: #dbeafe;
}

.backups-modal__found,
#backupsFoundCount {
    padding: 0 16px 8px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--muted);
}

.backups-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 12px 8px;
    min-height: 0;
}

.backups-modal__status {
    padding: 4px 16px 8px;
    flex-shrink: 0;
}

.backups-modal__right {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, .02);
}

.backups-preview-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 14px 16px 16px;
    gap: 12px;
}

.backups-preview-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.backups-preview-empty__phone {
    width: min(100%, 300px);
    aspect-ratio: 9 / 16;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    border-radius: 22px;
    border: 6px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .03);
    box-shadow: inset 0 0 0 1px var(--border);
}

/* ── backup rows ──────────────────────────────────── */
.backup-row {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 12px 10px;
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.backup-row:hover {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .14);
}

.backup-row--active {
    background: rgba(37, 99, 235, .08);
    border-color: rgba(37, 99, 235, .55);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, .25);
}

.backup-row__main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.backup-row__radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .18);
    flex-shrink: 0;
    margin-top: 2px;
    transition: border-color .15s, background .15s;
    box-sizing: border-box;
}

.backup-row__radio--checked {
    border-color: #2563eb;
    background: #2563eb;
    box-shadow: inset 0 0 0 4px var(--card);
}

.backup-row__info {
    flex: 1;
    min-width: 0;
}

.backup-row__top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-bottom: 6px;
}

.backup-row__id {
    font-weight: 650;
    font-size: 14px;
}

.backup-row__date {
    font-size: 12px;
    color: var(--muted);
}

.backup-row__bottom {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 12px;
    color: var(--muted);
}

.backup-row__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.backup-row__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.backup-row__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.backup-row__btn--restore {
    margin-left: auto;
}

.backup-icon {
    flex-shrink: 0;
    display: block;
}

.backup-icon--muted {
    opacity: .75;
}

/* ── reason badges ────────────────────────────────── */
.backup-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.backup-badge--blue { background: rgba(75, 123, 236, .2); color: #7ba7ff; }
.backup-badge--green { background: rgba(46, 197, 134, .2); color: #2ec586; }
.backup-badge--gray { background: rgba(255, 255, 255, .1); color: #aaa; }
.backup-badge--amber { background: rgba(255, 171, 0, .18); color: #ffab00; }
.backup-badge--purple { background: rgba(168, 85, 247, .18); color: #c084fc; }
.backup-badge--teal { background: rgba(20, 184, 166, .2); color: #5eead4; }

/* ── right panel preview ──────────────────────────── */
.backups-preview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    flex-shrink: 0;
}

.backups-preview-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.backups-preview-tabs.is-disabled {
    opacity: .45;
    pointer-events: none;
}

.backups-preview-tabs__btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -11px;
    transition: color .15s, border-color .15s;
}

.backups-preview-tabs__btn:hover {
    color: var(--text);
}

.backups-preview-tabs__btn.is-active {
    color: #93c5fd;
    border-bottom-color: #2563eb;
}

.backups-preview__open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    text-decoration: none;
    transition: background .15s;
}

.backups-preview__open:hover {
    background: rgba(255, 255, 255, .08);
}

.backups-preview__canvas {
    flex: 1;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.backups-preview__scaler {
    width: min(100%, 300px);
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 22px;
    border: 6px solid rgba(255, 255, 255, .12);
    box-shadow: 0 0 0 1px var(--border), 0 16px 48px rgba(0, 0, 0, .4);
    position: relative;
    background: #fff;
    flex-shrink: 0;
}

.backups-preview__scaler iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    border: 0;
    transform: scale(.5);
    transform-origin: 0 0;
}

/* ── restore info ─────────────────────────────────── */
.backups-restore-info {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .03);
    flex-shrink: 0;
}

.backups-restore-info__grid {
    display: grid;
    grid-template-columns: 1fr minmax(140px, 220px);
    gap: 16px;
    align-items: start;
}

.backups-modal__disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 12px 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 171, 0, .22);
    border-radius: 12px;
    background: rgba(255, 171, 0, .06);
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
    flex-shrink: 0;
}

.backups-modal__disclaimer-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.backups-restore-info__title {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.backups-restore-info__items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.backups-restore-info__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
}

.backups-restore-info__item strong {
    display: block;
    margin-bottom: 2px;
}

.backups-restore-info__check {
    color: #2ec586;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    flex-shrink: 0;
}

.backups-restore-info__note {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    line-height: 1.45;
}

@media (max-width: 860px) {
    .backups-modal__body {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .backups-modal__left {
        border-right: 0;
        border-bottom: 1px solid var(--border);
        max-height: 45vh;
    }

    .backups-restore-info__grid {
        grid-template-columns: 1fr;
    }
}

/* keep legacy selector open — was closed further down */
.backup-row__actions--restore {
    display: none;
}

.pager {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pager__item {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,.05);
    text-decoration: none;
    color: var(--text);
}

.pager__item--disabled {
    opacity: .4;
    cursor: not-allowed;
}

.pager__item--active {
    background: rgba(75,123,236,.18);
    border-color: rgba(75,123,236,.45);
}

.pager__item--nav {
    min-width: 2.25rem;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.2;
}

/* Оверлей: прокрутка внутри модалки, если контент выше экрана (не страница под ней) */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 100;
    padding: 24px 16px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal__content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 15px 40px rgba(0,0,0,.35);
    flex-shrink: 0;
}

.modal__content--wide {
    max-width: 720px;
    width: 96vw;
}

.modal__content--backups {
    max-width: min(960px, 96vw) !important;
    width: 96vw !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    min-height: min(640px, calc(100vh - 48px));
    min-width: 0;
    overflow: hidden;
}

/* Модалки чатов (карточка пользователя): как на client_chats.php */
.modal__content--chats {
    max-width: min(560px, 96vw);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    min-height: 0;
}

.cc-modal-chats__hint {
    margin: 0 0 10px;
}

.cc-modal-chats__list-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(58vh, 520px);
    padding: 12px 14px 14px;
    margin-top: 2px;
}

.cc-list--modal {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-top: 8px;
    padding-right: 4px;
}

.cc-modal-chats__status {
    margin-top: 10px;
}

.cc-modal-chats__empty {
    margin: 8px 4px;
}

/* Модалка «Интересовался» (pay_pending) */
.modal__content--pay-pending {
    max-width: min(920px, 96vw);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    min-height: 0;
}


.pp-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

/* Прокрутка снаружи: линия таймлайна (::before) на .pp-list тянется на всю высоту контента, а не на высоту viewport скролла */
.pp-list-scroll {
    display: block;
}

.pp-list {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 6px;
}

/* Единая непрерывная вертикальная линия через весь список */
.pp-list::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
    z-index: 0;
}

/* «Интересовался»: таймлайн по страницам (путь — пилюля-ссылка, линия между точками) */
.pp-journey-group {
    position: relative;
}

.pp-journey-node {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.pp-journey-node--page {
    align-items: center;
    margin-top: 10px;
}

.pp-journey-group:first-child .pp-journey-node--page {
    margin-top: 0;
}

.pp-journey-node--page .cc-date-sep {
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
    margin: 0 0 6px;
}

.pp-journey-node--event {
    margin-bottom: 2px;
}

.pp-journey-node--event .pp-item {
    flex: 1;
    min-width: 0;
}

.pp-journey-dot--page {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--muted);
    background: var(--card);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.pp-journey-dot--event {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    margin-top: 6px;
    margin-left: 4px;
    position: relative;
    z-index: 1;
}

.pp-journey-dot--purchase {
    background: rgb(52, 199, 89) !important;
    width: 10px !important;
    height: 10px !important;
    margin-left: 3px !important;
}

.pp-journey-dot--topup {
    background: rgb(255, 179, 0) !important;
    width: 10px !important;
    height: 10px !important;
    margin-left: 3px !important;
}


.pp-journey-node--hour {
    display: flex;
    align-items: center;
    margin: 6px 0 4px;
    position: relative;
    z-index: 2;
}

.pp-journey-hour-label {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.03em;
    background: var(--text, #e8e8e8);
    color: var(--card, #1a1a1a);
    border-radius: 20px;
    padding: 2px 10px;
    line-height: 1.6;
    margin-left: 20px;
}

.pp-journey-node--now {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    z-index: 2;
}

.pp-journey-dot--now {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0a84ff;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    animation: pp-now-pulse 2s ease-in-out infinite;
}

.pp-journey-now-label {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #0a84ff;
}

@keyframes pp-now-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0.5); }
    50% { box-shadow: 0 0 0 5px rgba(10, 132, 255, 0); }
}

.pp-journey-link {
    text-decoration: none;
    color: inherit;
    word-break: break-all;
    text-align: left;
    max-width: 100%;
}

.pp-journey-link:hover {
    opacity: 0.85;
    text-decoration: underline;
}

.pp-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 12px;
    line-height: 1.4;
    padding: 2px 0;
    min-width: 0;
}

.pp-item--activated .pp-item__title {
    color: rgb(52, 199, 89);
}

.pp-item--purchase .pp-item__title {
    color: rgb(52, 199, 89);
    font-weight: 700;
}

.pp-item--topup .pp-item__title {
    color: rgb(255, 179, 0);
    font-weight: 700;
}


.pp-item__title {
    font-weight: 600;
    white-space: nowrap;
}

.pp-item__details {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.pp-item__badge {
    color: rgb(52, 199, 89);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.pp-item__date {
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
    padding-left: 8px;
}

.pp-orders-wrap {
    overflow-x: auto;
    margin-top: 4px;
}

.pp-orders-wrap .pay-table {
    width: 100%;
    font-size: 12px;
}

.pp-designs-wrap {
    overflow-x: hidden;
    overflow-y: hidden;
    margin-top: 4px;
    max-height: min(70vh, 560px);
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.pp-designs-split {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}

.pp-designs-split__col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.pp-designs-split__col--timeline {
    flex: 0 0 38%;
    max-width: 42%;
}

.pp-designs-split__col--favorites {
    flex: 1 1 58%;
    min-width: 0;
}

@media (max-width: 640px) {
    .pp-designs-split {
        flex-direction: column;
    }

    .pp-designs-split__col--timeline {
        flex: 0 0 auto;
        max-width: none;
        max-height: min(38vh, 280px);
    }

    .pp-designs-split__col--favorites {
        flex: 1 1 auto;
        min-height: min(32vh, 240px);
    }
}

.pp-designs-split__heading {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
    margin: 0 0 4px 2px;
    flex-shrink: 0;
}

.pp-designs-timeline-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 4px;
    padding-right: 4px;
}

.pp-designs-favorites-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 4px;
}

.pp-designs-timeline {
    position: relative;
    padding: 4px 0 8px 18px;
}

.pp-designs-timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 1px;
}

.pp-designs-tl-row {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 6px 0 10px 0;
}

.pp-designs-tl-row::before {
    content: "";
    position: absolute;
    left: -15px;
    top: 16px;
    width: 8px;
    height: 8px;
    margin-left: 1px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: 2px solid rgba(20, 20, 22, 0.95);
    box-sizing: border-box;
    z-index: 1;
}

.pp-designs-tl-row--current::before {
    background: rgb(52, 199, 89);
    border-color: rgba(20, 20, 22, 0.95);
}

.pp-designs-tl-thumb {
    display: block;
    width: 44px;
    height: 58px;
    object-fit: cover;
    border-radius: 6px;
    cursor: zoom-in;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.pp-designs-tl-body {
    flex: 1 1 auto;
    min-width: 0;
}

.pp-designs-tl-line1 {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    line-height: 1.25;
}

.pp-designs-tl-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.pp-designs-tl-time {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.pp-designs-tl-meta {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.5);
}

.pp-designs-tl-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(52, 199, 89, 0.9);
    color: #0b0b0b;
}

.pp-designs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 8px;
}

.pp-design-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pp-design-card--purchased {
    border-color: rgb(52, 199, 89);
    box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.35);
}

.pp-design-card--selected {
    border-color: rgba(255, 255, 255, 0.22);
}

.pp-design-card__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(52, 199, 89, 0.95);
    color: #0b0b0b;
    pointer-events: none;
}

.pp-design-card__badge--selected {
    left: 4px;
    right: auto;
    background: rgba(180, 180, 190, 0.92);
    color: #1a1a1a;
}

.pp-design-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    cursor: zoom-in;
}

.pp-design-thumb:hover {
    opacity: 0.88;
}

.pp-design-meta {
    padding: 6px 4px 8px;
}

.pp-design-name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pp-design-date,
.pp-design-duration {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.2;
}

.pp-img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 48px 16px 16px;
}

.pp-img-lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.pp-img-lightbox__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    font-size: 1.25rem;
    line-height: 1;
    min-width: 36px;
    min-height: 36px;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

.pp-img-lightbox__img {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.modal__content--chat-read {
    max-width: min(1200px, 96vw);
    width: 100%;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    min-height: 0;
}

.cc-modal-read {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
}

.cc-modal-read__chat {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cc-modal-read__analysis {
    flex: 0 0 340px;
    max-width: 380px;
    min-width: 260px;
    box-sizing: border-box;
    border-left: 1px solid var(--border);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cc-modal-read__analysis [id^="cc-ai-anchor-"] {
    scroll-margin-top: 52px;
}

.cc-modal-read__analysis-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

dialog.cp-user-dialog {
    padding: 0;
    border: 1px solid var(--border, rgba(255,255,255,.08));
    border-radius: var(--radius, 12px);
    max-width: 96vw;
    background: var(--card, #151a24);
    color: var(--text);
    box-shadow: 0 24px 80px rgba(0,0,0,.55);
}
dialog.cp-user-dialog::backdrop {
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
}
.cp-user-dialog__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
    background: rgba(0,0,0,.2);
}
.cp-user-dialog__head strong {
    font-size: 0.9rem;
}
.cp-user-dialog__frame-wrap {
    width: min(96vw, 1100px);
    height: min(88vh, 900px);
    margin: 0;
    padding: 0;
}
.cp-user-dialog__frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #0b0e14;
}

.cc-modal-read .cc-chat-head {
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.cc-modal-read__head-actions {
    margin-left: auto;
    flex-shrink: 0;
}

.cc-modal-read__close {
    flex-shrink: 0;
}

.cc-messages--modal {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

@media (max-width: 700px) {
    .cc-main.cc-modal-read {
        flex-direction: column;
    }

    .cc-modal-read__analysis {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

.cc-modal-read__load,
.cc-modal-read__error {
    padding: 16px 18px;
}

.modal__actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* Широкая модалка: корень `.modal.print-modal-wide` (расчёт печати, редактор maket_lang и т.д.) */
.print-modal-wide .modal__content {
    max-width: 920px;
    width: 96vw;
}

.modal[hidden] { display: none !important; }

@supports selector(body:has(.modal)) {
    body:has(.modal:not([hidden])) {
        overflow: hidden;
    }
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* --- maket_lang editor (lang_maket.php) --- */
.maket-lang-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.maket-lang-status--ok {
    color: var(--ok);
}

.maket-lang-status--err {
    color: var(--danger);
}

.maket-lang-table-wrap {
    overflow-x: auto;
    margin-top: 8px;
}

.maket-lang-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.maket-lang-table th,
.maket-lang-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
}

.maket-lang-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-weight: 600;
}

.maket-lang-meta-cell {
    white-space: nowrap;
}

.maket-lang-meta-cell .js-meta-val {
    margin-right: 6px;
}

.maket-lang-meta-cell .input--sm {
    padding: 2px 6px;
    font-size: 13px;
    height: auto;
    min-width: 70px;
    max-width: 200px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    margin: 0;
    color: inherit;
    opacity: 0.45;
    font-size: 14px;
    line-height: 1;
    vertical-align: middle;
}

.btn-icon:hover {
    opacity: 1;
}

.maket-lang-table tr.is-editing .js-meta-val {
    display: none;
}

.maket-lang-editor-head {
    display: grid;
    grid-template-columns: minmax(100px, 0.9fr) minmax(120px, 1.1fr) minmax(140px, 1.4fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.maket-lang-col-h--actions {
    width: 140px;
}

.maket-lang-editor-rows {
    max-height: min(70vh, 720px);
    overflow-y: auto;
    margin-top: 4px;
}

.maket-lang-editor-row {
    display: grid;
    grid-template-columns: minmax(100px, 0.9fr) minmax(120px, 1.1fr) minmax(140px, 1.4fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.maket-lang-col-code {
    font-size: 12px;
    word-break: break-all;
    align-self: center;
}

.maket-lang-ru {
    font-size: 13px;
    line-height: 1.35;
    color: var(--muted);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 140px;
    overflow-y: auto;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.maket-lang-target .input {
    width: 100%;
    min-height: 38px;
}

.maket-lang-target textarea.input {
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
}

.maket-lang-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    justify-content: flex-start;
}

@media (max-width: 900px) {
    .maket-lang-editor-head,
    .maket-lang-editor-row {
        grid-template-columns: 1fr;
    }
    .maket-lang-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* --- client_chats.php: двухпанельный чат --- */
.client-chats-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.has-sidebar.client-chats-page {
    flex-direction: row;
}

.client-chats-page .topbar {
    flex-shrink: 0;
}

.client-chats-page .cc-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0 auto;
    padding: 12px 14px 16px;
    box-sizing: border-box;
}

.client-chats-page .cc-layout {
    flex: 1;
    display: flex;
    gap: 14px;
    align-items: stretch;
    min-height: 0;
    min-height: calc(100vh - 88px);
}

.client-chats-page .cc-center {
    flex: 1;
    display: flex;
    gap: 14px;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
}

.cc-sidebar.cc-sidebar--card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 0 1 380px;
    max-width: 440px;
    padding: 12px 14px 14px;
    min-height: 0;
}

.cc-sidebar__head {
    flex-shrink: 0;
}

.cc-sidebar__title {
    font-size: 1.1rem;
    margin: 0 0 4px;
    font-weight: 800;
}

.cc-sidebar__meta {
    margin: 0;
}

.cc-search {
    width: 100%;
    margin-top: 10px;
}

.cc-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
    min-height: 0;
    padding-right: 4px;
}

.cc-sidebar__pager {
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.cc-day {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 12px 0 8px;
    padding-left: 4px;
}

.cc-day:first-child {
    margin-top: 2px;
}

.cc-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    text-align: left;
    margin: 0 0 6px;
    padding: 10px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.cc-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.cc-item--active {
    border-color: rgba(75, 123, 236, 0.55);
    background: rgba(75, 123, 236, 0.12);
}

.cc-avatar {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: #fff;
    background: hsl(var(--cc-av-h, 210), 52%, 38%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.cc-avatar-badges {
    position: absolute;
    right: -8px;
    bottom: -8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-direction: row;
}

.cc-avatar-badges .sentiment-emoji {
    position: static;
    right: auto;
    bottom: auto;
}

.cc-status-dot {
    position: absolute;
    z-index: 1;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--card-bg, #1e2130);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    color: #fff;
    pointer-events: none;
}

.cc-status-dot--resolved {
    background: #38a169;
}

.cc-status-dot--resolved::before {
    content: "↑";
}

.cc-status-dot--not-resolved {
    background: #e05555;
}

.cc-status-dot--partial {
    background: #d69e2e;
}

.cc-status-dot--partial::before {
    content: "~";
    font-size: 10px;
    line-height: 1;
}

.cc-status-dot--unclear {
    background: #718096;
}

.cc-support-score {
    min-width: 1.5em;
    padding: 1px 5px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.58);
    color: rgba(255, 255, 255, 0.98);
    box-sizing: border-box;
}

.cc-support-score--none {
    color: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(0, 0, 0, 0.44);
}

.cc-support-score--high {
    border-color: rgba(72, 187, 120, 0.75);
    background: rgba(72, 187, 120, 0.38);
    color: #c8f5d9;
}

.cc-support-score--mid {
    border-color: rgba(136, 146, 176, 0.65);
    background: rgba(136, 146, 176, 0.34);
    color: #dde3f0;
}

.cc-support-score--warn {
    border-color: rgba(232, 184, 74, 0.75);
    background: rgba(232, 184, 74, 0.34);
    color: #ffe9b5;
}

.cc-support-score--low {
    border-color: rgba(224, 85, 85, 0.75);
    background: rgba(224, 85, 85, 0.38);
    color: #ffc9c9;
}

.cc-sort-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 10px;
    font-size: 13px;
}

.cc-sort-row__label {
    margin-right: 2px;
}

.cc-sort-row__sep {
    color: var(--muted);
    user-select: none;
}

a.cc-sort-link {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
}

a.cc-sort-link:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.35);
}

a.cc-sort-link--active {
    color: #fff;
    font-weight: 700;
    border-bottom: none;
}

.cc-score-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.cc-score-filter-btn {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    cursor: pointer;
}

.cc-score-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.cc-score-filter-btn--active {
    border-color: rgba(75, 123, 236, 0.55);
    background: rgba(75, 123, 236, 0.18);
    color: #fff;
}

.cc-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cc-item__top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.cc-item__name {
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-item__time {
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}

.cc-item__preview {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.cc-item__preview--ai {
    display: block;
    -webkit-line-clamp: unset;
    white-space: pre-line;
    max-height: 14em;
    overflow-y: auto;
    padding-right: 2px;
}

.cc-item__foot {
    font-size: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.cc-item__foot > .cc-badge {
    margin-left: 0;
}

.cc-foot-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 5px 1px 3px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.cc-foot-tag .cc-badge {
    margin-left: 0;
}

.cc-foot-tag__amt {
    font-size: 10px;
    line-height: 1.2;
    color: var(--muted, #888);
    white-space: nowrap;
}

.cc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1;
    padding: 1px 3px;
    vertical-align: middle;
    margin-left: 4px;
}

.cc-badge--star {
    color: #f5a623;
    font-size: 13px;
    padding: 0;
}

.cc-badge--star-red {
    color: #e53e3e;
    font-size: 13px;
    padding: 0;
}

.cc-badge--no-return {
    background: #e53e3e;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    padding: 0;
}

.cc-badge--green-block {
    background: #38a169;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    padding: 0;
}

.cc-badge--poop {
    font-size: 11px;
    line-height: 1;
    padding: 0;
    margin-left: 4px;
}

.cc-badge--amount {
    color: var(--muted, #888);
    font-size: 10px;
    white-space: nowrap;
}

.cc-item__userlink {
    color: var(--primary);
}

.cc-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

/* Модалка чата: две колонки (чат + анализ), не вертикальный .cc-main */
.cc-main.cc-modal-read {
    flex-direction: row;
}

.cc-main__empty {
    padding: 32px 20px;
    text-align: center;
}

.cc-main__chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.cc-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.15);
}

.cc-chat-head__intro {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.cc-head-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.cc-btn-copy {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border);
    color: var(--text);
}

.cc-btn-copy:hover {
    background: rgba(255, 255, 255, 0.14);
}

.cc-btn-analyze {
    background: linear-gradient(180deg, rgba(75, 123, 236, 0.35), rgba(55, 95, 190, 0.45));
    border-color: rgba(75, 123, 236, 0.45);
    color: #fff;
}

.cc-btn-analyze:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(90, 138, 250, 0.45), rgba(65, 108, 210, 0.55));
}

#ccBtnAnalyze.cc-btn-analyze--busy {
    cursor: progress;
}

.cc-analyze-busy {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.cc-analyze-dots {
    display: inline-flex;
    gap: 3px;
    padding-left: 1px;
}

.cc-analyze-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.35;
    animation: cc-analyze-dot 1s ease-in-out infinite;
}

.cc-analyze-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.cc-analyze-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes cc-analyze-dot {
    0%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

.cc-analysis-panel {
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 12px;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.cc-analysis-panel__inner {
    font-size: 0.9rem;
    line-height: 1.45;
}

.cc-analysis-panel__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 8px;
}

.cc-analysis-panel__stars {
    letter-spacing: 1px;
    color: #e8b84a;
    font-size: 1rem;
}

.cc-analysis-panel__sentiment {
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cc-analysis-panel__sentiment--negative {
    color: #e85555;
}

.cc-analysis-panel__sentiment--neutral {
    color: #aaa;
}

.cc-analysis-panel__sentiment--positive {
    color: #5ecf7a;
}

.cc-analysis-panel__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-top: 8px;
    margin-bottom: 2px;
}

.cc-analysis-panel__body {
    margin: 0;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.cc-analysis-aside {
    flex: 0 0 340px;
    max-width: 380px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 12px 14px 14px;
    overflow: hidden;
}

.cc-analysis-aside__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.cc-analysis-aside__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.cc-analysis-aside__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cc-analysis-aside__meta {
    margin: 6px 0 0;
    flex-shrink: 0;
}

.cc-analysis-aside__body {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
    min-height: 0;
    padding-right: 4px;
}

/* AI-анализ: «колбаса» — быстрый переход по разделам (засечки между сегментами) */
.cc-analysis-aside__body [id^="cc-ai-anchor-"] {
    scroll-margin-top: 52px;
}

.cc-ai-sausage {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 0 12px;
    padding: 6px 0 10px;
    background: linear-gradient(180deg, var(--card) 72%, rgba(18, 24, 38, 0));
    border-radius: 0 0 10px 10px;
}

.cc-ai-sausage__track {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    min-height: 34px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(75, 123, 236, 0.32);
    background: rgba(0, 0, 0, 0.28);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cc-ai-sausage__tooth {
    flex: 0 0 5px;
    align-self: stretch;
    min-height: 28px;
    background: repeating-linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08) 0 2px,
        rgba(75, 123, 236, 0.35) 2px 4px,
        rgba(255, 255, 255, 0.06) 4px 6px
    );
    clip-path: polygon(0 0, 100% 12%, 0 28%, 100% 44%, 0 60%, 100% 76%, 0 92%, 100% 100%, 0 100%);
}

.cc-ai-sausage__seg {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 7px 4px;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, text-shadow 0.18s ease;
}

.cc-ai-sausage__seg:hover:not(:disabled):not(.cc-ai-sausage__seg--active) {
    background: rgba(75, 123, 236, 0.22);
    color: #fff;
}

.cc-ai-sausage__seg--active {
    background: linear-gradient(135deg, #3d6fd6 0%, #5b4fd4 100%);
    color: #fff;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 16px rgba(75, 123, 236, 0.5);
    cursor: default;
}

.cc-ai-sausage__seg:focus-visible {
    outline: 2px solid rgba(75, 123, 236, 0.65);
    outline-offset: -2px;
    z-index: 1;
}

.cc-ai-sausage__seg--off,
.cc-ai-sausage__seg:disabled {
    opacity: 0.38;
    cursor: default;
    background: rgba(0, 0, 0, 0.12);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-card {
    margin-top: 4px;
    padding: 14px 14px 12px;
    border-radius: 18px;
    border: 1px solid rgba(75, 123, 236, 0.22);
    background: linear-gradient(165deg, rgba(22, 32, 58, 0.95) 0%, rgba(12, 16, 28, 0.98) 100%);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 8px 28px rgba(0, 0, 0, 0.35);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 10px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    flex-shrink: 0;
    color: #b8c8ff;
    background: radial-gradient(circle at 30% 25%, rgba(120, 160, 255, 0.35), rgba(40, 70, 140, 0.45));
    box-shadow: 0 0 16px rgba(75, 123, 236, 0.35);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-card__icon svg {
    display: block;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-card__title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    flex: 1;
    min-width: 0;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-badge--none,
:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-badge--low {
    background: rgba(100, 120, 150, 0.35);
    color: #dbe4f5;
    border-color: rgba(255, 255, 255, 0.12);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-badge--medium {
    background: linear-gradient(180deg, rgba(232, 150, 60, 0.45), rgba(180, 90, 20, 0.55));
    color: #fff;
    border-color: rgba(255, 200, 120, 0.35);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-badge--high {
    background: linear-gradient(180deg, rgba(220, 90, 70, 0.5), rgba(140, 40, 40, 0.65));
    color: #fff;
    border-color: rgba(255, 140, 120, 0.35);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-badge--critical {
    background: linear-gradient(180deg, #c62828, #7f1010);
    color: #fff;
    border-color: rgba(255, 100, 100, 0.45);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-reason {
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--muted);
    margin-bottom: 10px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-quote {
    position: relative;
    padding: 12px 12px 12px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(75, 123, 236, 0.18);
    margin-bottom: 12px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-quote__mark {
    position: absolute;
    left: 8px;
    top: 4px;
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    color: rgba(75, 123, 236, 0.55);
    font-family: Georgia, serif;
    pointer-events: none;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-quote__text {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0 0 0 14px;
    min-height: 7.5rem;
    font-size: 0.86rem;
    line-height: 1.5;
    font-family: inherit;
    white-space: pre-wrap;
    word-break: break-word;
    color: #e8ecf5;
    background: transparent;
    border: none;
    outline: none;
    resize: vertical;
    box-shadow: none;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-quote__text:focus {
    outline: 1px solid rgba(75, 123, 236, 0.45);
    outline-offset: 2px;
    border-radius: 6px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-btn-copy,
:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-btn-send {
    width: 100%;
    justify-content: center;
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-btn-copy {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-btn-copy:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-btn-send {
    border: none;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(180deg, #5a8cfa 0%, #3a5fc4 48%, #2d4aa8 100%);
    box-shadow: 0 6px 22px rgba(75, 123, 236, 0.45);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-btn-send:hover:not(:disabled) {
    filter: brightness(1.06);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-fu-btn-send:disabled {
    opacity: 0.75;
    cursor: progress;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-ai-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-ai-section-head__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    flex-shrink: 0;
    color: #b8c8ff;
    background: radial-gradient(circle at 30% 25%, rgba(120, 160, 255, 0.35), rgba(40, 70, 140, 0.45));
    box-shadow: 0 0 14px rgba(75, 123, 236, 0.3);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-ai-section-head__icon svg {
    display: block;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-ai-section-head__title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-act-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-act-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(75, 123, 236, 0.15);
    background: rgba(0, 0, 0, 0.22);
    cursor: default;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-act-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
    box-shadow: 0 0 10px currentColor;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-act-item__dot--low {
    color: #8aa4c8;
    background: #8aa4c8;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-act-item__dot--medium {
    color: #e8963c;
    background: #e8963c;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-act-item__dot--high,
:is(.client-chats-page, .cc-modal-read__analysis) .cc-act-item__dot--critical {
    color: #e85555;
    background: #e85555;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-act-item__body {
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: #e8ecf5;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-act-item__meta {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 4px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-act-item__chev {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 300;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-card {
    position: relative;
    padding: 12px 14px 14px;
    border-radius: 16px;
    border: 1px solid rgba(75, 123, 236, 0.18);
    background: linear-gradient(145deg, rgba(40, 28, 70, 0.55) 0%, rgba(12, 14, 28, 0.9) 100%);
    margin-bottom: 10px;
    overflow: hidden;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-card:last-child {
    margin-bottom: 0;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-card--high {
    border-color: rgba(200, 80, 90, 0.35);
    box-shadow: inset 0 0 40px rgba(120, 40, 80, 0.12);
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-card__meta {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 6px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-card__idea {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #e8ecf5;
    word-break: break-word;
    padding-right: 36px;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-badge--prio {
    display: inline-flex;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: lowercase;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-badge--prio.cc-insight-badge--low {
    background: rgba(100, 120, 150, 0.4);
    color: #dbe4f5;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-badge--prio.cc-insight-badge--medium {
    background: linear-gradient(180deg, rgba(232, 150, 60, 0.5), rgba(160, 80, 20, 0.55));
    color: #fff;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-badge--prio.cc-insight-badge--high,
:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-badge--prio.cc-insight-badge--critical {
    background: linear-gradient(180deg, rgba(200, 60, 55, 0.65), rgba(100, 25, 30, 0.85));
    color: #fff;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-card__glow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 220, 140, 0.45) 0%, rgba(255, 180, 60, 0.15) 45%, transparent 70%);
    pointer-events: none;
    opacity: 0.9;
}

:is(.client-chats-page, .cc-modal-read__analysis) .cc-insight-card__glow::after {
    content: "✦";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -52%);
    font-size: 1.1rem;
    color: rgba(255, 245, 200, 0.95);
    text-shadow: 0 0 12px rgba(255, 200, 80, 0.8);
}

.cc-ai-block {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.cc-ai-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cc-ai-block--summary .cc-ai-summary__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: -0.015em;
    word-break: break-word;
}

.cc-ai-block--summary .cc-ai-summary__dek {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.2;
    color: color-mix(in srgb, #2c2c2c 42%, #fff 58%);
    word-break: break-word;
}

.cc-ai-block--summary .cc-ai-summary__title + .cc-ai-summary__dek {
    margin-top: 10px;
}

.cc-ai-block--summary .cc-ai-badge--status {
    margin-top: 12px;
}

.cc-ai-block__title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 6px;
}

.cc-ai-block__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.cc-ai-block__title-row .cc-ai-block__title {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.cc-support-rules-modal__textarea {
    width: 100%;
    min-height: 220px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.45;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    resize: vertical;
}

.cc-ai-p {
    margin: 0 0 6px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
}

.cc-ai-p--lead {
    font-weight: 600;
}

.cc-ai-p--small {
    font-size: 0.82rem;
    color: var(--muted);
}

.cc-ai-badge {
    display: inline-block;
    margin: 4px 6px 0 0;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
}

.cc-ai-badge--status {
    text-transform: lowercase;
}

.cc-ai-badge--prio {
    background: rgba(75, 123, 236, 0.2);
    border-color: rgba(75, 123, 236, 0.35);
}

.cc-ai-scorebar {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 4px;
}

.cc-ai-scorebar__fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(75, 123, 236, 0.85), rgba(120, 170, 255, 0.75));
    min-width: 0;
}

.cc-ai-scorebar__label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
}

.cc-ai-subscore {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.cc-ai-subscore__name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: capitalize;
}

.cc-ai-ul {
    margin: 4px 0 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    line-height: 1.45;
}

.cc-ai-history-list {
    list-style: none;
    padding-left: 0;
    margin: 8px 0 0;
}

.cc-ai-history-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    padding: 6px 8px;
    margin-bottom: 6px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
    border-radius: 6px;
    background: var(--surface-2, rgba(0, 0, 0, 0.04));
}

.cc-ai-history-item__date {
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}

.cc-ai-history-item__summary {
    flex: 1 1 140px;
    min-width: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.cc-ai-history-item__open {
    flex-shrink: 0;
}

.cc-ai-ul--good li {
    color: #8fd99a;
}

.cc-ai-sentiment {
    position: relative;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, #c44 0%, #888 50%, #4a8 100%);
    margin: 28px 0 4px;
}

.cc-ai-sentiment__marker {
    position: absolute;
    top: -22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.cc-ai-sentiment__marker-emoji {
    font-size: 1.15rem;
    line-height: 1;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.cc-ai-sentiment__marker-knob {
    width: 10px;
    height: 18px;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.cc-ai-sentiment__label {
    font-size: 0.8rem;
    font-weight: 600;
}

.cc-ai-kv {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 6px;
}

.cc-ai-followup-text {
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.cc-ai-insight {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.cc-ai-insight__head {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--muted);
}

.cc-ai-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cc-ai-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(75, 123, 236, 0.15);
    border: 1px solid rgba(75, 123, 236, 0.3);
}

/* Иконки действий (ред./удалить) слева от подписи при разметке label, btn, btn */
.cc-ai-tag > button,
.cc-ai-tag > .cc-ai-tag__actions {
    order: -1;
    flex-shrink: 0;
}

.cc-ai-tag > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 2px;
    min-width: 1.25rem;
    height: 1.25rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(58, 109, 216, 0.95);
    cursor: pointer;
    line-height: 0;
}

.cc-ai-tag > button:hover {
    background: rgba(75, 123, 236, 0.2);
    color: rgba(38, 82, 180, 1);
}

.cc-ai-tag > button:focus-visible {
    outline: 2px solid rgba(75, 123, 236, 0.55);
    outline-offset: 1px;
}

.cc-chat-head__avatar {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    color: #fff;
    background: hsl(var(--cc-av-h, 210), 52%, 38%);
    flex-shrink: 0;
}

.user-header__icon {
    position: relative;
}

.sentiment-emoji {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    box-sizing: border-box;
}

.sentiment-emoji[data-mood="5"]::before {
    content: "\1F970";
}

.sentiment-emoji[data-mood="4"]::before {
    content: "\1F601";
}

.sentiment-emoji[data-mood="3"]::before {
    content: "\1F642";
}

.sentiment-emoji[data-mood="2"]::before {
    content: "\1F610";
}

.sentiment-emoji[data-mood="1"]::before {
    content: "\1F621";
}

.result .sentiment-emoji {
    position: static;
    margin-right: 6px;
    width: auto;
    height: auto;
    min-width: 1.1em;
    background: transparent;
    border: 0;
    font-size: 14px;
    vertical-align: middle;
}

.cc-chat-head__text {
    min-width: 0;
}

.cc-chat-head__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    word-break: break-word;
}

.cc-chat-head__sub {
    margin: 4px 0 0;
}

.cc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.12);
}

.cc-load {
    padding: 8px 16px 14px;
    border-top: 1px solid var(--border);
}

.cc-date-sep {
    display: flex;
    justify-content: center;
    margin: 6px 0 10px;
}

.cc-date-sep__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 14px;
}

.cc-row {
    display: flex;
    width: 100%;
}

.cc-row--client {
    justify-content: flex-start;
}

.cc-row--agent {
    justify-content: flex-end;
}

.cc-row--raw {
    justify-content: center;
}

.cc-bubble {
    max-width: min(92%, 560px);
    border-radius: 16px;
    padding: 10px 14px 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.cc-bubble--client {
    background: linear-gradient(180deg, rgba(40, 52, 78, 0.95), rgba(28, 36, 56, 0.98));
    border-color: rgba(255, 255, 255, 0.08);
}

.cc-bubble--agent {
    background: linear-gradient(180deg, rgba(55, 72, 110, 0.95), rgba(42, 58, 92, 0.98));
    border-color: rgba(75, 123, 236, 0.28);
}

.cc-bubble__meta {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
}

.cc-bubble__time {
    font-weight: 700;
    margin-right: 6px;
}

.cc-bubble__sender {
    font-weight: 600;
    color: var(--text);
}

.cc-bubble__text {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}

.cc-raw-line {
    font-size: 12px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    max-width: 100%;
    word-break: break-word;
}

/* ── AI Analysis: Circular ring progress (text rendered inside SVG) ── */
.cc-ai-score-ring-wrap {
    flex-shrink: 0;
    line-height: 0;
}
.cc-ai-score-ring-wrap svg {
    display: block;
}

/* ── AI Analysis: Hero row ── */
.cc-ai-score-hero {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(75, 123, 236, 0.18) 0%, rgba(30, 50, 120, 0.25) 100%);
    border: 1px solid rgba(75, 123, 236, 0.25);
    margin-bottom: 12px;
}
.cc-ai-score-hero__info {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 0;
}
.cc-ai-score-hero__total {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 4px 0 2px;
}
.cc-ai-badge--score {
    background: rgba(75, 123, 236, 0.25);
    border-color: rgba(75, 123, 236, 0.4);
    color: #a8c0ff;
}

/* ── AI Analysis: Subscore grid (flexbox, 3 per row) ── */
.cc-ai-subscore-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.cc-ai-subscore-card {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 calc(33.333% - 8px);
    flex: 1 1 calc(33.333% - 8px);
    min-width: 76px;
    max-width: calc(33.333% - 4px);
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 5px;
    padding: 8px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    text-align: center;
}
.cc-ai-subscore-card__name {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--muted);
    word-break: break-word;
    line-height: 1.2;
}
.cc-ai-subscore-card--has-tooltip {
    cursor: help;
}
.cc-ai-subscore-card--clickable {
    cursor: pointer;
}
.cc-ai-subscore-card--clickable:hover {
    border-color: rgba(75, 123, 236, 0.35);
}
.cc-ai-subscore-edit {
    margin-top: 6px;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.cc-ai-subscore-edit__lbl {
    display: block;
    font-size: 0.65rem;
    color: var(--muted);
    margin-bottom: 4px;
}
.cc-ai-subscore-edit__input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font: inherit;
}
.cc-ai-subscore-edit__ta {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 6px;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font: inherit;
    resize: vertical;
    min-height: 52px;
}
.cc-ai-subscore-edit__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

/* ── AI Analysis: Conversion / purchase vs chat ── */
.cc-ai-block--conversion {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(75, 123, 236, 0.06);
    border: 1px solid rgba(75, 123, 236, 0.18);
}
.cc-ai-conv-extras {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
}

.cc-ai-conv-extras .sentiment-emoji--inline {
    position: static;
    margin: 0;
    width: 22px;
    height: 22px;
    font-size: 14px;
}

.cc-ai-conv-badge {
    display: inline-block;
    margin: 4px 0 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.cc-ai-conv-badge--after {
    background: rgba(79, 208, 119, 0.2);
    border: 1px solid rgba(79, 208, 119, 0.45);
    color: #b8f0c4;
}
.cc-ai-conv-badge--before {
    background: rgba(75, 123, 236, 0.22);
    border: 1px solid rgba(75, 123, 236, 0.45);
    color: #c8d8ff;
}
.cc-ai-conv-badge--both {
    background: rgba(232, 184, 74, 0.15);
    border: 1px solid rgba(232, 184, 74, 0.4);
    color: #f0d78a;
}
.cc-ai-conv-badge--unknown {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--muted);
}
.cc-ai-conv-badge--none {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--muted);
}
.cc-ai-conv-role {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.cc-ai-conv-paid {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 6px;
    padding: 10px 12px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.cc-ai-conv-paid:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(75, 123, 236, 0.35);
}

.cc-ai-conv-paid:focus {
    outline: none;
}

.cc-ai-conv-paid:focus-visible {
    outline: 2px solid rgba(75, 123, 236, 0.65);
    outline-offset: 2px;
}

.cc-ai-conv-paid__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: rgba(75, 123, 236, 0.28);
    color: #7eb3ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cc-ai-conv-paid__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.cc-ai-conv-paid__label {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.2;
}

.cc-ai-conv-paid__amount {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.cc-ai-conv-paid__chev {
    flex-shrink: 0;
    font-size: 1.35rem;
    font-weight: 300;
    line-height: 1;
    color: var(--muted);
    opacity: 0.85;
    padding: 0 2px;
}

.cc-pay-modal-body {
    max-height: 60vh;
}

.cc-pay-row--debit td:nth-child(3) {
    color: #f0a0a0;
}

.cc-pay-row--credit td:nth-child(3) {
    color: #a0f0b0;
}

/* ── AI Analysis: Good / Warn sections ── */
.cc-ai-good-section {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(79, 208, 119, 0.06);
    border: 1px solid rgba(79, 208, 119, 0.2);
}
.cc-ai-good-section--warn {
    background: rgba(224, 80, 80, 0.06);
    border-color: rgba(224, 80, 80, 0.2);
}
.cc-ai-good-section__title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5ecf7a;
    margin-bottom: 6px;
}
.cc-ai-good-section--warn .cc-ai-good-section__title {
    color: #e07060;
}
.cc-ai-check-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cc-ai-check-list li {
    font-size: 0.83rem;
    line-height: 1.4;
    padding-left: 1.1em;
    position: relative;
}
.cc-ai-check-list li::before {
    position: absolute;
    left: 0;
    top: 0.1em;
    font-size: 0.6em;
}
.cc-ai-check-list--good li {
    color: #c0eeca;
}
.cc-ai-check-list--good li::before {
    content: "●";
    color: #5ecf7a;
}
.cc-ai-check-list--warn li {
    color: var(--text);
}
.cc-ai-check-list--warn li::before {
    content: "●";
    color: #e07060;
}

/* Десктоп: вся страница по высоте окна, прокрутка списка чатов — только внутри .cc-list */
@media (min-width: 961px) {
    body.has-sidebar.client-chats-page {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }

    .client-chats-page .sidebar-page {
        min-height: 0;
    }

    .client-chats-page .cc-layout {
        min-height: 0;
    }
}

@media (max-width: 960px) {
    .client-chats-page .cc-layout {
        flex-direction: column;
    }

    .client-chats-page .cc-center {
        flex-direction: column;
    }

    .cc-sidebar.cc-sidebar--card {
        flex: 0 0 auto;
        max-width: none;
        max-height: 44vh;
    }

    .cc-main {
        min-height: 48vh;
    }

    .cc-analysis-aside {
        flex: 0 1 auto;
        max-width: none;
        min-width: 0;
        max-height: 46vh;
    }
}

.known-bugs-page .kb-main {
    max-width: 1480px;
    margin: 0 auto;
    padding-bottom: 32px;
}

.known-bugs-page .kb-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 20px;
}

.known-bugs-page .kb-header__title {
    margin: 0 0 6px;
    font-size: 1.45rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.known-bugs-page .kb-header__sub {
    margin: 0;
    max-width: 560px;
    line-height: 1.45;
}

.known-bugs-page .kb-header__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.known-bugs-page .kb-header__pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--muted);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.known-bugs-page .kb-header__pill:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.18);
}

.known-bugs-page .kb-header__pill--active,
.known-bugs-page .kb-header__pill.kb-header__pill--active {
    background: rgba(75, 123, 236, 0.22);
    border-color: rgba(75, 123, 236, 0.45);
    color: var(--text);
}

.known-bugs-page .kb-toolbar {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(0, 2.2fr) auto;
    gap: 12px 16px;
    align-items: center;
    margin-bottom: 16px;
}

.known-bugs-page .kb-search-wrap {
    position: relative;
}

.known-bugs-page .kb-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: flex;
}

.known-bugs-page .kb-search {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    font-size: 14px;
}

.known-bugs-page .kb-search::placeholder {
    color: var(--muted);
}

.known-bugs-page .kb-search:focus {
    outline: none;
    border-color: rgba(75, 123, 236, 0.55);
    box-shadow: 0 0 0 2px rgba(75, 123, 236, 0.15);
}

.known-bugs-page .kb-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.known-bugs-page .kb-pill {
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.known-bugs-page .kb-pill:hover {
    color: var(--text);
}

.known-bugs-page .kb-pill.is-active {
    background: rgba(75, 123, 236, 0.28);
    border-color: rgba(75, 123, 236, 0.5);
    color: var(--text);
}

.known-bugs-page .kb-actions-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.known-bugs-page .kb-btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.known-bugs-page .kb-err {
    margin: 0 0 12px;
    color: var(--danger) !important;
}

.known-bugs-page .kb-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.known-bugs-page .kb-stat {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    overflow: hidden;
}

.known-bugs-page .kb-stat__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.known-bugs-page .kb-stat__icon--bug {
    background: rgba(255, 93, 93, 0.12);
    color: #ff8a8a;
}

.known-bugs-page .kb-stat__icon--support {
    background: rgba(75, 123, 236, 0.15);
    color: var(--primary);
}

.known-bugs-page .kb-stat__icon--ai {
    background: rgba(155, 89, 182, 0.18);
    color: #c39bd3;
}

.known-bugs-page .kb-stat__icon--ok {
    background: rgba(46, 204, 113, 0.14);
    color: var(--ok);
}

.known-bugs-page .kb-stat__body {
    min-width: 0;
    flex: 1;
}

.known-bugs-page .kb-stat__label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.known-bugs-page .kb-stat__value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
}

.known-bugs-page .kb-stat__delta {
    margin-top: 4px;
    font-size: 12px;
}

.known-bugs-page .kb-stat__delta--up {
    color: var(--ok);
}

.known-bugs-page .kb-stat__delta--down {
    color: var(--danger);
}

.known-bugs-page .kb-stat__spark {
    position: absolute;
    right: 8px;
    bottom: 6px;
    width: 52px;
    height: 22px;
    opacity: 0.22;
    color: var(--muted);
}

.known-bugs-page .kb-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
}

.known-bugs-page .kb-layout:has(.kb-sugg-col.is-hidden) {
    grid-template-columns: 1fr;
}

.known-bugs-page.kb-detail-sheet-open {
    overflow: hidden;
}

.known-bugs-page .kb-detail-root {
    position: fixed;
    inset: 0;
    z-index: 1150;
    pointer-events: none;
}

.known-bugs-page .kb-detail-root.kb-detail-root--open {
    pointer-events: auto;
}

.known-bugs-page .kb-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 16, 0.52);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.known-bugs-page .kb-detail-root.kb-detail-root--open .kb-detail-backdrop {
    opacity: 1;
}

.known-bugs-page .kb-sugg-col {
    display: flex;
    flex-direction: column;
    width: 240px;
    min-width: 240px;
    max-height: min(72vh, 820px);
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    transition: width 0.18s ease, min-width 0.18s ease;
}

.known-bugs-page .kb-sugg-col.is-collapsed {
    width: 36px;
    min-width: 36px;
}

.known-bugs-page .kb-sugg-col.is-hidden {
    display: none;
}

.known-bugs-page .kb-sugg-col__head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.known-bugs-page .kb-sugg-col.is-collapsed .kb-sugg-col__head {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 4px;
    gap: 8px;
    border-bottom: none;
    flex: 1;
    min-height: 0;
}

.known-bugs-page .kb-sugg-col__title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.known-bugs-page .kb-sugg-col.is-collapsed .kb-sugg-col__title {
    flex: 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
    max-height: none;
    overflow: visible;
    text-overflow: clip;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.known-bugs-page .kb-sugg-col.is-collapsed .kb-sugg-col__count {
    display: none;
}

.known-bugs-page .kb-sugg-col__count {
    color: var(--muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.known-bugs-page .kb-sugg-col__toggle {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.known-bugs-page .kb-sugg-col.is-collapsed .kb-sugg-col__toggle {
    transform: rotate(180deg);
}

.known-bugs-page .kb-sugg-col__toggle:hover {
    border-color: rgba(75, 123, 236, 0.45);
    color: var(--primary);
}

.known-bugs-page .kb-sugg-col__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
}

.known-bugs-page .kb-sugg-col.is-collapsed .kb-sugg-col__body {
    display: none;
}

.known-bugs-page .kb-sugg-card {
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card2);
    padding: 8px 10px;
    font-size: 12px;
}

.known-bugs-page .kb-sugg-card__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.known-bugs-page .kb-sugg-card__type {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.known-bugs-page .kb-sugg-card__add {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--primary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
}

.known-bugs-page .kb-sugg-card__add:hover {
    border-color: rgba(75, 123, 236, 0.45);
    background: rgba(75, 123, 236, 0.08);
}

.known-bugs-page .kb-sugg-card__text {
    line-height: 1.35;
    margin: 0 0 4px;
    word-break: break-word;
}

.known-bugs-page .kb-sugg-card__meta {
    font-size: 11px;
    margin: 0;
}

.known-bugs-page .kb-sugg-empty {
    font-size: 12px;
    color: var(--muted);
    padding: 8px 4px;
    text-align: center;
    line-height: 1.4;
}

.known-bugs-page .kb-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    min-height: 420px;
}

.known-bugs-page .kb-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    max-height: min(72vh, 820px);
}

.known-bugs-page .kb-column__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}

.known-bugs-page .kb-column__title {
    flex: 1;
    min-width: 0;
}

.known-bugs-page .kb-column__count {
    color: var(--muted);
    font-weight: 600;
}

.known-bugs-page .kb-column__add {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.known-bugs-page .kb-column__add:hover {
    border-color: rgba(75, 123, 236, 0.45);
    color: var(--primary);
}

.known-bugs-page .kb-column__body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
}

.known-bugs-page .kb-column__body.is-drop {
    outline: 2px dashed rgba(75, 123, 236, 0.45);
    outline-offset: -2px;
    border-radius: 8px;
}

.known-bugs-page .kb-card {
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card2);
    padding: 12px;
    cursor: grab;
    transition: border-color 0.12s, box-shadow 0.12s;
}

.known-bugs-page .kb-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

.known-bugs-page .kb-card.is-selected {
    border-color: rgba(75, 123, 236, 0.55);
    box-shadow: 0 0 0 1px rgba(75, 123, 236, 0.25);
}

.known-bugs-page .kb-card.is-dragging {
    opacity: 0.45;
}

.known-bugs-page .kb-card[draggable="false"] {
    cursor: default;
}

.known-bugs-page .kb-card__row {
    margin-bottom: 6px;
}

.known-bugs-page .kb-card__page {
    margin: 4px 0 6px;
}

.known-bugs-page .kb-card__title {
    font-weight: 650;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.35;
}

.known-bugs-page .kb-card__desc {
    margin: 0 0 8px;
    line-height: 1.4;
}

.known-bugs-page .kb-card__support {
    padding: 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.known-bugs-page .kb-card__support-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 4px;
}

.known-bugs-page .kb-card__support-text {
    line-height: 1.4;
}

.known-bugs-page .kb-card__toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 8px;
}

.known-bugs-page .kb-switch-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.known-bugs-page .kb-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.known-bugs-page .kb-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.known-bugs-page .kb-switch__ui {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border);
    transition: background 0.15s;
}

.known-bugs-page .kb-switch__ui::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: var(--text);
    transition: transform 0.15s;
}

.known-bugs-page .kb-switch input:checked + .kb-switch__ui {
    background: rgba(75, 123, 236, 0.45);
    border-color: rgba(75, 123, 236, 0.55);
}

.known-bugs-page .kb-switch input:checked + .kb-switch__ui::after {
    transform: translate(14px, -50%);
}

.known-bugs-page .kb-card__foot {
    display: flex;
    align-items: center;
    gap: 8px;
}

.known-bugs-page .kb-card__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(75, 123, 236, 0.25);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.known-bugs-page .kb-card__meta {
    flex: 1;
    min-width: 0;
}

.known-bugs-page .kb-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.known-bugs-page .kb-chip--sm {
    font-size: 11px;
    padding: 2px 8px;
}

.known-bugs-page .kb-chip--severity-critical {
    background: rgba(255, 93, 93, 0.18);
    color: #ff9a9a;
}

.known-bugs-page .kb-chip--severity-high {
    background: rgba(243, 156, 18, 0.2);
    color: #f5b041;
}

.known-bugs-page .kb-chip--severity-medium {
    background: rgba(241, 196, 15, 0.14);
    color: #f7dc6f;
}

.known-bugs-page .kb-chip--severity-low {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.known-bugs-page .kb-chip--code {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    background: rgba(155, 89, 182, 0.2);
    color: #d7bde2;
    border-radius: 6px;
    padding: 3px 8px;
    word-break: break-all;
}

.known-bugs-page .kb-detail {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--border);
    background: var(--card);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    overflow: hidden;
}

.known-bugs-page .kb-detail-root.kb-detail-root--open .kb-detail {
    transform: translateX(0);
}

.known-bugs-page .kb-detail__inner {
    padding: 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.known-bugs-page .kb-detail__top {
    margin-bottom: 14px;
}

.known-bugs-page .kb-detail__code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.known-bugs-page .kb-detail__code {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    word-break: break-all;
}

.known-bugs-page .kb-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.known-bugs-page .kb-icon-btn:hover {
    color: var(--text);
}

.known-bugs-page .kb-icon-btn.is-on {
    color: #f5b041;
    border-color: rgba(245, 176, 65, 0.45);
}

.known-bugs-page .kb-detail__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.known-bugs-page .kb-detail__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 650;
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.known-bugs-page .kb-detail__props {
    margin: 0 0 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.known-bugs-page .kb-prop {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px 12px;
    font-size: 13px;
    align-items: baseline;
}

.known-bugs-page .kb-prop dt {
    margin: 0;
    color: var(--muted);
    font-weight: 500;
}

.known-bugs-page .kb-prop dd {
    margin: 0;
    word-break: break-word;
}

.known-bugs-page .kb-detail__block {
    margin-bottom: 14px;
}

.known-bugs-page .kb-detail__block-hint {
    margin: -4px 0 8px;
    line-height: 1.35;
}

.known-bugs-page .kb-detail__block-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 6px;
}

.known-bugs-page .kb-detail__text {
    font-size: 13px;
    line-height: 1.45;
    padding: 10px;
    border-radius: 8px;
    background: var(--card2);
    border: 1px solid var(--border);
    white-space: pre-wrap;
}

.known-bugs-page textarea.kb-detail__text--editable {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    min-height: 140px;
    resize: vertical;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    white-space: pre-wrap;
}

.known-bugs-page textarea.kb-detail__text--editable:focus {
    outline: none;
    border-color: rgba(75, 123, 236, 0.55);
}

.known-bugs-page .kb-detail__rec-status {
    margin: 6px 0 0;
    min-height: 1.2em;
}

.known-bugs-page .kb-detail__rec-status--err {
    color: #e74c3c;
}

.known-bugs-page .kb-detail__ai-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    font-size: 13px;
}

.known-bugs-page .kb-detail__ai-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.known-bugs-page .kb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.known-bugs-page .kb-dot--on {
    background: var(--ok);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.25);
}

.known-bugs-page .kb-detail__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.known-bugs-page .btn--block {
    width: 100%;
    justify-content: center;
}

.known-bugs-page .kb-verify-out {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.45;
}

.known-bugs-page .kb-verify-out a.link {
    color: var(--primary);
    text-decoration: underline;
}

.known-bugs-page .kb-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.known-bugs-page .kb-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
}

.known-bugs-page .kb-modal[hidden] {
    display: none !important;
}

.known-bugs-page .kb-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    background: rgba(8, 10, 16, 0.72);
}

.known-bugs-page .kb-modal__box {
    width: min(640px, 100%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.known-bugs-page .kb-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.known-bugs-page .kb-modal__head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.known-bugs-page .kb-form .field__label {
    color: var(--muted);
}

.known-bugs-page .kb-form .field__input,
.known-bugs-page .kb-form select.field__input,
.known-bugs-page .kb-form textarea.field__input {
    background: var(--card2);
    border: 1px solid var(--border);
    color: var(--text);
}

.known-bugs-page .kb-form .field__input:focus {
    outline: none;
    border-color: rgba(75, 123, 236, 0.55);
}

@media (max-width: 1100px) {
    .known-bugs-page .kb-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .known-bugs-page .kb-toolbar {
        grid-template-columns: 1fr;
    }

    .known-bugs-page .kb-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .known-bugs-page .kb-actions-right {
        justify-content: flex-start;
    }
}
.backlog-page .bl-main {
    max-width: 1480px;
    margin: 0 auto;
    padding-bottom: 32px;
}

.backlog-page .bl-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 20px;
}

.backlog-page .bl-header__title {
    margin: 0 0 6px;
    font-size: 1.45rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.backlog-page .bl-header__sub {
    margin: 0;
    max-width: 560px;
    line-height: 1.45;
}

.backlog-page .bl-header__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.backlog-page .bl-header__pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--muted);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.backlog-page .bl-header__pill:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.18);
}

.backlog-page .bl-header__pill--active,
.backlog-page .bl-header__pill.bl-header__pill--active {
    background: rgba(75, 123, 236, 0.22);
    border-color: rgba(75, 123, 236, 0.45);
    color: var(--text);
}

.backlog-page .bl-toolbar {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(0, 2.2fr) auto;
    gap: 12px 16px;
    align-items: center;
    margin-bottom: 16px;
}

.backlog-page .bl-search-wrap {
    position: relative;
}

.backlog-page .bl-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: flex;
}

.backlog-page .bl-search {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    font-size: 14px;
}

.backlog-page .bl-search::placeholder {
    color: var(--muted);
}

.backlog-page .bl-search:focus {
    outline: none;
    border-color: rgba(75, 123, 236, 0.55);
    box-shadow: 0 0 0 2px rgba(75, 123, 236, 0.15);
}

.backlog-page .bl-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.backlog-page .bl-pill {
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.backlog-page .bl-pill:hover {
    color: var(--text);
}

.backlog-page .bl-pill.is-active {
    background: rgba(75, 123, 236, 0.28);
    border-color: rgba(75, 123, 236, 0.5);
    color: var(--text);
}

.backlog-page .bl-actions-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.backlog-page .bl-btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.backlog-page .bl-err {
    margin: 0 0 12px;
    color: var(--danger) !important;
}

.backlog-page .bl-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.backlog-page .bl-stat {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    overflow: hidden;
}

.backlog-page .bl-stat__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.backlog-page .bl-stat__icon--backlog {
    background: rgba(255, 93, 93, 0.12);
    color: #ff8a8a;
}

.backlog-page .bl-stat__icon--support {
    background: rgba(75, 123, 236, 0.15);
    color: var(--primary);
}

.backlog-page .bl-stat__icon--ai {
    background: rgba(155, 89, 182, 0.18);
    color: #c39bd3;
}

.backlog-page .bl-stat__icon--ok {
    background: rgba(46, 204, 113, 0.14);
    color: var(--ok);
}

.backlog-page .bl-stat__body {
    min-width: 0;
    flex: 1;
}

.backlog-page .bl-stat__label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.backlog-page .bl-stat__value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
}

.backlog-page .bl-stat__delta {
    margin-top: 4px;
    font-size: 12px;
}

.backlog-page .bl-stat__delta--up {
    color: var(--ok);
}

.backlog-page .bl-stat__delta--down {
    color: var(--danger);
}

.backlog-page .bl-stat__spark {
    position: absolute;
    right: 8px;
    bottom: 6px;
    width: 52px;
    height: 22px;
    opacity: 0.22;
    color: var(--muted);
}

.backlog-page .bl-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
}

.backlog-page .bl-layout:has(.bl-sugg-col.is-hidden) {
    grid-template-columns: 1fr;
}

.known-bugs-page.bl-detail-sheet-open {
    overflow: hidden;
}

.backlog-page .bl-detail-root {
    position: fixed;
    inset: 0;
    z-index: 1150;
    pointer-events: none;
}

.backlog-page .bl-detail-root.bl-detail-root--open {
    pointer-events: auto;
}

.backlog-page .bl-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 16, 0.52);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.backlog-page .bl-detail-root.bl-detail-root--open .bl-detail-backdrop {
    opacity: 1;
}

.backlog-page .bl-sugg-col {
    display: flex;
    flex-direction: column;
    width: 240px;
    min-width: 240px;
    max-height: min(72vh, 820px);
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    transition: width 0.18s ease, min-width 0.18s ease;
}

.backlog-page .bl-sugg-col.is-collapsed {
    width: 36px;
    min-width: 36px;
}

.backlog-page .bl-sugg-col.is-hidden {
    display: none;
}

.backlog-page .bl-sugg-col__head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.backlog-page .bl-sugg-col.is-collapsed .bl-sugg-col__head {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 4px;
    gap: 8px;
    border-bottom: none;
    flex: 1;
    min-height: 0;
}

.backlog-page .bl-sugg-col__title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.backlog-page .bl-sugg-col.is-collapsed .bl-sugg-col__title {
    flex: 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
    max-height: none;
    overflow: visible;
    text-overflow: clip;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.backlog-page .bl-sugg-col.is-collapsed .bl-sugg-col__count {
    display: none;
}

.backlog-page .bl-sugg-col__count {
    color: var(--muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.backlog-page .bl-sugg-col__toggle {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.backlog-page .bl-sugg-col.is-collapsed .bl-sugg-col__toggle {
    transform: rotate(180deg);
}

.backlog-page .bl-sugg-col__toggle:hover {
    border-color: rgba(75, 123, 236, 0.45);
    color: var(--primary);
}

.backlog-page .bl-sugg-col__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
}

.backlog-page .bl-sugg-col.is-collapsed .bl-sugg-col__body {
    display: none;
}

.backlog-page .bl-sugg-card {
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card2);
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}

.backlog-page .bl-sugg-card__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.backlog-page .bl-sugg-card__type {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.backlog-page .bl-sugg-card__add {
    position: relative;
    z-index: 1;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--primary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
}

.backlog-page .bl-sugg-card__add:hover {
    border-color: rgba(75, 123, 236, 0.45);
    background: rgba(75, 123, 236, 0.08);
}

.backlog-page .bl-sugg-card__text {
    line-height: 1.35;
    margin: 0 0 4px;
    word-break: break-word;
}

.backlog-page .bl-sugg-card__meta {
    font-size: 11px;
    margin: 0;
}

.backlog-page .bl-sugg-empty {
    font-size: 12px;
    color: var(--muted);
    padding: 8px 4px;
    text-align: center;
    line-height: 1.4;
}

.backlog-page .bl-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    min-height: 420px;
}

.backlog-page .bl-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    max-height: min(72vh, 820px);
}

.backlog-page .bl-column__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}

.backlog-page .bl-column__title {
    flex: 1;
    min-width: 0;
}

.backlog-page .bl-column__count {
    color: var(--muted);
    font-weight: 600;
}

.backlog-page .bl-column__add {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.backlog-page .bl-column__add:hover {
    border-color: rgba(75, 123, 236, 0.45);
    color: var(--primary);
}

.backlog-page .bl-column__body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
}

.backlog-page .bl-column__body.is-drop {
    outline: 2px dashed rgba(75, 123, 236, 0.45);
    outline-offset: -2px;
    border-radius: 8px;
}

.backlog-page .bl-card {
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card2);
    padding: 12px;
    cursor: grab;
    transition: border-color 0.12s, box-shadow 0.12s;
}

.backlog-page .bl-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

.backlog-page .bl-card.is-selected {
    border-color: rgba(75, 123, 236, 0.55);
    box-shadow: 0 0 0 1px rgba(75, 123, 236, 0.25);
}

.backlog-page .bl-card.is-dragging {
    opacity: 0.45;
}

.backlog-page .bl-card[draggable="false"] {
    cursor: default;
}

.backlog-page .bl-card__row {
    margin-bottom: 6px;
}

.backlog-page .bl-card__page {
    margin: 4px 0 6px;
}

.backlog-page .bl-card__title {
    font-weight: 650;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.35;
}

.backlog-page .bl-card__desc {
    margin: 0 0 8px;
    line-height: 1.4;
}

.backlog-page .bl-card__support {
    padding: 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.backlog-page .bl-card__support-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 4px;
}

.backlog-page .bl-card__support-text {
    line-height: 1.4;
}

.backlog-page .bl-card__toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 8px;
}

.backlog-page .bl-switch-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.backlog-page .bl-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.backlog-page .bl-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.backlog-page .bl-switch__ui {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border);
    transition: background 0.15s;
}

.backlog-page .bl-switch__ui::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: var(--text);
    transition: transform 0.15s;
}

.backlog-page .bl-switch input:checked + .bl-switch__ui {
    background: rgba(75, 123, 236, 0.45);
    border-color: rgba(75, 123, 236, 0.55);
}

.backlog-page .bl-switch input:checked + .bl-switch__ui::after {
    transform: translate(14px, -50%);
}

.backlog-page .bl-card__foot {
    display: flex;
    align-items: center;
    gap: 8px;
}

.backlog-page .bl-card__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(75, 123, 236, 0.25);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.backlog-page .bl-card__meta {
    flex: 1;
    min-width: 0;
}

.backlog-page .bl-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.backlog-page .bl-chip--sm {
    font-size: 11px;
    padding: 2px 8px;
}

.backlog-page .bl-chip--severity-critical {
    background: rgba(255, 93, 93, 0.18);
    color: #ff9a9a;
}

.backlog-page .bl-chip--severity-high {
    background: rgba(243, 156, 18, 0.2);
    color: #f5b041;
}

.backlog-page .bl-chip--severity-medium {
    background: rgba(241, 196, 15, 0.14);
    color: #f7dc6f;
}

.backlog-page .bl-chip--severity-low {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.backlog-page .bl-chip--code {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    background: rgba(155, 89, 182, 0.2);
    color: #d7bde2;
    border-radius: 6px;
    padding: 3px 8px;
    word-break: break-all;
}

.backlog-page .bl-detail {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--border);
    background: var(--card);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    overflow: hidden;
}

.backlog-page .bl-detail-root.bl-detail-root--open .bl-detail {
    transform: translateX(0);
}

.backlog-page .bl-detail__inner {
    padding: 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.backlog-page .bl-detail__top {
    margin-bottom: 14px;
}

.backlog-page .bl-detail__code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.backlog-page .bl-detail__code {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    word-break: break-all;
}

.backlog-page .bl-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.backlog-page .bl-icon-btn:hover {
    color: var(--text);
}

.backlog-page .bl-icon-btn.is-on {
    color: #f5b041;
    border-color: rgba(245, 176, 65, 0.45);
}

.backlog-page .bl-detail__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.backlog-page .bl-detail__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 650;
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.backlog-page .bl-detail__props {
    margin: 0 0 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.backlog-page .bl-prop {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px 12px;
    font-size: 13px;
    align-items: baseline;
}

.backlog-page .bl-prop dt {
    margin: 0;
    color: var(--muted);
    font-weight: 500;
}

.backlog-page .bl-prop dd {
    margin: 0;
    word-break: break-word;
}

.backlog-page .bl-detail__block {
    margin-bottom: 14px;
}

.backlog-page .bl-detail__block-hint {
    margin: -4px 0 8px;
    line-height: 1.35;
}

.backlog-page .bl-detail__block-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 6px;
}

.backlog-page .bl-detail__text {
    font-size: 13px;
    line-height: 1.45;
    padding: 10px;
    border-radius: 8px;
    background: var(--card2);
    border: 1px solid var(--border);
    white-space: pre-wrap;
}

.backlog-page textarea.bl-detail__text--editable {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    min-height: 140px;
    resize: vertical;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    white-space: pre-wrap;
}

.backlog-page textarea.bl-detail__text--editable:focus {
    outline: none;
    border-color: rgba(75, 123, 236, 0.55);
}

.backlog-page .bl-detail__rec-status {
    margin: 6px 0 0;
    min-height: 1.2em;
}

.backlog-page .bl-detail__rec-status--err {
    color: #e74c3c;
}

.backlog-page .bl-detail__ai-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    font-size: 13px;
}

.backlog-page .bl-detail__ai-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.backlog-page .bl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.backlog-page .bl-dot--on {
    background: var(--ok);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.25);
}

.backlog-page .bl-detail__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.backlog-page .btn--block {
    width: 100%;
    justify-content: center;
}

.backlog-page .bl-verify-out {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.45;
}

.backlog-page .bl-verify-out a.link {
    color: var(--primary);
    text-decoration: underline;
}

.backlog-page .bl-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.backlog-page .bl-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
}

.backlog-page .bl-modal[hidden] {
    display: none !important;
}

.backlog-page .bl-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    background: rgba(8, 10, 16, 0.72);
}

.backlog-page .bl-modal__box {
    width: min(640px, 100%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.backlog-page .bl-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.backlog-page .bl-modal__head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.backlog-page .bl-form .field__label {
    color: var(--muted);
}

.backlog-page .bl-form .field__input,
.backlog-page .bl-form select.field__input,
.backlog-page .bl-form textarea.field__input {
    background: var(--card2);
    border: 1px solid var(--border);
    color: var(--text);
}

.backlog-page .bl-form .field__input:focus {
    outline: none;
    border-color: rgba(75, 123, 236, 0.55);
}

@media (max-width: 1100px) {
    .backlog-page .bl-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .backlog-page .bl-toolbar {
        grid-template-columns: 1fr;
    }

    .backlog-page .bl-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .backlog-page .bl-actions-right {
        justify-content: flex-start;
    }
}

.backlog-page .bl-card__row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}
.backlog-page .bl-stat__icon--backlog {
    background: rgba(46, 204, 113, 0.14);
    color: #6ee7a8;
}
.backlog-page .bl-chip--item-type {
    font-size: 11px;
    font-weight: 600;
}
.backlog-page .bl-chip--item-type-feature {
    background: rgba(75, 123, 236, 0.22);
    color: #9ec0ff;
}
.backlog-page .bl-chip--item-type-improvement {
    background: rgba(241, 196, 15, 0.18);
    color: #f5d76e;
}
.backlog-page .bl-chip--item-type-idea {
    background: rgba(155, 89, 182, 0.2);
    color: #d6b0e6;
}
.backlog-page .bl-chip--item-type-task {
    background: rgba(52, 152, 219, 0.18);
    color: #85c8ef;
}
.backlog-page .bl-chip--item-type-other {
    background: rgba(149, 165, 166, 0.2);
    color: #bdc3c7;
}
.backlog-page .bl-sugg-card__type--featurerequest,
.backlog-page .bl-sugg-card__type--feature_request {
    border-color: rgba(75, 123, 236, 0.45);
    color: #9ec0ff;
}
.backlog-page .bl-sugg-card__type--bug {
    border-color: rgba(255, 93, 93, 0.35);
}

.cp-detail__type-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.client-proposals-page .cp-detail__type-select,
.cp-detail__type-select {
    display: block;
    width: 100%;
    max-width: 280px;
    margin-bottom: 4px;
    padding: 6px 28px 6px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.client-proposals-page .cp-detail__type-select:focus,
.cp-detail__type-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(75, 123, 236, 0.25);
}
