@font-face {
    font-family: 'Sora';
    src: url("/static/fonts/Sora-VariableFont_wght.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 75% 125%;
    font-style: normal;
}

@font-face {
    font-family: 'Rubik';
    src: url("/static/fonts/Rubik-VariableFont_wght.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 75% 125%;
    font-style: normal;
}

@font-face {
    font-family: "Material Symbols Rounded";
    src: url("/static/fonts/MaterialSymbolsRoundedVF.woff2") format("woff2");
    font-weight: 100 700;
    font-style: normal;
    font-display: block;
}

/* -- Animatable CSS properties -- */

@property --next_stop_progress {
    syntax: '<percentage>';
    initial-value: 0%;
    inherits: true;
}

@property --next_stop_progress_num {
    syntax: '<number>';
    initial-value: 0;
    inherits: true;
}

@property --next_stop_progress_pos {
    syntax: '<length-percentage>';
    initial-value: 0%;
    inherits: true;
}

/* -- Colors and vars -- */

:root{

    --app-margin: 14px;
    --topbar-height: 33px;
    --bottom-nav-height: 60px;
    --content-fade-height: calc(var(--bottom-nav-height) + (var(--app-margin) * 1.2));

    --vt-ease: cubic-bezier(.2,0,.2,1);
    --vt-in: 220ms;
    --vt-out: 180ms;

    --jotaele-blue: #2a3b9b;
    --jotaele-teal: #18aed7;
    --jotaele-black: #33383c;
    --jotaele-white: #fff;
    --jotaele-background: #e4f0f4;
    --jotaele-background-accent: #d3e4f3;
    --jotaele-text-muted: #6c757d;
    --jotaele-text-subtle: #9ea4a9;
    --jotaele-color-button: #7a99b4;
    --jotaele-color-button-accent: #5a7e9e;
    --jotaele-midnight: #001c38;
    --jotaele-error: #e91e43;
    --jotaele-success: #15a37a;
    --jotaele-warning: #f59f00;
    --jotaele-notice: #2f80ed;
}

html,
body {
    padding: 0;
    margin: 0;
    font-family: Rubik, sans-serif;
    font-weight: 300;
    overflow: hidden;
    background: var(--jotaele-background);
    color: var(--jotaele-black);
}

h1, h2, h3, h4, h5, h6 {
    font-family: Sora, sans-serif;
    font-weight: 700;
    color: var(--jotaele-black);
}

a {
    text-decoration: none;
    color: var(--jotaele-black);
}

p {
    font-family: Rubik, sans-serif;
    font-weight: 300;
    color: var(--jotaele-black);
    line-height: 1.3em;
    font-size: 1.08rem;
}

.sr-only {
    position: absolute !important;
    width: 0;
    height: 0;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.display-none {
    display: none !important;
}

.material-symbols-rounded {
    font-family: "Material Symbols Rounded", sans-serif;
    font-weight: 400;
    font-style: normal;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.app-block-padding {
    padding-left: var(--app-margin);
    padding-right: var(--app-margin);
    box-sizing: border-box;
}

.app-block-vertical-padding {
    padding-top: var(--app-margin);
    box-sizing: border-box;
}

.app-block-navbar-padding {
    padding-bottom: calc(var(--bottom-nav-height) + (var(--app-margin) * 1.5)) !important;
}

main {
    display: flex;
    flex-direction: column;
    height: 100svh;
    min-height: 0;
    position: relative;
}

#content {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    mask-image: linear-gradient(
        to bottom,
        #000 0%,
        #000 calc(100% - var(--content-fade-height)),
        transparent 100%
    );
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

/* -- Topbar navbar -- */

#app-topbar {
    position: relative;
    display: flex;
    width: 100%;
    padding: var(--app-margin);
    z-index: 999;
    box-sizing: border-box;
    background: var(--jotaele-background);
}

#app-topbar .topbar-inner {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    height: var(--topbar-height);
    max-height: var(--topbar-height);
    align-items: center;
}

.topbar-btn {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: var(--topbar-height);
    height: var(--topbar-height);
    background: var(--jotaele-white);
    border: 0;
    border-radius: 100%;
    color: var(--jotaele-black);
    text-decoration: none;
    transition: ease 0.3s;
    font-size: 1.35rem;
}

.topbar-btn.nude-icon {
    background: none;
    font-size: 1.8rem;
}

.topbar-btn:hover,
.topbar-btn:active {
    background: var(--jotaele-teal);
    color: var(--jotaele-white);
}

.topbar-btn.disabled,
.topbar-title.disabled {
    pointer-events: none;
    opacity: 0;
}

#app-topbar .topbar-title {
    width: 100%;
    height: var(--topbar-height);
    display: flex;
    justify-content: center;
    align-items: center;
}

#app-topbar .topbar-title img {
    height: calc(var(--topbar-height) * 0.8);
    width: auto;
}

.subsection-topbar {
    flex: 0 0 auto;
    padding-bottom: var(--app-margin);
    border-bottom: 1px solid var(--jotaele-background-accent);
}

/* -- Bottom navbar -- */

#bottom-nav {
    position: fixed;
    margin: 0 calc(var(--app-margin) * 2) calc(var(--app-margin) * 1.3);
    left: 0;
    bottom: 0;
    z-index: 999999;
    display: block;
    width: calc(100% - (var(--app-margin) * 4));
    box-sizing: border-box;
    overflow: hidden;
    backdrop-filter: blur(3px);
    border-radius: 999px;
}

.backdrop-nav {
    background: linear-gradient(to bottom, transparent, var(--jotaele-background) 60%);
    position: fixed;
    width: 100%;
    height: var(--bottom-nav-height);
    padding: var(--app-margin) var(--app-margin) calc(var(--app-margin) * 1.3);
    bottom: 0;
    z-index: 70;
    pointer-events: none;
}

#bottom-nav .nav-inner {
    display: flex;
    width: 100%;
    height: var(--bottom-nav-height);
    max-height: var(--bottom-nav-height);
    background: var(--jotaele-white);
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

#bottom-nav .navbar-inner-wrapper {
    display: flex;
    width: 100%;
    min-width: 0;
    padding: calc(var(--app-margin) / 2);
}

#bottom-nav .navbar-item {
    font-family: Sora, sans-serif;
    text-decoration: none;
    color: var(--jotaele-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    border-radius: 999px;
    font-size: 0.75rem;
    transition: ease 0.3s;
    gap: 0.1rem;
}

#bottom-nav .navbar-item i {
    font-size: 23px;
    line-height: 1em;
}

#bottom-nav .navbar-item:not(.item-active):hover,
#bottom-nav .navbar-item:not(.item-active):active {
    color: var(--jotaele-teal);
}

#bottom-nav .navbar-item.item-active {
    background: var(--jotaele-teal);
    color: var(--jotaele-white);
    font-weight: 600;
}

/* -- Config Sheet -- */

.sheet {
    width: auto;
    max-width: none;
    height: 100dvh;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    inset: 0;
    z-index: 1001;
}

.sheet::backdrop {
    background: rgba(0,0,0,.25);
    opacity: 0;
    transition: opacity 180ms var(--vt-ease);
}

.sheet[open]::backdrop { opacity: 1; }

.sheet-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(378px, 92vw);
    height: 100dvh;
    background: var(--jotaele-white);
    box-shadow: -9px 0 27px rgba(0,0,0,.15);
    border-radius: 14px 0 0 14px;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 220ms var(--vt-ease);
}

.sheet[open] .sheet-panel { transform: translateX(0); }

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--app-margin) * 1.2);
    border-bottom: 1px solid var(--jotaele-background-accent);
}

.sheet-header h2 {
    font-family: Sora, sans-serif;
    font-size: 1.08rem;
    margin: 0;
}

.sheet-close {
    background: none;
    border: 0;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 999px;
}

.sheet-nav {
    display: flex;
    flex-direction: column;
    padding: var(--app-margin);
    gap: 4px;
    overflow: auto;
}

.sheet-item {
    display: grid;
    grid-template-columns: 25px 1fr;
    align-items: center;
    gap: .675rem;
    padding: .63rem .81rem;
    border-radius: 11px;
    text-decoration: none;
    color: var(--jotaele-black);
    background: transparent;
    border: 0;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.sheet-item i { font-size: 20px; }

.sheet-item:hover,
.sheet-item:active {
    background: color-mix(in srgb, var(--jotaele-background-accent) 55%, white 45%);
}

/* -- Transitions -- */

#content {
    view-transition-name: page;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

@keyframes vt-fade-in   { from { opacity: 0 } to { opacity: 1 } }
@keyframes vt-fade-out  { from { opacity: 1 } to { opacity: 0 } }
@keyframes vt-slide-in  { from { transform: translateX(8px) } to { transform: none } }
@keyframes vt-slide-out { from { transform: none } to { transform: translateX(-8px) } }

::view-transition-new(page) {
    animation: vt-fade-in var(--vt-in) var(--vt-ease) both,
    vt-slide-in var(--vt-in) var(--vt-ease) both;
}
::view-transition-old(page) {
    animation: vt-fade-out var(--vt-out) var(--vt-ease) both,
    vt-slide-out var(--vt-out) var(--vt-ease) both;
}

#app-topbar   { view-transition-name: topbar; }
#bottom-nav   { view-transition-name: bottomnav; }

/* -- Home -- */

#app-topbar.topbar-home {
    background: var(--jotaele-blue);
}

#app-topbar.topbar-home .topbar-btn.nude-icon {
    color: white;
}

#hero-home {
    display: flex;
    flex-direction: column;
    padding: 0 calc(var(--app-margin) * 1) calc(var(--app-margin) * 1.5);
    background: var(--jotaele-blue);
}

