/* Routech — версия для слабовидящих (все страницы) */

.a11y-widget {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 10000;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.a11y-widget-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid #333;
    border-radius: 8px;
    background: #fff;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

.a11y-widget-toggle:hover,
.a11y-widget-toggle:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.a11y-widget-toggle[aria-pressed="true"] {
    background: #000;
    color: #ff0;
    border-color: #ff0;
}

.a11y-widget-icon { font-size: 18px; line-height: 1; }

.a11y-panel {
    margin-top: 8px;
    padding: 16px;
    border: 2px solid #000;
    border-radius: 8px;
    background: #fff;
    color: #000;
    min-width: 280px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.a11y-panel[hidden] { display: none !important; }

.a11y-panel-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000;
}

.a11y-panel-group { margin-bottom: 14px; }
.a11y-panel-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.a11y-btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

.a11y-btn {
    padding: 8px 14px;
    border: 2px solid #000;
    border-radius: 6px;
    background: #fff;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

.a11y-btn:hover,
.a11y-btn:focus-visible {
    background: #eee;
    outline: 3px solid #0066cc;
    outline-offset: 1px;
}

.a11y-btn.is-active { background: #000; color: #ff0; }

.a11y-off-btn {
    width: 100%;
    margin-top: 4px;
    background: #000;
    color: #fff;
    border-color: #000;
}

/* --- Темы --- */

html.a11y-mode.a11y-theme-dark {
    --bg: #000;
    --panel: #000;
    --panel2: #111;
    --line: #ffff00;
    --text: #ffffff;
    --muted: #ffff00;
    --accent: #ffff00;
    --accent-dim: #222;
    --danger: #ff6666;
    --success: #66ff66;
    --warning: #ffff00;
}

html.a11y-mode.a11y-theme-light {
    --bg: #ffffff;
    --panel: #ffffff;
    --panel2: #f5f5f5;
    --line: #000000;
    --text: #000000;
    --muted: #333333;
    --accent: #0000cc;
    --accent-dim: #eeeeee;
    --danger: #cc0000;
    --success: #006600;
    --warning: #664400;
}

html.a11y-mode { font-size: 100%; scroll-behavior: auto; }
html.a11y-mode.a11y-font-lg { font-size: 118%; }
html.a11y-mode.a11y-font-xl { font-size: 136%; }

html.a11y-mode,
html.a11y-mode body {
    background: var(--bg) !important;
    color: var(--text) !important;
    background-image: none !important;
}

html.a11y-mode body {
    line-height: 1.75;
    letter-spacing: .02em;
}

html.a11y-mode * {
    text-shadow: none !important;
    box-shadow: none !important;
}

html.a11y-mode .a11y-widget,
html.a11y-mode .a11y-panel,
html.a11y-mode .a11y-widget-toggle {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .35) !important;
}

html.a11y-mode a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px !important;
    color: var(--accent) !important;
}

html.a11y-mode *:focus-visible {
    outline: 3px solid #0066cc !important;
    outline-offset: 3px !important;
}

html.a11y-mode .btn,
html.a11y-mode input,
html.a11y-mode select,
html.a11y-mode textarea {
    border-width: 2px !important;
    border-color: var(--line) !important;
    min-height: 44px;
    font-size: 1em !important;
    background: var(--panel) !important;
    color: var(--text) !important;
}

html.a11y-mode .btn-primary,
html.a11y-mode .btn-orange {
    background: var(--text) !important;
    color: var(--bg) !important;
    border: 2px solid var(--line) !important;
}

html.a11y-mode .btn-secondary {
    background: var(--bg) !important;
    color: var(--text) !important;
}

html.a11y-mode .badge,
html.a11y-mode .bid-status {
    border: 2px solid var(--line) !important;
    font-weight: 700;
}

/* Панели, карточки, таблицы */
html.a11y-mode .card,
html.a11y-mode .auth-card,
html.a11y-mode .detail-card,
html.a11y-mode .service-card,
html.a11y-mode .bid-item,
html.a11y-mode .board-filters,
html.a11y-mode .board-table-wrap,
html.a11y-mode .table-wrap,
html.a11y-mode .data-table,
html.a11y-mode .comment,
html.a11y-mode .home-hero,
html.a11y-mode .home-hero-highlight,
html.a11y-mode .advantage-card,
html.a11y-mode .step-card,
html.a11y-mode .trust-strip,
html.a11y-mode .landing-cta,
html.a11y-mode .dashboard-hero,
html.a11y-mode .detail-hero,
html.a11y-mode .stats-strip-item,
html.a11y-mode .vehicle-card,
html.a11y-mode .slot-btn,
html.a11y-mode .address-block,
html.a11y-mode .cargo-map,
html.a11y-mode .leaflet-container {
    background: var(--panel) !important;
    background-image: none !important;
    border: 2px solid var(--line) !important;
    color: var(--text) !important;
}

html.a11y-mode .public-header,
html.a11y-mode .public-footer,
html.a11y-mode .board-header,
html.a11y-mode aside,
html.a11y-mode .app-sidebar,
html.a11y-mode .mobile-app-bar {
    background: var(--bg) !important;
    backdrop-filter: none !important;
    border: 2px solid var(--line) !important;
    color: var(--text) !important;
}

html.a11y-mode .board-table th,
html.a11y-mode .board-table td,
html.a11y-mode .table-wrap th,
html.a11y-mode .table-wrap td {
    border: 1px solid var(--line) !important;
    color: var(--text) !important;
    background: var(--panel) !important;
}

html.a11y-mode .board-table tr:hover td {
    background: var(--panel2) !important;
}

/* Текст и акценты */
html.a11y-mode .muted,
html.a11y-mode .page-subtitle,
html.a11y-mode .home-lead,
html.a11y-mode .section-desc,
html.a11y-mode .form-group label,
html.a11y-mode .detail-param label,
html.a11y-mode nav a,
html.a11y-mode .public-nav a {
    color: var(--muted) !important;
    opacity: 1 !important;
}

html.a11y-mode .logo,
html.a11y-mode .page-title,
html.a11y-mode h1,
html.a11y-mode h2,
html.a11y-mode h3 {
    color: var(--text) !important;
}

html.a11y-mode .rate-cell,
html.a11y-mode .rate-big,
html.a11y-mode .bid-price,
html.a11y-mode .hero-counter-value,
html.a11y-mode .detail-price-value,
html.a11y-mode .detail-route,
html.a11y-mode .home-eyebrow,
html.a11y-mode .price-cell,
html.a11y-mode .company-rating,
html.a11y-mode nav a.active,
html.a11y-mode .public-nav a.active {
    color: var(--accent) !important;
}

html.a11y-mode nav a.active {
    border: 2px solid var(--line) !important;
    font-weight: 700;
}

html.a11y-mode .error-box,
html.a11y-mode .success-box {
    border-width: 2px !important;
    font-weight: 600;
}

html.a11y-mode.a11y-theme-dark .error-box {
    background: #330000 !important;
    color: #ff9999 !important;
    border-color: #ff6666 !important;
}

html.a11y-mode.a11y-theme-dark .success-box {
    background: #003300 !important;
    color: #99ff99 !important;
    border-color: #66ff66 !important;
}

html.a11y-mode.a11y-theme-light .error-box {
    background: #ffe0e0 !important;
    color: #000 !important;
    border-color: #cc0000 !important;
}

html.a11y-mode.a11y-theme-light .success-box {
    background: #e0ffe0 !important;
    color: #000 !important;
    border-color: #006600 !important;
}

html.a11y-mode .a11y-widget-toggle[aria-pressed="true"] {
    background: #000;
    color: #ff0;
    border-color: #ff0;
}

@media (max-width: 600px) {
    .a11y-widget {
        top: auto;
        bottom: 12px;
        right: 12px;
        left: 12px;
    }
    .a11y-widget-toggle { width: 100%; justify-content: center; }
    .a11y-panel { min-width: 0; width: 100%; }
}
