/* TrainLab history finder, edition 02. Primary search = one field.
   Optional refinement appears only after the first search. */
body.trainlab-page .tl-finder {
  border-top: 1px solid var(--t-ink,#192920);
  border-bottom: 1px solid var(--t-line,#dbe2dc);
  padding: 25px 0 30px;
}
body.trainlab-page .tl-finder .history-search-heading h2 {
  font: 600 clamp(37px,4vw,50px)/1.07 "DM Sans",system-ui,sans-serif;
  letter-spacing: -.055em;
}
body.trainlab-page .tl-finder .history-search-heading p {
  margin: 10px 0 0;
  color: #63756a;
  font: 400 14px/1.5 "DM Sans",sans-serif;
}
.tl-entry-tabs {
  display: flex;
  align-items: stretch;
  width: min(100%,525px);
  margin-top: 26px;
  border-bottom: 1px solid #d5ded7;
}
.tl-entry-tabs button {
  flex: 1;
  min-height: 48px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #687970;
  cursor: pointer;
  padding: 12px 8px;
  font: 600 12px/1.4 "DM Sans",sans-serif;
}
.tl-entry-tabs button.selected {
  color: #182c20;
  border-bottom-color: #182c20;
}
.tl-entry-tabs button:hover { background:#eff2ee; color:#182c20; }
.tl-entry-tabs button:focus-visible { outline:2px solid #336851;outline-offset:-2px; }
.tl-entry-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  max-width: 620px;
  padding: 23px 0 0;
}
.tl-entry-panel[hidden],.tl-refine-field[hidden] {display:none!important}
.tl-entry-panel label {
  color: #1e3529;
  font: 600 12px/1.45 "DM Sans",sans-serif;
}
body.trainlab-page .tl-entry-panel input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 55px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #bfcfc3;
  border-radius: 3px;
  color: #192920;
  font: 500 14px/1.5 "DM Sans",sans-serif;
}
body.trainlab-page .tl-entry-panel input:focus,
body.trainlab-page .tl-refine-field input:focus {
  outline: 2px solid #336851;
  outline-offset: -1px;
}
.tl-entry-panel p {
  margin: 0;
  color: #6f8175;
  font: 400 12px/1.6 "DM Sans",sans-serif;
}
.tl-first-day { width:fit-content;color:#336851;font:600 11px "DM Sans",sans-serif;text-underline-offset:3px; }
body.trainlab-page .tl-finder .history-search-button {
  display:flex;align-items:center;justify-content:center;
  gap:10px;
  width:min(100%,620px);
  min-height:52px;
  margin-top:22px;
  color:#fff;
  background:#336851;
  border:1px solid #336851;
  border-radius:3px;
  font:600 13px "DM Sans",sans-serif;
}
body.trainlab-page .tl-finder .history-search-button:hover {background:#234a37}
.tl-finder .tl-search-helper {margin-top:12px}
body.trainlab-page .tl-finder-results-heading {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:24px;
}
body.trainlab-page .tl-finder-results-heading h2 {
  font-size:clamp(30px,4vw,42px);
  line-height:1.14;
}
body.trainlab-page .tl-finder-results-heading p {margin:8px 0 0;color:#64776b;font-size:12px;}
.tl-change-search {
  min-height:44px; padding:7px 0;
  color:#336851; background:transparent;border:0;
  cursor:pointer;
  font:600 11px "DM Sans",sans-serif;
  white-space:nowrap;
}
.tl-change-search:hover {text-decoration:underline;text-underline-offset:3px}
.tl-refine {
  margin:0 0 19px;
  border:1px solid #d2dcd4;
  background:#fff;
}
.tl-refine>summary {
  display:flex;align-items:center;justify-content:space-between;
  min-height:49px;gap:12px;
  padding:12px 17px;
  list-style:none;cursor:pointer;
  color:#1d3f2e;font:600 12px "DM Sans",sans-serif;
}
.tl-refine>summary::-webkit-details-marker {display:none;}
.tl-refine>summary small {font-size:11px;color:#87988b;font-weight:400}
.tl-refine[open]>summary {border-bottom:1px solid #d2dcd4}
.tl-refine>summary:hover {background:#f1f4f0}
.tl-refine-grid {
  padding:16px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:13px;
}
.tl-refine-field {display:grid;align-content:start;gap:8px;min-width:0}
.tl-refine-field label {font:600 11px "DM Sans",sans-serif;color:#315341}
body.trainlab-page .tl-refine-field input {
  min-height:45px;width:100%;box-sizing:border-box;
  border-radius:3px;
  border:1px solid #c8d5cb;
  padding:0 11px;
  background:#fff;
  font:500 12px "DM Sans",sans-serif;
}
.tl-refine-apply {
  min-height:43px;
  padding:10px 18px;
  margin:0 16px 16px;
  border:1px solid #336851;
  border-radius:3px;
  background:transparent;
  color:#336851;
  cursor:pointer;
  font:600 12px "DM Sans",sans-serif;
}
.tl-refine-apply:hover {background:#ecf2ec}
body.trainlab-page .history-toolbar {
  grid-template-columns:1fr;
  border-bottom:1px solid #d6e0d7;
}
body.trainlab-page .history-toolbar .today-filters {display:flex;flex-wrap:wrap;gap:22px;}
body.trainlab-page .history-toolbar .today-filter {
  min-height:50px; border:0;border-bottom:2px solid transparent;
  border-radius:0;
  background:transparent;
  padding:13px 0;
  color:#708174;
  font:600 11px "DM Sans",sans-serif;
}
body.trainlab-page .history-toolbar .today-filter.active {
  color:#172b1f;
  background:transparent;
  border-bottom-color:#172b1f;
}
body.trainlab-page .history-results {margin-top:42px}
body.trainlab-page .history-train-row {
  grid-template-columns:75px minmax(0,1fr) 118px 87px;
  gap:14px;min-height:80px;padding:13px 2px;
}
body.trainlab-page .history-train-row .today-train-time strong {
  font-variant-numeric:tabular-nums;
  color:#172b1f;
}
body.trainlab-page .history-train-row .today-train-time span {font-size:10px}
body.trainlab-page .history-train-row .today-train-status strong {
  color:#172b1f!important;
  font-weight:600;
  text-align:right;
  overflow-wrap:anywhere;
}
body.trainlab-page .history-train-row .today-train-action {
  grid-column:4;
  color:#315d44;
  justify-self:end;
  font-size:11px;
}
body.trainlab-page .history-train-row:hover {background:#f0f4ef}
body.trainlab-page .history-train-row:focus-visible {outline:2px solid #336851;outline-offset:2px;}
@media(max-width:760px) {
  body.trainlab-page .trainlab-history-main {padding-top:26px;}
  .tl-refine-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  body.trainlab-page .history-train-row {
    grid-template-columns:60px minmax(0,1fr) 86px;
    gap:10px;
  }
  body.trainlab-page .history-train-row .today-train-status {grid-column:3;justify-self:end;}
  body.trainlab-page .history-train-row .today-train-action {
    grid-column:2/-1;
    justify-self:start;
    font-size:11px;
  }
  .tl-finder-results-heading {flex-wrap:wrap}
}
@media(max-width:480px) {
  .tl-entry-tabs {width:100%}
  .tl-entry-tabs button {font-size:11.5px;}
  body.trainlab-page .tl-refine-grid {grid-template-columns:1fr;}
  body.trainlab-page .history-toolbar .today-filters {gap:14px;}
  body.trainlab-page .history-toolbar .today-filter {font-size:10.5px;}
  body.trainlab-page .history-train-row {grid-template-columns:58px minmax(0,1fr);gap:8px 11px;}
  body.trainlab-page .history-train-row .today-train-status {grid-column:2;justify-self:start;}
  body.trainlab-page .history-train-row .today-train-status strong {text-align:left;}
  body.trainlab-page .history-train-row .today-train-action {grid-column:2;justify-self:start;}
}

/* Dropdown suggestions must never overlay the primary search button.
   Expand within the chosen field instead, preserving pointer and keyboard UX. */
body.trainlab-page .tl-entry-panel .tl-suggestions:not([hidden]),
body.trainlab-page .tl-refine-field .tl-suggestions:not([hidden]) {
  position: static;
  top: auto; left: auto; right: auto;
  display: block;
  width: 100%;
  box-sizing: border-box;
  max-height: 188px;
  margin: 6px 0 0;
  border: 1px solid #ccd8cd;
  box-shadow: 0 4px 15px #132a1b0b;
  z-index: auto;
}

/* Historical landing: keep the search directly beneath the single headline. */
body.trainlab-page .history-hero{padding-bottom:25px}
body.trainlab-page .history-hero h1{font-size:clamp(48px,6vw,71px)}
body.trainlab-page .history-search-card.tl-finder{
  border-top:0;
  padding-top:0;
  padding-bottom:30px;
}
body.trainlab-page .tl-finder .tl-entry-tabs{margin-top:0}
body.trainlab-page .tl-finder .tl-entry-panel{padding-top:22px}
.tl-history-coverage{font:500 11px/1.6 "DM Sans",sans-serif;color:#758579;margin:13px 0 0}
.tl-a11y-meta{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
body.trainlab-page .tl-finder-results-heading{margin-bottom:17px}
@media(max-width:760px){
  body.trainlab-page .history-hero{padding-bottom:21px}
  body.trainlab-page .trainlab-history-main{padding-top:27px}
}