.hero-home-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.hero-logo {
    display: flex;
    width: 60%;
    max-width: 288px;
    margin-bottom: calc(var(--app-margin) * 1.5);
}

.hero-logo img {
    width: 100%;
    height: auto;
    transform-origin: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.hero-logo img[data-logo-state="on"] {
    animation: logo-jolt 720ms cubic-bezier(.2, .8, .2, 1) both;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.2));
}

.hero-logo img[data-logo-state="off"] {
    animation: logo-settle 520ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes logo-jolt {
    0% {
        transform: scale(1) rotate(0deg);
    }
    18% {
        transform: scale(1.08) rotate(-4deg);
    }
    40% {
        transform: scale(0.98) rotate(3deg);
    }
    62% {
        transform: scale(1.05) rotate(-2deg);
    }
    80% {
        transform: scale(1) rotate(1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes logo-settle {
    0% {
        transform: scale(1.02) rotate(1deg);
    }
    45% {
        transform: scale(0.98) rotate(-2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.main-content {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.welcome-message {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.welcome-message .txt-title {
    font-size: 1.62rem;
    font-weight: 600;
    font-family: Sora, sans-serif;
    color: var(--jotaele-blue);
}

.welcome-message-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.by-jotaele {
    background: var(--jotaele-background-accent);
    padding: 0.45rem 0.72rem;
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    font-size: 0.72rem;
    gap: 0.09rem;
}

.by-jotaele a {
    display: flex;
    flex-direction: column;
    gap: 0.09rem;
}

/* -- Station search box -- */

.search-station-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    gap: var(--app-margin);
}

.search-box-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: var(--jotaele-white);
    font-family: 'Rubik', sans-serif;
    border-radius: 9px;
    height: 1.53rem;
    min-width: 0;
    width: 100%;
    padding: calc(var(--app-margin) / 1.5);
}

.search-box-wrapper .search-input {
    background: none;
    border: none;
    outline: none;
    border-radius: 0;
    padding: 0 0;
    margin: 0 0;
    min-width: 0;
    font-size: 1.08rem;
    flex: 1 1 80%;
    box-shadow: none;
    font-family: 'Rubik', sans-serif;
    color: var(--jotaele-black);
}

.search-box-wrapper .search-input:focus,
.search-box-wrapper .search-input:focus-visible {
    outline: none;
}

.search-box-wrapper .search-btn {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 1.35rem;
    color: var(--jotaele-black);
    transition: ease 0.3s;
    padding: 0;
}

.search-station-box .nearby-btn {
    display: flex;
    flex: 0 0 auto;
    line-height: normal;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    width: 2.25rem;
    background: var(--jotaele-color-button);
    border: 0;
    border-radius: 100%;
    box-shadow: none;
    font-size: 1.44rem;
    color: var(--jotaele-white);
    transition: ease 0.3s;
    padding: 0;
}

.search-box-wrapper .nearby-btn:hover,
.search-box-wrapper .nearby-btn:active {
    background: var(--jotaele-color-button-accent);
}

.nuclei-picker {
    background: var(--jotaele-background-accent);
    padding: var(--app-margin);
    margin-bottom: var(--app-margin);
    border-radius: 14px;
    position: relative;
}

.nuclei-picker .current-nuclei {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.nuclei-picker .current-nuclei .current-nucleus-label,
.nuclei-picker .current-nuclei .current-nucleus-label strong {
    font-size: 0.99rem;
    color: var(--jotaele-black);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.nucleus-menu {
    position: absolute;
    z-index: 70;
    right: 0;
    bottom: 0;
    margin-top: .45rem;
    min-width: 234px;
    max-height: 60vh;
    overflow: auto;
    background: var(--jotaele-white);
    border-radius: 14px;
    box-shadow: 1px 1px 4px #0000003b;
    padding: .45rem;
    animation: np-fade-in .14s ease-out;
}

@keyframes np-fade-in { from { opacity: 0; transform: translateY(-4px); } }

.nucleus-search {
    padding: .225rem .225rem .45rem;
}

.nucleus-search input[type="search"] {
    width: 100%;
    padding: .495rem .63rem;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    background: var(--jotaele-white);
    color: var(--jotaele-black);
    font-size: 0.99rem;
    font-family: 'Rubik', sans-serif;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.nucleus-search input[type="search"]:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--jotaele-background-accent) 55%, #000 0%);
}

.nucleus-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 2px;
}

.nucleus-item {
    width: 100%;
    text-align: left;
    padding: .54rem .63rem;
    border-radius: 9px;
    border: 0;
    background: transparent;
    color: var(--jotaele-black);
    font-size: 0.99rem;
    font-family: 'Rubik', sans-serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background .12s ease, transform .06s ease, color .12s ease;
}

.nucleus-name {
    overflow-x: clip;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nucleus-actions {
    margin-top: .45rem;
    padding-top: .45rem;
    border-top: 1px solid rgba(0,0,0,.06);
    display: flex;
    justify-content: flex-end;
    gap: .45rem;
}

.nucleus-actions .link-like {
    background: none;
    border: 0;
    color: var(--jotaele-black);
    padding: .315rem .495rem;
    border-radius: 7px;
    cursor: pointer;
    transition: background .12s ease, transform .06s ease;
}

.nucleus-dropdown > summary {
    list-style: none;
    content: "";
    display: flex;
    align-items: center;
}

/* -- Stations list -- */

.app-main-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

ul.chip-list {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: var(--app-margin);
    list-style: none;
    min-height: 0;
    overflow-y: visible;
    overflow-x: hidden;
    margin: 0 0;
    padding: 0 0 calc(var(--bottom-nav-height) + (var(--app-margin) * 1.5));
    contain: paint;
}

.chip-card {
    background: var(--jotaele-white);
    border-radius: 24px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.04);
}

.chip-card:hover,
.chip-card:active {
    background: var(--jotaele-background-accent);
}

.chip-card .chip-link {
    display: flex;
    width: 100%;
    padding: var(--app-margin);
    min-height: 3.6rem;
    min-width: 0;
}

.chip-card .chip-main {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 auto;
    gap: calc(var(--app-margin) / 1);
    min-width: 0;
}

.chip-card .chip-icon {
    width: 36px;
    height: 36px;
    border-radius: 100%;
    flex: 0 0 36px;
    background: var(--jotaele-color-button);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1em;
    color: var(--jotaele-white);
}

.chip-card .chip-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: calc(var(--app-margin) / 3);
    min-width: 0;
}

.chip-card .chip-name {
    font-family: Sora, sans-serif;
    font-weight: 700;
    color: var(--jotaele-black);
    font-size: 0.99rem;
    line-height: 1.15em;
    margin: 0 0;
    padding: 0 0;
    overflow-x: clip;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.chip-card .station-chip-more {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 1.26rem;
    color: var(--jotaele-blue);
}

.chip-card .chip-subtitle {
    display: flex;
    font-family: 'Rubik', sans-serif;
    font-size: 0.9rem;
    color: var(--jotaele-text-muted);
    margin: 0 0;
    padding: 0 0;
    gap: calc(var(--app-margin) / 3);
}

.station-badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.18rem;
}

.station-badge img {
    display: flex;
    height: 1rem;
    width: auto;
}

.empty-list-block {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: calc(100% - var(--bottom-nav-height));
    max-height: calc(100% - var(--bottom-nav-height));
}

.empty-list-block .empty-list-message-block {
    flex: 1 1 90%;
    opacity: 0.7;
    width: 80%;
    max-width: 80%;
}
.empty-list-block .empty-list-icon {
    font-size: 4rem;
    text-align: center;
    color: var(--jotaele-color-button-accent);
    letter-spacing: -3rem;
    height: 6.5rem;
    vertical-align: text-top;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-list-block .empty-list-icon .material-symbols-rounded {
    font-weight: 300;
    font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 48;
}

.empty-list-block .empty-symbol.material-symbols-rounded {
    font-size: 0.6em;
    font-variation-settings: "FILL" 0, "wght" 700, "GRAD" 0, "opsz" 48;
    margin-top: 1rem;
}

.empty-list-block .empty-list-message {
    text-align: center;
    font-size: 1.3em;
    color: var(--jotaele-color-button-accent);
    font-weight: 400;
    margin: 0 0;
    line-height: 1.25em;
}

/* -- Lines list -- */

.line-chip-icon.generic-chip-icon {
    background: var(--line-color, var(--jotaele-color-button))
}

.line-chip-icon.image-line-icon {
    display: flex;
    flex: 0 0 3.15rem;
    position: relative;
}

.line-chip-icon.image-line-icon img {
    display: block;
    height: 100%;
    width: auto;
}

.line-card .line-name {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0 0;
    font-size: 0.99rem;
}

.line-card .line-name .line-terminal-name {
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow-x: clip;
    text-overflow: ellipsis;
    display: block;
}

.grouped-lists-scroll {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: calc((var(--bottom-nav-height) * 3.3) + (var(--app-margin) * 8));
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.sticky-title {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--jotaele-background);
    border-bottom: 1px solid var(--jotaele-background-accent);
}

.sticky-title .app-block-title {
    margin: 0 0;
    padding: calc(var(--app-margin) / 1.5) 0;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    gap: var(--app-margin);
}

.app-block-title .title-badge {
    height: 1.35rem;
    display: inline-block;
}

.app-block-title .title-badge img {
    height: 100%;
    width: auto;
    display: inline-block;
}

.grouped-chip-list {
    flex: 0 0 auto;
    overflow: visible;
    margin: 0 0 var(--app-margin) 0;
    padding: 0 0 0 0;
    gap: var(--app-margin);
}

.grouped-chip-list + .sticky-title {
    margin-top: calc(var(--app-margin) * 1.25);
}

.grouped-lists-scroll .chip-list {
    flex: none;
    min-height: 0;
    overflow: visible;
    margin: 0 0 var(--app-margin) 0;
    padding: 0;
    gap: var(--app-margin);
}

.line-name-swappable {
    position: relative;
    perspective: 900px;
    transform-style: preserve-3d;
    isolation: isolate;
    min-height: 2.5em;
}

.line-name-swappable .face {
    position: absolute;
    inset: 0;
    display: flex;
    gap: .2rem;
    align-items: center;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transform-origin: 50% 50%;
    transition: transform 320ms var(--vt-ease), opacity 320ms var(--vt-ease);
    margin: 0;
}

.line-name-swappable .front { transform: rotateX(0deg); }
.line-name-swappable .back  { transform: rotateX(180deg); }

.line-card[data-state="b"] .line-name-swappable .front { transform: rotateX(-180deg); }
.line-card[data-state="b"] .line-name-swappable .back  { transform: rotateX(0deg); }

.line-toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 100%;
    background: transparent;
    border: 1px solid var(--jotaele-background-accent);
    color: inherit;
    cursor: pointer;
    margin: 0 var(--app-margin);
    transition: ease 0.3s;
}

.line-toggle-button:hover,
.line-toggle-button:active {
    background: var(--jotaele-teal);
    color: var(--jotaele-white);
}

.line-link--a, .line-link--b { display: flex; }
.line-link--a[hidden], .line-link--b[hidden] { display: none !important; }

[hidden],
.is-hidden {
    display: none !important;
}

/* - Route Maps - */

.grid-route-map {
    --number-of-stations: 10;
    --line-route-width: 8px;
    --icon-dot-size: 17px;
    --icon-border-dot-size: 4px;
    --line-color: var(--jotaele-blue);
    --station-block-height: 4.5rem;
    --connections-icon-size: 0.95rem;
    --next_stop_progress_num: 0;
    --train-marker-scale: 1.3;
    --train-marker-border-size: calc(3px / var(--train-marker-scale));
    --train-marker-diameter: calc(
        (var(--icon-dot-size) + (var(--train-marker-border-size) * 2)) * var(--train-marker-scale)
    );
    --train-marker-radius: calc(var(--train-marker-diameter) / 2);
    --train-marker-inset: var(--train-marker-radius);
    --train-marker-range: calc(100% - (var(--train-marker-inset) * 2));
    --next_stop_progress_pos: calc(
        var(--train-marker-inset)
        + (var(--train-marker-range) * (var(--next_stop_progress_num) / 100))
    );

    display: grid;
    width: 100%;
    max-width: 100%;
    height: 100%;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: repeat(var(--number-of-stations), 1fr);
    grid-column-gap: calc(var(--app-margin) * 0.8);
    grid-auto-flow: row dense;
    box-sizing: border-box;
    padding: 0 0;
    margin: var(--app-margin) 0;
}

#line-route {
    --train-color: var(--jotaele-blue);
}

.train-details-panel {
    --line-color: var(--jotaele-blue);
}

.station-block,
.grid-route-map-station {
    display: contents;
}

.grid-route-map-station.stop-anchor-highlight .station-block,
.grid-route-map-station.stop-anchor-highlight .grid-route-line {
    animation: stopAnchorPulse 1.6s ease;
}

@keyframes stopAnchorPulse {
    0% {
        box-shadow: 0 0 0 rgba(255, 180, 80, 0.4);
        background-color: rgba(255, 213, 153, 0.2);
    }
    50% {
        box-shadow: 0 0 12px rgba(255, 180, 80, 0.7);
        background-color: rgba(255, 213, 153, 0.45);
    }
    100% {
        box-shadow: 0 0 0 rgba(255, 180, 80, 0);
        background-color: transparent;
    }
}

.grid-route-map .route-line-wrapper {
    display: flex;
    height: 100%;
    width: var(--icon-dot-size);
    position: relative;
    align-items: flex-start;
    justify-content: center;
}

.grid-route-map .route-line-fragment {
    display: block;
    position: absolute;
    width: var(--line-route-width);
    height: calc(100% - (var(--icon-dot-size) - 3px));
    background: var(--line-color);
    top: calc(var(--icon-dot-size) - 2px);
}

.grid-route-map .route-dot {
    position: absolute;
    content: "";
    display: block;
    border-radius: 100%;
    z-index: 2;
    width: var(--icon-dot-size);
    height: var(--icon-dot-size);
    background: var(--jotaele-white);
    border: var(--icon-border-dot-size) solid var(--line-color);
    box-sizing: border-box;
    transition:
        box-shadow 0.3s var(--vt-ease),
        transform 0.25s var(--vt-ease),
        background-color 0.25s var(--vt-ease),
        border-color 0.25s var(--vt-ease);
}

.grid-route-map .grid-route-station-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: var(--station-block-height);
}

.grid-route-map .grid-route-station-name {
    font-family: Sora, sans-serif;
    font-weight: 700;
    color: var(--jotaele-black);
    background: transparent;
    font-size: 1rem;
    line-height: 1.1em;
    display: inline-block;
    padding: 0.2em 0.3em;
    position: relative;
    transform: translateY(-0.2em);
    transition: ease 0.2s;
    overflow-y: clip;
}

.grid-route-map .grid-route-map-station.destination-station .route-line-fragment {
    height: 0;
}

.grid-route-map .grid-route-connections {
    display: flex;
    flex-direction: row;
    margin-bottom: 0.5rem;
    gap: 0.25rem;
    padding: 0.1em 0.3em;
    transition: padding 0.2s var(--vt-ease);
}

.grid-route-map .grid-route-connections .connections-group {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
    padding-bottom: 0.3em;
    white-space: nowrap;
    max-width: 80%;
    overflow: hidden;
    flex-wrap: wrap;
    transition: ease 0.2s;
}

.toggle-connections-shown {
    position: relative;
}

.toggle-connections-shown:after {
    content: '';
    border: 1px solid var(--jotaele-text-subtle);
    width: 75%;
    left: 3px;
    transform: rotate(-35deg);
    position: absolute;
    transition: ease 0.2s;
}

.toggle-connections-shown[aria-pressed="true"]:after {
    opacity: 0;
}

.toggle-connections-shown[aria-pressed="false"] {
    color: var(--jotaele-text-subtle);
}


.grid-route-map .grid-route-connections .line-chip-icon {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.18rem;
    flex: 0 0 auto;
    color: white;
}

.grid-route-map .grid-route-connections .line-chip-icon img {
    display: flex;
    height: var(--connections-icon-size);
    width: auto;
}

.grid-route-map .grid-route-connections .line-chip-icon.generic-chip-icon {
    width: var(--connections-icon-size);
    height: var(--connections-icon-size);
}

.grid-route-map-station a:hover .grid-route-station-name,
.grid-route-map-station a:active .grid-route-station-name {
    color: var(--jotaele-teal);
}

.line-chip-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: calc(var(--app-margin) / 1.5);
    flex: 0 0 auto;
    color: white;
    overflow: hidden;
}

.line-chip-header .line-chip-icon {
    height: 1.4rem;
    flex: 1 0 auto;
}

.line-chip-icon.chip-icon-group {
    display: flex;
    gap: 0.25rem;
}

.line-chip-icon.cercanias-logo-icon img {
    display: block;
    height: calc(100% - 2px);
    width: auto;
}

.app-block-with-buttons {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}

.line-chip-header .line-name {
    display: flex;
    flex-direction: column;
    font-size: 1.1rem;
    line-height: 1.1em;
    width: 100%;
    min-width: 0;
    margin: var(--app-margin) 0;
}

.line-chip-header .line-name {
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.line-name-post-title {
    margin: 0 0;
    font-size: 1.35rem;
}

.line-chip-header-buttons {
    display: flex;
    flex-direction: row;
    gap: calc(var(--app-margin) / 2);
}

.header-secondary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 100%;
    border: 0 solid var(--jotaele-text-muted);
    color: var(--jotaele-text-muted);
    background: var(--jotaele-white);
    cursor: pointer;
    transition: ease 0.3s;
    position: relative;
}

.connections-group[hidden] { opacity: 0 !important; }

.line-chip-header-buttons .line-toggle-button {
    margin: 0 0;
    background: var(--jotaele-white);
    color: var(--jotaele-color-button-accent);
}


/* - Connections banner - */

.connections-banner {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.connections-banner .connections-group {
    display: flex;
    flex-direction: row;
    align-items: center;
}

/* - Buttons group navbar - */

#action-buttons-items {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + (var(--app-margin) * 2.6));
    z-index: 9999;
    right: 0;
    padding-right: calc(var(--app-margin) * 1.5);
    opacity: 0;
    transform: scale(0.3);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#action-buttons-items.visible {
    opacity: 1;
    transform: scale(1);
}

#action-buttons-items .navbar-buttons-group {
    position: relative;
    z-index: 9999;
}

#route-actions.navbar-buttons-group {
    padding: 0 var(--app-margin) calc(var(--app-margin) / 1) 0;
    width: fit-content;
    right: 0;
    left: auto;
    background: none;
    position: fixed;
    bottom: 0;
    z-index: 1000;
}

.nav-buttons-group-inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: calc(var(--app-margin) / 2);
}

