/* Цветовая система, размеры и шрифты проекта */
:root {
    --bg: #0c1220;
    --bg-soft: #131c2f;
    --panel: rgba(14, 22, 38, 0.82);
    --panel-strong: #111827;
    --card: #f4f0e8;
    --card-dark: #1b2438;
    --text: #eef2ff;
    --text-soft: #b5c0d8;
    --text-dark: #101728;
    --line: rgba(173, 190, 255, 0.18);
    --blue: #2f80ed;
    --blue-strong: #1f5fbf;
    --sand: #dfb466;
    --mint: #8ed1b4;
    --radius-xl: 16px;
    --radius-lg: 12px;
    --radius-md: 10px;
    --content-width: clamp(960px, 92vw, 1320px);
    --font-main: "Segoe UI", Arial, Helvetica, sans-serif;
    --font-accent: "Segoe UI", Arial, Helvetica, sans-serif;
}

/* Базовый сброс и универсальная геометрия */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    font-family: var(--font-main);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
.button:focus-visible,
.back-to-top:focus-visible,
.nav-links a:focus-visible,
.text-link:focus-visible {
    outline: 2px solid rgba(159, 203, 255, 0.95);
    outline-offset: 3px;
}

img {
    display: block;
    max-width: 100%;
}

/* Общая верхняя область страниц и контейнеры контента */
.hero,
.subpage-hero {
    padding: clamp(10px, 2vw, 18px) clamp(14px, 2.4vw, 18px) clamp(6px, 1.5vw, 12px);
}

.topbar,
.hero-layout,
.page,
.subpage-heading,
.legal-page {
    width: min(100%, var(--content-width));
    margin: 0 auto;
}

.topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    padding: clamp(14px, 2.2vw, 20px) clamp(14px, 2vw, 18px);
    background:
        linear-gradient(180deg, rgba(19, 28, 47, 0.94), rgba(12, 18, 32, 0.92)),
        rgba(12, 18, 32, 0.88);
    border: 1px solid rgba(173, 190, 255, 0.12);
    border-radius: 28px;
    backdrop-filter: blur(14px);
}

.topbar > * {
    min-width: 0;
}

/* Бренд и верхняя навигация */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-accent);
    font-size: 1.65rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #ffffff;
    line-height: 1;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 0.88;
}

.brand-copy span {
    display: block;
}

.brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 0;
    border: none;
    object-fit: contain;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
    color: rgba(230, 234, 247, 0.74);
    font-size: 0.98rem;
    min-width: 0;
    width: 100%;
}

.nav-links::-webkit-scrollbar {
    height: 0;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 2px;
    white-space: nowrap;
}

.nav-links a:hover,
.text-link:hover {
    color: #ffffff;
}

.nav-featured {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 8px;
    border-radius: 999px;
    color: #8fb6ff;
    font-family: var(--font-accent);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.nav-featured:hover {
    color: #b6cdfc;
}

/* Hero-блок главной страницы */
.hero-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(18px, 3vw, 32px);
    align-items: center;
    padding-top: clamp(12px, 2vw, 18px);
}

.feature-columns-grid {
    align-items: stretch;
}

.hero-copy {
    min-width: 0;
}

@media (min-width: 981px) {
    .hero-copy.hero-copy-scroll {
        overflow-y: auto;
        padding-right: 8px;
    }
}

/* Заголовки, подписи и основной текст */
.eyebrow,
.card-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--sand);
}

