* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
}

html {
    font-family: var(--font-family);
    scrollbar-color: rgba(255, 255, 255, 0.14) rgba(10, 16, 24, 0.6);
    scrollbar-width: thin;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* iOS: фокус на полях <16px даёт авто-зум — держим минимум 16px на тач-устройствах */
@media (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="color"]):not([type="file"]),
    textarea,
    select {
        font-size: 16px !important;
    }
}

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

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
    background: rgba(10, 16, 24, 0.4);
    border-radius: 999px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

.app-hint {
    margin: 0;
    font-size: var(--font-sm);
    color: var(--app-caption);
    line-height: 1.45;
    font-weight: 400;
}

.text-title {
    font-size: var(--font-lg);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--app-text);
}

.text-caption {
    font-size: var(--font-xs);
    color: var(--app-caption);
    font-weight: 400;
    line-height: 1.35;
}

.money-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.money-block--end {
    align-items: flex-end;
    text-align: right;
}

.money-amount {
    font-size: var(--font-2xl);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--app-green);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.money-caption {
    font-size: var(--font-xs);
    color: var(--app-caption);
    font-weight: 400;
    line-height: 1.3;
}

#screen-profile .money-amount {
    font-size: var(--font-xl);
    color: var(--app-green);
}

body {
    touch-action: manipulation;
    background-color: var(--app-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(23, 128, 56, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(47, 128, 237, 0.08), transparent);
    color: var(--app-text);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    font-weight: 400;
    font-size: var(--font-base);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes slideInFromRight {
    from { transform: translateX(100%); opacity: 0.96; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutToLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0.88; }
}

@keyframes slideInFromLeft {
    from { transform: translateX(-100%); opacity: 0.96; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutToRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0.88; }
}

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

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

@keyframes authGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.85; }
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 14px rgba(0, 122, 74, 0.35)); }
    50% { transform: scale(1.04); filter: drop-shadow(0 6px 20px rgba(0, 74, 153, 0.45)); }
}

@keyframes trainDrift {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(6px); opacity: 0.65; }
}

.app-screen-header {
    position: static;
    width: 100%;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
    overflow: visible;
}

.app-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 6px 12px;
    box-sizing: border-box;
}

.app-header-bar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.app-header-bar-brand .app-brand-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.schedule-title-plate {
    background: linear-gradient(90deg, #024C4E 0%, #038B6F 50%, #06CA86 100%);
    border: none;
    border-top: 1px solid rgba(6, 202, 134, 0.22);
    border-radius: 0 0 var(--card-radius) var(--card-radius);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    box-sizing: border-box;
    min-height: 34px;
}

.schedule-title-plate .screen-section-title {
    margin: 0;
    font-size: clamp(14px, 3.8vw, 17px);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #ffffff;
    line-height: 1.1;
    text-align: center;
    width: 100%;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

.app-brand-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 3px 10px rgba(0, 190, 160, 0.24));
}

.app-brand-text {
    font-size: clamp(12px, 3.2vw, 14px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: rgba(176, 187, 204, 0.92);
    text-transform: uppercase;
    line-height: 1.1;
}

.screen-section-title {
    margin: 0;
    font-size: var(--font-xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--app-text);
    line-height: 1.15;
}

.screen-card {
    width: 100%;
    padding: var(--card-padding);
    border-radius: var(--card-radius);
    border: var(--card-border);
    background: var(--surface-card);
    box-sizing: border-box;
}

.screen-card-head {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: calc(-1 * var(--card-padding));
    margin-right: calc(-1 * var(--card-padding));
    padding: 0 var(--card-padding) 16px;
    margin-bottom: 18px;
}

.screen-card-head::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 12%,
        rgba(255, 255, 255, 0.1) 88%,
        transparent 100%
    );
}

.screen-card-head .screen-section-title {
    flex: 1;
    min-width: 0;
}