.nav-buttons-button-group {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    width: calc(var(--bottom-nav-height) - var(--app-margin) * 1.3);
    border-radius: 999px;
}

.nav-buttons-button-group .navbar-button {
    background: none;
    backdrop-filter: none;
    border: 0;
    box-shadow: 0 0 0;
}

.navbar-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--bottom-nav-height) - var(--app-margin) * 1.3);
    height: calc(var(--bottom-nav-height) - var(--app-margin) * 1.3);
    border-radius: 100%;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--jotaele-text-muted);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    font-size: 1.55rem;
    cursor: pointer;
}

.navbar-button:hover,
.navbar-button:active {
    color: var(--jotaele-teal);
}

.navbar-button[aria-expanded="true"] {
    background: var(--jotaele-teal);
    color: var(--jotaele-white);
}

.navbar-button[aria-expanded="true"]:hover,
.navbar-button[aria-expanded="true"]:active {
    background: var(--jotaele-teal);
    color: var(--jotaele-background-accent);
}

.navbar-button.active,
.navbar-button[aria-pressed="true"] {
    background: var(--jotaele-teal);
    color: var(--jotaele-white);
}

.navbar-button.active:hover,
.navbar-button[aria-pressed="true"]:hover {
    background: var(--jotaele-teal);
    color: var(--jotaele-background-accent);
}

