/* Statistics — the movement tab ("Ruch"). Colours come from the shared stats tokens in stats.css,
   so the tab follows the light and dark themes without its own palette. */

/* ── Section ─────────────────────────────────────────────────────────────── */

.mv-section { margin-top: 1.25rem; }
.mv-section > p { color: var(--text-sec); margin: 0.25rem 0 0.75rem; }
.mv-note { color: var(--text-sec); font-size: 0.85rem; margin: 0.5rem 0 0; }
.mv-sub { margin-top: 1rem; }
.mv-sub-title { font-weight: 600; color: var(--stats-strong); margin: 0.75rem 0 0.25rem; }
.mv-foot { margin-top: 0.75rem; }
.mv-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }

.mv-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.75rem 0; }
.mv-tiles--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mv-tiles strong { display: block; font-size: 1.25rem; color: var(--stats-strong); }
.mv-tiles span { display: block; font-size: 0.8rem; color: var(--text-sec); }

/* ── Hour charts ─────────────────────────────────────────────────────────── */

.mv-chart { margin: 0.5rem 0 0.25rem; }
.mv-chart-body { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0.25rem; }
.mv-chart-y { position: relative; }
.mv-chart-tick { position: absolute; right: 0; font-size: 0.7rem; color: var(--text-sec); transform: translateY(0); }
.mv-chart-plot {
    display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); align-items: end; gap: 2px;
    border-bottom: 1px solid var(--stats-axis); position: relative;
}
.mv-bar-col {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%;
    background: none; border: 0; padding: 0; margin: 0; cursor: pointer; min-width: 0;
}
.mv-bar-col:disabled { cursor: default; }
.mv-bar-col--sel .mv-bar { outline: 2px solid var(--accent); outline-offset: 1px; }
.mv-bar {
    display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px;
}
.mv-bar--warn { background: var(--warn); }
.mv-bar--grey { background: var(--stats-unknown); }
.mv-bar-value {
    position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 2px);
    font-size: 0.7rem; color: var(--stats-strong); white-space: nowrap;
}
.mv-chart-x {
    display: flex; justify-content: space-between; margin-left: 2.5rem; font-size: 0.7rem; color: var(--text-sec);
}

/* ── Lists (phone rows and grouped rows) ────────────────────────────────── */

.mv-groups { display: grid; gap: 0.5rem; }
.mv-group { background: var(--stats-card-bg); border-radius: 0.75rem; padding: 0.5rem 0.75rem; }
.mv-group-head { display: flex; justify-content: space-between; gap: 0.5rem; color: var(--text-main); text-decoration: none; }
.mv-group-head span { color: var(--text-sec); font-size: 0.85rem; }
.mv-group-row { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center; padding: 0.25rem 0; color: var(--text-main); text-decoration: none; }
.mv-group-row span { color: var(--text-sec); font-size: 0.85rem; text-align: right; }

.mv-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0.5rem; align-items: center;
    background: var(--stats-card-bg); border-radius: 0.75rem; padding: 0.6rem 0.75rem;
    color: var(--text-main); text-decoration: none;
}
.mv-row-no { color: var(--text-sec); font-size: 0.8rem; min-width: 1.5rem; }
.mv-row-main { display: grid; gap: 0.2rem; min-width: 0; }
.mv-row-main strong, .mv-row-speed strong { overflow-wrap: anywhere; }
.mv-row-lines { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.mv-row-speed { text-align: right; display: grid; gap: 0.1rem; }
.mv-row-speed span { color: var(--text-sec); font-size: 0.8rem; }
.mv-row svg { color: var(--text-sec); }

.mv-line {
    display: inline-block; min-width: 2.2rem; text-align: center; border-radius: 0.4rem;
    padding: 0.1rem 0.4rem; font-weight: 700; font-size: 0.85rem; background: var(--stats-chip); color: var(--stats-strong);
}
.mv-kind--tramwaj { background: var(--accent); color: #0b0f1a; }
.mv-kind--autobus { background: var(--stats-chip); color: var(--stats-strong); }
.mv-line-cell { display: inline-flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }

.mv-mark {
    justify-self: end; font-size: 0.7rem; font-weight: 600; border-radius: 999px; padding: 0.1rem 0.5rem;
}
.mv-mark--slow { background: var(--warn); color: #0b0f1a; }
.mv-mark--fast { background: var(--stats-ontime); color: #0b0f1a; }

/* ── Speed by line (phone bars, wide strip) ─────────────────────────────── */

.mv-line-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; padding: 0.2rem 0; }
.mv-line-name { font-weight: 700; color: var(--stats-strong); }
.mv-line-track { height: 0.6rem; background: var(--stats-track); border-radius: 999px; overflow: hidden; }
.mv-line-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.mv-line-value { font-size: 0.85rem; color: var(--text-sec); white-space: nowrap; }

.mv-strip { position: relative; height: 1.25rem; border-bottom: 1px solid var(--stats-axis); margin: 0.75rem 0; }
.mv-strip-tick {
    position: absolute; bottom: 0; width: 2px; height: 100%; background: var(--accent); transform: translateX(-1px);
}
.mv-strip-tick--slow { background: var(--warn); }

/* ── Controls, status and the list head ─────────────────────────────────── */

.mv-controls { margin: 0.5rem 0; }
.mv-list-head h1 { margin: 0.25rem 0; }
.mv-list-head p { color: var(--text-sec); margin: 0.25rem 0; }
.mv-status { color: var(--text-sec); font-size: 0.9rem; margin: 0.5rem 0; }

/* ── Tap card and the card of one segment ───────────────────────────────── */

.mv-dl { display: grid; grid-template-columns: auto auto; gap: 0.25rem 0.75rem; margin: 0 0 0.5rem; }
.mv-dl dt { color: var(--text-sec); }
.mv-dl dd { margin: 0; text-align: right; color: var(--stats-strong); font-weight: 600; }
.mv-diff--slow { color: var(--warn); }
.mv-card-label { font-weight: 600; color: var(--stats-strong); margin: 0.5rem 0 0.25rem; }
.mv-card-lines { display: grid; gap: 0.35rem; }
.mv-card-line { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; }
.mv-track { height: 0.5rem; background: var(--stats-track); border-radius: 999px; overflow: hidden; }
.mv-fill { display: block; height: 100%; background: var(--warn); border-radius: 999px; }

/* ── Wide layout: the table and the strip keep their padding ────────────── */

@media (min-width: 960px) {
    .mv-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mv-tiles--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .mv-chart-plot { height: 180px; }
}