.phone-screen {
    width: 100%;
    max-width: 640px;
    min-height: auto;
    background: transparent;
    border: none;
    border-radius: var(--card-radius);
    padding: 28px 24px;
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
}

    /* Плашка даты смены + «Ночь» */
    .shift-date-card {
width: 100%;
background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: var(--app-radius);
margin-bottom: 0;
overflow: hidden;
    }

    .shift-date-main {
padding: 4px 12px;
    }

    .shift-date-picker {
position: relative;
display: block;
min-height: 48px;
padding: 12px 48px 12px 8px;
cursor: pointer;
user-select: none;
    }

    .shift-date-display {
display: block;
color: #ffffff;
font-size: 16px;
font-weight: 600;
line-height: 1.35;
letter-spacing: -0.01em;
pointer-events: none;
    }

    .shift-date-input {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
border: none;
outline: none;
background: transparent;
color: transparent;
opacity: 0;
cursor: pointer;
color-scheme: dark;
font-size: 16px;
z-index: 2;
    }

    .shift-date-input:focus {
outline: none;
    }

    .shift-date-card:focus-within .shift-date-main {
background: rgba(255, 255, 255, 0.03);
    }

    .shift-date-input::-webkit-calendar-picker-indicator {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
cursor: pointer;
opacity: 0;
    }

    .shift-date-calendar-icon {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
width: 22px;
height: 22px;
display: flex;
align-items: center;
justify-content: center;
color: #8b97ab;
pointer-events: none;
z-index: 1;
transition: color 0.2s ease;
    }

    .shift-date-picker:hover .shift-date-calendar-icon,
    .shift-date-picker:active .shift-date-calendar-icon {
color: #b8c4d8;
    }

    .shift-date-night {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px 16px;
background: rgba(0, 0, 0, 0.18);
border-top: none;
font-size: 14px;
color: #5a6a82;
    }

    .shift-date-night-label {
color: #5a6a82;
font-weight: 400;
    }

    .night-switch {
position: relative;
display: inline-block;
width: 44px;
height: 24px;
flex-shrink: 0;
    }

    .night-switch input {
opacity: 0;
width: 0;
height: 0;
    }

    .night-switch-slider {
position: absolute;
cursor: pointer;
inset: 0;
background: #252d3a;
border-radius: 13px;
transition: background 0.2s ease, box-shadow 0.2s ease;
    }

    .night-switch-slider::before {
content: '';
position: absolute;
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background: #ffffff;
border-radius: 50%;
transition: transform 0.2s ease;
    }

    .night-switch input:checked + .night-switch-slider {
background: #178038;
box-shadow: 0 0 8px rgba(23, 128, 56, 0.35);
    }

    .night-switch input:checked + .night-switch-slider::before {
transform: translateX(20px);
    }

/* Переключатель вкладок (базовые кнопки) */
.tabs-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 12px;
    min-height: 40px;
    font-size: var(--font-sm);
    font-weight: 500;
    color: rgba(196, 209, 232, 0.82);
    cursor: pointer;
    border-radius: var(--app-radius);
    transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tab-btn:hover {
    color: #f7fbff;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 4px 14px rgba(0, 0, 0, 0.18);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: var(--app-gap);
}

.schedule-date-hint {
    margin: 0;
    font-size: var(--font-sm);
    font-weight: 400;
    color: var(--app-caption);
    line-height: 1.45;
    text-align: center;
}

#screen-schedule .phone-screen {
    overflow: visible;
    overflow-x: visible;
    padding: 0 12px 24px;
}

#screen-schedule .schedule-app-wrap {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: var(--app-gap);
}

#screen-schedule .app-screen-header {
    position: static;
    top: auto;
    z-index: auto;
}

#screen-schedule .screen-card--schedule {
    overflow: visible;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    position: static;
    top: auto;
    z-index: auto;
}

#screen-schedule .screen-card--schedule .app-community-footer {
    margin-top: 4px;
    margin-bottom: var(--bottom-tabbar-clearance);
}