.hero-copy h1,
.subpage-heading h1 {
    margin: 10px 0 14px;
    font-family: var(--font-main);
    font-weight: 400;
    font-size: clamp(1.9rem, 4.8vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.hero-text,
.section-heading p,
.contact-card p,
.legal-card p,
.legal-list {
    color: var(--text-soft);
    line-height: 1.65;
}

.hero-actions,
.security-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    margin-top: clamp(18px, 3vw, 28px);
    align-items: center;
}

.hero-actions-secondary {
    margin-top: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 10px;
    font-weight: 400;
    transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

/* Уважение к системной настройке снижения анимаций */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.button-download {
    min-width: 0;
    border: 1px solid var(--line);
    background: linear-gradient(145deg, rgba(74, 150, 241, 0.16), rgba(27, 28, 82, 0.96));
    color: var(--text);
    gap: 8px;
}

.button-download img {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    object-fit: contain;
}

.button-download span {
    line-height: 1;
}

.button-download:hover {
    background: linear-gradient(145deg, rgba(74, 150, 241, 0.22), rgba(38, 40, 99, 0.98));
}

.hero-visual {
    position: relative;
}

.hero-banner {
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
}

.hero-stack {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.hero-stack a {
    display: block;
}

.hero-stack img {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    cursor: zoom-in;
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 8, 16, 0.78);
    backdrop-filter: blur(16px);
}

.image-modal[hidden] {
    display: none;
}

.image-modal-content {
    position: relative;
    margin: 0;
    max-width: min(96vw, 1400px);
    max-height: 90vh;
    padding: 14px;
    border-radius: 22px;
    background: rgba(13, 20, 34, 0.95);
    border: 1px solid rgba(173, 190, 255, 0.18);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.image-modal-image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 84px);
    object-fit: contain;
    border-radius: 14px;
}

.image-modal-caption {
    margin: 10px 4px 2px;
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: center;
}

.image-modal-nav {
    position: absolute;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.92);
    color: #ffffff;
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
}

.image-modal-nav:hover {
    background: rgba(34, 45, 68, 0.98);
}

.image-modal-nav-prev {
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
}

.image-modal-nav-next {
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 640px) {
    .image-modal-content {
        padding: 10px;
    }

    .image-modal-image {
        max-height: calc(90vh - 72px);
    }

    .image-modal-nav {
        width: 38px;
        height: 38px;
        font-size: 1.7rem;
    }

    .image-modal-nav-prev {
        left: 8px;
    }

    .image-modal-nav-next {
        right: 8px;
    }
}

.page {
    padding: 0 0 48px;
}

.page > :first-child {
    margin-top: 0;
}

.section {
    margin-top: 28px;
    width: 100%;
    padding: 22px 18px 24px;
    background:
        linear-gradient(180deg, rgba(19, 28, 47, 0.94), rgba(12, 18, 32, 0.92)),
        rgba(12, 18, 32, 0.88);
    border: 1px solid rgba(173, 190, 255, 0.12);
    border-radius: 28px;
    backdrop-filter: blur(14px);
}

.feature-section {
    padding: 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
}

.feature-section .section-heading {
    display: block;
    margin-bottom: 16px;
}

.feature-columns-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.documents-section {
    padding-left: 18px;
    padding-right: 18px;
}

.feature-column {
    width: 100%;
    min-height: 0;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(111, 177, 255, 0.2);
    background: rgba(15, 23, 39, 0.74);
}

.feature-column h2 {
    margin: 0 0 18px;
    font-family: var(--font-accent);
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1.05;
    color: var(--sand);
    letter-spacing: -0.02em;
    text-transform: none;
}

.feature-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
    color: var(--text-soft);
    background: transparent;
}

.feature-list li {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 10px;
    align-items: start;
}

.feature-list li::before {
    content: "•";
    color: var(--mint);
    line-height: 1.65;
}

.contact-card,
.legal-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
}

.section-heading {
    max-width: 100%;
    margin-bottom: 22px;
}

.section-heading .eyebrow {
    display: block;
    margin: 0 0 10px;
    font-family: var(--font-accent);
    font-size: 1.4rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.section-heading h2 {
    display: none;
}

.section-heading h2,
.legal-card h2 {
    margin: 10px 0 10px;
    font-family: var(--font-accent);
}

.legal-list {
    margin: 14px 0 0;
    padding-left: 18px;
}

.legal-list li {
    margin-top: 8px;
}

.feedback-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.documents-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.feedback-page {
    width: min(100%, var(--content-width));
    margin: 0 auto;
    display: grid;
    gap: 18px;
    padding: 0 0 56px;
}

.feedback-panel {
    padding: 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
}

.feedback-panel .section-heading {
    display: block;
    margin-bottom: 16px;
}

.feedback-panel .section-heading h2 {
    display: block;
    margin: 0;
    font-family: var(--font-accent);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--sand);
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.feedback-section .section-heading {
    max-width: 100%;
    text-align: left;
    margin-bottom: 18px;
}

.feedback-section .feedback-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: stretch;
}

