/* Полосы прокрутки во всём приложении одинаковые: тонкие, тёмные, без светлой дорожки. */
* {
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}

body {
    margin: 0;
    font-family: Inter,Segoe UI,Arial,sans-serif;
    background: #0f172a;
    color: #e5e7eb
}

.shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh
}

aside {
    background: #111827;
    padding: 24px;
    border-right: 1px solid #334155
}

    aside a {
        display: block;
        color: #cbd5e1;
        text-decoration: none;
        padding: 10px 12px;
        border-radius: 8px;
        margin: 6px 0
    }

        aside a.active, aside a:hover {
            background: #1f2937;
            color: white
        }

main {
    padding: 28px
}

.card {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 18px;
    margin: 14px 0
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
    gap: 14px
}

input, button {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #475569
}

input {
    background: #020617;
    color: white
}

button {
    background: #2563eb;
    color: white;
    cursor: pointer
}

table {
    width: 100%;
    border-collapse: collapse
}

.badge {
    background: #dc2626;
    color: white;
    border-radius: 999px;
    padding: 2px 8px
}

td, th {
    padding: 10px;
    border-bottom: 1px solid #334155;
    text-align: left
}

.muted {
    color: #94a3b8
}

.unread {
    font-weight: 700;
    color: #fbbf24
}

pre {
    white-space: pre-wrap;
    background: #020617;
    padding: 12px;
    border-radius: 8px;
    max-height: 55vh;
    overflow: auto
}

.xml-viewer {
    margin-top: 20px;
}

.xml-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.xml-btn {
    background: #1f3f8f;
    border: 1px solid #3659a8;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

    .xml-btn:hover {
        background: #2952b8;
    }

    .xml-btn.active {
        background: #3568e0;
    }

.structured-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 18px;
}

    .info-block h3 {
        margin: 0 0 14px 0;
        color: #93c5fd;
    }

.info-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    margin-bottom: 10px;
}

    .info-row .label {
        color: #94a3b8;
    }

.message-text {
    margin-top: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    color: #e5e7eb;
}

.xml-raw {
    background: #020617;
    padding: 18px;
    border-radius: 10px;
    overflow: auto;
    white-space: pre-wrap;
    color: #dbeafe;
    border: 1px solid #334155;
    max-height: 65vh;
}

.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

button.danger {
    background: #dc2626;
    border-color: #ef4444;
}

    button.danger:hover {
        background: #b91c1c;
    }

.error {
    color: #fca5a5;
}

.xml-full-block {
    max-width: 100%;
}

.xml-details {
    margin: 8px 0;
    padding-left: 12px;
    border-left: 1px solid #334155;
}

    .xml-details summary {
        cursor: pointer;
        color: #93c5fd;
        font-weight: 700;
        margin-bottom: 8px;
    }

.xml-attr {
    margin-left: 8px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 400;
}

.xml-leaf-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 14px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(51, 65, 85, .45);
}

    .xml-leaf-row .label {
        color: #93c5fd;
    }

.xml-long-row {
    display: block;
}

    .xml-long-row .label {
        display: block;
        margin-bottom: 8px;
    }

.xml-long-text,
.xml-direct-text {
    display: block;
    white-space: pre-wrap;
    line-height: 1.55;
    color: #e5e7eb;
}

.xml-direct-text {
    margin: 8px 0 12px;
}