.app-email-upgrade-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9200;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-top, 0px));
    background: linear-gradient(135deg, rgba(6, 199, 133, 0.18), rgba(2, 76, 78, 0.95));
    border-bottom: 1px solid rgba(6, 199, 133, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.app-email-upgrade-banner[hidden] {
    display: none !important;
}

.app-email-upgrade-banner__text {
    flex: 1 1 auto;
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    color: #ecfdf5;
}

.app-email-upgrade-banner__action {
    flex: 0 0 auto;
    border: none;
    border-radius: 10px;
    padding: 7px 12px;
    background: var(--brand-grad, linear-gradient(135deg, #06c785, #024c4e));
    color: #ecfdf5;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.app-email-upgrade-banner__close {
    flex: 0 0 auto;
    border: none;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

body.has-email-upgrade-banner .main-screens-stage {
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
}

body.has-email-upgrade-banner #screen-auth {
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
}

#screen-schedule .schedule-tabs-stage:not(.is-transitioning):not(.is-dragging) {
    overflow: visible;
}

/* Стеклянный блок: вкладки Маршрут / Расписание + карточка поезда */
.schedule-glass-stack {
    width: var(--schedule-glass-width);
    max-width: 100%;
    margin: 0 auto 10px;
    position: static;
    top: auto;
    z-index: auto;
    border: var(--card-border);
    border-radius: var(--card-radius);
    background: var(--surface-card-inner);
    box-shadow: none;
    overflow: hidden;
}

.schedule-glass-stack.has-route-card {
    border-radius: var(--glass-radius);
}

.schedule-glass-tabs {
    margin: 0;
    padding: 5px;
    background: var(--surface-card);
    border-bottom: 1px solid var(--glass-border-soft);
}

.schedule-glass-stack.has-route-card .schedule-glass-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.schedule-glass-body {
    padding: 0;
    background: transparent;
}

#scheduleHeader.schedule-glass-body {
    position: static;
    margin: 0;
    width: 100%;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
}

#tab-route {
    padding-bottom: 24px;
}

#tab-schedule {
    width: 100%;
    min-width: 0;
    overflow: visible;
    --schedule-pad-x: 24px;
    gap: 12px;
    padding-top: 4px;
    padding-bottom: 24px;
}

#scheduleHeader .schedule-route-card {
    margin: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    border: none;
    border-radius: 0 !important;
    box-shadow: none;
    background: #141b27;
    border-top: none;
    animation: none;
    overflow: hidden;
}

#screen-schedule .schedule-glass-stack--route-tab .route-card-top {
    display: none;
}

/* Компактные часы на «Маршруте» остаются внутри того же glass-stack, без отрыва от вкладок */
#screen-schedule .schedule-glass-stack--route-tab #scheduleHeader.schedule-glass-body {
    display: block;
}

#screen-schedule .schedule-glass-stack--route-tab .schedule-route-card {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #141b27;
}

#screen-schedule .schedule-glass-stack--route-tab .schedule-route-card-middle {
    min-height: 32px;
    padding-top: 6px;
    padding-bottom: 4px;
}

#screen-schedule .schedule-glass-stack--route-tab .schedule-route-clock-row {
    position: relative;
    min-height: 32px;
}

#screen-schedule .schedule-glass-stack--route-tab .schedule-route-card-footer {
    padding-top: 0;
    padding-bottom: 5px;
}

#screen-schedule .schedule-glass-stack--route-tab .schedule-route-card .route-card-section {
    padding: 4px 12px 4px 18px;
}

#screen-schedule .schedule-glass-stack--route-tab .schedule-route-card-footer .schedule-date-hint {
    margin: 0;
    line-height: 1.3;
}

#screen-schedule .route-shift-sticky-shell {
    display: block;
    margin: 0;
    padding: 0;
    width: 100%;
}

#screen-schedule .route-shift-sticky-shell .route-shift-compact-wrap {
    margin: 0;
    padding: 0 12px 10px;
    box-sizing: border-box;
}

#screen-schedule #tab-route .route-shift-expanded {
    margin-top: 8px;
}

.schedule-glass-stack:not(.has-route-card) .schedule-glass-tabs {
    border-bottom: none;
}

#scheduleHeader .schedule-route-card::before {
    width: 6px;
    background: var(--brand-grad-vertical);
    opacity: 1;
}

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

