* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --user-accent: #007acc;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    background-color: #1e1e1e;
    color: #cccccc;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #252526;
}

::-webkit-scrollbar-thumb {
    background: #3e3e42;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--user-accent, #007acc);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

.spin {
    animation: spin 1s linear infinite;
}

pre[class*="language-"] {
    background: #1e1e1e !important;
    border-radius: 8px;
    margin: 16px 0;
    padding: 16px !important;
    overflow-x: auto;
}

code[class*="language-"] {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 14px;
}

.markdown-content {
    line-height: 1.75;
    color: #dcddde;
    font-size: 15px;
    word-break: break-word;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: #f2f3f5;
    font-weight: 700;
    line-height: 1.3;
    margin: 28px 0 12px;
}

.markdown-content h1 {
    font-size: 2em;
    padding-bottom: 10px;
    border-bottom: 2px solid #007acc;
}

.markdown-content h2 {
    font-size: 1.5em;
    padding-bottom: 8px;
    border-bottom: 1px solid #3e3e42;
}

.markdown-content h3 {
    font-size: 1.25em;
}
.markdown-content h4 {
    font-size: 1.1em;
    color: #cccccc;
}
.markdown-content h5 {
    font-size: 1em;
    color: #949ba4;
}
.markdown-content h6 {
    font-size: 0.9em;
    color: #72767d;
}

.markdown-content > h1:first-child,
.markdown-content > h2:first-child {
    margin-top: 0;
}

.markdown-content p {
    margin: 14px 0;
}

.markdown-content a {
    color: #007acc;
    text-decoration: none;
    border-bottom: 2px solid rgba(0, 122, 204, 0.6);
    transition:
        border-color 0.15s,
        color 0.15s;
}

.markdown-content a:hover {
    color: #7983f5;
    border-bottom-color: #7983f5;
}

.markdown-content ul {
    margin: 14px 0;
    padding-left: 2em;
    list-style-type: disc;
}

.markdown-content ul ul {
    list-style-type: circle;
    margin: 4px 0;
}

.markdown-content ul ul ul {
    list-style-type: square;
}

.markdown-content ol {
    margin: 14px 0;
    padding-left: 2em;
    list-style-type: decimal;
}

.markdown-content ol ol {
    list-style-type: lower-alpha;
    margin: 4px 0;
}

.markdown-content ol ol ol {
    list-style-type: lower-roman;
}

.markdown-content li {
    margin: 6px 0;
    padding-left: 4px;
}

.markdown-content li > p {
    margin: 4px 0;
}

.markdown-content li.task-list-item {
    list-style: none;
    margin-left: -1.5em;
    padding-left: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.markdown-content input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 2px solid #3e3e42;
    border-radius: 4px;
    background: #1e1e1e;
    margin-top: 3px;
    cursor: default;
    position: relative;
    flex-shrink: 0;
}

.markdown-content input[type="checkbox"]:checked {
    background: #007acc;
    border-color: #007acc;
}

.markdown-content input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 0;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.markdown-content blockquote {
    border-left: 4px solid #007acc;
    padding: 10px 16px;
    margin: 16px 0;
    background: rgba(0, 122, 204, 0.06);
    border-radius: 0 6px 6px 0;
    color: #949ba4;
}

.markdown-content blockquote p {
    margin: 4px 0;
}

.markdown-content code {
    background: rgba(30, 31, 34, 0.8);
    padding: 2px 7px;
    border-radius: 5px;
    font-family:
        "Consolas", "JetBrains Mono", "Monaco", "Courier New", monospace;
    font-size: 0.875em;
    color: #eb459e;
    border: 1px solid #3e3e42;
    white-space: nowrap;
}

.markdown-content pre {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 16px 0;
    position: relative;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    border: none;
    color: #f2f3f5;
    font-size: 0.875em;
    white-space: pre;
}

.markdown-content table {
    width: auto;
    min-width: 50%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.93em;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #3e3e42;
}

.markdown-content thead tr {
    background: #1e1e1e;
}

.markdown-content th {
    padding: 10px 14px;
    font-weight: 600;
    color: #f2f3f5;
    text-align: left;
    border-bottom: 2px solid #007acc;
}

.markdown-content td {
    padding: 10px 14px;
    border-bottom: 1px solid #3e3e42;
    color: #dcddde;
}

.markdown-content th,
.markdown-content td {
    text-align: unset;
}

.markdown-content th:not([align]),
.markdown-content td:not([align]) {
    text-align: left;
}

.markdown-content tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.markdown-content tbody tr:hover td {
    background: rgba(0, 122, 204, 0.07);
    transition: background 0.15s;
}

.markdown-content tbody tr:last-child td {
    border-bottom: none;
}

.markdown-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.markdown-content hr {
    border: none;
    border-top: 2px solid #3e3e42;
    margin: 28px 0;
}

.markdown-content strong {
    color: #f2f3f5;
    font-weight: 700;
}

.markdown-content em {
    font-style: italic;
    color: #cccccc;
}

.markdown-content del {
    text-decoration: line-through;
    color: #72767d;
}

.markdown-content h1[id]::before,
.markdown-content h2[id]::before,
.markdown-content h3[id]::before {
    content: "#";
    color: #007acc;
    margin-right: 8px;
    font-weight: 400;
    opacity: 0.5;
    font-size: 0.85em;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    min-height: 0;
    background: linear-gradient(
        180deg,
        rgba(30, 31, 34, 0.7) 0%,
        rgba(17, 18, 20, 0.95) 100%
    );
}

.chat-topbar {
    position: sticky;
    top: 64px;
    z-index: 5;
    border-bottom: 1px solid #3e3e42;
    background: rgba(30, 31, 34, 0.9);
    backdrop-filter: blur(10px);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.chat-topbar-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-room-header-meta {
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
}

.chat-room-avatar-trigger,
.chat-room-title-trigger {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

.chat-room-title-trigger {
    display: block;
    text-align: left;
}

.chat-room-avatar-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.chat-room-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--user-accent, #007acc) 22%, transparent);
    color: color-mix(in srgb, var(--user-accent, #007acc) 72%, #f2f3f5);
    overflow: hidden;
}

.chat-room-icon-symbol {
    font-size: 15px;
}

.chat-room-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-room-avatar-fallback {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    background: linear-gradient(
        145deg,
        var(--user-accent, #007acc),
        color-mix(in srgb, var(--user-accent, #007acc) 80%, #10131d)
    );
}

.chat-room-avatar-trigger.is-clickable,
.chat-room-title-trigger.is-clickable {
    cursor: pointer;
}

.chat-room-avatar-trigger:disabled,
.chat-room-title-trigger:disabled {
    opacity: 1;
}

.chat-room-avatar-trigger.is-clickable:hover .chat-room-icon,
.chat-room-title-trigger.is-clickable:hover .chat-room-title {
    filter: brightness(1.08);
}

.chat-room-title {
    font: 700 14px/1.2 'JetBrains Mono', monospace;
    color: #f2f3f5;
    white-space: nowrap;
}

.chat-room-subtitle {
    font-size: 11.5px;
    color: #6a6a6a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.chat-connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chat-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.chat-status-dot.is-connected {
    background: #4ade80;
}

.chat-status-dot.is-connecting {
    background: #f59e0b;
}

.chat-status-dot.is-disconnected {
    background: #f87171;
}

.chat-status-dot.is-offline {
    background: #5b5f68;
}

.chat-status-text {
    font: 11.5px 'JetBrains Mono', monospace;
    color: #949ba4;
}

.chat-status-text.is-connected {
    color: #4ade80;
}

.chat-status-text.is-disconnected {
    color: #f87171;
}

.chat-main {
    position: relative;
    flex: 1;
    min-height: 0;
}

.chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background:
        radial-gradient(
            1200px 320px at 50% -10%,
            rgba(0, 122, 204, 0.09),
            transparent 70%
        ),
        radial-gradient(
            700px 240px at 0% 100%,
            rgba(74, 222, 128, 0.06),
            transparent 75%
        ),
        linear-gradient(180deg, rgba(30, 31, 34, 0.2), rgba(17, 18, 20, 0.18));
}

.chat-messages-spacer {
    flex: 1 0 auto;
}

.chat-messages-inner {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100%;
    color: #949ba4;
    padding: 28px;
}

.chat-empty-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 122, 204, 0.12);
    color: #a4acff;
    font-size: 24px;
    margin-bottom: 12px;
}

.chat-empty-state h3 {
    font-size: 16px;
    color: #c4cad2;
    font-weight: 500;
}

.chat-log-row {
    display: flex;
    gap: 12px;
    padding: 5px 14px;
    align-items: baseline;
    border-left: 3px solid transparent;
}

.chat-log-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.chat-log-row.is-own {
    border-left-color: #007acc;
    background: rgba(0, 122, 204, 0.07);
}

.chat-log-time {
    flex: 0 0 52px;
    text-align: right;
    color: #5b5f68;
    font: 10.5px/1.5 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.chat-log-name {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

.chat-log-name[data-user-popup-id] {
    cursor: pointer;
}

.chat-log-name[data-user-popup-id]:hover {
    text-decoration: underline;
}

.chat-log-text {
    min-width: 0;
    color: #cccccc;
    font-size: 13.5px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chat-log-text > :first-child {
    margin-top: 0;
}

.chat-log-text > :last-child {
    margin-bottom: 0;
}

.chat-log-text p {
    margin: 0;
}

.chat-log-text p + p {
    margin-top: 6px;
}

.chat-log-text a {
    color: #7dd3fc;
    text-decoration: none;
    border-bottom: 1px solid rgba(125, 211, 252, 0.5);
}

.chat-log-text a:hover {
    border-bottom-color: currentColor;
}

.chat-log-text code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.92em;
    background: #2d2d30;
    padding: 1px 5px;
    border-radius: 4px;
}

.chat-log-text pre {
    background: #1b1b1d;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    margin: 6px 0;
}

.chat-log-text pre code {
    background: transparent;
    padding: 0;
}

.chat-log-system {
    text-align: center;
    color: #6a8a72;
    font: 11px/1.6 'JetBrains Mono', monospace;
    padding: 3px 14px;
}

.chat-input-container {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 12px 14px;
    border-top: 1px solid #33353b;
    background: #1b1b1d;
}

.chat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #111214;
    border: 1px solid #33353b;
    border-radius: 6px;
    padding: 6px 10px;
}

.chat-input:focus-within {
    border-color: #007acc;
}

.chat-input-prompt {
    flex-shrink: 0;
    color: #3f7fa8;
    font: 14px 'JetBrains Mono', monospace;
    user-select: none;
}

.chat-input-field {
    flex: 1;
    min-width: 0;
    min-height: 24px;
    max-height: 160px;
    resize: none;
    overflow-y: auto;
    border: none;
    background: transparent;
    color: #e4e6eb;
    font: 13.5px/1.5 'JetBrains Mono', monospace;
    outline: none;
    padding: 3px 0;
}

.chat-input-field::placeholder {
    color: #5b5f68;
}

.chat-send-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #007acc;
    border-radius: 5px;
    padding: 5px 12px;
    background: transparent;
    color: #007acc;
    font: 600 12.5px 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-send-btn:hover:not(:disabled) {
    background: rgba(0, 122, 204, 0.12);
}

.chat-send-btn:disabled {
    border-color: #3a3d44;
    color: #3a3d44;
    cursor: not-allowed;
}

.chat-send-key {
    font-size: 11px;
    opacity: 0.8;
}

.chat-scroll-bottom-btn {
    position: absolute;
    right: 14px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #4a4f5a;
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(30, 31, 34, 0.92);
    color: #c4cad2;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    font-size: 12px;
}

.chat-scroll-bottom-btn.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chat-scroll-bottom-btn:hover {
    border-color: var(--user-accent, #007acc);
    color: #f2f3f5;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

@media (max-width: 640px) {
    .chat-topbar {
        padding: 12px;
    }

    .chat-room-title {
        font-size: 13px;
    }

    .chat-room-subtitle {
        font-size: 11px;
    }

    .chat-messages {
        padding: 10px 0;
    }

    .chat-log-row {
        gap: 8px;
        padding: 5px 10px;
    }

    .chat-log-time {
        flex-basis: 44px;
    }

    .chat-send-btn {
        padding: 5px 9px;
    }

    .chat-send-key {
        display: none;
    }
}

.course-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.course-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.course-card-footer {
    margin-top: auto;
}

.course-card-desc {
    line-height: 1.4;
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.course-card-cover-frame {
    flex-shrink: 0;
    height: 180px;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid var(--v1-border);
    overflow: hidden;
    background: var(--v1-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-card-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: var(--v1-bg);
}

.course-card-cover-frame > .course-card-cover-fallback {
    width: 100%;
    height: 100%;
}

.course-card-cover-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--v1-bg-3);
    color: var(--v1-fg-dim);
    font-size: 36px;
}

.course-detail-cover-frame {
    border-radius: 8px;
    border: 1px solid var(--v1-border);
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--v1-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(260px, 50vw, 500px);
}

.course-detail-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    background: var(--v1-bg);
}

.course-detail-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--v1-bg-3);
    color: var(--v1-fg-dim);
    font-size: 48px;
}

@media (max-width: 640px) {
    .course-detail-cover-frame {
        height: clamp(180px, 52vw, 260px);
    }

}

/* UI-классы сайта (.tag, .number и т.п.) совпадают с именами Prism-токенов
   (.token.tag …) и протекают в подсветку кода. Сбрасываем только раскладку
   и оформление внутри блоков кода — цвета темы Prism при этом сохраняются. */
pre[class*="language-"] .token,
code[class*="language-"] .token {
    display: inline !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border-radius: 0 !important;
}

.bot-page {
    min-height: calc(100vh - 64px);
}

.bot-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.16;
    z-index: 0;
}

.bot-glow-left {
    background: var(--v1-accent, #007acc);
    top: -140px;
    left: -140px;
}

.bot-glow-right {
    background: var(--v1-violet, #a78bfa);
    right: -180px;
    top: 260px;
}

.bot-hero {
    border-radius: 20px;
    background: linear-gradient(145deg, #232632 0%, #1f222b 50%, #1a1d25 100%);
    border: 1px solid rgba(0, 122, 204, 0.35);
    margin-bottom: 32px;
}

.bot-hero-content {
    padding: 36px;
}

.bot-title {
    color: #f2f3f5;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.15;
    margin-bottom: 10px;
}

.bot-subheading {
    color: #d6daf4;
    font-size: clamp(18px, 2.3vw, 26px);
    line-height: 1.35;
    margin-bottom: 14px;
}

.bot-subtitle {
    color: #c8ccd2;
    font-size: 17px;
    line-height: 1.65;
    max-width: 860px;
    margin-bottom: 18px;
}

.bot-cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.bot-note {
    font-size: 13px;
    color: #949ba4;
    margin-top: 14px;
}

.bot-section {
    margin-bottom: 28px;
}

.bot-section-title {
    color: #f2f3f5;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: clamp(24px, 3vw, 30px);
    margin-bottom: 14px;
}

.bot-mini-stats {
    margin-top: -6px;
}

.bot-mini-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.bot-mini-stat-card {
    background: var(--v1-bg-2, #252526);
    border: 1px solid var(--v1-border, #3e3e42);
    border-radius: 12px;
    padding: 14px 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bot-mini-stat-card i {
    color: var(--v1-green, #86efac);
    margin-top: 3px;
}

.bot-mini-stat-card p {
    color: #d3d7dd;
    line-height: 1.45;
}

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

.bot-card {
    background: var(--v1-bg-2, #252526);
    border: 1px solid var(--v1-border, #3e3e42);
    border-radius: 14px;
    padding: 18px;
    transition:
        border-color 0.2s ease,
        transform 0.2s ease;
}

.bot-card:hover {
    border-color: var(--v1-accent-2, #569cd6);
    transform: translateY(-2px);
}

.bot-card-title {
    color: #f2f3f5;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
}

.bot-card-text {
    color: #c7cbd1;
    line-height: 1.6;
}

.bot-chip {
    margin-top: 12px;
    display: inline-block;
    font-family: "JetBrains Mono", "Consolas", "Monaco", monospace;
    font-size: 12px;
    color: var(--v1-sky, #7dd3fc);
    background: rgba(125, 211, 252, 0.12);
    border: 1px solid rgba(125, 211, 252, 0.4);
    border-radius: 999px;
    padding: 5px 10px;
}

.bot-list {
    display: grid;
    gap: 10px;
}

.bot-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--v1-border, #3e3e42);
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--v1-bg-2, #252526);
}

.bot-list-item i {
    margin-top: 4px;
    color: var(--v1-green, #86efac);
}

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

.bot-step-card {
    background: var(--v1-bg-2, #252526);
    border: 1px solid var(--v1-border, #3e3e42);
    border-radius: 14px;
    padding: 18px;
    position: relative;
}

.bot-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--v1-accent, #007acc);
    color: #fff;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-weight: 700;
    margin-bottom: 10px;
}

.bot-step-card p {
    line-height: 1.6;
}

.bot-faq-list {
    display: grid;
    gap: 10px;
}

.bot-faq-item {
    background: var(--v1-bg-2, #252526);
    border: 1px solid var(--v1-border, #3e3e42);
    border-radius: 12px;
    overflow: hidden;
}

.bot-faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    color: #f2f3f5;
    font-weight: 600;
    position: relative;
}

.bot-faq-item summary::-webkit-details-marker {
    display: none;
}

.bot-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--v1-accent-2, #569cd6);
    font-size: 20px;
    line-height: 1;
}

.bot-faq-item[open] summary::after {
    content: "−";
}

.bot-faq-item p {
    padding: 0 16px 14px;
    color: #c8ccd2;
    line-height: 1.6;
}

.bot-bottom-cta {
    margin-top: 12px;
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(
        150deg,
        rgba(0, 122, 204, 0.19),
        rgba(167, 139, 250, 0.14)
    );
    border: 1px solid rgba(0, 122, 204, 0.35);
}

.bot-bottom-cta h2 {
    color: #f2f3f5;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: clamp(24px, 3vw, 32px);
    margin-bottom: 14px;
}

@media (max-width: 900px) {
    .bot-mini-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bot-grid {
        grid-template-columns: 1fr;
    }

    .bot-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .bot-hero-content {
        padding: 22px;
    }

    .bot-mini-stats-grid {
        grid-template-columns: 1fr;
    }

    .bot-subtitle {
        font-size: 15px;
    }
}

.chat-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    min-height: 0;
    background: linear-gradient(
        180deg,
        rgba(30, 31, 34, 0.7) 0%,
        rgba(17, 18, 20, 0.96) 100%
    );
}

.chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    min-height: 0;
    flex: 1;
}

.chat-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-sidebar {
    border-left: 1px solid #3e3e42;
    background: linear-gradient(
        180deg,
        rgba(30, 31, 34, 0.98),
        rgba(24, 25, 28, 0.98)
    );
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-sidebar-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 12px 4px;
    padding: 11px 12px;
    background: #111214;
    border: 1px solid #33353b;
    border-radius: 6px;
}

.chat-sidebar-search-icon {
    flex-shrink: 0;
    color: #6a6a6a;
    font-size: 12px;
}

.chat-sidebar-search-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #e4e6eb;
    font-size: 13px;
}

.chat-sidebar-search-input::placeholder {
    color: #6a6a6a;
}

.dm-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    border: 1px solid #3e3e42;
    border-radius: 8px;
    background: #22242a;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    max-height: 280px;
    overflow-y: auto;
    z-index: 12;
}

.dm-search-results.hidden {
    display: none;
}

.dm-search-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #32343a;
    color: #d8dbe0;
    cursor: pointer;
    text-align: left;
}

.dm-search-item:last-child {
    border-bottom: none;
}

.dm-search-item:hover {
    background: #2b2d33;
}

.dm-search-item.is-disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.dm-search-name {
    font-weight: 600;
}

.dm-search-meta {
    color: #949ba4;
    font-size: 12px;
}

.dm-search-badge {
    margin-left: auto;
    background: rgba(248, 113, 113, 0.2);
    color: #f28c8f;
    border: 1px solid rgba(248, 113, 113, 0.4);
    border-radius: 999px;
    font-size: 11px;
    padding: 2px 7px;
}

.dm-search-empty {
    padding: 11px;
    color: #8f969f;
    text-align: center;
    font-size: 13px;
}

.chat-sidebar-scroll {
    overflow-y: auto;
    min-height: 0;
    flex: 1;
    padding-bottom: 10px;
}

.chat-sidebar-section-h {
    font: 700 10.5px/1 'JetBrains Mono', monospace;
    letter-spacing: 0.1em;
    color: #6a6a6a;
    text-transform: uppercase;
    padding: 14px 14px 6px;
}

.chat-sidebar-section-personal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-section-add {
    width: 26px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #3e3e42;
    border-radius: 5px;
    background: transparent;
    color: #969696;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-section-add:hover {
    border-color: #007acc;
    color: #57b8ec;
}

.chat-sidebar-divider {
    height: 1px;
    background: #2c2d31;
    margin: 8px 14px;
}

/* Канал (общий чат) */
.chat-channel-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.chat-channel-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.chat-channel-row.is-active {
    background: rgba(0, 122, 204, 0.16);
    border-left-color: #007acc;
}

.chat-channel-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #007acc2e;
    color: #57b8ec;
    font-weight: 700;
    font-size: 14px;
}

.chat-channel-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chat-channel-name {
    color: #e4e6eb;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-channel-sub {
    color: #75798a;
    font-size: 11px;
}

.chat-channel-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #6a6a6a;
}

.chat-channel-dot.is-connected {
    background: #86efac;
}

.chat-channel-dot.is-connecting {
    background: #f59e0b;
}

.chat-channel-dot.is-disconnected {
    background: #f87171;
}

/* Компактные строки личных диалогов */
.dm-row-compact {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.dm-row-compact:hover {
    background: rgba(255, 255, 255, 0.03);
}

.dm-row-compact.is-active {
    background: rgba(0, 122, 204, 0.16);
    border-left-color: #007acc;
}

.dm-row-avatar {
    position: relative;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dm-row-avatar[data-user-popup-id] {
    cursor: pointer;
}

.dm-item-avatar-image,
.dm-item-avatar-fallback {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    object-fit: cover;
    background: linear-gradient(
        145deg,
        var(--user-accent, #007acc),
        color-mix(in srgb, var(--user-accent, #007acc) 80%, #10131d)
    );
}

.dm-row-presence {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid #1e1e1e;
}

.dm-row-presence.is-online {
    background: #86efac;
}

.dm-row-presence.is-offline {
    background: #5b5f68;
}

.dm-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dm-row-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.dm-row-name {
    color: #cfd3d8;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-row-compact.has-unread .dm-row-name {
    color: #fff;
    font-weight: 700;
}

.dm-row-time {
    flex-shrink: 0;
    color: #66697a;
    font: 10px 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.dm-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dm-row-preview {
    flex: 1;
    min-width: 0;
    color: #8b8f96;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-row-compact.has-unread .dm-row-preview {
    color: #c7cbd1;
}

.dm-row-badge {
    flex-shrink: 0;
    min-width: 16px;
    text-align: center;
    background: #007acc;
    color: #fff;
    font: 700 9px 'JetBrains Mono', monospace;
    border-radius: 999px;
    padding: 2px 6px;
}

.chat-sidebar-empty {
    color: #8f969f;
    text-align: center;
    border: 1px dashed #3e3e42;
    border-radius: 10px;
    padding: 18px 12px;
    margin: 4px 14px 0;
}

.chat-sidebar-empty i {
    font-size: 22px;
    margin-bottom: 8px;
    color: #a2a8ff;
}

.profile-page-grid {
    display: grid;
    gap: 14px;
}

.profile-main-card,
.profile-info-card,
.profile-settings-card {
    background: var(--v1-bg-2);
    border: 1px solid var(--v1-border);
    border-radius: 8px;
}

.profile-main-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
}

.profile-avatar-wrap {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid color-mix(in srgb, var(--user-accent, #007acc) 55%, transparent);
}

.profile-avatar-image,
.profile-avatar-fallback {
    width: 100%;
    height: 100%;
}

.profile-avatar-image {
    object-fit: cover;
}

.profile-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--user-accent, #007acc) 92%, #ffffff),
        color-mix(in srgb, var(--user-accent, #007acc) 78%, #111526)
    );
    color: #fff;
    font-size: 34px;
    font-weight: 700;
}

.profile-main-meta {
    min-width: 0;
}

.profile-display-name {
    color: var(--v1-fg);
    font-size: 26px;
    line-height: 1.1;
}

.profile-username {
    color: var(--v1-fg-dim);
    margin-top: 3px;
}

.profile-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.profile-info-card {
    padding: 16px;
}

.profile-card-title {
    color: var(--v1-fg);
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 700;
}

.profile-bio {
    color: var(--v1-fg-dim);
    line-height: 1.6;
    white-space: pre-wrap;
}

.profile-bio.is-placeholder {
    color: var(--v1-fg-dim);
}

.profile-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.profile-meta-label {
    color: var(--v1-fg-dim);
    font-size: 13px;
}

.profile-meta-value {
    color: var(--v1-fg);
    font-weight: 600;
}

.profile-settings-card {
    padding: 18px;
}

.settings-avatar-section {
    border: 1px solid var(--v1-border);
    border-radius: 8px;
    padding: 12px;
    background: var(--v1-bg);
}

.settings-avatar-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.settings-avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--user-accent, #007acc) 55%, transparent);
    background: var(--v1-bg-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.settings-avatar-preview:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.settings-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-avatar-fallback {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(
        145deg,
        var(--user-accent, #007acc),
        color-mix(in srgb, var(--user-accent, #007acc) 80%, #13192a)
    );
}

.settings-avatar-actions {
    min-width: 0;
}

.settings-avatar-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-avatar-hint {
    margin-top: 8px;
    color: var(--v1-fg-dim);
    font-size: 12px;
}

.user-popup {
    position: fixed;
    width: min(320px, calc(100vw - 20px));
    background: var(--v1-bg-2);
    border: 1px solid var(--v1-border);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
    padding: 12px;
    z-index: 120;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.user-popup.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.user-popup-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-popup-avatar-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--user-accent, #007acc) 16%, transparent);
}

.user-popup-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-popup-avatar-fallback {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(
        145deg,
        var(--user-accent, #007acc),
        color-mix(in srgb, var(--user-accent, #007acc) 80%, #151a2b)
    );
}

.user-popup-meta {
    min-width: 0;
}

.user-popup-display-name {
    color: var(--v1-fg);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-popup-username {
    margin-top: 2px;
    color: var(--v1-fg-dim);
    font-size: 13px;
}

.user-popup-bio {
    margin-top: 10px;
    color: var(--v1-fg-dim);
    font-size: 13px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.user-popup-message-btn {
    margin-top: 10px;
    width: 100%;
}

.user-popup-loading,
.user-popup-error {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v1-fg-dim);
}

.user-popup-error {
    text-align: center;
    font-size: 13px;
}

@media (max-width: 640px) {
    .settings-avatar-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-avatar-preview {
        width: 82px;
        height: 82px;
    }
}

@media (max-width: 1180px) {
    .chat-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

@media (max-width: 980px) {
    .chat-layout {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .chat-sidebar {
        border-left: none;
        border-top: 1px solid #3e3e42;
        min-height: 280px;
    }

    .profile-main-card {
        flex-direction: column;
        align-items: flex-start;
    }
}


