/* Timetables Pro 2.6.0 – Departure board design.
   All colours come from the Branding tab via CSS variables on .tp-wrap:
   --tp-text, --tp-muted, --tp-border, --tp-link, --tp-surface, --tp-cta.
   Override fonts/colours in "Added custom CSS" on .tp-wrap.tp-theme-board. */

:where(.tp-wrap.tp-theme-board){
  --tpb-max:820px;
  --tpb-radius:12px;
  --tpb-next-bg:#f8fafc;
  --tpb-next-line:var(--tp-link,#0f172a);
  --tpb-row-h:52px;
  --tpb-soon-bg:#fff4e5;
  --tpb-soon-ink:#7a4100;
}
.tp-wrap.tp-theme-board{
  font-family:var(--tp-font-ui,inherit);
  color:var(--tp-text,#0f172a);
  max-width:calc(var(--tpb-max) + 32px);
  margin:0 auto 1.5rem;
  padding:0 16px;
  line-height:1.4;
}
.tp-theme-board *,.tp-theme-board *::before,.tp-theme-board *::after{box-sizing:border-box}
.tp-theme-board p{margin:0}
.tp-theme-board button{font:inherit;color:inherit;cursor:pointer}
.tp-theme-board .tpb-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.tp-theme-board :focus-visible{outline:3px solid var(--tp-link,#0f172a);outline-offset:2px;border-radius:6px}
.tp-theme-board time,.tp-theme-board .tpb-mono{font-family:var(--tp-font-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);font-variant-numeric:tabular-nums}

/* Direction switch (only rendered when 2+ boards are on the page) */
.tpb-switch{display:flex;gap:4px;padding:4px;margin:0 0 12px;background:#eef2f6;border-radius:999px;width:max-content;max-width:100%}
.tpb-switch[hidden]{display:none}
.tpb-switch a,.tpb-switch span{display:inline-flex;align-items:center;min-height:40px;padding:8px 16px;border-radius:999px;font-weight:600;font-size:.95rem;text-decoration:none;white-space:nowrap;color:var(--tp-text,#0f172a)}
.tpb-switch span[aria-current]{background:var(--tp-surface,#fff);box-shadow:0 1px 3px rgba(15,23,42,.15)}
.tpb-switch a:hover{text-decoration:underline}

/* Date chips */
.tpb-dates{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 6px;margin:0 0 14px;scrollbar-width:thin}
.tpb-chip{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:8px 14px;border:1px solid var(--tp-border,#e5e7eb);border-radius:999px;background:var(--tp-surface,#fff);font-weight:600;font-size:.92rem;white-space:nowrap}
.tpb-chip[aria-pressed="true"]{background:var(--tp-text,#0f172a);border-color:var(--tp-text,#0f172a);color:var(--tp-surface,#fff)}
.tpb-chip-date{position:relative}
.tpb-chip-date input{border:0;background:transparent;font:inherit;font-weight:500;color:inherit;padding:0;max-width:9.5em}

/* Next departure */
.tpb-next{border:1px solid var(--tp-border,#e5e7eb);border-left:4px solid var(--tpb-next-line);background:var(--tpb-next-bg);border-radius:var(--tpb-radius);padding:16px 18px;margin:0 0 16px;display:grid;gap:6px}
.tpb-next-label{font-size:.82rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--tp-muted,#64748b)}
.tpb-next-main{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.tpb-next-time{font-size:2.6rem;font-weight:700;line-height:1;letter-spacing:-.01em}
.tpb-next-in{font-size:1.05rem;color:var(--tp-muted,#64748b);font-weight:600}
.tpb-next-ci{font-size:1rem}
.tpb-next-ci span{color:var(--tp-muted,#64748b);font-weight:400}
.tpb-next-arr{font-size:.95rem;color:var(--tp-text,#0f172a)}
.tpb-cta{display:inline-flex;align-items:center;justify-content:center;gap:8px;margin-top:8px;min-height:48px;padding:12px 22px;border-radius:10px;background:var(--tp-cta,#15803d);color:#fff!important;font-weight:700;text-decoration:none!important;width:max-content;max-width:100%}
.tpb-cta:hover{filter:brightness(1.07)}
.tpb-cta-note{font-size:.82rem;color:var(--tp-muted,#64748b)}
.tpb-next-sched{font-weight:500;letter-spacing:.02em;text-transform:none}
.tpb-next-hint{font-size:.9rem;color:var(--tp-muted,#64748b)}
.tpb-next.is-soon .tpb-next-ci{background:var(--tpb-soon-bg);color:var(--tpb-soon-ink);border-radius:8px;padding:6px 10px;width:max-content;max-width:100%}
.tpb-next.is-soon .tpb-next-ci .tpb-next-in{color:var(--tpb-soon-ink)}
.tp-theme-board .tpb-plus{font-size:.65em;font-weight:700;margin-left:2px;vertical-align:super;color:var(--tp-muted,#64748b)}
.tp-theme-board .tpb-row:not(.is-departed):not(.is-closed) .tpb-ci{color:var(--tp-text,#0f172a);font-weight:600}

/* List header */
.tpb-listhead{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 16px;align-items:baseline;margin:0 0 6px}
.tpb-summary{font-weight:700}
.tpb-tznote{font-size:.88rem;color:var(--tp-muted,#64748b)}

/* Table */
.tp-theme-board .tpb-table{width:100%;border-collapse:collapse;margin:0;background:transparent;border:0}
.tp-theme-board .tpb-table caption{caption-side:top}
.tp-theme-board .tpb-table th{text-align:left;font-size:.78rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--tp-muted,#64748b);padding:8px 10px;border-bottom:2px solid var(--tp-border,#e5e7eb);background:transparent}
.tpb-th-sub{display:block;font-weight:500;text-transform:none;letter-spacing:0}
.tp-theme-board .tpb-table td{padding:10px;border-bottom:1px solid var(--tp-border,#e5e7eb);vertical-align:middle;height:var(--tpb-row-h);background:transparent}
.tp-theme-board .tpb-dep time{font-size:1.25rem;font-weight:700}
.tp-theme-board .tpb-arr time{font-size:1.1rem;font-weight:500}
.tp-theme-board .tpb-arrow{display:none;color:var(--tp-muted,#64748b);margin-right:6px}
.tp-theme-board .tpb-ci{color:var(--tp-muted,#64748b);font-size:.92rem;font-family:var(--tp-font-mono,ui-monospace,monospace);font-variant-numeric:tabular-nums}
.tp-theme-board .tpb-ci-label{display:none;font-family:var(--tp-font-ui,inherit)}
.tp-theme-board .tpb-st{font-size:.85rem;color:var(--tp-muted,#64748b);white-space:nowrap}
.tp-theme-board .tpb-bk{text-align:right;white-space:nowrap}
.tp-theme-board .tpb-tag{display:inline-block;padding:3px 10px;border-radius:999px;background:var(--tp-link,#0f172a);color:#fff;font-weight:700;font-size:.78rem;letter-spacing:.03em}
.tp-theme-board .tpb-book{display:inline-flex;align-items:center;min-height:40px;padding:8px 14px;border:1.5px solid currentColor;border-radius:8px;color:var(--tp-link,#0f172a)!important;font-weight:700;font-size:.92rem;text-decoration:none!important}
.tp-theme-board .tpb-book:hover{background:var(--tp-link,#0f172a);color:#fff!important}
.tp-theme-board .tpb-row.is-departed td{color:var(--tp-muted,#64748b)}
.tp-theme-board .tpb-row.is-departed time{font-weight:500}
.tp-theme-board .tpb-row.is-closed td{color:var(--tp-muted,#64748b)}
.tp-theme-board .tpb-row.is-next td{background:var(--tpb-next-bg)}
.tp-theme-board .tpb-row.is-next td:first-child{box-shadow:inset 4px 0 0 var(--tpb-next-line)}
.tp-theme-board .tpb-row[hidden]{display:none}

.tp-theme-board .tpb-toggle{display:block;width:100%;min-height:44px;margin:6px 0;padding:10px 12px;border:1px dashed var(--tp-border,#cbd5e1);border-radius:10px;background:transparent;font-weight:600;color:var(--tp-link,#0f172a)}
.tp-theme-board .tpb-toggle:hover{background:#f8fafc}
.tp-theme-board .tpb-empty{padding:18px 4px;color:var(--tp-muted,#64748b)}
.tpb-list-host[aria-busy="true"]{opacity:.55;transition:opacity .15s}
.tpb-error{padding:14px;border:1px solid #fca5a5;background:#fef2f2;border-radius:10px;color:#7f1d1d}
.tpb-error button{margin-left:8px;text-decoration:underline;background:none;border:0;color:inherit;font-weight:700}

/* Footer */
.tpb-foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 16px;align-items:center;margin-top:10px}
.tpb-disclaimer{font-size:.85rem;color:var(--tp-muted,#64748b)}
.tpb-actions{display:flex;gap:16px;flex-wrap:wrap}
.tpb-link{background:none;border:0;padding:10px 0;min-height:44px;color:var(--tp-link,#0f172a);font-weight:600;text-decoration:underline;text-underline-offset:3px}
.tpb-print-head{display:none}

/* Mobile: compact two-line rows, no header row */
@media (max-width:600px){
  .tpb-next-time{font-size:2.2rem}
  .tpb-switch{width:100%;border-radius:14px}
  .tpb-switch a,.tpb-switch span{flex:1 1 0;justify-content:center;text-align:center;white-space:normal;padding:8px 10px;border-radius:10px;font-size:.9rem}
  .tpb-cta{width:100%}
  .tp-theme-board .tpb-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .tp-theme-board .tpb-table,.tp-theme-board .tpb-table tbody{display:block}
  .tp-theme-board .tpb-table tr.tpb-row{display:grid;grid-template-columns:auto auto 1fr auto;grid-template-areas:"dep arr st bk" "ci ci ci bk";align-items:center;column-gap:10px;row-gap:0;padding:10px 6px;border-bottom:1px solid var(--tp-border,#e5e7eb)}
  .tp-theme-board .tpb-table tr.tpb-row[hidden]{display:none}
  .tp-theme-board .tpb-table td{display:block;padding:0;border:0;height:auto}
  .tp-theme-board .tpb-dep{grid-area:dep}
  .tp-theme-board .tpb-arr{grid-area:arr}
  .tp-theme-board .tpb-st{grid-area:st}
  .tp-theme-board .tpb-bk{grid-area:bk}
  .tp-theme-board .tpb-ci{grid-area:ci;font-size:.9rem;margin-top:2px}
  .tp-theme-board .tpb-arrow{display:inline}
  .tp-theme-board .tpb-ci-label{display:inline}
  .tp-theme-board .tpb-row.is-next{background:var(--tpb-next-bg);box-shadow:inset 4px 0 0 var(--tpb-next-line)}
  .tp-theme-board .tpb-row.is-next td,.tp-theme-board .tpb-row.is-next td:first-child{background:transparent;box-shadow:none}
  .tpb-foot{flex-direction:column;align-items:flex-start}
}

@media (prefers-reduced-motion:reduce){
  .tp-theme-board *{transition:none!important;animation:none!important}
}

/* Print / save as PDF: only the chosen board, all rows */
@media print{
  html.tpb-printing body *{visibility:hidden!important}
  html.tpb-printing .tpb-print-target,html.tpb-printing .tpb-print-target *{visibility:visible!important}
  html.tpb-printing .tpb-print-target{position:absolute;left:0;top:0;width:100%;max-width:none;padding:0}
  .tpb-print-target .tpb-dates,.tpb-print-target .tpb-switch,.tpb-print-target .tpb-actions,.tpb-print-target .tpb-toggle,.tpb-print-target .tpb-bk,.tpb-print-target .tpb-col-bk,.tpb-print-target .tpb-cta,.tpb-print-target .tpb-next-in,.tpb-print-target .tpb-next-host,.tpb-print-target .tpb-st,.tpb-print-target .tpb-col-st,.tpb-print-target .tpb-empty{display:none!important}
  .tpb-print-target .tpb-row td{color:#000!important;background:none!important;box-shadow:none!important}
  .tpb-print-target .tpb-print-head{font-weight:700}
  .tpb-print-target time{font-weight:600!important}
  .tpb-print-target .tpb-row[hidden]{display:table-row!important}
  .tpb-print-target .tpb-print-head{display:block;font-size:10pt;margin:0 0 8pt}
  .tpb-print-target .tpb-table thead{position:static;width:auto;height:auto;clip:auto}
  .tpb-print-target .tpb-table,.tpb-print-target .tpb-table tbody{display:table}
  .tpb-print-target .tpb-table tbody{display:table-row-group}
  .tpb-print-target .tpb-table tr.tpb-row{display:table-row}
  .tpb-print-target .tpb-table td{display:table-cell;padding:3pt 6pt;height:auto}
  .tpb-print-target .tpb-arrow,.tpb-print-target .tpb-ci-label{display:none}
  .tpb-print-target .tpb-row.is-next td{background:none}
}