.schedule-route-card .route-card-top {
    gap: 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
    padding-bottom: 8px;
}

.schedule-route-card .route-card-title {
    min-width: 0;
    font-family: var(--font-family);
    font-size: clamp(14px, 3.8vw, var(--font-md));
    font-weight: 600;
    line-height: 1.3;
    color: var(--app-text-bright);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-route-card .route-card-subtitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
    font-size: var(--font-xs);
    line-height: 1.25;
    color: var(--app-muted);
}

.schedule-route-card .schedule-route-category {
    flex: 1;
    min-width: 0;
    text-align: right;
    font-size: var(--font-sm);
    font-weight: 500;
    color: rgba(196, 209, 232, 0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-route-card .route-card-subtitle .train-num-chip {
    flex-shrink: 0;
}

.schedule-route-card-middle {
    min-height: 40px;
    justify-content: center;
    align-items: center;
    border-bottom: none;
    padding-top: 2px;
    padding-bottom: 2px;
}

.schedule-route-card-middle .route-card-middle-head {
    width: 100%;
    justify-content: center;
}

.schedule-route-clock-row {
    position: relative;
    align-items: center;
    min-height: 32px;
    padding-inline: 34px;
}

.schedule-route-clock-row .schedule-route-time {
    width: 100%;
    text-align: center;
}

.schedule-live-clock-refresh {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: var(--app-radius);
    background: rgba(255, 255, 255, 0.08);
    color: #8393af;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.schedule-live-clock-refresh:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
}

.schedule-live-clock-refresh:active {
    transform: translateY(-50%) scale(0.94);
}

.schedule-live-clock-refresh:focus-visible {
    outline: 2px solid rgba(29, 167, 69, 0.45);
    outline-offset: 2px;
}

.schedule-live-clock-refresh-icon {
    width: 14px;
    height: 14px;
}

.schedule-live-clock-refresh-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.schedule-route-time {
    width: 100%;
    text-align: center;
    font-size: clamp(18px, 4.6vw, 22px);
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.clock-wrap.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

.clock-wrap__time {
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    color: #34d399;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: auto !important;
    text-align: center;
}

.clock-wrap__sub {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    line-height: 1.2;
    margin-top: 2px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    color: #94a3b8;
}

.clock-wrap__sub--muted,
.clock-wrap__sub--ok {
    color: #94a3b8;
}

.clock-wrap__sub--dwell {
    color: #38bdf8;
}

.clock-wrap__sub--warn {
    color: #94a3b8;
}

.clock-wrap__sub--danger {
    color: #f87171;
}

.clock-wrap__sub.crew-sync-badge {
    color: #38bdf8;
    font-size: 0.72rem;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.clock-wrap__sub.crew-sync-badge.is-hiding {
    opacity: 0;
}

.schedule-route-card-footer {
    padding-top: 8px;
    padding-bottom: 10px;
    border-bottom: none;
}

.schedule-route-card-footer .schedule-date-hint {
    margin: 0;
    font-size: var(--font-xs);
    font-weight: 500;
    line-height: 1.35;
    color: var(--app-muted);
    letter-spacing: 0.02em;
}

.schedule-empty {
    display: block;
    text-align: center;
    color: var(--app-muted);
    font-size: var(--font-base);
    margin: 8px 0 16px;
    padding: 12px 8px;
}

.schedule-route-card {
    margin-bottom: 0;
}

.schedule-results-wrap {
    animation: fadeInScale 0.3s ease-out;
    overflow: visible;
    margin-top: 12px;
    padding-top: 4px;
    padding-bottom: 20px;
}

.schedule-loader {
    margin-bottom: 16px;
}

.action-btn {
    background-color: #178038;
    color: #ffffff;
    border: none;
    border-radius: var(--app-radius);
    padding: 12px 22px;
    font-size: var(--font-md);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.action-btn:hover {
    background-color: #1f8440;
    transform: translateY(-1px);
}

.action-btn:active {
    background-color: #0f5a2c;
}

button:focus-visible,
.train-input:focus-visible {
    outline: 2px solid rgba(29, 167, 69, 0.45);
    outline-offset: 2px;
}

.trains-dynamic {
    margin-bottom: 12px;
}

.trains-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 6px;
}

.train-field {
    position: relative;
    min-width: 0;
}

.train-field-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: var(--app-radius);
    background: transparent;
    color: #5a6a82;
    font-size: 18px;
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.train-field-clear:hover,
.train-field-clear:focus-visible {
    color: #9db0cf;
    background: rgba(255, 255, 255, 0.06);
}

.train-field--has-clear .train-input {
    padding-right: 34px;
}

.train-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 10px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--app-radius);
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    color: #f4f7ff;
    backdrop-filter: blur(10px);
    text-align: left;
    font-weight: 400;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, font-weight 0.2s ease;
    min-width: 0;
    line-height: 1.2;
}

.train-input:focus {
    border-color: #178038;
    background: rgba(255, 255, 255, 0.12);
}

.train-input::placeholder {
    color: #4a5668;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
}

.train-input:not(:placeholder-shown) {
    color: #f4f7ff;
    font-weight: 600;
}

.trains-submit {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.add-train-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 6px 0 2px;
    border: none;
    background: transparent;
    color: #5a6a82;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s ease;
}

.add-train-btn:hover {
    color: #9db0cf;
}

.add-train-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.trains-submit .action-btn {
    flex: 1;
}

@media (max-width: 430px) {
    .train-input {
        padding: 10px 8px;
        font-size: 13px;
    }

    .train-input::placeholder {
        font-size: 11px;
    }

    .trains-submit {
        gap: 8px;
    }
}

.info-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.info-chip {
    display: inline-flex;
    align-items: stretch;
    height: 20px;
    max-height: 20px;
    border-radius: 5px;
    border: 1px solid var(--info-chip-border);
    background: var(--info-chip-bg);
    color: var(--info-chip-text);
    overflow: hidden;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.info-chip__prefix,
.info-chip__value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-chip__prefix {
    padding: 0 5px;
    border-right: 1px solid var(--info-chip-border);
    background: var(--info-chip-prefix-bg);
    text-transform: uppercase;
}

.info-chip__value {
    padding: 0 6px;
    font-variant-numeric: tabular-nums;
}

.info-chip--danger {
    border-color: var(--info-chip-danger-border);
    background: var(--info-chip-danger-bg);
    color: var(--info-chip-danger-text);
}

.info-chip--danger .info-chip__prefix {
    border-right-color: var(--info-chip-danger-border);
    background: var(--info-chip-danger-prefix-bg);
}

/* --- Овальная шапка + sticky только на экране «Маршрут» --- */
html,
body {
    background-color: #0b0e14 !important;
}

.main-screens-stage:not(.is-transitioning):not(.is-dragging) {
    overflow: visible !important;
}

#screen-schedule,
#screen-schedule .schedule-app-wrap,
#screen-schedule .screen-card--schedule {
    overflow: visible !important;
}

#screen-instructions,
#screen-instructions .instructions-app-wrap {
    overflow: hidden !important;
}

#screen-instructions.screen:not(.hidden) {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
}