.document-card {
    width: 100%;
    min-height: 88px;
    padding: 14px 16px;
    display: flex;
    border-radius: 18px;
    border: 1px solid rgba(111, 177, 255, 0.18);
    background: rgba(15, 23, 39, 0.6);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.document-card:hover {
    transform: translateY(-1px);
    border-color: rgba(111, 177, 255, 0.32);
    background: rgba(15, 23, 39, 0.72);
}

.text-link.document-title {
    min-height: 100%;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text);
    line-height: 1.25;
}

.text-link.document-title span {
    display: grid;
    gap: 2px;
}

.text-link.document-title strong {
    font-family: var(--font-accent);
    font-size: 1rem;
    font-weight: 400;
}

.text-link.document-title small {
    max-width: 100%;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 400;
    line-height: 1.35;
}

.text-link.document-title:hover {
    color: #ffffff;
}

.text-link.document-title::after {
    content: "";
    flex: 0 0 auto;
    align-self: center;
    margin-left: auto;
    color: #9fcbff;
    width: 0.92em;
    height: 0.92em;
    background-color: currentColor;
    transform: rotate(-45deg);
    transform-origin: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h13'/%3E%3Cpath d='M12 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h13'/%3E%3Cpath d='M12 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.68;
}

.text-link.document-title:hover::after {
    transform: rotate(0deg);
    opacity: 0.92;
}

.contact-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.contact-list li {
    padding: 0;
    display: block;
    align-content: start;
    color: var(--text-soft);
    line-height: 1.45;
}

.contact-list span {
    color: var(--text-soft);
}

.contact-email {
    color: var(--sand);
    font-family: var(--font-main);
    font-size: 1.02rem;
    font-weight: 500;
    white-space: nowrap;
}

.contact-email:hover {
    color: #ffffff;
}

.text-link {
    color: var(--sand);
    font-weight: 400;
}

.site-footer {
    width: min(100%, var(--content-width));
    margin: 0 auto;
    padding: 24px 20px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--line);
    color: var(--text-soft);
}

.site-footer strong {
    display: block;
    color: var(--text);
    font-family: var(--font-accent);
}

.site-footer p {
    margin: 6px 0 0;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 400;
}

.site-footer-links a:hover {
    color: #ffffff;
}

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(10, 16, 28, 0.82);
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
    z-index: 40;
}

.back-to-top:hover {
    background: rgba(47, 128, 237, 0.3);
}

.subpage-heading {
    padding: 14px 0 0;
}

.legal-page {
    display: grid;
    gap: 18px;
    padding: 0 0 56px;
}

.legal-card {
    padding: 24px;
    background: rgba(11, 18, 32, 0.7);
}