.navbar-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.navbar-button.loading .navbar-button-icon {
    animation: pulse-icon 1s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.navbar-button.error {
    animation: shake-btn 0.4s ease-in-out;
    color: var(--jotaele-error);
}

@keyframes shake-btn {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}


/* - Bottom drawers - */

.drawer-bottom {
    position: fixed;
    left:0;
    right:0;
    bottom: 0;
    z-index: 100001;
    transform: translateY(100%);
    transition: ease 0.3s;
    color: var(--jotaele-black);
    max-height: 60vh;
    outline: 0;
    padding-bottom: calc(var(--bottom-nav-height) + (var(--app-margin) * 1.5));
}


.drawer-inner {
    overflow: auto;
    max-height: 60vh;
    outline: 0;
    width: 100%;
}

.drawer-bottom.open {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-title {
    margin: 0;
    font-size: 1rem;
}

.drawer-close {
    background: transparent;
    border: 0;
    font-size: 1.2rem;
    color: inherit;
    cursor: pointer;
    padding: 0 0;
}

.htmx-indicator {
    opacity: 0;
    transition: opacity .2s;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

/* - Route trains drawer - */

#route-trains-body {
    display: flex;
    flex-direction: column-reverse;
    padding: var(--app-margin);
}

.drawer-title-group {
    display: flex;
    gap: calc(var(--app-margin) / 1.5);
}

.drawer-trains.drawer-bottom {
    background: linear-gradient(to bottom, transparent 0%, var(--jotaele-background) 25%, var(--jotaele-background) 80%);
    border-radius: 0;
    height: 10.8rem;
    max-height: 10.8rem;
    box-shadow: none;
    z-index: 100001;
    display: flex;
    align-items: flex-end;
}

#route-trains-body .drawer-header {
    height: calc(var(--bottom-nav-height) - var(--app-margin));
    display: flex;
    align-items: center;
    width: calc(100% - var(--bottom-nav-height));
    gap: calc(var(--app-margin) / 2);
}

#route-trains-body .drawer-header .drawer-title {
    font-size: 1.08rem;
    line-height: 1.1em;
    display: flex;
    flex-direction: column;
    color: var(--jotaele-black);
    padding-right: var(--app-margin);
    gap: 0.1rem;
}

.drawer-title .muted {
    font-family: 'Rubik', sans-serif;
    color: var(--jotaele-text-muted);
    font-size: 0.855rem;
    line-height: 1.1em;
    font-weight: 400;
}

.grouped-lists-scroll-horizontal {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    touch-action: pan-x;
    padding: 0 0 calc(var(--app-margin) * 1) 0;
    margin: 0 0;
    gap: var(--app-margin);
    scrollbar-width: none;
    min-height: calc(var(--app-margin) + 4.005rem);
}

.route-train-chip-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 7.2rem;
    width: 7.2rem;
    overflow: hidden;
    align-items: flex-start;
    padding: calc(var(--app-margin) * 0.9) var(--app-margin);
    border-radius: 13px;
    position: relative;
}

.route-train-chip-card > a {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    gap: calc(var(--app-margin) / 2);
}

.route-train-chip-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: calc(var(--app-margin) / 2);
    flex: 0 0 auto;
    overflow: hidden;
}

.route-train-chip-card .chip-name {
    font-size: 1rem;
    margin-right: 0.45rem;
}

.route-train-chip-card .route-train-chip-icon {
    flex: 0 0 1.35rem;
    height: 1.35rem;
    width: 0.9rem;
    font-size: 1rem;
    background: var(--train-color, var(--jotaele-color-button));
}

.route-train-chip-card .route-train-chip-stop-name {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.route-train-chip-card .route-train-chip-stop-name .station-label-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* - Train Map - */

.train-map-panel {
    display: flex;
    flex-direction: column;
    gap: var(--app-margin);
    padding: calc(var(--app-margin) * 1.2);
}

.train-map-meta {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--app-margin) * 0.7);
    font-size: 0.9rem;
    color: var(--jotaele-text-muted);
}

.train-map-meta strong {
    color: var(--jotaele-black);
    font-weight: 600;
    margin-right: 0.15rem;
}

section.line-route:has(.train-map-container) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.train-map-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.train-map-container .maplibregl-ctrl-bottom-left {
    padding-bottom: calc(var(--bottom-nav-height) + calc(var(--app-margin) * 1.3));
}

.train-map-container .maplibregl-ctrl-bottom-right {
    display: none;
}

.maplibregl-ctrl-attrib-button {
    background-image: url(/static/img/icon-info-tooltip.svg) !important;
    background-size: 1rem;
    background-repeat: no-repeat;
    background-position: center;
}

.maplibregl-ctrl-attrib a,
.maplibregl-ctrl-attrib-inner {
    color: var(--jotaele-text-muted) !important;
    text-decoration: none;
}

.maplibregl-ctrl-attrib.maplibregl-compact,
.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {
    background: none !important;
    padding-left: 10px !important;
}

.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {
    width: 0 !important;
}

#train-detail-map,
.train-map-container [data-train-map],
#train-map {
    width: 100%;
    height: 100%;
}

.train-map-footer {
    font-size: 0.82rem;
    color: var(--jotaele-text-muted);
}

.maplibregl-marker:has(.train-map-marker) {
    will-change: transform;
}

.train-map-marker {
    --halo-rotation: 0deg;
    --train-marker-size: 1.6rem;
    --halo-size: 5rem;

    width: var(--train-marker-size);
    height: var(--train-marker-size);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.train-map-marker.train-map-marker-mismatch {
    opacity: 0.55;
}

.train-map-marker > .train-map-marker-pulse {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--train-marker-size);
    height: var(--train-marker-size);
    border-radius: 999px;
    background: color-mix(in srgb, var(--line-color) 45%, transparent);
    box-sizing: border-box;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    will-change: transform, opacity;
    animation: trainPulseRing 2s ease-in-out infinite;
}

.train-map-marker::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 100%;
    border: 3px solid var(--jotaele-white);
    background: var(--line-color) url(/static/img/icon-train-position-white.svg) no-repeat center;
    background-size: round(nearest, calc(var(--train-marker-size) / 2.1), 1px);
    z-index: 2;
    will-change: background-color;
    animation: trainBlink 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

[data-train-map][data-map-ghost="true"] .train-map-marker::after,
[data-train-map] .train-map-marker.train-map-marker-mismatch::after {
    background: var(--jotaele-text-subtle) url(/static/img/icon-train-position-white.svg) no-repeat center;
    background-size: round(nearest, calc(var(--train-marker-size) / 2.1), 1px);
    animation: trainBlinkGhost 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

[data-train-map][data-map-ghost="true"] .train-map-marker > .train-map-marker-pulse,
[data-train-map] .train-map-marker.train-map-marker-mismatch > .train-map-marker-pulse {
    background: color-mix(in srgb, var(--jotaele-text-subtle) 45%, transparent);
}

[data-train-map][data-map-ghost="true"] .train-map-marker::before,
[data-train-map] .train-map-marker.train-map-marker-mismatch::before {
    background: radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--jotaele-text-subtle) 50%, transparent), transparent 70%);
}

@keyframes trainPulseRing {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.train-map-marker > span {
    position: relative;
    z-index: 3;
}

.train-map-marker::before {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(var(--train-marker-size) / 2 - var(--halo-size));
    width: var(--halo-size);
    height: var(--halo-size);
    transform: translateX(-50%) rotate(var(--halo-rotation));
    transform-origin: 50% 100%;
    background: radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--line-color) 50%, transparent), transparent 70%);
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
    opacity: 0.85;
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.train-map-marker.direction-unknown::before,
.train-map-marker.halo-initializing::before {
    opacity: 0;
}

#route-trains-panel .drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.route-train-different-route-indicator {
    position: absolute;
    right: calc(var(--app-margin) / 2);
    top: calc(var(--app-margin) / 2);
    color: var(--jotaele-color-button);
    font-size: 0.8rem !important;
}

.live-pill {
    --size: .55rem;
    display: inline-flex;
    align-items: center;
}

.live-pill .dot {
    position: relative;
    width: var(--size);
    height: var(--size);
    border-radius: 999px;
    background: var(--jotaele-teal);
    box-shadow: 0 0 0 .18rem color-mix(in srgb, var(--jotaele-teal) 15%, transparent);
    animation: live-blink 1.1s var(--vt-ease) infinite;
}

.live-pill .dot:after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--jotaele-teal);
    animation: live-pulse 1.8s ease-out infinite;
    opacity: .45;
}

