/* bahn.h15n.org: what the suite's shared.css doesn't have. Built only from its
   tokens (--page, --recess, --ink, --line, --line-strong, --accent, --mark), so
   both themes come for free. As in the suite, text is only ever --ink; the
   accent is a fill. */

:root {
  --gap: clamp(16px, 2.5vw, 24px);
  /* The brand colour is pale; on the light page a bar or line in it would be
     barely there (about 2:1). Data marks use this darker step in light mode,
     at least 3:1 against both page and recess, and the colour itself in dark. */
  --accent-strong: light-dark(color-mix(in srgb, var(--accent) 50%, #000), var(--accent));
}

.num, .entry__value, .verdict__figure, .facts dd, .connection__price, .chart__months {
  font-variant-numeric: tabular-nums;
}

.muted { font-size: 0.88em; opacity: 0.72; }
td .muted, th .muted { display: block; font-family: var(--font-sans); font-weight: 400; letter-spacing: 0; }

.narrow { max-width: 30em; }

.optional {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.72;
}

.hint {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.4;
}

/* Buttons. shared.css styles .button for links; these make <button>s match,
   and add a quiet variant on the page colour. */

button.button {
  border: 0;
  font-size: 1em;
  cursor: pointer;
}
.button--quiet, button.button--quiet,
main a.button--quiet {
  border: 1px solid var(--line-strong);
  background: var(--page);
  color: var(--ink);
}
.button:hover { background: color-mix(in srgb, var(--accent) 82%, var(--ink)); }
.button--quiet:hover { background: var(--recess); }
.button:disabled { opacity: 0.6; cursor: progress; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { text-decoration-thickness: 2px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 20px;
}

/* The site bar's call to action is a form here (signing out is a POST). */
.sitebar__form { margin: 0; }
button.sitebar__cta {
  border: 1px solid var(--line-strong);
  background: var(--page);
  color: var(--ink);
  cursor: pointer;
}
button.sitebar__cta:hover { background: var(--recess); }

/* Messages after an action. */

.flashes { margin-bottom: 24px; }
.flash {
  max-width: none;
  margin: 0 0 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--recess);
}
.flash--error { border-color: var(--mark-line); background: var(--mark); }

/* Forms: fields in a grid that wraps, labels above. */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13em), 1fr));
  gap: 16px var(--gap);
}
.field { min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field--check { align-self: end; padding-bottom: 8px; }
.form-grid input:not([type="checkbox"], [type="radio"]),
.form-grid select { max-width: none; }

/* iOS Safari gives date and time fields a minimum width of their own and
   ignores width: 100%, so in a narrow column they stick out past the screen
   and the whole page can be dragged sideways. Without the native appearance
   they size like any other input. The value would otherwise sit centred. */
input[type="date"],
input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  min-height: 2.75em;
}
input::-webkit-date-and-time-value { text-align: start; }
.when__row input[type="time"] { flex: 1; }

fieldset { max-width: none; margin-bottom: 24px; padding-bottom: 20px; }
fieldset.field { margin: 0; padding: 0; border: 0; }

/* A euro sign inside the field, so the number reads as money. */
.money { position: relative; }
.money::before {
  content: "€";
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}
.money input { padding-inline-start: 28px; }
.money--pct::before { content: "%"; left: auto; right: 12px; }
.money--pct input { padding-inline: 12px 30px; }
.money--count::before { content: none; }
.money--count input { padding-inline-start: 12px; }

.when__row { display: flex; gap: 8px; margin-top: 26px; }
.when__row select { flex: 0 0 auto; width: auto; }

/* Station autocomplete. */

.station { position: relative; }
.station__list {
  position: absolute;
  z-index: 4;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 18em;
  margin: 4px 0 0;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--page);
  list-style: none;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.14);
}
.station__list li {
  max-width: none;
  margin: 0;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
}
.station__list li[aria-selected="true"],
.station__list li:hover { background: var(--recess); }

/* Overview: the verdict. */

.verdict { margin-bottom: clamp(40px, 6vw, 72px); }

.verdict__figure {
  margin: 8px 0 16px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  isolation: isolate;
}
.verdict__figure mark {
  position: relative;
  z-index: -1;
  padding: 0 0.12em;
  border-radius: 0.14em;
}

.verdict .lede { max-width: 42em; }

.meter {
  position: relative;
  height: 14px;
  margin-top: 28px;
  border-radius: 999px;
  background: var(--recess);
}
.meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--accent-strong);
}
.meter__pace {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
}
.meter__legend, .chart figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  max-width: none;
  margin-top: 10px;
  font-size: 14px;
}
.meter__key {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 10px;
  margin-left: 8px;
  border-radius: 3px;
  background: var(--accent-strong);
}
.meter__key:first-child { margin-left: 0; }
.meter__key--pace { width: 2px; height: 14px; border-radius: 0; background: var(--ink); }
.meter__key--target { height: 0; border-top: 2px dotted var(--ink); background: none; border-radius: 0; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14em), 1fr));
  gap: 20px var(--gap);
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.facts dt { font-size: 14px; }
.facts dd {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.2;
}
.facts dd.facts__small {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
}
.facts--wide { margin-bottom: clamp(32px, 5vw, 56px); }