.app-header-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 14px !important;
    margin: 8px 12px 10px !important;
    border-radius: 9999px !important;
    background: rgba(18, 25, 38, 0.92) !important;
    border: 1px solid rgba(6, 199, 133, 0.28) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
    box-sizing: border-box !important;
    position: static !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

/* Инструкции (Frame 142): без общей овальной шапки — два отдельных блока */
#screen-instructions .app-header-bar.instr-header-bar {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 0 6px !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#screen-instructions .app-header-bar.instr-header-bar .app-header-bar-brand {
    flex: 0 1 auto !important;
}

.app-header-bar-end {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.app-header-bar-brand .app-brand-text {
    text-transform: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
}

/* Маршрут: монолитная липкая зона (шапка + табы), без просвета сверху */
#screen-schedule .route-sticky-header-wrap,
.route-sticky-header-wrap {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    width: 100%;
    box-sizing: border-box;
    margin: 0 !important;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 0 0 !important;
    background: #0b0e14 !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow:
        0 16px 30px rgba(0, 0, 0, 0.7),
        0 -20px 0 20px #0b0e14 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

#screen-schedule .route-sticky-header-wrap:has(.schedule-glass-stack.has-route-card) {
    border-bottom: none !important;
    box-shadow:
        0 -20px 0 20px #0b0e14 !important;
}

#screen-schedule .route-sticky-header-wrap .app-screen-header {
    padding: 0;
}