.live-pill.is-stale .dot,
.live-pill.is-stale .dot:after,
.live-pill.is-sched .dot,
.live-pill.is-sched .dot:after {
    background: var(--jotaele-text-muted);
    box-shadow: none;
    animation: none;
}

.live-pill.is-semi-stale .dot,
.live-pill.is-est .dot,
.live-pill.is-completed .dot {
    --live-dot-color: var(--jotaele-warning);
    animation: live-blink 3s var(--vt-ease) infinite !important;
    box-shadow: 0 0 0 .18rem color-mix(in srgb, var(--live-dot-color) 10%, transparent) !important;
    background: var(--live-dot-color) !important;
}

.live-pill.is-completed .dot {
    --live-dot-color: var(--jotaele-success);
}

.live-pill.is-semi-stale .dot:after,
.live-pill.is-est .dot:after,
.live-pill.is-completed .dot:after {
    display: none !important;
}

@keyframes live-blink {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%      { transform: scale(.86);  opacity: .55; }
}

@keyframes live-pulse {
    0%   { transform: scale(1);    opacity: .45; }
    70%  { transform: scale(2.1);  opacity: 0;   }
    100% { transform: scale(2.1);  opacity: 0;   }
}

#route-trains-panel .drawer-inner {
    opacity: 0;
    transition: opacity 0.2s;
    transition-delay: 0.2s;
    will-change: opacity;
    height: 100%;
    max-height: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
}

#route-trains-panel .drawer-inner.is-fading {
    opacity: 0;
}

#route-trains-panel.drawer-bottom {
    opacity: 0;
    transition: ease 0.3s;
    display: flex;
    flex-direction: column;
}

#route-trains-panel.drawer-bottom.open,
#route-trains-panel.drawer-bottom.open .drawer-inner {
    opacity: 1;
}

.error-drawer {
    background: var(--jotaele-white);
    border-radius: 10px;
    padding: calc(var(--app-margin) / 1) var(--app-margin);
    margin-bottom: var(--app-margin);
    display: flex;
    align-items: center;
    gap: var(--app-margin);
    font-size: 1rem;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.04);
}

.error-drawer i {
    color: var(--jotaele-error);
}

.error-drawer.no-stop-error {
    margin: 0;
    padding: 0 0 var(--app-margin) 0;
}

.stop-modal-body[data-stop-state="loading"] .error-drawer,
.stop-modal-body[data-stop-state="ready"] .error-drawer {
    display: none !important;
}

/* - Train map details panel - */

#train-details-map-panel {
    --line-color: var(--jotaele-blue);
    background: color-mix(in srgb, rgb(255 255 255 / 65%) 65%, var(--jotaele-background) 30%);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    box-shadow: 0 0 0 1px var(--jotaele-background-accent);
    margin: calc(var(--app-margin) * 1.5) calc(var(--app-margin) * 1) 0;
    padding: calc(var(--app-margin) * 1) calc(var(--app-margin) * 1);
    position: relative;
    inset: 0;
    z-index: 10;
    font-family: Rubik, sans-serif;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.1em;
}

.train-details-content .train-current-status-block {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    line-height: 1.1em;
    min-width: 0;
    gap: calc(var(--app-margin) / 1.5);
    overflow: hidden;
}

.train-details-content .next-station-area {
    display: flex;
    flex-direction: row;
    gap: calc(var(--app-margin) / 2);
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    line-height: 1.1em;
}

.train-current-stop-area {
    display: flex;
    flex-direction: row;
    gap: calc(var(--app-margin) / 2);
    align-items: center;
}

.train-details-content .next-station-area-section.text {
    min-width: 0;
    overflow: hidden;
}

.train-details-content .train-current-status {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Rubik', sans-serif;
    line-height: normal;
    color: var(--jotaele-text-muted);
}

.train-details-content .train-current-stop {
    font-family: Sora, sans-serif;
    font-weight: 700;
    color: var(--jotaele-black);
    font-size: 1.1rem;
    line-height: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    white-space: nowrap;
}

.train-details-content .icon-next-stop {
    --route-dot-size: 1rem;
    --icon-border-dot-size: 0.25rem;

    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--route-dot-size);
    height: var(--route-dot-size);
    min-width: var(--route-dot-size);
    min-height: var(--route-dot-size);
    max-width: var(--route-dot-size);
    max-height: var(--route-dot-size);
}

.train-details-content .icon-next-stop .route-dot {
    display: block;
    border-radius: 100%;
    width: 100%;
    height: 100%;
    background: var(--jotaele-white);
    border: var(--icon-border-dot-size) solid var(--line-color, --jotaele-blue);
    animation: blink-next-station 2s infinite;
    transition: border 0.3s ease;
    box-sizing: border-box;
}

#train-details-map-panel.train-state--in-transit .icon-next-stop .route-dot {
    animation: blinkRouteDot 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

#train-details-map-panel.train-state--arriving .icon-next-stop .route-dot {
    animation: blinkRouteDot 1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

#train-details-map-panel.train-state--in-station .icon-next-stop .route-dot {
    animation: trainBlink 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    border: 0;
}

#train-details-map-panel.train-state--in-station .train-current-stop {
    animation: blinkOpacity 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.train-details-content .next-station-time-area {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    flex: 0 1 auto;
    margin-bottom: 0.1rem;
}

.next-station-time-area .arrival-hour-sched.train-arrival-time--late,
.next-station-time-area .arrival-hour-sched.train-arrival-time--early {
    font-size: 1rem;
    font-weight: 400;
}

/* -- Active stop marker -- */

.grid-route-map-station .grid-route-station-name {
    transition:
            background-color 0.18s var(--vt-ease),
            color 0.18s var(--vt-ease),
            margin-left 0.18s var(--vt-ease);
    transition-delay: 0.18s, 0.18s, 0.18s;
}

.grid-route-map-station.is-active .grid-route-station-name {
    color: var(--jotaele-white);
    background-color: var(--jotaele-blue);
    margin-left: 7px;
    transition-delay: 0s, 0s, 0s;
}

.grid-route-map-station.is-active a:hover .grid-route-station-name,
.grid-route-map-station.is-active a:active .grid-route-station-name {
    color: var(--jotaele-white) !important;
}

.grid-route-map-station.is-active .route-dot {
    border-color: var(--line-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--line-color) 25%, transparent);
}

.grid-route-map .grid-route-map-station.is-active .grid-route-connections {
    padding: 0.3em 0.3em;
}

.grid-route-map-station .grid-route-station-name::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 9px;
    height: 100%;
    background-color: var(--jotaele-blue);
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
    opacity: 0;
    z-index: -1;
    transition: left 0.18s var(--vt-ease), opacity 0.12s var(--vt-ease);
    transition-delay: 0s, 0.18s;
}

.grid-route-map-station.is-active .grid-route-station-name::before {
    opacity: 1;
    left: -9px;
    transition-delay: 0.18s, 0.18s;
}

/* - Stop drawer - */

#drawer.drawer-stop {
    z-index: 100002;
}

.drawer-inner {
    padding: var(--app-margin);
    width: 100%;
    box-sizing: border-box;
}

.stop-modal-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--app-margin) / 2);
    margin-bottom: calc(var(--app-margin) * 1);
    border-bottom: 1px solid var(--jotaele-background-accent);
    padding-bottom: calc(var(--app-margin) * 0.8);
}

.close-button {
    width: 1.44rem;
    height: 1.44rem;
    font-size: 1.26rem;
    color: var(--jotaele-color-button-accent);
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100%;
    margin-left: var(--app-margin);
}

#stop-modal-title {
    font-size: 1rem;
    margin: 0 0;
    flex: 1 1 auto;
    min-width: 0;
}

#stop-modal-title a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

#stop-modal-title .stop-modal-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#stop-modal-title:hover a,
#stop-modal-title:active a {
    transition: ease 0.2s;
    color: var(--jotaele-black);
}

#stop-modal-title i {
    vertical-align: middle;
    color: var(--jotaele-blue);
    font-size: 1.1em;
}

#stop-modal-title:hover a,
#stop-modal-title:active a,
#stop-modal-title:hover a i,
#stop-modal-title:active a i {
    color: var(--jotaele-teal);
}

.stop-detail {
    background: var(--jotaele-white);
    padding: calc(var(--app-margin) * 1) calc(var(--app-margin) * 1.3) calc(var(--app-margin) * 1.3) calc(var(--app-margin) * 1.3);
    border-radius: 24px;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.04);
}

.train-eta-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: calc(var(--app-margin) / 1.5);
    flex: 0 0 auto;
    overflow: hidden;
}

.train-eta-chip .train-eta-time {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--jotaele-background-accent);
    border-radius: 9px;
    padding: 0 0;
    font-size: 1.35rem;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: var(--jotaele-black);
    height: 100%;
    flex: 1 1;
}

.nearest-train-card {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.platform-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--app-margin) / 2);
    margin-right: 0.45rem;
    margin-bottom: 0.63rem;
}

.nearest-train-header {
    font-size: 1rem;
    font-family: 'Rubik', sans-serif;
    color: var(--jotaele-black);
}

.nearest-train-header.eta-header {
    display: flex;
    gap: 0.54rem;
    padding-left: 0.18rem;
}

.nearest-train-header.platform-header {
    text-align: center;
    margin-bottom: 0.72rem;
}

.platform-badge {
    background: #f5333f;
    width: 2.16rem;
    height: 2.16rem;
    transform: rotate(45deg);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, opacity 0.3s ease;
}

.platform-badge .platform-unit {
    color: #fff;
    transform: rotate(-45deg);
    display: block;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
}