.split--overview { margin-top: 0; }
/* On phones, logging comes before the chart: it's what the page is opened for. */
@media (max-width: 859.98px) {
  .split--overview > .split__column:last-child { order: -1; }
}
.split--overview .split__column > h2:not(:first-child) { margin-top: 48px; }

/* The year as a chart. */

.chart { margin: 0 0 32px; }
.chart svg {
  display: block;
  width: 100%;
  height: 200px;
  overflow: visible;
  border-bottom: 1px solid var(--line-strong);
}
.chart path, .chart line { fill: none; vector-effect: non-scaling-stroke; }
.chart__area { fill: var(--mark) !important; stroke: none; }
.chart__line { stroke: var(--accent-strong); stroke-width: 2.5; stroke-linejoin: round; }
.chart__pace { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart__target { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 1.5 4; stroke-linecap: round; }
.chart__months {
  position: relative;
  height: 20px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.chart__months span { position: absolute; top: 0; }
.chart__months span:nth-child(even) { display: none; }
@media (min-width: 560px) { .chart__months span:nth-child(even) { display: inline; } }

/* Tables of money: labels left, figures right. */

.breakdown, .ranked, .bars { display: table; width: 100%; }
.breakdown td, .breakdown th, .ranked td, .ranked th { padding-right: 0; }
.breakdown td:first-child, .ranked td:first-child { padding-right: 16px; }
.num { text-align: end !important; white-space: nowrap; }
.breakdown tfoot th, .breakdown tfoot td {
  border-bottom: 0;
  font-family: var(--font-slab);
  font-size: 17px;
  font-weight: 700;
}
.breakdown tfoot td { font-family: var(--font-sans); font-weight: 600; }

/* Logging: tabs on the overview. Without JavaScript all three forms show. */

.record { margin-bottom: 8px; }
.record__tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 999px;
  background: var(--recess);
}
.record__tabs button {
  padding: 6px 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-family: var(--font-slab);
  font-size: 15px;
  cursor: pointer;
}
.record__tabs button:hover { background: var(--page); }
.record__tabs button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.record__panel + .record__panel { margin-top: 40px; }
.record--tabbed .record__panel + .record__panel { margin-top: 0; }
.record__heading { margin-top: 0; font-size: 19px; }
.record--tabbed .record__heading {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}

/* The journal: one row per entry. */

.entries {
  margin: 0 0 16px;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.entry {
  display: grid;
  grid-template-columns: 4.5em minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 4px 14px;
  max-width: none;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.entry__date { font-size: 14px; white-space: nowrap; }
.entry__date span { display: block; font-family: var(--font-slab); font-weight: 700; letter-spacing: 0.01em; }
.entry__title { display: block; font-weight: 600; line-height: 1.35; }
.entry__meta { display: block; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.entry__value { font-weight: 600; white-space: nowrap; }
main a.entry__edit { font-size: 14px; }

@media (max-width: 480px) {
  .entry { grid-template-columns: 3.6em minmax(0, 1fr) auto; }
  .entry__edit { grid-column: 2; }
}

.month { margin-bottom: 40px; }
.month__title { margin: 0 0 12px; font-size: 22px; }
.month__title .muted { display: inline; margin-left: 8px; font-family: var(--font-sans); font-size: 15px; }

.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
main a.filter__item {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  text-decoration: none;
}
main a.filter__item:hover { border-color: var(--ink); }
main a.filter__item[aria-current] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

.delete { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }

/* The next trip. */

.next {
  margin-bottom: 40px;
  padding: 18px 20px;
  border: 1px solid var(--mark-line);
  border-radius: 10px;
  background: var(--mark);
}
.next .label { margin: 0; }
.next__route { margin: 4px 0; font-family: var(--font-serif); font-size: clamp(22px, 3vw, 28px); line-height: 1.25; }
.next__meta { margin: 0; font-size: 15px; }
.next details { margin-top: 12px; }
.next summary { cursor: pointer; font-size: 15px; }

.stops { margin: 8px 0 0; padding: 0; list-style: none; font-size: 15px; }
.stops li { display: grid; grid-template-columns: 3.4em minmax(0, 1fr) auto; gap: 12px; max-width: none; margin: 0; padding: 3px 0; }
.stops .stops__line { display: block; margin-top: 8px; font-family: var(--font-slab); font-weight: 700; }

/* Plan: the connections found. */

.results { margin-top: 48px; }
.connections { margin: 0; padding: 0; list-style: none; }
.connection {
  max-width: none;
  margin: 0 0 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.connection__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 16px;
  align-items: baseline;
}
.connection__times { margin: 0; font-family: var(--font-serif); font-size: 24px; }
.connection__times time { font-family: inherit; font-size: inherit; }
.connection__price { grid-row: 1 / 3; grid-column: 2; margin: 0; font-size: 22px; font-weight: 600; }
.connection__meta { margin: 0; font-size: 14px; }
.legs { margin: 14px 0 0; padding: 0; list-style: none; font-size: 15px; }
.legs li { max-width: none; margin: 0; padding: 3px 0; }
.legs b { font-family: var(--font-slab); }
.connection__log { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.connection__log .actions { margin-top: 12px; }

/* Stats: bars. */

.bars th { width: 1%; padding-right: 16px; font-family: var(--font-sans); font-size: 15px; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.bars th, .bars td { vertical-align: middle; }
.bars td { padding-right: 0; }
.bars__bar { width: 100%; padding-right: 12px !important; }
.bars__bar span { display: block; min-width: 2px; height: 12px; border-radius: 3px; background: var(--accent-strong); }
.bars .num { width: 3em; }
.ranked { margin-bottom: 24px; }

/* ---------------------------------------------------------------- Rechner */

.rechner-intro { margin-bottom: clamp(32px, 5vw, 56px); }
.rechner-intro mark { white-space: nowrap; }

/* Phones: the result is below all the inputs, so a bar at the bottom shows
   the outcome while typing. It hides once the full result is in view. */
.rechner__bar {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--mark-line);
  background: var(--mark);
  font-size: 15px;
  line-height: 1.35;
}
.rechner__bar a { color: var(--ink); }
@media (min-width: 980px) { .rechner__bar { display: none; } }
@media (max-width: 979.98px) { .rechner { padding-bottom: 56px; } }

.rechner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
}
@media (min-width: 980px) {
  .rechner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 5vw, 72px); }
  .rechner__result { position: sticky; top: 52px; align-self: start; }
}

.rechner h2 { margin-top: 0; }
.rechner section + section { margin-top: 48px; }

.choice-row { display: flex; flex-wrap: wrap; gap: 8px 24px; }

.routes { margin: 0 0 16px; padding: 0; list-style: none; }
.route {
  max-width: none;
  margin: 0 0 12px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.route__head { display: flex; gap: 8px; align-items: end; margin-bottom: 12px; }
.route__head .field { flex: 1; }
.route .form-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5em), 1fr)); gap: 12px; }
.route__sum { margin: 10px 0 0; font-size: 14px; }

