:root {
    --page-bg: #b4cae8;
    --page-bg-mid: #c9daf0;
    --surface: #f4f8fd;
    --elevated: #ffffff;
    --border: rgba(15, 35, 60, 0.16);
    --accent: #0d5eb3;
    --accent-hover: #0a4d94;
    --text: #0f1a2c;
    --text-muted: #2c3d52;
    --focus: #0a4d94;
    --radius: 14px;
    --radius-lg: 18px;
    --shadow: 0 6px 28px rgba(15, 35, 60, 0.12);
    --disclaimer-bg: rgba(255, 255, 255, 0.55);
    --disclaimer-border: rgba(15, 35, 60, 0.12);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--page-bg);
    background-image:
        linear-gradient(165deg, var(--page-bg-mid) 0%, var(--page-bg) 45%, #a8c0e0 100%),
        radial-gradient(ellipse 100% 70% at 50% 0%, rgba(255, 255, 255, 0.45), transparent 55%);
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 760px;
    margin: 0 auto;
    padding: 1.25rem 1.125rem 2.25rem;
}

.disclaimer--footer {
    margin: 1.1rem auto 0;
    max-width: 38rem;
    padding: 0.9rem 1.1rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-muted);
    text-align: center;
    text-wrap: balance;
    background: var(--disclaimer-bg);
    border: 1px solid var(--disclaimer-border);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.footer-ai {
    margin: 0.75rem auto 0;
    max-width: 38rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: center;
    text-wrap: balance;
    background: var(--disclaimer-bg);
    border: 1px solid var(--disclaimer-border);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.header {
    padding: 0.75rem 0 1.25rem;
}

.header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.title-block h1 {
    margin: 0 0 0.45rem;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.header-top .title-block {
    min-width: 0;
    flex: 1;
}

.title-block p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.lang-switch {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.lang-switch__label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    color: rgba(44, 61, 82, 0.65);
    cursor: pointer;
}

.lang-switch__label:hover {
    color: var(--text-muted);
}

.lang-switch__label:focus-within,
.lang-switch__label:focus-visible {
    outline: none;
}

.lang-switch:focus-within .lang-switch__label {
    color: var(--text-muted);
}

.lang-select {
    min-width: 7.5rem;
    padding: 0.2rem 1.1rem 0.2rem 0.35rem;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(44, 61, 82, 0.85);
    background-color: rgba(255, 255, 255, 0.22);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6b7d' fill-opacity='0.75' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.35rem center;
    background-size: 8px 8px;
    border: 1px solid rgba(15, 35, 60, 0.1);
    border-radius: 8px;
    cursor: pointer;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.lang-select:hover {
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.38);
    border-color: rgba(15, 35, 60, 0.14);
}

.lang-select:focus {
    outline: none;
    border-color: rgba(13, 94, 179, 0.28);
    box-shadow: 0 0 0 2px rgba(13, 94, 179, 0.12);
}

.lang-select:focus-visible {
    outline: 2px solid rgba(10, 77, 148, 0.45);
    outline-offset: 1px;
}

.search-wrap {
    position: relative;
}

.search-wrap__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--accent);
    pointer-events: none;
    opacity: 0.9;
}

#bot-search {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.0625rem;
    font-family: inherit;
    color: var(--text);
    background: var(--elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow);
}

#bot-search::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

#bot-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(13, 94, 179, 0.22);
}

.section-label {
    margin: 1.65rem 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.bot-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.bot-list > li {
    width: 100%;
    min-width: 0;
}

.bot-avatar-link {
    display: block;
    flex-shrink: 0;
    border-radius: 50%;
    outline-offset: 3px;
    transition: opacity 0.15s, box-shadow 0.15s;
}

.bot-avatar-link:hover {
    opacity: 0.92;
}

.bot-avatar-link:focus-visible {
    outline: 3px solid var(--focus);
}

.bot-avatar-wrap {
    position: relative;
    width: 64px;
    height: 64px;
}

.bot-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.15rem;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
    padding: 1.35rem 1.3rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: border-color 0.15s;
}

.bot-card:hover {
    border-color: rgba(13, 94, 179, 0.35);
}

.bot-card[hidden] {
    display: none !important;
}

.bot-avatar-wrap .bot-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(145deg, var(--accent), #2563a8);
}

.bot-avatar-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent), #0a4d94);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.bot-avatar-fallback.is-visible {
    display: flex;
}

.bot-meta h2 {
    margin: 0 0 0.2rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.bot-title-link {
    color: inherit;
    text-decoration: none;
    border-radius: 4px;
    outline-offset: 2px;
}

.bot-title-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.bot-title-link:focus-visible {
    outline: 3px solid var(--focus);
}

.bot-meta .handle {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
}

.bot-desc {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
    max-width: none;
}

.handle-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
    outline-offset: 2px;
}

.handle-link .fa-telegram {
    font-size: 1.05em;
    opacity: 0.9;
}

.handle-link:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.handle-link:focus-visible {
    outline: 3px solid var(--focus);
}

.policy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.policy-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 999px;
    border: 2px solid var(--border);
    color: var(--text);
    background: var(--elevated);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.policy-actions a:hover {
    background: rgba(13, 94, 179, 0.1);
    border-color: rgba(13, 94, 179, 0.35);
}

.policy-actions a.primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
}

.policy-actions a.primary:hover {
    background: var(--accent-hover);
}

.empty-state {
    margin-top: 1.1rem;
    padding: 1.35rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.empty-state[hidden] {
    display: none !important;
}

.page--404 {
    justify-content: center;
}

.error-404 {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.error-404__title {
    margin: 0 0 0.75rem;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--accent);
    line-height: 1.1;
}

.error-404__lead {
    margin: 0 0 0.5rem;
    font-size: 1.0625rem;
    color: var(--text);
    line-height: 1.5;
}

.error-404__sub {
    margin: 0 0 1.35rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.error-404__actions {
    justify-content: center;
    margin: 0;
}

.footer {
    margin-top: auto;
    padding-top: 2.25rem;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.footer__main {
    margin: 0 0 0.25rem;
}

.footer a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.footer a:hover {
    color: var(--accent-hover);
}

@media (min-width: 480px) {
    .page {
        padding: 1.65rem 1.5rem 2.65rem;
    }

    .title-block h1 {
        font-size: 1.75rem;
    }

    .bot-card {
        padding: 1.5rem 1.45rem;
        gap: 1.25rem;
    }

    .bot-avatar-wrap {
        width: 72px;
        height: 72px;
    }

    .bot-meta h2 {
        font-size: 1.3rem;
    }

    .bot-desc {
        font-size: 0.875rem;
    }
}

@media (min-width: 640px) {
    .page {
        max-width: 800px;
    }

    .bot-list {
        gap: 1rem;
    }
}

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