.platform-badge.is-live,
.platform-badge.is-passed {
    background: #f5333f;
}

.stop-modal-body.stop-status-passed .platform-badge {
    opacity: 0.6 !important;
}

.platform-badge.is-habitual,
.platform-badge.is-unknown {
    background: var(--jotaele-text-muted);
}

.platform-badge.exceptional-platform .platform-unit {
    animation: 0.9s blink-animation-effect infinite;
}

@keyframes blink-animation-effect {
    0%, 54%, 100% {
        opacity: 1;
    }

    72%, 82% {
        opacity: 0;
    }
}

.second-train-approaching {
    padding-top: 0;
}

.second-train-approaching .second-train-label {
    display: flex;
    gap: 0.225rem;
    margin: 0 0;
    font-family: Rubik, sans-serif;
    font-weight: 300;
    line-height: 1.3em;
    font-size: 1rem;
    color: var(--jotaele-text-muted);
}

.second-train-approaching .second-train-label a {
    color: var(--jotaele-text-muted);
}

.stop-modal-footer {
    margin-top: calc(var(--app-margin) * 1.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 1.8rem;
}

.stop-modal-footer .view-train-link > a {
    border: 1px solid var(--jotaele-background-accent);
    border-radius: 9999px;
    padding: calc(var(--app-margin) / 3) calc(var(--app-margin) * 1);
    color: var(--jotaele-color-button-accent);
    font-size: 0.9rem;
    font-family: 'Sora', sans-serif;
    font-weight: 500;
    display: flex;
    gap: 0.25rem;
    transition: ease 0.2s;
}

.stop-modal-footer .view-train-link > a i {
    font-size: 1rem;
}

.stop-modal-footer .view-train-link > a:hover,
.stop-modal-footer .view-train-link > a:active {
    background: var(--jotaele-background-accent);
}

.train-id-chip {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--jotaele-text-subtle);
    font-weight: 400;
}

.train-id-chip a {
    color: var(--jotaele-text-subtle);
}

.train-id-chip a i {
    vertical-align: bottom;
}

.train-id-chip a:hover {
    color: var(--jotaele-color-button-accent);
}

.route-train-chip-icon {
    width: 1.2rem;
    height: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 100%;
    font-size: 0.9rem;
    background: var(--train-color, var(--jotaele-color-button));
    color: var(--jotaele-white);
}

/* - Stops time odometer - */

.rolling-number {
    display: inline-flex;
    align-items: baseline;
    position: relative;
    font-variant-numeric: tabular-nums;
    --rn-digit-height: 1.32em;
    --rn-face-height: var(--rn-digit-height);
}

.rolling-number .unit {
    margin-left: 0.25em;
    display: inline-flex;
    align-items: center;
    height: var(--rn-digit-height);
    line-height: var(--rn-digit-height);
}

.rolling-number__column {
    position: relative;
    overflow-y: clip;
    height: var(--rn-digit-height);
    width: 0.68ch;
    display: inline-block;
}

#eta-clock .rolling-number__column {
    width: 0.6ch;
}

.rolling-number__digits {
    display: block;
    will-change: transform;
    transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rolling-number__digits > span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--rn-digit-height);
    line-height: var(--rn-digit-height);
}

.rolling-number__digits > span .material-symbols-rounded,
.train-eta-time .material-symbols-rounded,
.rolling-number__stopped .material-symbols-rounded {
    font-size: 1em;
    line-height: 1;
    vertical-align: -0.1em;
}

.rolling-number__prefix {
    display: inline-block;
    width: 0.61ch;
    text-align: right;
    margin-right: 0.41ch;
    margin-left: -0.61ch;
    font-size: 0.7em;
}

.rolling-number__stopped {
    position: absolute;
    left: calc(0.81ch + 0.072em);
    top: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: 0.81ch 0.81ch;
    align-items: center;
    justify-items: center;
    pointer-events: none;
    opacity: 0.9;
}

.rolling-number__stopped[hidden] {
    display: none;
}

.train-eta-output-wrapper {
    position: relative;
    width: 12rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.train-eta-output-wrapper .train-eta-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s var(--vt-ease), visibility 0.24s var(--vt-ease);
    color: var(--jotaele-blue);
    background: var(--jotaele-background-accent);
    border-radius: 9px;
}

.train-eta-loader .dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.3;
    animation: eta-loader-pulse 1s infinite ease-in-out;
}

.train-eta-loader .dot:nth-child(2) { animation-delay: 0.12s; }
.train-eta-loader .dot:nth-child(3) { animation-delay: 0.24s; }

.nearest-train-card.is-loading .train-eta-loader {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nearest-train-card.is-loading .train-eta-time {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.nearest-train-card:not(.is-loading) .train-eta-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.train-eta-time[data-loading="true"] {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.train-eta-time[data-loading="false"] {
    opacity: 1 !important;
    visibility: visible !important;
}

.nearest-train-card.is-loading .train-eta-chip {
    cursor: default;
}

.nearest-train-card.is-loading .nearest-train-header,
.nearest-train-card.is-loading [data-field="primary-status-text"] {
    opacity: 0.8;
}

@keyframes eta-loader-pulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.75); }
    40% { opacity: 1; transform: scale(1); }
}

.train-eta-output-wrapper .train-eta-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    cursor: pointer;
    transition: opacity 0.24s var(--vt-ease), visibility 0.24s var(--vt-ease);
}

.stop-status-passed .train-eta-time {
    background: color-mix(in srgb, var(--jotaele-white) 90%, var(--jotaele-text-subtle) 30%);
}

.train-eta-time.is-clock .unit {
    display: none;
}

.train-eta-chip #eta-primary[aria-hidden="true"],
.train-eta-chip #eta-clock[aria-hidden="true"] {
    pointer-events: none;
}

.train-eta-chip [hidden] {
    display: none !important;
}

.rolling-number__faces {
    display: block;
    overflow: hidden;
    width: 100%;
    height: var(--rn-face-height, 1.5em);
    min-height: var(--rn-face-height, 1.5em);
}

.rolling-number__faces-inner {
    display: flex;
    flex-direction: column;
    transform: translateY(0%);
    transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rolling-number__faces-inner.is-station {
    transform: translateY(-50%);
}

.rolling-number__face {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--rn-face-height);
    height: var(--rn-face-height);
    padding: 0.05em 0;
    width: 100%;
}

.rolling-number__face--numeric {
    gap: 0.15em;
    align-items: center;
}

.rolling-number__face--station {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    line-height: 1.5;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    animation: blink-animation-effect 1.1s var(--vt-ease) infinite;
}

.rolling-number.is-station .unit {
    visibility: hidden;
}

.rolling-number__sep {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.3ch;
    margin: 0 0.05ch;
    height: var(--rn-digit-height);
    line-height: var(--rn-digit-height);
}

/* - Trains detail card - */

.train-detail-header .route-train-chip-icon {
    height: 1.5rem;
    width: 1.5rem;
    font-size: 1.1rem;
}

.route-train-chip-icon {
    height: 1.2rem;
    width: 1.2rem;
    font-size: 1rem;
}

.train-details-content-area {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: calc(var(--app-margin) * 1);
    min-height: 0;
    height: 100%;
}

.train-details-panel-wrapper {
    width: 100%;
}

.train-details-panel {
    background: color-mix(in srgb, var(--jotaele-white) 70%, var(--jotaele-background) 30%);
    border-radius: 14px;
    box-shadow: 0 0 0 1px var(--jotaele-background-accent);
    padding: calc(var(--app-margin) * 1) calc(var(--app-margin) * 1);
}

.train-details-panel .train-details-header .train-details-preheader,
#train-details-map-panel .train-details-header .train-details-preheader {
    display: flex;
    color: var(--jotaele-black);
    font-family: 'Sora', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0;
    gap: 0.15rem;
    align-items: center;
    justify-content: center;
}

.train-details-panel .train-details-header .train-details-preheader .train-details-label,
#train-details-map-panel .train-details-header .train-details-preheader .train-details-label {
    margin-left: 0.25rem;
}

.train-type-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    font-family: 'Rubik', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1px;
    line-height: 1;
    color: var(--jotaele-color-button);
    box-sizing: border-box;
}

.train-type-badge .material-symbols-rounded {
    font-size: 0.9rem;
    line-height: 1;
    font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 24;
}

.train-type-badge__label {
    display: inline-block;
}

.train-type-live-dot {
    --size: 0.5rem;
    margin-left: 0.15rem;
    flex-shrink: 0;
    line-height: 0;
}

.train-type-live-dot .dot {
    display: block;
}

.train-details-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: calc(var(--app-margin) * 0.8);
    padding-bottom: calc(var(--app-margin) * 0.8);
    border-bottom: 1px solid var(--jotaele-background-accent);
}

.train-details-header .line-chip-icon {
    flex: 0 0;
    height: 1.1rem;
}

.train-details-header .service-type-chip-icon {
    margin-right: 0.1rem;
    display: flex;
    align-items: center;
}

.train-details-header-content {
    display: flex;
    align-items: center;
    gap: calc(var(--app-margin) * 0.2);
    min-width: 0;
    margin-bottom: calc(var(--app-margin) * 0.7);
}

.train-header-terminal {
    min-width: 0;
}

.train-details-header-content .train-header-terminal {
    flex: 0 1 auto;
    font-family: Sora, sans-serif;
    font-weight: 700;
    color: var(--jotaele-black);
    background: transparent;
    font-size: 0.9rem;
    line-height: 1.2em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    white-space: nowrap;
}

.train-details-header-content .train-header-terminal.destination {
    flex: 0 1 50%;
}