.verdict-box {
  padding: 20px 22px;
  border-radius: 12px;
  background: var(--mark);
  border: 1px solid var(--mark-line);
}
.verdict-box__title { margin: 0 0 8px; font-size: clamp(24px, 3vw, 30px); line-height: 1.2; }
.verdict-box p:last-child { margin-bottom: 0; }

.compare { margin-top: 24px; font-size: 14px; }
.compare td, .compare th { padding: 7px 8px 7px 0; }
.compare td:last-child, .compare th:last-child { padding-right: 0; }
.compare th[scope="col"] { font-size: 13px; }
.compare tbody th, .compare tfoot th { font-family: var(--font-sans); font-weight: 400; letter-spacing: 0; font-size: 14px; }
.compare tfoot th { font-weight: 700; }
.compare tfoot th, .compare tfoot td { border-bottom: 0; font-weight: 700; }
.compare .is-best { background: var(--mark); }
.compare-wrap { overflow-x: auto; }
.compare { display: table; width: 100%; }

.volume svg { display: block; width: 100%; height: auto; overflow: visible; }
.volume .axis { stroke: var(--line-strong); stroke-width: 1; }
.volume .grid { stroke: var(--line); stroke-width: 1; }
.volume .series { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.volume .series--bc100 { stroke: var(--accent-strong); stroke-width: 3; }
.volume .series--ohne { stroke: var(--ink); }
.volume .series--bc50 { stroke: var(--ink); stroke-dasharray: 6 4; }
.volume .series--bc25 { stroke: var(--ink); stroke-dasharray: 1.5 4; stroke-linecap: round; }
.volume .you { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; }
.volume text { fill: var(--ink); font-family: var(--font-sans); font-size: 12px; }
.volume .legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; }
.volume .legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.volume .legend svg { width: 22px; height: 10px; }

.explain { margin-top: clamp(48px, 7vw, 88px); }
.explain .split { margin-top: 0; }

@media print {
  .topbar, .sitebar, .skip-link, .rechner__inputs .actions { display: none; }
}
