/* Deep navy on off-white with an orange accent: an independent look, not a carrier's. */
@font-face {
    font-family: "Fraunces";
    src: url("../fonts/fraunces-latin-opsz-normal-SfWU466.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --navy: #1b2a4a;
    --accent: #e8601c;
    --link: #24508f;
    --surface: #ffffff;
    --page: #f6f3ee;
    --ink: #172238;
    --ink-muted: #5e6372;
    --line: #e2ddd3;
    --grid: #ebe7df;
    --strong-bg: var(--navy);
    --strong-ink: #ffffff;
    --up: #007a3d;
    --down: #b3261e;
    --series-actual: #2f5ea8;
    --series-expected: #c25e00;
    --series-band: rgba(194, 94, 0, 0.14);
    --series-actual-band: rgba(47, 94, 168, 0.14);
    --fill-above: rgba(47, 94, 168, 0.3);
    --fill-below: rgba(194, 94, 0, 0.3);
    /* The navy band at the top: top bar and page head in one. */
    --mast-bg: var(--navy);
    --mast-ink: #f6f3ee;
    --mast-muted: #c3cadb;
    --mast-accent: #ff8a4c;
    --mast-edge: #ffc917;
    --accent-ink: #b5470e;
    /* NS yellow, with a dark gold edge so a filled star still stands out 3:1 on white. */
    --star: #ffc917;
    --star-edge: #8a6700;
    --track-on-tint: rgba(23, 34, 56, 0.12);
    /* Status: text colours meet 4.5:1 on the surface, dot colours 3:1. */
    --plenty: #007a3d;
    --plenty-dot: #1f9254;
    --plenty-bg: #e3f4ea;
    --tight: #8a5300;
    --tight-dot: #c98800;
    --tight-bg: #fff1cc;
    --empty: #b3261e;
    --empty-dot: #d0342b;
    --empty-bg: #fbe3e1;
    --unknown-dot: #a3a3b5;
    --heat-0: #b3261e;
    --heat-0-ink: #ffffff;
    --heat-1: #f6c445;
    --heat-1-ink: #2e2000;
    --heat-2: #dbe8fb;
    --heat-2-ink: #0b2a5c;
    --heat-3: #9fc2f2;
    --heat-3-ink: #0b2a5c;
    --heat-4: #2f6fd0;
    --heat-4-ink: #ffffff;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(23, 34, 56, 0.06), 0 2px 8px rgba(23, 34, 56, 0.04);
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 16px/1.5 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

a {
    color: var(--link);
}

h1, h2, h3 {
    font-family: "Fraunces", Georgia, "Times New Roman", serif;
    font-weight: 600;
    font-optical-sizing: auto;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 0.5rem;
}

h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.7rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.1rem;
}

code {
    background: var(--grid);
    padding: 0 4px;
    border-radius: 4px;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

.skip {
    position: absolute;
    left: -999px;
}

.skip:focus {
    left: 16px;
    top: 8px;
    z-index: 10;
    background: var(--surface);
    padding: 8px 12px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Top bar and masthead: one navy band */

.topbar,
.masthead {
    background: var(--mast-bg);
    color: var(--mast-ink);
}

.topbar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    min-height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--mast-ink);
    text-decoration: none;
}

.brand__icon {
    flex: none;
    width: 38px;
    height: 38px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* The availability dot: the logo says what the site does. */
.brand__dot {
    fill: var(--plenty-dot);
    stroke: var(--mast-bg);
    stroke-width: 2;
}

.brand__text {
    display: flex;
    flex-direction: column;
}

.brand__name {
    font-family: "Fraunces", Georgia, "Times New Roman", serif;
    font-weight: 650;
    font-size: 1.35rem;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.brand__badge {
    display: inline-block;
    padding: 0.2em 0.38em 0.14em;
    border-radius: 0.3em;
    background: var(--mast-edge);
    color: var(--mast-bg);
    font-family: system-ui, sans-serif;
    font-size: 0.62em;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.06em;
    vertical-align: 0.22em;
}

.brand__tagline {
    color: var(--mast-muted);
    font-size: 0.8rem;
    line-height: 1.3;
}

.topbar__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
}

.topbar__nav a {
    color: var(--mast-ink);
    font-weight: 600;
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 3px solid transparent;
}

.topbar__nav a[aria-current="page"] {
    border-bottom-color: var(--mast-accent);
}

.topbar__nav a:hover,
.topbar__nav a:focus-visible {
    text-decoration: underline;
}

.masthead {
    padding: 12px 0 32px;
    border-bottom: 4px solid var(--mast-edge);
}

.masthead a:not(.button) {
    color: var(--mast-ink);
}

.topbar :focus-visible,
.masthead :focus-visible {
    outline-color: var(--mast-accent);
}

.masthead h1 {
    margin-bottom: 6px;
}

.stale {
    background: var(--tight-bg);
    color: var(--tight);
    font-weight: 600;
    padding: 10px 0;
}

.main__body {
    padding-top: 24px;
    padding-bottom: 48px;
}

/* A part that assets/live.js swaps after a new count; the wrapper itself takes no place in the layout. */
.live {
    display: contents;
}

/* Navigation between the parts of a location page, stuck to the top of the screen while scrolling */

.sections {
    position: sticky;
    top: 0;
    z-index: 6;
    margin: -12px -4px 12px;
    padding: 10px 4px;
    background: var(--page);
}

.sections__list {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.sections__link {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

.sections__link:hover {
    border-color: currentColor;
}

.tiles--location {
    scroll-margin-top: 80px;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

.crumbs {
    margin: 0 0 8px;
}

.crumbs a::before {
    content: "\2190\00a0";
}

/* Hero, inside the masthead */

.hero__meta {
    color: var(--mast-muted);
    margin: 0;
}

.hero--home {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.hero--home h1 {
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    letter-spacing: -0.025em;
    max-width: 14ch;
}

/* "nu" gets an orange underline: the one word the site is about. */
.hero__mark {
    text-decoration: underline;
    text-decoration-color: var(--mast-accent);
    text-decoration-thickness: 0.1em;
    text-underline-offset: 0.12em;
    text-decoration-skip-ink: none;
}

/* A bike rack: one slot with plenty, one tight, one empty. */
.rack {
    flex: none;
    width: 330px;
    height: auto;
    margin-bottom: -32px;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rack__ground {
    stroke: var(--mast-muted);
    stroke-width: 2;
    opacity: 0.5;
}

.rack__stand {
    stroke: var(--mast-muted);
    stroke-width: 3;
    opacity: 0.45;
}

.rack__bike {
    stroke: var(--mast-ink);
    stroke-width: 1.4;
}

.rack__dot {
    stroke: var(--mast-bg);
    stroke-width: 3;
}

.rack__dot--plenty {
    fill: var(--plenty-dot);
}

.rack__dot--tight {
    fill: var(--tight-dot);
}

.rack__dot--empty {
    fill: none;
    stroke: var(--mast-muted);
    stroke-width: 2;
    stroke-dasharray: 3 3;
}

.hero--location {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
}

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

/* Buttons and the star */

.button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 16px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.button:hover {
    border-color: var(--ink-muted);
}

.button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    padding: 6px;
    margin: -6px 0;
    color: var(--ink-muted);
    cursor: pointer;
    border-radius: 999px;
}

.star svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.star[aria-pressed="true"] {
    color: var(--star-edge);
}

.star[aria-pressed="true"] svg {
    fill: var(--star);
}

.star--labelled {
    margin: 0;
    padding: 8px 16px;
    color: var(--ink);
    border: 1px solid var(--line);
    background: var(--surface);
}

.star--labelled svg {
    width: 18px;
    height: 18px;
}

.star--labelled[aria-pressed="true"] {
    color: var(--ink);
    border-color: var(--star-edge);
}

/* Finder: at the top of the card with all locations, and stuck to the top of the screen while scrolling through it */

.finder {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 4px;
    margin: 0 -4px;
    background: var(--surface);
}

.finder__options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin: 4px 0 8px;
}

.finder__options:not(:has(> :not([hidden]))) {
    display: none;
}

.finder__field {
    position: relative;
    flex: 1 1 260px;
}

.finder__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--ink-muted);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.finder input {
    width: 100%;
    font: inherit;
    font-size: 1.1rem;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.finder input:focus {
    outline: none;
    border-color: var(--link);
}

.finder .button {
    padding: 10px 18px;
}

.finder__status:empty {
    display: none;
}

.finder__status {
    margin: 0 0 8px;
}

.hint {
    margin: 0 0 8px;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

/* Laatst bekeken: one row of small links, which scrolls sideways on a phone */

.recent {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    min-width: 0;
}

.recent__title {
    flex: none;
    margin: 0;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-ink);
}

.chips {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-left: 4px solid var(--unknown-dot);
    border-radius: 999px;
    background: var(--page);
    font-size: 0.9rem;
}

.chip--plenty {
    border-left-color: var(--plenty-dot);
}

.chip--tight {
    border-left-color: var(--tight-dot);
}

.chip--empty {
    border-left-color: var(--empty-dot);
}

.chip__link {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    color: var(--ink);
    text-decoration: none;
}

.chip__link:hover .chip__name {
    text-decoration: underline;
}

.chip__count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.chip__forget {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 999px;
    color: var(--ink-muted);
    cursor: pointer;
}

.chip__forget:hover {
    background: var(--surface);
    color: var(--ink);
}

.chip__forget svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

/* While searching only the results matter */

.is-searching [data-hide-when-searching] {
    display: none !important;
}

/* Mijn OV-fiets */

.digest__summary h2 {
    margin-top: 0;
}

.digest__summary p {
    margin: 0 0 6px;
}

.digest__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0 20px;
}

.digest-card {
    border-left: 6px solid var(--unknown-dot);
}

.digest-card--plenty {
    border-left-color: var(--plenty-dot);
}

.digest-card--tight {
    border-left-color: var(--tight-dot);
}

.digest-card--empty {
    border-left-color: var(--empty-dot);
}

.digest-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.digest-card__head h3 {
    margin: 0;
    line-height: 1.25;
}

.digest-card__head h3 a {
    color: var(--ink);
}

.digest-card__city {
    margin: 2px 0 0;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.digest-card__now {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 8px;
}

.digest-card__count {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.digest-card__state {
    display: grid;
    justify-items: start;
    gap: 2px;
}

.digest-card__state .status {
    margin-left: 0;
}

.digest-card__trend {
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.digest-card .bar {
    display: block;
    width: 100%;
    height: 6px;
}

.digest-card__ahead {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 14px 0 0;
}

.digest-card__ahead div {
    background: var(--page);
    border-radius: 8px;
    padding: 6px 10px;
}

.digest-card__ahead dt {
    color: var(--ink-muted);
    font-size: 0.8rem;
}

.digest-card__ahead dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.digest-card__outlook {
    margin: 12px 0 0;
    font-weight: 600;
}

.digest-card__week,
.digest-card__alternative {
    margin: 10px 0 0;
    font-size: 0.95rem;
}

.digest-card__week {
    color: var(--ink-muted);
}

/* Taking stars and lists to another device */

.share h2 {
    margin-top: 0;
}

.share__panel {
    margin-top: 8px;
    font-size: 0.95rem;
}

.share__row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.share__url {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 0.9rem;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}

.share .hint:empty {
    display: none;
}

.share .hint {
    margin-top: 6px;
}

.dialog {
    max-width: min(480px, calc(100vw - 32px));
    padding: 20px 24px;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 8px 32px rgba(7, 7, 33, 0.3);
}

.dialog::backdrop {
    background: rgba(7, 7, 33, 0.5);
}

.dialog h2 {
    margin-top: 0;
}

.dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.button--primary {
    background: var(--strong-bg);
    border-color: var(--strong-bg);
    color: var(--strong-ink);
}

.button--primary:hover {
    border-color: var(--ink);
}

/* Tiles */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.tile {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.tiles--national .tile {
    background: var(--page);
    box-shadow: none;
}

.tiles--rent {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tile__value--text {
    font-size: 1.6rem;
}

.facts__title {
    margin: 16px 0 4px;
    font-size: 1rem;
}

.facts__remark {
    margin: 0 0 6px;
}

.facts__note,
.facts__more {
    margin: 10px 0 0;
}

.tiles--location {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* The main tile takes a light tint of its status; the status word and the bar use the darker text colour. */
.tile--main {
    grid-column: span 2;
    border-top: 6px solid var(--unknown-dot);
}

.tile--plenty {
    background: var(--plenty-bg);
    border-top-color: var(--plenty-dot);
}

.tile--tight {
    background: var(--tight-bg);
    border-top-color: var(--tight-dot);
}

.tile--empty {
    background: var(--empty-bg);
    border-top-color: var(--empty-dot);
}

.tile--plenty .tile__status {
    color: var(--plenty);
}

.tile--tight .tile__status {
    color: var(--tight);
}

.tile--empty .tile__status {
    color: var(--empty);
}

.tile--main.tile--plenty .bar__fill {
    fill: var(--plenty);
}

.tile--main.tile--tight .bar__fill {
    fill: var(--tight);
}

.tile--main.tile--empty .bar__fill {
    fill: var(--empty);
}

.tile__status {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 2px;
}

.tile--main .tile__value {
    font-size: 3rem;
}

.tile--main .bar {
    margin: 6px 0 8px;
    max-width: 320px;
    height: 8px;
}

.tile--main .bar__track {
    fill: var(--track-on-tint);
}

.tile__trend {
    color: var(--ink) !important;
    font-weight: 600;
}

.tile--wait {
    grid-column: span 2;
}

/* The coming hours side by side in one tile, each with its clock time, the expected count and how that reads. */
.tile--ahead {
    grid-column: span 2;
}

.ahead {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.ahead__hour {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0 12px;
    border-left: 1px solid var(--line);
}

.ahead__hour:first-child {
    padding-left: 0;
    border-left: 0;
}

.ahead__when {
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.ahead__clock {
    display: block;
    color: var(--ink);
    font-weight: 600;
}

.ahead__value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.ahead .status {
    margin-left: 0;
}

.ahead__range {
    color: var(--ink-muted);
    font-size: 0.8rem;
}

.tile--wait .notice {
    margin: 6px 0 0;
}

.tile__label {
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.tile__value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.tile__note {
    color: var(--ink-muted);
    font-size: 0.85rem;
}

/* Cards */

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    /* Room for the sticky finder when scrolled into view. */
    scroll-margin-top: 80px;
}

.card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin-bottom: 8px;
}

.card__head h2 {
    margin: 0;
}

.card__count {
    margin: 0;
    flex: 1;
}

.card__intro {
    color: var(--ink-muted);
    margin-top: 0;
}

.notice {
    border-left: 4px solid var(--accent);
    padding-left: 12px;
}

.sort {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.sort select {
    font: inherit;
    color: var(--ink);
    background: var(--page);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 8px;
}

/* Pages of the table of locations */

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 16px;
}

.pager__status {
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.pager__size {
    margin-left: auto;
}

.button:disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
}

.button:disabled:hover {
    border-color: var(--line);
}

/* Bikes or e-bikes: a segmented control */

.kinds {
    display: inline-flex;
    margin: 0;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--page);
    font-size: 0.9rem;
}

.kinds label {
    position: relative;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.kinds input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.kinds label:has(input:checked) {
    background: var(--surface);
    font-weight: 600;
    box-shadow: var(--shadow);
}

.kinds label:has(input:focus-visible) {
    outline: 2px solid var(--link);
    outline-offset: 1px;
}

/* Arrival: how likely a bike is at a given time */

.arrival__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.arrival__form input {
    font: inherit;
    font-size: 1.1rem;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--page);
    color: var(--ink);
}

.arrival__hint {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.9rem;
}

.arrival__result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 6px solid var(--unknown-dot);
    background: var(--page);
}

.arrival__result p {
    margin: 0;
}

.arrival__chance {
    font-size: 1.2rem;
    font-weight: 700;
}

.arrival--sure,
.arrival--likely {
    border-left-color: var(--plenty-dot);
}

.arrival--sure .arrival__chance,
.arrival--likely .arrival__chance {
    color: var(--plenty);
}

.arrival--maybe {
    border-left-color: var(--tight-dot);
}

.arrival--maybe .arrival__chance {
    color: var(--tight);
}

.arrival--unlikely {
    border-left-color: var(--empty-dot);
}

.arrival--unlikely .arrival__chance {
    color: var(--empty);
}

.card--alternatives {
    border-left: 6px solid var(--plenty-dot);
}

.card--notice {
    border-left: 6px solid var(--accent);
}

.card--notice p {
    margin-bottom: 0;
}

/* Opening hours */

.opening__now {
    font-weight: 600;
    margin-top: 0;
}

.opening__now--closed {
    color: var(--accent-ink);
}

.opening,
.facts {
    border-collapse: collapse;
    margin-bottom: 8px;
}

.opening th,
.opening td,
.facts th,
.facts td {
    text-align: left;
    padding: 2px 16px 2px 0;
    font-weight: normal;
    vertical-align: top;
}

.facts th {
    color: var(--ink-muted);
}

.opening td {
    font-variant-numeric: tabular-nums;
}

.pattern-summary {
    font-weight: 600;
    margin: 0 0 6px;
}

/* Charts */

.chart {
    position: relative;
    height: 300px;
}

.chart__table {
    margin-top: 12px;
}

.chart__table summary {
    cursor: pointer;
    color: var(--link);
}

.chart__table .table {
    margin-top: 8px;
    font-size: 0.9rem;
}

/* Tables */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.table th {
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.table a {
    font-weight: 600;
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
}

.table--locations tbody tr:hover {
    background: var(--page);
}

.star-cell {
    width: 40px;
    padding-right: 0 !important;
}

.name-cell__city {
    display: none;
}

.num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.count-cell {
    min-width: 96px;
}

/* The label goes before the number, so the numbers line up on the right. */
.count-cell .status {
    margin: 0 4px 0 0;
}

.station-list__count .status {
    margin: 0;
}

.count-cell .bar {
    display: block;
    width: 80px;
    height: 5px;
    margin: 4px 0 0 auto;
}

.count {
    font-weight: 700;
}

.count--empty {
    color: var(--empty);
}

.count--tight {
    color: var(--tight);
}

.change--up {
    color: var(--up);
}

.change--down {
    color: var(--down);
}

.muted {
    color: var(--ink-muted);
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--grid);
    color: var(--ink-muted);
}

.badge--notice {
    background: transparent;
    border: 1px solid var(--accent-ink);
    color: var(--accent-ink);
    text-decoration: none;
}

/* Status label and bar */

.status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0 7px;
    border-radius: 999px;
    margin-left: 4px;
    vertical-align: 1px;
}

.status--plenty {
    background: var(--plenty-bg);
    color: var(--plenty);
}

.status--tight {
    background: var(--tight-bg);
    color: var(--tight);
}

.status--empty {
    background: var(--empty-bg);
    color: var(--empty);
}

.bar__track {
    fill: var(--grid);
}

.bar--plenty .bar__fill {
    fill: var(--plenty-dot);
}

.bar--tight .bar__fill {
    fill: var(--tight-dot);
}

.bar--empty .bar__fill {
    fill: var(--empty-dot);
}

/* Other locations at the station */

.station-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.station-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.station-list li:last-child {
    border-bottom: 0;
}

.station-list a {
    font-weight: 600;
    text-decoration: none;
}

.station-list__count {
    display: inline-flex;
    gap: 10px;
    align-items: baseline;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Week pattern */

/* On a phone the table scrolls sideways: the days stay in view, and a shade on a side means there is more there. */
.heat-frame {
    position: relative;
}

.heat-frame::before,
.heat-frame::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: var(--heat-scrollbar, 0);
    z-index: 2;
    width: 28px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.heat-frame::before {
    left: var(--heat-labels, 30px);
    background: linear-gradient(to right, var(--surface), transparent);
}

.heat-frame::after {
    right: 0;
    background: linear-gradient(to left, var(--surface), transparent);
}

.heat-frame--more-left::before,
.heat-frame--more-right::after {
    opacity: 1;
}

.heat-hint {
    margin: 0 0 6px;
    font-size: 0.85rem;
}

.heat-hint::before {
    content: "↔ ";
}

.heat-wrap {
    overflow-x: auto;
}

/* The shadows close the gaps of the border spacing, so no cell shows next to the day labels. */
.heat tbody th,
.heat thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    box-shadow: -2px 0 0 var(--surface), 2px 0 0 var(--surface);
}

.heat {
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    width: 100%;
    min-width: 640px;
}

.heat th {
    color: var(--ink-muted);
    font-weight: 600;
    padding: 2px;
}

.heat tbody th {
    text-align: left;
    padding-right: 6px;
}

.heat__cell {
    text-align: center;
    padding: 6px 0;
    border-radius: 4px;
    min-width: 24px;
}

.heat--none {
    background: var(--grid);
}

.heat--0 {
    background: var(--heat-0);
    color: var(--heat-0-ink);
}

.heat--1 {
    background: var(--heat-1);
    color: var(--heat-1-ink);
}

.heat--2 {
    background: var(--heat-2);
    color: var(--heat-2-ink);
}

.heat--3 {
    background: var(--heat-3);
    color: var(--heat-3-ink);
}

.heat--4 {
    background: var(--heat-4);
    color: var(--heat-4-ink);
}

.heat__cell--now {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
}

/* The average of the current hour so far, standing in for an average from earlier weeks that is not there yet. */
.heat__cell--current {
    font-style: italic;
}

/* Legend for the map and the week pattern */

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 8px 0 0;
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend__swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* National section with the map */

.national {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.national:has(> :only-child) {
    grid-template-columns: 1fr;
}

/* Leaflet's own z-indexes stay inside the map, below the sticky navigation. */
.map {
    margin: 0;
    isolation: isolate;
}

.map__svg {
    display: block;
    width: 100%;
    max-height: 520px;
}

.map__svg a {
    cursor: pointer;
}

/* The zoomable map (Leaflet on the PDOK background map) */

.map__tiles--spot {
    height: 320px;
}

.map__tiles .leaflet-interactive.dot--current {
    stroke: var(--ink);
    stroke-width: 3;
}

.map-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 12px 0 0;
}

.map-links__label {
    color: var(--ink-muted);
}

.map__tiles {
    height: 520px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--page);
    font: inherit;
}

.map__tiles .leaflet-interactive.dot {
    stroke: var(--surface);
}

.map__tiles .leaflet-interactive.dot:hover {
    stroke: var(--ink);
}

.map__tiles .leaflet-popup-content-wrapper,
.map__tiles .leaflet-popup-tip,
.map__tiles .leaflet-tooltip,
.map__tiles .leaflet-bar a {
    background: var(--surface);
    color: var(--ink);
}

.map__tiles .leaflet-popup-content {
    margin: 12px 16px;
}

.map__tiles .leaflet-control-attribution {
    background: var(--surface);
    color: var(--ink-muted);
}

.map__tiles .leaflet-control-attribution a {
    color: var(--link);
}

.map-popup {
    display: grid;
    gap: 2px;
}

.map-popup__name {
    font-weight: 700;
    font-size: 1rem;
}

.map-popup__status--plenty {
    color: var(--plenty);
}

.map-popup__status--tight {
    color: var(--tight);
}

.map-popup__status--empty {
    color: var(--empty);
}

.dot {
    stroke: var(--surface);
    stroke-width: 0.8;
}

.map__svg a:hover .dot {
    stroke: var(--ink);
    stroke-width: 1.5;
}

.dot--plenty {
    fill: var(--plenty-dot);
    background: var(--plenty-dot);
}

.dot--tight {
    fill: var(--tight-dot);
    background: var(--tight-dot);
}

.dot--empty {
    fill: var(--empty-dot);
    background: var(--empty-dot);
}

.dot--unknown {
    fill: var(--unknown-dot);
    background: var(--unknown-dot);
}

.map__city {
    font-size: 9px;
    font-weight: 600;
    fill: var(--ink-muted);
    paint-order: stroke;
    stroke: var(--surface);
    stroke-width: 3px;
    stroke-linejoin: round;
    pointer-events: none;
}

.national__chart h3 {
    margin-bottom: 4px;
}

.prose {
    max-width: 70ch;
}

.footer__name {
    font-family: "Fraunces", Georgia, "Times New Roman", serif;
    font-weight: 650;
    color: var(--ink);
}

.footer {
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 0.9rem;
    padding: 16px 0 32px;
}

@media (max-width: 760px) {
    .rack {
        display: none;
    }

    .national {
        grid-template-columns: 1fr;
    }

    .map__svg {
        max-height: 440px;
    }

    .map__tiles {
        height: 420px;
    }
}

/* Between phone and desktop the table is too wide for the screen: the city moves under the name. */
@media (max-width: 800px) {
    .table--locations .city-cell {
        display: none;
    }

    .table--locations th,
    .table--locations td {
        padding-inline: 5px;
    }

    .name-cell__city {
        display: block;
        color: var(--ink-muted);
        font-size: 0.85rem;
        font-weight: 400;
    }
}

/* Phones: every location row becomes a small card */
@media (max-width: 600px) {
    .card--table {
        padding: 12px;
    }

    /* "Bij mij in de buurt" becomes an icon next to the search field; the label stays for screen readers. */
    .finder {
        flex-wrap: nowrap;
    }

    .finder__field {
        flex-basis: auto;
        min-width: 0;
    }

    .finder .button {
        flex: none;
        padding: 10px 12px;
    }

    .finder__nearby-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .table--locations thead {
        display: none;
    }

    .table--locations tbody tr {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr) auto;
        grid-template-areas:
            "star name count"
            "star change count"
            "star distance count";
        align-items: center;
        gap: 0 8px;
        padding: 10px 4px;
        border-bottom: 1px solid var(--line);
    }

    .table--locations td {
        border: 0;
        padding: 0;
    }

    .table--locations .star-cell {
        grid-area: star;
        width: auto;
    }

    .table--locations .name-cell {
        grid-area: name;
    }

    .name-cell__city {
        display: block;
        color: var(--ink-muted);
        font-size: 0.85rem;
    }

    .table--locations .city-cell,
    .table--locations .lent-cell {
        display: none;
    }

    .table--locations .change-cell {
        grid-area: change;
        text-align: left !important;
        font-size: 0.85rem;
    }

    .table--locations .change-cell:not(:has(.change))  {
        display: none;
    }

    .table--locations .change-cell .change::after {
        content: " in het afgelopen uur";
        color: var(--ink-muted);
    }

    .table--locations .distance-cell {
        grid-area: distance;
        text-align: left !important;
        font-size: 0.85rem;
        color: var(--ink-muted);
    }

    .table--locations .count-cell {
        grid-area: count;
        min-width: 0;
    }

    .table--locations .count {
        font-size: 1.4rem;
    }

    /* On a phone the label sits under the number again. */
    .table--locations .count-cell {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .table--locations .count-cell .status {
        order: 1;
        margin: 0;
    }

    .table--locations .count-cell .bar {
        order: 2;
    }

    .tile--main,
    .tile--wait,
    .tile--ahead {
        grid-column: 1 / -1;
    }

    .ahead__hour {
        padding: 0 8px;
    }

    .ahead__value {
        font-size: 1.5rem;
    }

    .chart {
        height: 240px;
    }
}