.train-header-terminal.through {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-left: -7px;
    flex: 0 0 2.5rem;
}

.train-details-header-content .train-header-terminal.through .through-chevrons {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.train-details-header-content .train-header-terminal.through .through-chevron {
    width: 0.55rem;
    height: 0.55rem;
    border-top: 0.2rem solid var(--jotaele-color-button);
    border-right: 0.2rem solid var(--jotaele-color-button);
    transform: rotate(45deg);
    opacity: 0.25;
}

.train-details-header-content .train-header-terminal.through .through-chevron + .through-chevron {
    margin-left: -0.25rem;
}

.train-details-header-content .train-header-terminal.through .through-chevrons.train-flow-state--in-transit .through-chevron {
    animation: through-chevron-pulse 1.3s ease-in-out infinite;
}

.train-details-header-content .train-header-terminal.through .through-chevrons.train-flow-state--in-transit .through-chevron:nth-child(2) {
    animation-delay: 0.15s;
}

.train-details-header-content .train-header-terminal.through .through-chevrons.train-flow-state--in-transit .through-chevron:nth-child(3) {
    animation-delay: 0.3s;
}

.train-details-header-content .train-header-terminal.through .through-chevrons.train-flow-state--origin .through-chevron {
    opacity: 1;
}

.train-details-header-content .train-header-terminal.through .through-chevrons.train-flow-state--destination .through-chevron {
    opacity: 1;
    border-top: 0.2rem solid var(--jotaele-success);
    border-right: 0.2rem solid var(--jotaele-success);
}

@keyframes through-chevron-pulse {
    0% {
        opacity: 0.2;
        transform: translateX(0) rotate(45deg);
    }
    30% {
        opacity: 1;
        transform: translateX(0) rotate(45deg);
    }
    60% {
        opacity: 0.4;
        transform: translateX(0) rotate(45deg);
    }
    100% {
        opacity: 0.2;
        transform: translateX(0) rotate(45deg);
    }
}

.mini-route-map-grid {
    --line-route-width: 4px;
    --number-of-stations: 3;
    --icon-dot-size: calc(var(--line-route-width) * 2.9);

    display: grid;
    grid-template-rows: auto;
    grid-template-columns: auto repeat(var(--number-of-stations), 1fr) auto;
    grid-row-gap: calc(var(--app-margin) * 0.3);
    grid-auto-flow: column dense;
}

.mini-route-map-grid .route-line-wrapper {
    display: flex;
    width: 100%;
    height: var(--icon-dot-size);
    position: relative;
    align-items: center;
    justify-content: center;
}

.mini-route-map-grid .route-line-fragment {
    display: block;
    position: absolute;
    height: var(--line-route-width);
    width: calc(100% + 1px);
    background: var(--line-color);
    top: calc(50% - (var(--line-route-width) / 2));
}

.mini-route-map-grid .route-dot {
    position: absolute;
    content: "";
    display: block;
    border-radius: 100%;
    z-index: 2;
    width: var(--icon-dot-size);
    height: var(--icon-dot-size);
    background: var(--line-color);
    box-sizing: border-box;
    transition: box-shadow 0.3s var(--vt-ease);
    top: calc(50% - (var(--icon-dot-size) / 2));
}

.mini-route-map-grid .grid-route-map-station.origin-station .route-dot {
    border: 3px solid var(--line-color);
    background: var(--jotaele-white);
}

.mini-route-map-grid .grid-route-map-station.through-station {
    --through-ellipsis-dot-size: calc(var(--line-route-width) * 1);
    --through-ellipsis-inner-gap: calc(var(--through-ellipsis-dot-size) * 2);
    --through-ellipsis-outer-gap: calc(var(--through-ellipsis-dot-size) * 5);
    --through-ellipsis-break: calc(var(--through-ellipsis-outer-gap));
}

.mini-route-map-grid .grid-route-map-station.through-station .route-line-fragment {
    background: linear-gradient(
            to right,
            var(--line-color) 0 calc(50% - var(--through-ellipsis-break)),
            transparent calc(50% - var(--through-ellipsis-break)) calc(50% + var(--through-ellipsis-break)),
            var(--line-color) calc(50% + var(--through-ellipsis-break)) 100%
    );
}

.mini-route-map-grid .grid-route-map-station.through-station .route-dot {
    top: calc(50% - (var(--through-ellipsis-dot-size) / 2));
    left: 50%;
    width: var(--through-ellipsis-dot-size);
    height: var(--through-ellipsis-dot-size);
    border-radius: 50%;
    transform: translateX(-50%);
    background: var(--line-color);
    border: 0;
    box-shadow:
            calc(var(--through-ellipsis-inner-gap) * -1) 0 0 var(--line-color),
            calc(var(--through-ellipsis-inner-gap) * 1) 0 0 var(--line-color),
            calc(var(--through-ellipsis-outer-gap) * -1) 0 0 var(--line-color),
            calc(var(--through-ellipsis-outer-gap) * 1) 0 0 var(--line-color);
}

.mini-route-map-grid .grid-route-line {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.mini-route-map-grid .route-line-time {
    display: inline-flex;
    align-items: baseline;
    gap: calc(var(--app-margin) * 0.3);
}

.mini-route-map-grid .grid-route-map-station.destination-station .route-line-time {
    justify-content: flex-end;
}

.mini-route-map-grid .grid-time-cell {
    display: flex;
    align-items: center;
}

.mini-route-map-grid .grid-line-cell,
.mini-route-map-grid .grid-route-map-station {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-route-map-grid .grid-time-cell .route-line-time {
    justify-content: center;
}

.mini-route-map-grid .grid-time-cell.origin-station .route-line-time {
    margin-right: 0.3rem;
}

.mini-route-map-grid .grid-time-cell.destination-station .route-line-time {
    margin-left: 0.3rem;
}

.mini-route-map-grid .grid-route-station-info {
    display: none;
}

.mini-route-map-grid .grid-route-map-station.origin-station .route-line-wrapper,
.mini-route-map-grid .grid-route-map-station.origin-station .grid-route-station-info {
    display: flex;
    justify-content: flex-start;
}

.mini-route-map-grid .grid-route-map-station.destination-station .route-line-wrapper,
.mini-route-map-grid .grid-route-map-station.destination-station .grid-route-station-info {
    display: flex;
    justify-content: flex-end;
}

.mini-route-map-grid .arrival-hour,
.next-station-time-area .arrival-hour {
    color: var(--jotaele-text-muted);
    font-weight: 500;
    font-size: 1.1rem;
    display: flex;
    font-family: 'Rubik', sans-serif;
    flex-direction: column;
    white-space: nowrap;
}

.mini-route-map-grid .station-block.destination-station .arrival-hour {
    text-align: right;
}

.arrival-hour-sched {
    color: var(--jotaele-black);
    font-weight: 400;
    font-size: 1rem;
}

.arrival-hour-sched.train-arrival-time--late {
    color: var(--jotaele-error);
    text-decoration: line-through;
}

.arrival-hour-sched.train-arrival-time--early {
    color: var(--jotaele-success);
    text-decoration: line-through;
}

.mini-route-map-grid .station-label {
    color: var(--jotaele-text-subtle);
    font-size: 0.9rem;
    font-weight: 400;
}

.mini-route-map-labels .station-label {
    color: var(--jotaele-text-subtle);
    font-size: 1rem;
    display: flex;
    font-weight: 400;
    gap: 0.4rem;
}

.station-status-label {
    display: none;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    font-family: 'Rubik', sans-serif;
    font-size: 0.9rem;
    font-weight: 450;
    letter-spacing: 0.1px;
    line-height: 1;
    color: var(--jotaele-color-button);
    margin-bottom: calc(var(--app-margin) * 0.7);
}

.station-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--jotaele-background-accent);
    color: var(--jotaele-color-button);
    flex-shrink: 0;
}

.station-status-icon .material-symbols-rounded {
    font-size: 0.7rem;
    line-height: normal;
    font-variation-settings: "FILL" 0, "wght" 700, "GRAD" 0, "opsz" 24;
}

.mini-route-label.through-label .station-status-label {
    justify-content: center;
    text-align: center;
    margin: 0 auto;
    max-width: 100%;
}

.mini-route-map-labels {
    display: grid;
    align-items: flex-start;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
}

.mini-route-label {
    display: flex;
    align-items: center;
    min-height: 1.5rem;
}

.mini-route-label.origin-label {
    grid-column: 1 / 2;
    justify-content: flex-start;
}

.mini-route-label.through-label {
    grid-column: 2 / 3;
    justify-content: space-between;
}

.mini-route-label.destination-label {
    grid-column: 3 / 4;
    justify-content: flex-end;
}

.mini-route-label.through-label .station-label-text {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex: 0 1 auto;
    line-height: 1.1em;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
}

.mini-route-label.through-label .station-label-text .train-status-label {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    font-size: 0.9rem;
    text-align: left;
}

.accessibility-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 100%;
    font-size: 0.8rem;
    background: var(--jotaele-color-button);
    color: var(--jotaele-white);
    height: 1.1rem;
    width: 1.1rem;
}

.accessibility-badge.accessible {
    background: var(--jotaele-blue);
}

.accessibility-badge i {
    font-variation-settings: "FILL" 0, "wght" 700, "GRAD" 0, "opsz" 24;
}

.train-details-header .accessibility-badge-block {
    margin-left: 0.3rem;
    display: flex;
    align-items: center;
}

/*.train-details-header .accessibility-badge-block:before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-right: 0.4rem;
    border-radius: 100%;
    background: var(--jotaele-color-button);
}*/

/* - Trains detail route map - */