.policy-markdown {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.policy-markdown pre,
.policy-markdown code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.schedule-hero {
    padding-bottom: 0;
}

.schedule-hero-text {
    max-width: 100%;
}

.schedule-page {
    width: min(100%, var(--content-width));
    margin: 0 auto;
    display: grid;
    gap: 6px;
    padding: 0 0 56px;
}

.schedule-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.schedule-chip {
    min-width: 180px;
    padding: 10px 12px;
    display: grid;
    gap: 4px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(15, 23, 39, 0.88);
}

.schedule-chip-label {
    color: var(--text-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.schedule-chip strong {
    font-size: 1rem;
}

.schedule-panel {
    display: grid;
    gap: 10px;
}

.schedule-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
}

.schedule-search {
    flex: 1 1 320px;
    display: grid;
    gap: 8px;
    color: var(--text-soft);
    font-weight: 400;
}

.schedule-search span {
    color: var(--text);
}

.schedule-search input {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(9, 14, 24, 0.8);
    color: var(--text);
    font: inherit;
    outline: none;
}

.schedule-search input::placeholder {
    color: rgba(181, 192, 216, 0.7);
}

.schedule-search input:focus {
    border-color: rgba(111, 177, 255, 0.58);
    outline: 2px solid rgba(74, 150, 241, 0.22);
    outline-offset: 1px;
}

.schedule-source-note,
.schedule-status-message {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.schedule-results {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: start;
}

@media (min-width: 1280px) {
    .schedule-results {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.schedule-route-card {
    display: block;
    padding: clamp(14px, 2vw, 16px);
    border-radius: 16px;
    border: 1px solid rgba(111, 177, 255, 0.24);
    background:
        linear-gradient(145deg, rgba(74, 150, 241, 0.16), rgba(15, 23, 39, 0.92) 56%),
        rgba(15, 23, 39, 0.92);
    color: inherit;
    text-decoration: none;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
    cursor: pointer;
}

.schedule-route-card--summary {
    min-height: 54px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.schedule-route-summary-title {
    margin: 0;
    font-family: var(--font-accent);
    font-size: 1.28rem;
    line-height: 1.1;
    color: var(--text);
    letter-spacing: 0.01em;
}

.schedule-route-card--detail {
    min-height: auto;
    margin-top: 0;
}

.schedule-route-card--detail .schedule-route-badge {
    margin: 0 auto;
    font-size: clamp(1.2rem, 2.1vw, 1.4rem);
    min-height: 40px;
    font-weight: 700;
}

.schedule-route-card:hover,
.schedule-route-card:focus-visible {
    outline: none;
}

.schedule-route-header {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.schedule-route-header > div:first-child {
    display: flex;
    justify-content: center;
    padding-bottom: 4px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(173, 190, 255, 0.12);
}

.schedule-route-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    width: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: #e6eeff;
    font-size: 1.12rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1;
    text-align: center;
}

.schedule-route-meta {
    display: grid;
    gap: 5px;
    align-content: start;
    justify-items: start;
    width: 100%;
    color: var(--text-soft);
    font-size: clamp(0.85rem, 1.5vw, 0.94rem);
    text-align: left;
}

.schedule-route-description {
    margin: 2px 0 0;
    color: rgba(230, 238, 255, 0.78);
    font-size: clamp(0.88rem, 1.5vw, 0.95rem);
    line-height: 1.5;
}

.releases-page {
    width: min(100%, var(--content-width));
    margin: 0 auto;
    display: grid;
    gap: 18px;
    padding: 0 0 56px;
}

.releases-panel {
    display: grid;
    gap: 16px;
}

.releases-summary {
    margin-top: 16px;
}

.releases-hero-text {
    max-width: 920px;
}

.releases-list {
    display: grid;
    gap: 16px;
}

.release-card {
    display: grid;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(111, 177, 255, 0.18);
    background: rgba(15, 23, 39, 0.74);
}

.release-card-header {
    display: grid;
    gap: 10px;
}

.release-card-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.release-card-title-row h2 {
    margin: 0;
    font-family: var(--font-accent);
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    line-height: 1.1;
    flex: 0 1 auto;
}

.release-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.release-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(111, 177, 255, 0.18);
    background: rgba(12, 19, 33, 0.78);
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1;
}

.release-badge--accent {
    color: #ffffff;
    border-color: rgba(142, 209, 180, 0.28);
    background: rgba(19, 46, 38, 0.8);
}

.release-badge--muted {
    color: rgba(230, 234, 247, 0.68);
}

.release-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.release-meta a {
    color: #9fcbff;
}

.release-body {
    color: var(--text-soft);
    line-height: 1.6;
}

.release-markdown h1,
.release-markdown h2,
.release-markdown h3 {
    margin: 0 0 10px;
    color: var(--text);
    font-family: var(--font-accent);
    line-height: 1.12;
}

.release-markdown h1 {
    font-size: clamp(1.3rem, 2vw, 1.65rem);
}

.release-markdown h2 {
    font-size: clamp(1.15rem, 1.8vw, 1.35rem);
}

.release-markdown h3 {
    font-size: clamp(1.02rem, 1.6vw, 1.2rem);
}

.release-markdown p {
    margin: 0 0 10px;
}

.release-markdown p:last-child,
.release-markdown h1:last-child,
.release-markdown h2:last-child,
.release-markdown h3:last-child,
.release-markdown ul:last-child {
    margin-bottom: 0;
}

.release-markdown ul {
    margin: 0 0 10px;
    padding-left: 20px;
}

.release-markdown li {
    margin-top: 6px;
}

.release-markdown code {
    padding: 0 6px;
    border-radius: 8px;
    background: rgba(12, 19, 33, 0.9);
    color: #dbe7ff;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
}

.release-markdown a {
    color: #9fcbff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.release-assets {
    display: grid;
    gap: 10px;
}

.release-assets strong {
    font-family: var(--font-accent);
    font-size: 1rem;
    font-weight: 400;
}

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

.release-asset-link {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(111, 177, 255, 0.18);
    background: rgba(12, 19, 33, 0.72);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.release-asset-link:hover {
    transform: translateY(-1px);
    border-color: rgba(111, 177, 255, 0.3);
    background: rgba(18, 28, 47, 0.9);
}

.release-asset-name {
    color: var(--text);
    font-size: 0.96rem;
}

.release-asset-meta {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.release-empty-assets,
.release-empty-state {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px dashed rgba(111, 177, 255, 0.18);
    color: var(--text-soft);
    line-height: 1.5;
}

.release-empty-state {
    background: rgba(15, 23, 39, 0.5);
}

.release-empty-state strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-family: var(--font-accent);
}

.release-empty-state p {
    margin: 0;
}

.release-empty-state-error {
    border-style: solid;
    border-color: rgba(255, 145, 145, 0.28);
}

.release-error-detail {
    margin-top: 8px;
    font-size: 0.88rem;
    color: rgba(230, 234, 247, 0.72);
    word-break: break-word;
}

.schedule-route-body {
    padding-top: 2px;
}

.schedule-departures {
    width: 100%;
    display: grid;
    gap: clamp(10px, 1.6vw, 12px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.schedule-departure-group {
    width: 100%;
    justify-self: stretch;
    padding: 20px 20px;
    border-radius: 14px;
    border: 1px solid rgba(173, 190, 255, 0.16);
    background: transparent;
}

.schedule-departure-header {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
    text-align: center;
}

.schedule-departure-header strong {
    font-family: var(--font-accent);
    font-size: 1.18rem;
}

.schedule-entries {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 14px;
    justify-items: center;
}

.schedule-entry {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: center;
    justify-items: center;
    width: fit-content;
    max-width: 100%;
    justify-self: center;
    padding: 8px 14px;
    border-radius: 12px;
    background: none;
    border: 0;
    text-align: center;
    cursor: pointer;
}

.schedule-departure-group {
    cursor: default;
}

.schedule-entry--next {
    background: none;
    border-color: transparent;
}

.schedule-entry-time {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-family: var(--font-accent);
    font-size: 1.24rem;
    color: #ffffff;
    line-height: 1.1;
    text-align: center;
}

.schedule-entry--next .schedule-entry-time,
.schedule-entry--next .schedule-entry-body p,
.schedule-entry--next .schedule-entry-body strong {
    color: #fff7d1;
}

.schedule-entry-body {
    display: grid;
    gap: 8px;
    justify-items: center;
}

.schedule-entry-body strong {
    font-size: 1.06rem;
}

.schedule-entry-body p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.5;
}

.schedule-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.schedule-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(142, 209, 180, 0.14);
    border: 1px solid rgba(142, 209, 180, 0.28);
    color: #dff7ea;
    font-size: 0.88rem;
    font-weight: 400;
}

.schedule-empty-row,
.schedule-empty-state {
    padding: 18px;
    border-radius: 12px;
    border: 1px dashed rgba(173, 190, 255, 0.25);
    color: var(--text-soft);
    background: rgba(6, 12, 22, 0.35);
}

.schedule-empty-state strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-family: var(--font-accent);
}

.schedule-empty-state p {
    margin: 0;
    line-height: 1.6;
}

.schedule-empty-state-error {
    border-color: rgba(255, 130, 130, 0.3);
}

.schedule-error-detail {
    margin-top: 10px !important;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.85rem;
    word-break: break-word;
}

/* Адаптив для планшетов и маленьких экранов */
@media (max-width: 980px) {
    .hero-layout,
    .feature-columns-grid,
    .documents-grid,
    .feedback-grid,
    .contact-list,
    .releases-list {
        grid-template-columns: 1fr;
    }

    .topbar,
    .site-footer {
        border-radius: 14px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .topbar {
        gap: 12px;
    }

    .brand {
        min-width: 0;
        max-width: 100%;
    }

    .nav-links {
        width: 100%;
        order: 3;
        justify-content: flex-start;
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 0;
        gap: 10px 16px;
        font-size: 0.94rem;
    }

    .nav-links a {
        min-height: 34px;
    }

    .nav-featured {
        min-height: 36px;
        font-size: 1.18rem;
    }

    .hero-layout {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        order: 2;
    }

    .hero-copy {
        order: 1;
    }

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

    .schedule-route-header {
        flex-direction: column;
    }

    .schedule-route-meta {
        width: 100%;
    }

    .schedule-departure-group {
        padding: 16px;
    }

    .schedule-entries {
        gap: 12px;
    }

    .schedule-entry-time {
        font-size: 1.15rem;
    }

    .release-card-title-row {
        align-items: flex-start;
    }
}

/* Дополнительная подстройка для телефонов */
@media (max-width: 640px) {
    .hero,
    .subpage-hero,
    .page,
    .legal-page,
    .schedule-page,
    .site-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .site-footer-links {
        justify-content: flex-start;
    }

    .section,
    .legal-card,
    .contact-card,
    .document-card {
        border-radius: 14px;
    }

    .document-card {
        min-height: 80px;
        padding: 12px 14px;
    }

    .text-link.document-title {
        gap: 8px;
    }

    .text-link.document-title strong {
        font-size: 0.95rem;
    }

    .text-link.document-title small {
        font-size: 0.8rem;
    }

    .hero-copy h1,
    .subpage-heading h1 {
        font-size: 1.8rem;
        line-height: 1.06;
    }

    .topbar {
        gap: 10px;
        padding: 14px 16px;
        grid-template-columns: 1fr;
    }

    .brand {
        font-size: 1.22rem;
        font-weight: 400;
    }

    .brand-copy {
        line-height: 0.9;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        min-height: 34px;
        font-size: 0.95rem;
        padding: 0 2px;
    }

    .nav-featured {
        order: 2;
        margin-left: auto;
        min-height: 34px;
        font-size: 1.1rem;
        font-weight: 700;
    }

    .hero-layout {
        gap: 16px;
        padding-top: 14px;
        grid-template-columns: 1fr;
    }

    .hero-text {
        font-size: 1rem;
        line-height: 1.55;
    }

    .hero-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .hero-actions-secondary {
        width: 100%;
    }

    .hero-actions .button {
        min-height: 44px;
    }

    .release-card {
        padding: 14px;
    }

    .release-assets-grid {
        grid-template-columns: 1fr;
    }

    .section {
        margin-top: 18px;
        padding: 18px;
    }

    .schedule-summary {
        gap: 10px;
    }

    .schedule-chip {
        min-width: 0;
        flex: 1 1 100%;
    }

    .schedule-route-card {
        padding: 14px;
    }

    .schedule-departures {
        grid-template-columns: 1fr;
    }

    .schedule-entries {
        grid-template-columns: 1fr;
    }

    .schedule-entry {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px 0;
        border-bottom: 0;
        background: none;
    }

    .schedule-entry-time {
        font-size: 1.15rem;
    }

    .section-heading .eyebrow {
        font-size: 1.15rem;
    }

    .feature-column {
        padding: 14px;
    }

    .feature-column h2 {
        font-size: 1.15rem;
    }

    .hero-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .hero-stack a,
    .hero-stack img {
        width: 100%;
    }

    .hero-stack a {
        aspect-ratio: 3 / 4;
        overflow: hidden;
        border-radius: var(--radius-lg);
    }

    .hero-stack img {
        height: 100%;
        object-fit: cover;
        object-position: top center;
    }

    .back-to-top {
        right: 12px;
        bottom: 12px;
    }
}

/* Узкие экраны: уменьшаем плотность и сохраняем читабельность */
@media (max-width: 420px) {
    .hero-copy h1,
    .subpage-heading h1 {
        font-size: 1.6rem;
        line-height: 1.08;
    }

    .section,
    .legal-card {
        padding: 14px;
    }

    .hero-stack {
        grid-template-columns: 1fr;
    }

    .schedule-toolbar {
        align-items: stretch;
    }

    .schedule-route-summary-title {
        font-size: 1.05rem;
    }

    .schedule-route-card--detail .schedule-route-badge {
        font-size: 1.06rem;
    }

    .schedule-route-meta {
        font-size: 0.84rem;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a,
    .nav-featured {
        min-height: 32px;
        font-size: 0.92rem;
    }

    .releases-summary {
        margin-top: 12px;
    }

    .release-badges {
        gap: 6px;
    }
}

@media (min-width: 1440px) {
    :root {
        --content-width: clamp(1160px, 88vw, 1480px);
    }

    .release-assets-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .schedule-results {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}