#screen-profile .profile-screen-header,
#screen-calendar .app-screen-header {
    width: 100%;
    max-width: 100%;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 0;
    box-sizing: border-box;
}

/* Верхняя строка: логотип | часы | Поддержать (все основные экраны) */
#screen-schedule .route-sticky-header-wrap .app-header-bar.route-header-bar,
#screen-profile .profile-screen-header .app-header-bar.route-header-bar,
#screen-calendar .app-screen-header .app-header-bar.route-header-bar,
#screen-instructions .instr-sticky-header-wrap .app-header-bar.route-header-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center !important;
    gap: 8px !important;
    margin: 0 0 10px !important;
    width: 100% !important;
    min-height: 48px !important;
    height: auto !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-sizing: border-box !important;
}

#screen-schedule .route-sticky-header-wrap .route-header-brand,
#screen-profile .profile-screen-header .route-header-brand,
#screen-calendar .app-screen-header .route-header-brand,
#screen-instructions .instr-sticky-header-wrap .route-header-brand {
    justify-self: start;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 10px !important;
    border-radius: 12px !important;
    background: rgba(18, 25, 38, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-sizing: border-box !important;
    max-width: 100%;
}

#screen-schedule .route-sticky-header-wrap .route-header-brand-text,
#screen-profile .profile-screen-header .route-header-brand-text,
#screen-calendar .app-screen-header .route-header-brand-text,
#screen-instructions .instr-sticky-header-wrap .route-header-brand-text {
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.15 !important;
    color: #e8edf5 !important;
    white-space: normal !important;
}

#screen-schedule .route-sticky-header-wrap .route-header-brand .app-brand-logo,
#screen-profile .profile-screen-header .route-header-brand .app-brand-logo,
#screen-calendar .app-screen-header .route-header-brand .app-brand-logo,
#screen-instructions .instr-sticky-header-wrap .route-header-brand .app-brand-logo {
    width: 26px !important;
    height: 26px !important;
}

#screen-schedule .route-sticky-header-wrap .clock-wrap.time-box,
#screen-profile .profile-screen-header .clock-wrap.time-box,
#screen-calendar .app-screen-header .clock-wrap.time-box,
#screen-instructions .instr-sticky-header-wrap .clock-wrap.time-box {
    justify-self: center;
    grid-column: 2;
    background: rgba(14, 20, 32, 0.92) !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-radius: 10px !important;
    padding: 6px 12px 7px !important;
    box-shadow: none !important;
    max-width: min(100%, 10rem);
}

#screen-schedule .route-sticky-header-wrap .clock-wrap .app-header-bar-clock,
#screen-schedule .route-sticky-header-wrap .clock-wrap__time,
#screen-schedule .route-sticky-header-wrap #scheduleLiveClock,
#screen-profile .profile-screen-header .clock-wrap .app-header-bar-clock,
#screen-profile .profile-screen-header .clock-wrap__time,
#screen-calendar .app-screen-header .clock-wrap .app-header-bar-clock,
#screen-calendar .app-screen-header .clock-wrap__time,
#screen-instructions .instr-sticky-header-wrap .clock-wrap .app-header-bar-clock,
#screen-instructions .instr-sticky-header-wrap .clock-wrap__time {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif !important;
    color: #34d399 !important;
    font-weight: 700 !important;
    font-size: 1.15rem !important;
    letter-spacing: 0.5px !important;
    font-variant-numeric: tabular-nums !important;
    font-feature-settings: "tnum" !important;
}

