
/* WRAP */
  /* .wrap — fluid width from web-travel-style.css */
  /* HEADER — from web-travel-style.css */
  /* BOOKING AGGREGATORS SECTION */
  .aggregators-section {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 18px 0 20px;
    margin-bottom: 0;
  }
  .agg-inner { max-width: 940px; margin: 0 auto; padding: 0 32px; }
  .agg-title {
    font-size: var(--fs-sub,12px);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
  }
  .agg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 10px;
  }
  .agg-card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 12px 14px;
    text-decoration: none;
    transition: box-shadow .18s, transform .18s, border-color .15s;
    display: block;
  }
  .agg-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(138,108,26,0.10);
  }
  .agg-name { font-weight: 600; color: var(--text, #1a1917); font-size: var(--fs-body,14px); margin-bottom: 3px; }
  .agg-desc { font-size: var(--fs-body,14px); color: var(--muted); line-height: 1.4; }
  .agg-link { display: inline-block; margin-top: 5px; font-size: var(--fs-body,14px); color: var(--text, #1a1917); text-decoration: none; }
  .agg-link:visited { color: #3d3a32; }
  /* FILTERS */
  .train-search-row { text-align: center; margin: var(--search-gap, 32px) auto; }
  .controls {
    max-width: none;
    margin: 0 auto;
    padding: 10px 32px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
  }
  .filter-label {
    font-size: var(--fs-sub,12px);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 4px;
  }
  .filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border2, #e6e2da);
    color: var(--muted, #6a6660);
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
  }
.filter-btn:hover { font-family: inherit;
    border-color: var(--border-warm, #c4b896);
    color: var(--text, #1a1917);
  }
/* No border-color here. The tone class already on the element paints the rim
   its own family calls for -- a permanent 2px own-ink border on a Family 1
   pastel (pills doc Family 1 gallery), `transparent` on a Solid sb-* -- and
   this rule ties that one on specificity (0,2,0) while loading later, so a
   rgba(var(--sp-rgb),.45) here silently washed the ACTIVE pill's edge out on
   every trains page. */
.filter-btn.active { font-family: inherit;
    background: var(--sp-wash);
    color: var(--sp-ink);
    font-weight: 600;
  }
  /* 2026-08-30: the [data-ftype] hardcoded-hex overrides (one bespoke color
     per train type, matching none of the approved families) are retired --
     european-trains and asian-trains (the only two pages that ever used
     data-ftype) now carry real .pill-badge sb-* or nt-grey classes in the
     markup instead, so the generic .filter-btn.active rule above (which
     already reads var(--sp-wash)/var(--sp-ink)) picks up the right color
     on its own. */
  .book-link.primary:visited   { color: #3d3a32; }
  .book-link.secondary:visited { color: #6a6660; }

  /* Desktop: rounded pills, spaced — matching the toolbar pill grammar. */
  @media (min-width: 601px), (pointer: fine) {
    .controls { gap: 8px; }
    .filter-btn { flex: 0 0 auto; padding: 9px 20px; font-size: 13px; font-weight: 500; line-height: 1; color: var(--muted); border: 1px solid var(--border2, #e6e2da); border-radius: 6px; margin-left: 0; background: var(--surface, #ffffff); transition: border-color .15s, color .15s; }
    .filter-btn:hover { border-color: var(--border-warm, #c4b896); color: var(--text, #1a1917); }
    .jump-nav { gap: 6px !important; }
    .jump-btn { flex: 0 0 auto; height: 34px; padding: 0 14px; font-size: 13px; font-weight: 500; line-height: 1; color: var(--muted, #6a6660); border: 1px solid var(--border2, #e6e2da); border-radius: 6px !important; margin-left: 0; background: var(--warm, #fdf8f0); }
    .jump-btn:hover { background: var(--nt-grey-wash, #f0ede8); border-color: rgba(var(--nt-grey-rgb, 106,102,96), .75); box-shadow: none; transform: none; }
    .jump-btn.active,
    .jump-btn.active:hover,
    .jump-btn.active:focus { background: var(--nt-grey-wash, #f0ede8); border: 1px solid rgba(var(--nt-grey-rgb, 106,102,96), .75); color: var(--nt-grey-ink, #6a6660); font-weight: 600; box-shadow: none; }
  }
  /* MAIN CONTENT */
  main { padding: 20px 32px 32px; max-width: none; margin: 0 auto; }
  /* COUNTRY SECTION */
  .country-section { margin-bottom: 20px; margin-top: 24px; }
  .country-header {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .country-flag { font-size: 22px; line-height: 1; }
  /* TRAIN CARDS */
  .trains-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; align-items: stretch; }
  .train-card {
    --spine: var(--en-grey-text, #4f4a3e);
    display: flex;
    flex-direction: column;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 4px 0 0 0 var(--spine);
    transition: box-shadow .18s, transform .18s, border-color .15s;
  }
  .train-card:hover { border-color: var(--accent); box-shadow: inset 4px 0 0 0 var(--spine), 0 4px 16px rgba(138,108,26,0.10); transform: translateY(-1px); }
  .train-card.hidden { display: none; }
  .card-top {
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--surface2);
  }
  .train-meta { flex: 1; min-width: 0; }
  .train-name { font-family: var(--font); font-size: 16px; font-weight: 700; color: var(--text, #1a1917); line-height: 1.22; margin-bottom: 3px; }
  .train-operator { font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }
  .type-badge {
    flex-shrink: 0;
  }
  .card-body { padding: 14px 18px; flex: 1; display: flex; flex-direction: column; }
  .info-row { display: flex; gap: 8px; margin-bottom: 10px; align-items: flex-start; }
  .info-icon { font-size: var(--fs-sub,12px); flex-shrink: 0; margin-top: 1px; width: 18px; text-align: center; }
  .info-content { flex: 1; font-size: var(--fs-body,14px); color: var(--text, #1a1917); }
  .info-label {
    font-size: var(--fs-sub,12px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
  }
  .country-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
  .ctag {
    font-family: inherit;
    font-size: var(--fs-sub,12px);
    font-weight: 400;
    background: var(--tag-bg);
    border: 1.5px solid var(--border2, #e6e2da);
    color: var(--text, #1a1917);
    padding: 2px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .ctag.origin { border-color: rgba(184,134,90,0.4); background: var(--warm); color: #8a4a10; }  /* ORANGE canonical */
  .ctag.cross  { border-color: rgba(26,58,139,0.4); background: #e8f0fb; color: var(--navy); }
  .ctag.stop   { border-color: rgba(26,90,26,0.4); background: #e8f5e8; color: #1a5a1a; }
  .ctag.ctag-more {
    background: none; border-style: dashed; color: var(--muted);
    cursor: pointer; font-weight: 600;
  }
  .ctag.ctag-more:hover { border-color: var(--rust); color: var(--rust); }
  .ctag.ctag-hidden { display: none; }
  .routes-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
  .route-item { font-size: var(--fs-body,14px); color: var(--muted); }
  .route-item a.city-link,
  .route-item a.city-link:visited { color: var(--accent, #8a6c1a); text-decoration: none; }
  .route-item a.city-link:hover,
  .route-item a.city-link:focus-visible { text-decoration: underline; }
  .booking-section { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
  .booking-label {
    font-size: var(--fs-sub,12px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 7px;
    display: block;
  }
  .booking-links { display: flex; flex-wrap: wrap; gap: 14px; }
  .book-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 600;
    border: none;
    padding: 0;
    border-radius: 0;
    background: none !important;
    color: var(--muted);
  }
  .book-link::after { content: "\203A"; font-weight: 700; transition: transform .15s; }
  .book-link:hover::after { transform: translateX(2px); }
  .book-link.primary   { color: var(--text, #1a1917); }
  .book-link.primary:hover, .book-link.primary:focus { color: var(--rust); }
  .book-link.secondary { color: var(--muted); }
  .book-link.secondary:hover, .book-link.secondary:focus { color: var(--rust); }
  .book-link:focus { outline: none; }
  .book-link:focus-visible { outline: 2px solid rgba(var(--nt-grey-rgb, 106,102,96), .75); outline-offset: 2px; }
  .section-divider { display: flex; align-items: center; gap: 16px; margin: 12px 0 8px; }
  .section-divider hr { flex: 1; border: none; border-top: 1px solid var(--border); }
  .section-divider-text { font-size: var(--fs-sub,12px); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
  .multi-section { margin-bottom: 16px; }
  .multi-header { font-size: 18px; font-weight: 700; color: var(--accent); margin-bottom: 5px; display: flex; align-items: center; gap: 10px; }
  .multi-sub { color: var(--muted); font-size: var(--fs-sub,12px); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
  /* PINK bar accent (H) — left 4px bar on tinted card, for callouts/panels. Bar is sphere mid. */
  .bar-pink { display:block; background:rgba(246,136,184,0.08); border-radius:8px; padding:10px 14px 10px 18px; border-left:4px solid #f688b8; color:#8a2168; }
  /* hide inline footer and toolbar.js injected footnote */
  footer, .tb-footnote { display: none !important; }
  .country-section.all-hidden { display: none; }
  /* uniform gutter */
  @media (max-width: 600px) and (pointer: coarse) {
  html, 
  .wrap { overflow-x: hidden !important; }
  #train-search { width: 100%; }
    main { padding-left: 0; padding-right: 0; }
    .trains-grid { grid-template-columns: 1fr; }
    .trains-grid { gap: 9px; }
    .card-top { padding: 8px 12px 7px; gap: 8px; }
    .train-name { font-size: 13px; margin-bottom: 2px; }
    .train-operator { font-size: var(--fs-sub,12px); }
    .type-badge { font-size: 12px; padding: 1px 6px; }
    .card-body { padding: 9px 12px; }
    .info-row { margin-bottom: 5px; gap: 7px; }
    .info-icon { margin-top: 0; }
    .info-label { margin-bottom: 1px; font-size: 12px; }
    .info-content { font-size: 13px; }
    .country-tags { gap: 4px; margin-top: 3px; }
    .ctag { font-size: 12px; padding: 1px 6px; }
    .routes-list { gap: 3px; margin-top: 3px; }
    .route-item { font-size: 13px; }
    .agg-grid { grid-template-columns: repeat(2, 1fr); }
    .controls.controls { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 0 !important; align-items: stretch !important; margin-top: 2px !important; padding-right: 0 !important; padding-bottom: 8px !important; max-width: 100% !important; width: 100% !important; }
    .filter-label { display: none; }
    .controls .filter-btn {
      height: 46px !important;
      display: flex !important; align-items: center !important; justify-content: center !important;
      text-align: center !important; white-space: normal !important; line-height: 1.12 !important;
      border: 2px solid var(--border, #d8d4cc) !important;
      border-radius: 0 !important; font-size: 12px !important; padding: 4px 6px !important;
    }
    /* Guides-Index border technique — overlap adjacent borders with margin. */
    .jump-nav { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 0 !important; width: 100% !important; margin: 8px 0 !important; padding: 0 !important; }
    .jump-nav .jump-btn { height: 46px !important; display: flex !important; align-items: center !important; justify-content: center !important; text-align: center !important; white-space: normal !important; line-height: 1.12 !important; border: 2px solid var(--border, #d8d4cc) !important; border-radius: 0 !important; font-size: 12px !important; padding: 4px 6px !important; }
  }
  #train-search{width:var(--search-w, 440px);height:var(--search-h, 56px);max-width:100%;box-sizing:border-box;margin:0;font-size:17px;outline:none;transition:border-color .15s,box-shadow .15s;flex-shrink:0;}
  #train-search:focus{border-color: var(--c-search-focus-border); box-shadow: none;}
  #train-search::placeholder{color:var(--c-search-placeholder);}
  #train-noresult{display:none;padding:8px 4px;font-size:13px;color:var(--muted);}
  /* country jump nav */
  .jump-nav{max-width:none;margin:8px auto 4px;padding:0 32px 6px;display:flex;flex-wrap:wrap;justify-content:center;gap:6px;}
  .jump-btn{display:inline-flex;align-items:center;justify-content:center;font-size:var(--fs-sub,12px);font-weight: 400;color:var(--muted);text-decoration:none;padding:4px 11px;border:1px solid var(--border);border-radius:6px;background:var(--warm,#fdf8f0);white-space:nowrap;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .08s;}
  .jump-btn:visited{color:#6a6660;}
  .jump-btn:hover{border-color:rgba(var(--nt-grey-rgb, 106,102,96), .75);box-shadow:0 2px 8px rgba(0,0,0,.08);transform:translateY(-1px);}
  .jump-btn.active{border-color:rgba(var(--nt-grey-rgb, 106,102,96), .75);box-shadow:0 2px 8px rgba(0,0,0,.08);}
  .jump-btn:focus-visible{outline:2px solid rgba(var(--nt-grey-rgb, 106,102,96), .75);outline-offset:1px;}
  .country-section{scroll-margin-top:16px;}
  .multi-section{scroll-margin-top:16px;}
  @media (max-width: 600px) and (pointer: coarse) {
    .jump-nav{padding:0 14px 6px;}
  }
/* Discontinued route notices — class keeps color out of inline style so dark mode can flip it */
.route-warn { color: #dc2626; }
@media (prefers-color-scheme: dark) {
  .filter-btn { color: var(--text); }
  .jump-btn { color: var(--text); }
  .ctag.origin { color: #c8a060; }
  /* .filter-btn.active dark: reads the same var(--sp-wash)/var(--sp-ink) as
     the light-mode generic rule (see base .filter-btn.active above) -- no
     per-type dark override needed now that color comes from the sb-* or nt-grey
     class on the element, same as every other .pill-badge.sb-* on the site. */
  .filter-btn.active { background: var(--sp-wash); color: var(--sp-ink); }
  .ctag.cross { background: #0a1e3a; color: #5a9aee; border-color: rgba(90,154,238,.35); }
  .route-warn { color: #f07070; }
}
.op-review {
  margin-top: 12px;
  padding: 10px 13px;
  background: color-mix(in srgb, var(--rust, #C04E1A) 6%, var(--surface, #fff));
  border: 1px solid color-mix(in srgb, var(--rust, #C04E1A) 20%, var(--border2, #e6e2da));
  border-left: 3px solid var(--rust, #C04E1A);
  border-radius: 3px 8px 8px 3px;
}
.op-review-label {
  font-size: var(--fs-sub, 12px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust, #C04E1A);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}
.op-review-text {
  font-size: var(--fs-body, 14px);
  line-height: 1.5;
  color: var(--text, #1a1917);
  margin: 0;
}
@media (max-width: 600px) and (pointer: coarse) {
  .op-review { margin-top: 9px; padding: 8px 10px; }
  .op-review-label { font-size: 12px; margin-bottom: 2px; }
  .op-review-text { font-size: 13px; line-height: 1.45; }
}

@media (prefers-color-scheme: dark) {
  .op-review-label { color: var(--text); }
}


.rail-band { margin: 26px 0 0; }
.rb-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 0 0 4px; padding-bottom: 8px; border-bottom: 1.5px solid var(--border, #d8d4cc);
}
.rb-head h2 {
  font-family: var(--font); font-size: 1.16rem; font-weight: 600;
  margin: 0; color: var(--text, #3d3a32); letter-spacing: 0;
}
.rb-head .rb-kicker {
  font-size: 11px; color: var(--muted, #6a6660); margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.rb-sub { margin: 6px 0 0; font-size: 13px; color: var(--muted, #6a6660); line-height: 1.5; }
.rb-table {
  margin-top: 14px; border: 1px solid var(--border2, #e6e2da);
  border-radius: 6px; overflow: hidden; background: var(--surface, #fff);
}
.rb-row {
  display: grid; grid-template-columns: 1.1fr 1.45fr auto 1.55fr; gap: 14px;
  align-items: center; padding: 11px 15px; border-top: 1px solid var(--border2, #e6e2da);
}
.rb-row:first-child { border-top: 0; }
.rb-row:nth-child(even) { background: var(--warm, #fdf8f0); }
.rb-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--text, #3d3a32); }
.rb-flag { font-size: 16px; line-height: 1; }
.rb-route { font-size: 13px; color: var(--text, #3d3a32); }
.rb-time {
  font-size: 12px; color: var(--rust, #C04E1A); font-weight: 600;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.rb-verdict { font-size: 12.5px; color: var(--muted, #6a6660); line-height: 1.4; }
.rb-row a.rb-name { text-decoration: none; }
.rb-row a.rb-name:hover { color: var(--rust, #C04E1A); }
@media (max-width: 700px) {
  .rb-row { grid-template-columns: 1fr auto; row-gap: 4px; padding: 13px 14px; }
  .rb-route { grid-column: 1 / -1; color: var(--muted, #6a6660); }
  .rb-verdict { grid-column: 1 / -1; }
}
/* The honest note under a band — a gap in the network, or where a pass lives. */
.rb-note {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 12px;
  background: var(--en-orange-top, #fdefdc); border: 1px solid var(--en-orange-rim, #db8e3b);
  border-radius: 4px; padding: 11px 14px; font-size: 13px;
  color: var(--en-orange-text, #8a551a); line-height: 1.5;
}
.rb-note svg { flex: 0 0 auto; margin-top: 1px; }
.rb-note a { color: inherit; }
.purpose-header {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 30px 0 0; padding-bottom: 8px; border-bottom: 1.5px solid var(--border, #d8d4cc);
}
.purpose-header h2 {
  font-family: var(--font); font-size: 1.16rem; font-weight: 600;
  margin: 0; color: var(--text, #3d3a32);
}
.purpose-header .rb-kicker { font-size: 11px; color: var(--muted, #6a6660); margin-left: auto; }
.purpose-sub { margin: 6px 0 0; font-size: 13px; color: var(--muted, #6a6660); line-height: 1.5; }
@media (prefers-color-scheme: dark) {
  .rb-table { background: #1e1c1a; }
  .rb-row:nth-child(even) { background: #201e1c; }
}

.trains-end-nav { max-width: 860px; margin: 28px auto 0; padding: 0 16px; text-align: center; }
.trains-end-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 400; color: var(--text, #1a1917);
  background: var(--nt-cream-wash, #fdf8f0); border: 1.5px solid var(--border2, #e6e2da);
  border-radius: 999px; padding: 10px 20px; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.trains-end-cta:hover { border-color: rgba(var(--nt-grey-rgb, 106,102,96), .75); background: var(--nt-grey-wash, #f0ede8); }
.trains-end-cta + .trains-end-cta { margin-left: 8px; }
@media (prefers-color-scheme: dark) {
  .trains-end-cta {
    background: var(--surface, #2a2825);
    color: var(--text, #e8e5e0);
    border-color: var(--border, #3a3730);
  }
  .trains-end-cta:hover {
    background: var(--surface2, #1e1c1a);
    color: var(--text, #e8e5e0);
    border-color: #5a5040;
  }
}