.train-details-padding {
    mask-image: linear-gradient(to bottom, transparent 0%, black var(--app-margin), black 100%);
    padding-bottom: calc((var(--bottom-nav-height) * 3.3));
}

.train-status-route-map {
    padding: 0 calc(var(--app-margin) / 2);
}

.grid-route-map .grid-route-map-station.passed-station .grid-route-line .route-line-fragment {
    background: var(--jotaele-text-subtle) !important;
}

.grid-route-map .grid-route-map-station.passed-station .grid-route-line .route-dot,
.grid-route-map.train-status--enroute .grid-route-map-station.current-station .grid-route-line .route-dot,
.grid-route-map.train-status--arriving .grid-route-map-station.current-station .grid-route-line .route-dot {
    border-color: var(--jotaele-text-subtle) !important;
}

.grid-route-map .grid-route-map-station.passed-station .station-name,
.grid-route-map .grid-route-map-station.passed-station .stop-time,
.grid-route-map.train-status--enroute .grid-route-map-station.current-station .station-name,
.grid-route-map.train-status--enroute .grid-route-map-station.current-station .stop-time,
.grid-route-map.train-status--arriving .grid-route-map-station.current-station .station-name,
.grid-route-map.train-status--arriving .grid-route-map-station.current-station .stop-time{
    color: var(--jotaele-text-subtle) !important;
}

.grid-route-map .grid-route-map-station.passed-station .delay-label,
.grid-route-map.train-status--enroute .grid-route-map-station.current-station .delay-label,
.grid-route-map.train-status--arriving .grid-route-map-station.current-station .delay-label {
    opacity: 0.6;
}

.grid-route-map .stop-times {
    display: flex;
    gap: calc(var(--app-margin) * 0.6);
}

.grid-route-map .stop-time {
    display: inline-block;
    color: var(--jotaele-text-muted);
    font-weight: 400;
}

.grid-route-map .stop-time.scheduled-time {
    font-weight: 300;
}

.grid-route-map .stop-times dd {
    display: block;
    margin-inline-start: 0;
}

.grid-route-map .stop-times .scheduled-time-is-not-current .stop-time-label {
    text-decoration: line-through;
    font-weight: 300;
}

.grid-route-map .grid-route-map-station.passed-station .stop-time.scheduled-time:not(.scheduled-time-is-not-current),
.grid-route-map.live-train .grid-route-map-station:not(.destination-station):not(.passed-station):not(.current-station) .stop-times .delay-label {
    display: none;
}


.grid-route-map .stop-times .stop-time-label.delay-label {
    color: var(--jotaele-error);
    font-weight: 300;
    font-size: 0.9em;
}

.grid-route-map .stop-times .stop-time-label.delay-label.advanced-train {
    color: var(--jotaele-success);
}

.grid-route-train-platform .platform-badge {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 4px;
}

.grid-route-train-platform .platform-chip {
    margin-right: 0.25rem;
    margin-top: 0.45rem;
}

.grid-route-train-platform .platform-unit {
    font-size: 1rem;
}

.grid-route-map .grid-route-map-station.passed-station .platform-badge,
.grid-route-map.train-status--enroute .grid-route-map-station.current-station .platform-badge,
.grid-route-map.train-status--arriving .grid-route-map-station.current-station .platform-badge {
    opacity: 0.6;
}

.grid-route-map.train-status--enroute .grid-route-map-station.current-stop .route-line-fragment,
.grid-route-map.train-status--arriving .grid-route-map-station.current-stop .route-line-fragment {
    background: linear-gradient(to bottom,
    var(--jotaele-text-subtle) 0%,
    var(--jotaele-text-subtle) var(--next_stop_progress_pos),
    var(--line-color) var(--next_stop_progress_pos)
    ) !important;
    transition: --next_stop_progress_pos 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.grid-route-map-header {
    padding: calc(var(--app-margin) / 2) 0 calc(var(--app-margin) / 1.5) 0;
    margin: 0 calc(var(--app-margin) * 0.5) 0;
    color: var(--jotaele-text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 400;
}

/* - Train position indicator - */

.grid-route-map .grid-route-map-station.current-stop .route-line-fragment::after,
.grid-route-map.train-status--stopped .grid-route-map-station.current-stop .route-dot {
    width: var(--icon-dot-size);
    height: var(--icon-dot-size);
    transform: scale(var(--train-marker-scale));
    background: var(--line-color) url(/static/img/icon-train-position-white.svg) no-repeat center;
    background-size: round(nearest, calc(var(--icon-dot-size) / 1.4 / var(--train-marker-scale)), 1px);
    border: var(--train-marker-border-size) solid var(--jotaele-background);
    z-index: 10;
    box-sizing: content-box;
    transition: background 0.18s ease;
}

.grid-route-map .grid-route-map-station.current-stop .route-line-fragment::after {
    content: '';
    position: absolute;
    top: var(--next_stop_progress_pos);
    left: 50%;
    transform: translate(-50%, -50%) scale(var(--train-marker-scale));
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: none;
    transition: top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.18s ease-out;
}

.grid-route-map.train-status--enroute .grid-route-map-station.current-stop .route-line-fragment::after,
.grid-route-map.train-status--arriving .grid-route-map-station.current-stop .route-line-fragment::after,
.grid-route-map.train-status--stopped .grid-route-map-station.current-stop .route-dot::after {
    opacity: 1;
    animation:
        trainPulse 2s ease-in-out infinite,
        trainBlink 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

@keyframes trainPulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--line-color) 45%, transparent);
    }
    100% {
        box-shadow: 0 0 0 10px transparent;
    }
}

@keyframes trainBlink {
    0%, 100% {
        background-color: var(--line-color);
    }
    50% {
        background-color: color-mix(in srgb, var(--line-color), white 30%);
    }
}

@keyframes trainBlinkGhost {
    0%, 100% {
        background-color: var(--jotaele-text-subtle);
    }
    50% {
        background-color: color-mix(in srgb, var(--jotaele-text-subtle), white 30%);
    }
}

/* Highlight for current stop when train is at station and for next stop when train is between stations */

.grid-route-map:is(.train-status--arriving, .train-status--enroute) .grid-route-map-station.next-stop .station-name {
    font-weight: 900;
}

.grid-route-map:is(.train-status--stopped) .grid-route-map-station.current-stop .station-name {
    animation: blinkOpacity 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.grid-route-map.train-status--stopped .grid-route-map-station.current-stop .route-dot {
    animation:
        trainPulse 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite,
        trainBlink 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.grid-route-map:is(.train-status--arriving, .train-status--enroute) .grid-route-map-station.next-stop .route-dot {
    animation: blinkRouteDot 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

@keyframes blinkRouteDot {
    0%, 40%, 100% {
        background-color: var(--jotaele-white);
    }
    50%, 90% {
        background-color: var(--jotaele-color-button);
    }
}

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

/* - Ghost train mode - */

.grid-route-map.ghost-train.train-status--enroute .grid-route-map-station.current-stop .route-line-fragment::after,
.grid-route-map.ghost-train.train-status--arriving .grid-route-map-station.current-stop .route-line-fragment::after,
.grid-route-map.ghost-train.train-status--stopped .grid-route-map-station.current-stop .route-dot {
    animation: trainBlinkGhost 2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    background: var(--jotaele-color-button) url(/static/img/icon-train-position-white.svg) no-repeat center;
    background-size: round(nearest, calc(var(--icon-dot-size) / 1.4 / var(--train-marker-scale)), 1px);
}

/* - Technical stops - */

.grid-route-map-station.technical-station {
    position: relative;
}

.grid-route-map-station.technical-station .route-dot {
    background: var(--jotaele-warning) !important;
}

.grid-route-map-station.technical-station .grid-route-station-name {
    color: var(--jotaele-warning);
}

.grid-route-map-station .station-name-subtitle {
    font-size: 0.8em;
    color: var(--jotaele-text-subtle);
    display: block;
    margin-top: 0.2em;
}

/* - Information toast - */

.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + (var(--app-margin) * 2.6));
    left: 50%;
    transform: translate(-50%, 0);
    background: color-mix(in srgb, var(--jotaele-blue) 65%, transparent);
    backdrop-filter: blur(8px);
    color: var(--jotaele-white);
    padding: calc(var(--app-margin) * 0.5) calc(var(--app-margin) * 1.5) calc(var(--app-margin) * 0.5) calc(var(--app-margin) * 1);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100% - (var(--app-margin) * 12));
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    width: auto;
    box-sizing: border-box;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: transform 300ms cubic-bezier(.21, 1.02, .73, 1), opacity 200ms ease;
}

body:has(.train-map-container) .toast-container {
    z-index: 100000;
}

.toast-container[data-toast-type="stale"] {
    background: color-mix(in srgb, var(--jotaele-text-muted) 70%, transparent);
    color: var(--jotaele-white);
}

.toast-container[data-toast-type="stale"] .toast-icon {
    background: var(--jotaele-white);
    color: var(--jotaele-text-muted);
}

.toast-container.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: calc(var(--app-margin) / 1.5);
}

.toast-icon {
    font-size: 1.1rem;
    line-height: 1;
    flex: 0 0 auto;
    background: var(--jotaele-white);
    color: var(--jotaele-blue);
    border-radius: 100%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon i {
    font-variation-settings: "FILL" 0, "wght" 600, "GRAD" 0, "opsz" 20;
    padding-top: 3px;
}

.toast-text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.toast-title {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.1em;
    text-align: left;
}

.toast-body,
.toast-message {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.15em;
    text-align: left;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/*
body {
    background: url(/static/img/prueba3.jpg);
    background-size: auto 96%;
    background-position: 0 26px;
}*/