#screen-schedule .route-sticky-header-wrap .clock-wrap__sub {
    font-family: inherit !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.2px !important;
    font-variant-numeric: tabular-nums !important;
    font-feature-settings: "tnum" !important;
}

#screen-schedule .route-sticky-header-wrap .route-header-donate,
#screen-profile .profile-screen-header .route-header-donate,
#screen-calendar .app-screen-header .route-header-donate,
#screen-instructions .instr-sticky-header-wrap .route-header-donate {
    justify-self: end;
    grid-column: 3;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    background: rgba(18, 25, 38, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #c5cedb !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

#screen-schedule .route-sticky-header-wrap .app-screen-header,
#screen-instructions .instr-sticky-header-wrap .app-screen-header {
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

#screen-schedule .route-sticky-header-wrap .app-screen-header {
    padding-left: 12px;
    padding-right: 12px;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack.has-route-card {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack.has-route-card::before {
    display: none !important;
}

/* Вкладка «Маршрут»: табы + панель смены — одна карточка, без «разъезда» */
#screen-schedule .route-sticky-header-wrap .schedule-glass-stack.has-route-card.schedule-glass-stack--route-tab {
    margin: 0 12px 10px !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #111827 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    box-sizing: border-box !important;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack.has-route-card.schedule-glass-stack--route-tab .schedule-glass-tabs {
    margin: 0 !important;
    padding: 4px !important;
    width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: rgba(0, 0, 0, 0.22) !important;
    box-shadow: none !important;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack--route-tab .route-shift-sticky-shell .route-shift-compact-wrap {
    padding: 0 !important;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack--route-tab .route-header-card.header-card {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack.has-route-card:not(.schedule-glass-stack--route-tab) {
    background: #141b27 !important;
    border: var(--card-border) !important;
    border-radius: var(--card-radius) !important;
    overflow: hidden !important;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack.has-route-card:not(.schedule-glass-stack--route-tab) .schedule-glass-tabs {
    margin: 0 !important;
    padding: 4px !important;
    border: none !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: rgba(0, 0, 0, 0.22) !important;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack.has-route-card #scheduleHeader .schedule-route-card {
    background: #141b27;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack:not(.has-route-card) {
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box;
    margin-bottom: 12px;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-stack:not(.has-route-card) .schedule-glass-tabs {
    border-radius: 16px !important;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-tabs {
    margin: 0 !important;
    padding: 4px !important;
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 16px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: stretch !important;
    gap: 4px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-tabs .tab-btn {
    flex: 1 1 50% !important;
    height: auto !important;
    min-height: 0 !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 0 12px !important;
    color: rgba(232, 237, 245, 0.75) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#screen-schedule .route-sticky-header-wrap .schedule-glass-tabs .tab-btn.active {
    color: #ffffff !important;
    background: var(--brand-grad) !important;
    box-shadow:
        0 0 18px rgba(6, 199, 133, 0.22),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
}

/* Список поездов — без внешней «коробки» screen-card */
#screen-schedule .screen-card--schedule {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-top: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

#screen-schedule .schedule-tabs-stage,
#screen-schedule #tab-route {
    overflow: visible !important;
}

/* Sticky: родители маршрута без overflow:hidden и без верхнего padding */
#screen-schedule,
#screen-schedule .phone-screen,
#screen-schedule .phone-screen.schedule-app-wrap,
#screen-schedule .schedule-app-wrap {
    overflow: visible !important;
    overflow-x: visible !important;
    padding-top: 0 !important;
}

.app-header-bar .header-clock,
.app-header-bar .app-header__clock {
    font-family: "Cascadia Mono", "SF Mono", Consolas, monospace !important;
    font-variant-numeric: tabular-nums !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #00f59b !important;
    background: rgba(6, 199, 133, 0.12) !important;
    border: 1px solid rgba(6, 199, 133, 0.3) !important;
    border-radius: 9999px !important;
    padding: 4px 10px !important;
    line-height: 1 !important;
    width: auto !important;
    text-align: center;
}


.schedule-title-plate {
    display: none !important;
}
