{
  "id": 30,
  "slug": "swiss-railway-timetable",
  "name": "Swiss Railway Timetable",
  "kind": "style",
  "family": "Transit & Signage",
  "sourceSite": {
    "name": "SBB Digital Design System",
    "url": "https://digital.sbb.ch/",
    "verifiedStatus": 200
  },
  "tagline": "Precision Swiss Federal Railways departure board, live Mondaine station clock, SBB red accents, and tabular schedules.",
  "whyUnique": "Combines the iconic Swiss Railway clock (complete with its signature red paddle second hand) with ultra-scannable tabular departure boards and zero visual ambiguity.",
  "theme": "light",
  "mobileStrength": "native-first",
  "tags": [
    "swiss-railway",
    "sbb-signage",
    "departure-board",
    "mondaine-clock",
    "tabular-ui"
  ],
  "bestFor": [
    "Real-time transit & flight dashboards",
    "Scheduling & logistics tools",
    "Public-sector design systems",
    "Operational status boards"
  ],
  "palette": [
    {
      "role": "canvas",
      "hex": "#FFFFFF",
      "name": "Station White"
    },
    {
      "role": "surface",
      "hex": "#F3F4F6",
      "name": "Platform Cool Gray"
    },
    {
      "role": "ink",
      "hex": "#1A1A1A",
      "name": "Timetable Black"
    },
    {
      "role": "accent",
      "hex": "#EB0000",
      "name": "SBB Signal Red"
    },
    {
      "role": "muted",
      "hex": "#5E646C",
      "name": "Track Slate"
    }
  ],
  "typography": {
    "display": "Inter",
    "body": "Inter",
    "mono": "IBM Plex Mono",
    "googleFontsUrl": "https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap",
    "scaleNotes": "Strict tabular numerals for departure times and platform numbers, high-contrast bold destination names, and SBB red line badges."
  },
  "layoutNotes": "Top station header featuring a live SVG Swiss Railway clock, interactive line/destination filter bar, high-contrast departure table, and slide-down train composition detail panel.",
  "interactionNotes": "Live ticking Mondaine-style SVG clock, interactive platform/train-type filters (IC, IR, S-Bahn), and clickable departure rows revealing stop-by-stop schedules and occupancy bars.",
  "mobileNotes": "Transforms the departure table into clean scannable rail cards at 390px with >=44px row targets and a compact header clock.",
  "agentGuardrails": {
    "do": [
      "Enforce tabular-nums on every time, delay (+2'), and track number for vertical alignment.",
      "Use SBB Signal Red (#EB0000) strictly for train badges, clock paddle, and active delay alerts.",
      "Prioritize immediate glanceability over decorative flourishes."
    ],
    "dont": [
      "Never use low-contrast gray text for critical departure times or platform numbers.",
      "Avoid sluggish animations that obscure live schedule updates."
    ]
  },
  "demoFile": "demos/swiss-railway-timetable.html",
  "thumbDesktop": "thumbs/swiss-railway-timetable-desktop.webp",
  "thumbMobile": "thumbs/swiss-railway-timetable-mobile.webp",
  "urls": {
    "page": "https://templates.michaelpitts.net/t/swiss-railway-timetable",
    "markdown": "https://templates.michaelpitts.net/t/swiss-railway-timetable.md",
    "api": "https://templates.michaelpitts.net/api/templates/swiss-railway-timetable",
    "demo": "https://templates.michaelpitts.net/demos/swiss-railway-timetable.html",
    "thumbDesktop": "https://templates.michaelpitts.net/thumbs/swiss-railway-timetable-desktop.webp",
    "thumbMobile": "https://templates.michaelpitts.net/thumbs/swiss-railway-timetable-mobile.webp"
  },
  "agentPrompt": "Design & build using template #030 \"Swiss Railway Timetable\" (style / Transit & Signage, light theme).\nFull AI blueprint & standalone starter code: https://templates.michaelpitts.net/t/swiss-railway-timetable.md\nLive demo: https://templates.michaelpitts.net/demos/swiss-railway-timetable.html\nReal-world inspiration: SBB Digital Design System (https://digital.sbb.ch/)\n\nCore aesthetic: Combines the iconic Swiss Railway clock (complete with its signature red paddle second hand) with ultra-scannable tabular departure boards and zero visual ambiguity.\nPalette: canvas: #FFFFFF (Station White), surface: #F3F4F6 (Platform Cool Gray), ink: #1A1A1A (Timetable Black), accent: #EB0000 (SBB Signal Red), muted: #5E646C (Track Slate)\nTypography: Display=\"Inter\", Body=\"Inter\", Mono=\"IBM Plex Mono\"\nLayout: Top station header featuring a live SVG Swiss Railway clock, interactive line/destination filter bar, high-contrast departure table, and slide-down train composition detail panel.\nInteractions: Live ticking Mondaine-style SVG clock, interactive platform/train-type filters (IC, IR, S-Bahn), and clickable departure rows revealing stop-by-stop schedules and occupancy bars.\nMobile: Transforms the departure table into clean scannable rail cards at 390px with >=44px row targets and a compact header clock.\n\nGuardrails:\n- DO: Enforce tabular-nums on every time, delay (+2'), and track number for vertical alignment.\n- DO: Use SBB Signal Red (#EB0000) strictly for train badges, clock paddle, and active delay alerts.\n- DO: Prioritize immediate glanceability over decorative flourishes.\n- DON'T: Never use low-contrast gray text for critical departure times or platform numbers.\n- DON'T: Avoid sluggish animations that obscure live schedule updates.",
  "sourceCode": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>SBB CFF FFS — Zürich HB Live Departure Board</title>\n<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n<link href=\"https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=Inter:wght@400;500;600;700;800&display=swap\" rel=\"stylesheet\">\n<style>\n  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }\n  :root {\n    --sbb-red: #eb0000;\n    --sbb-red-dark: #c60018;\n    --white: #ffffff;\n    --cloud: #f4f5f7;\n    --slate-line: #d8dde6;\n    --board-bg: #152238;\n    --board-row: #1c2c47;\n    --board-hover: #243758;\n    --board-line: #2d4266;\n    --ink: #111827;\n    --muted: #5a6577;\n    --amber: #f5b700;\n    --ok: #16a34a;\n    --font-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;\n    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;\n  }\n  html, body {\n    background: var(--cloud);\n    color: var(--ink);\n    font-family: var(--font-sans);\n    line-height: 1.45;\n    overflow-x: hidden;\n    -webkit-font-smoothing: antialiased;\n  }\n\n  /* SBB Top Header */\n  header {\n    background: var(--white);\n    border-bottom: 1px solid var(--slate-line);\n    position: sticky;\n    top: 0;\n    z-index: 35;\n  }\n  .header-inner {\n    max-width: 1180px;\n    margin: 0 auto;\n    padding: 12px 20px;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n  }\n  .sbb-brand {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    text-decoration: none;\n    color: var(--ink);\n  }\n  .sbb-flag {\n    width: 46px;\n    height: 24px;\n    background: var(--sbb-red);\n    display: grid;\n    place-items: center;\n    flex-shrink: 0;\n  }\n  .sbb-brand-text {\n    font-weight: 800;\n    font-size: 0.92rem;\n    letter-spacing: 0.04em;\n  }\n  .sbb-brand-text span {\n    display: block;\n    font-size: 0.68rem;\n    font-weight: 500;\n    color: var(--muted);\n    letter-spacing: 0.02em;\n  }\n  .nav-links {\n    display: none;\n    list-style: none;\n    gap: 24px;\n  }\n  .nav-links a {\n    text-decoration: none;\n    color: var(--ink);\n    font-size: 0.84rem;\n    font-weight: 600;\n    padding: 10px 0;\n    border-bottom: 2px solid transparent;\n  }\n  .nav-links a:hover { border-bottom-color: var(--sbb-red); }\n  .menu-btn {\n    min-width: 44px;\n    min-height: 44px;\n    border: 1px solid var(--slate-line);\n    background: var(--white);\n    color: var(--ink);\n    font-family: var(--font-sans);\n    font-weight: 700;\n    font-size: 0.78rem;\n    padding: 0 12px;\n    cursor: pointer;\n  }\n  .mobile-nav {\n    display: none;\n    flex-direction: column;\n    background: var(--white);\n    border-bottom: 1px solid var(--slate-line);\n    padding: 4px 20px 12px;\n  }\n  .mobile-nav.open { display: flex; }\n  .mobile-nav a {\n    min-height: 44px;\n    display: flex;\n    align-items: center;\n    text-decoration: none;\n    color: var(--ink);\n    font-weight: 600;\n    font-size: 0.88rem;\n    border-top: 1px solid var(--slate-line);\n  }\n\n  /* Main Container */\n  .page {\n    max-width: 1180px;\n    margin: 0 auto;\n    padding: 24px 16px 72px;\n  }\n\n  /* Station Hero + Live Mondaine Railway Clock */\n  .station-hero {\n    background: var(--white);\n    border: 1px solid var(--slate-line);\n    border-top: 4px solid var(--sbb-red);\n    padding: 22px 20px;\n    display: grid;\n    grid-template-columns: minmax(0, 1fr);\n    gap: 24px;\n    align-items: center;\n    margin-bottom: 24px;\n  }\n  .station-badge {\n    display: inline-flex;\n    align-items: center;\n    gap: 8px;\n    font-family: var(--font-mono);\n    font-size: 0.72rem;\n    font-weight: 600;\n    color: var(--sbb-red);\n    text-transform: uppercase;\n    letter-spacing: 0.08em;\n    margin-bottom: 8px;\n  }\n  .live-dot {\n    width: 8px;\n    height: 8px;\n    border-radius: 50%;\n    background: var(--sbb-red);\n  }\n  h1 {\n    font-size: clamp(1.85rem, 4.8vw, 2.85rem);\n    font-weight: 800;\n    letter-spacing: -0.03em;\n    line-height: 1.06;\n    margin-bottom: 8px;\n  }\n  .station-sub {\n    color: var(--muted);\n    font-size: 0.94rem;\n    max-width: 52ch;\n    margin-bottom: 16px;\n  }\n  .kpi-strip {\n    display: grid;\n    grid-template-columns: repeat(3, minmax(0, 1fr));\n    gap: 10px;\n    padding-top: 14px;\n    border-top: 1px solid var(--slate-line);\n  }\n  .kpi span {\n    display: block;\n    font-size: 0.7rem;\n    color: var(--muted);\n    text-transform: uppercase;\n    letter-spacing: 0.05em;\n  }\n  .kpi strong {\n    font-family: var(--font-mono);\n    font-size: 1rem;\n    font-weight: 600;\n    color: var(--ink);\n  }\n\n  /* Clock Card */\n  .clock-card {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    background: var(--cloud);\n    border: 1px solid var(--slate-line);\n    padding: 18px 16px;\n  }\n  #sbbClock {\n    width: 176px;\n    height: 176px;\n    display: block;\n  }\n  .clock-readout {\n    margin-top: 12px;\n    text-align: center;\n  }\n  .digital-time {\n    font-family: var(--font-mono);\n    font-size: 1.15rem;\n    font-weight: 600;\n    letter-spacing: 0.04em;\n    font-variant-numeric: tabular-nums;\n  }\n  .clock-note {\n    display: block;\n    font-size: 0.68rem;\n    color: var(--muted);\n    margin-top: 2px;\n  }\n  .clock-note.pausing { color: var(--sbb-red); font-weight: 600; }\n\n  /* Filter Toolbar */\n  .controls-bar {\n    background: var(--white);\n    border: 1px solid var(--slate-line);\n    padding: 16px;\n    margin-bottom: 18px;\n    display: grid;\n    grid-template-columns: minmax(0, 1fr);\n    gap: 12px;\n  }\n  .search-input, .platform-select {\n    width: 100%;\n    min-height: 44px;\n    padding: 10px 12px;\n    border: 1.5px solid #aeb7c4;\n    background: var(--white);\n    color: var(--ink);\n    font-family: var(--font-sans);\n    font-size: 0.9rem;\n    font-weight: 500;\n  }\n  .search-input:focus, .platform-select:focus {\n    outline: 2px solid var(--sbb-red);\n    border-color: var(--sbb-red);\n  }\n  .cat-filters {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 8px;\n  }\n  .cat-btn {\n    min-height: 44px;\n    padding: 0 14px;\n    border: 1.5px solid var(--slate-line);\n    background: var(--cloud);\n    color: var(--ink);\n    font-family: var(--font-sans);\n    font-size: 0.8rem;\n    font-weight: 700;\n    cursor: pointer;\n    transition: all 0.14s;\n  }\n  .cat-btn.active {\n    background: var(--sbb-red);\n    border-color: var(--sbb-red);\n    color: var(--white);\n  }\n\n  /* Industrial Slate Departure Board */\n  .board {\n    background: var(--board-bg);\n    color: var(--white);\n    border-radius: 3px;\n    overflow: hidden;\n    box-shadow: 0 14px 36px rgba(15, 25, 42, 0.16);\n  }\n  .board-head {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    justify-content: space-between;\n    gap: 10px;\n    padding: 14px 16px;\n    background: #0f192b;\n    border-bottom: 2px solid var(--sbb-red);\n  }\n  .board-title {\n    font-weight: 800;\n    font-size: 0.92rem;\n    letter-spacing: 0.08em;\n    text-transform: uppercase;\n  }\n  .board-count {\n    font-family: var(--font-mono);\n    font-size: 0.74rem;\n    color: #9bb0cf;\n  }\n\n  .board-cols {\n    display: none;\n    grid-template-columns: 76px 90px 1fr 120px 84px 110px;\n    gap: 12px;\n    padding: 10px 18px;\n    font-size: 0.7rem;\n    font-weight: 700;\n    letter-spacing: 0.08em;\n    text-transform: uppercase;\n    color: #8fa6c9;\n    border-bottom: 1px solid var(--board-line);\n  }\n\n  .dep-list {\n    display: flex;\n    flex-direction: column;\n  }\n  .dep-row {\n    width: 100%;\n    min-height: 70px;\n    padding: 14px 16px;\n    background: var(--board-row);\n    border: none;\n    border-bottom: 1px solid var(--board-line);\n    color: var(--white);\n    font-family: var(--font-sans);\n    text-align: left;\n    cursor: pointer;\n    display: grid;\n    grid-template-columns: 64px minmax(0, 1fr) auto;\n    grid-template-areas:\n      \"time dest plat\"\n      \"cat via status\";\n    gap: 6px 10px;\n    align-items: center;\n    transition: background 0.12s;\n  }\n  .dep-row:nth-child(even) { background: var(--board-bg); }\n  .dep-row:hover { background: var(--board-hover); }\n\n  .dep-time {\n    grid-area: time;\n    font-family: var(--font-mono);\n    font-size: 1.08rem;\n    font-weight: 600;\n    font-variant-numeric: tabular-nums;\n  }\n  .dep-cat {\n    grid-area: cat;\n  }\n  .train-pill {\n    display: inline-block;\n    padding: 3px 7px;\n    font-family: var(--font-mono);\n    font-size: 0.72rem;\n    font-weight: 600;\n    border-radius: 2px;\n    background: var(--sbb-red);\n    color: var(--white);\n  }\n  .train-pill.ir { background: #ffffff; color: var(--sbb-red); }\n  .train-pill.ec { background: #1d4ed8; color: var(--white); }\n  .train-pill.sbahn { background: #334155; color: var(--white); }\n\n  .dep-dest {\n    grid-area: dest;\n    font-size: 1.02rem;\n    font-weight: 700;\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n  }\n  .dep-via {\n    grid-area: via;\n    font-size: 0.74rem;\n    color: #9cb0ce;\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n  }\n  .dep-plat {\n    grid-area: plat;\n    justify-self: end;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    min-width: 36px;\n    height: 30px;\n    padding: 0 8px;\n    background: var(--white);\n    color: var(--ink);\n    font-family: var(--font-mono);\n    font-weight: 600;\n    font-size: 0.84rem;\n    border-radius: 2px;\n  }\n  .dep-status {\n    grid-area: status;\n    justify-self: end;\n    font-family: var(--font-mono);\n    font-size: 0.72rem;\n    font-weight: 600;\n    color: #4ade80;\n  }\n  .dep-status.delay { color: var(--amber); }\n\n  .empty-state {\n    padding: 36px 20px;\n    text-align: center;\n    color: #9bb0cf;\n    font-size: 0.9rem;\n  }\n\n  /* Train Detail Slide-Over Drawer */\n  .drawer-backdrop {\n    position: fixed;\n    inset: 0;\n    background: rgba(15, 23, 42, 0.56);\n    z-index: 60;\n    display: none;\n    justify-content: flex-end;\n  }\n  .drawer-backdrop.open { display: flex; }\n  .drawer {\n    width: 100%;\n    max-width: 440px;\n    background: var(--white);\n    color: var(--ink);\n    height: 100%;\n    overflow-y: auto;\n    display: flex;\n    flex-direction: column;\n    box-shadow: -12px 0 36px rgba(0,0,0,0.25);\n  }\n  .drawer-head {\n    background: var(--board-bg);\n    color: var(--white);\n    padding: 18px 20px;\n    border-bottom: 4px solid var(--sbb-red);\n    display: flex;\n    align-items: flex-start;\n    justify-content: space-between;\n    gap: 12px;\n  }\n  .drawer-close {\n    min-width: 44px;\n    min-height: 44px;\n    border: 1px solid rgba(255,255,255,0.3);\n    background: transparent;\n    color: var(--white);\n    font-family: var(--font-sans);\n    font-size: 1.2rem;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n  .drawer-body {\n    padding: 20px;\n    display: flex;\n    flex-direction: column;\n    gap: 20px;\n  }\n  .drawer-meta {\n    display: grid;\n    grid-template-columns: repeat(3, minmax(0, 1fr));\n    gap: 10px;\n    background: var(--cloud);\n    border: 1px solid var(--slate-line);\n    padding: 12px;\n  }\n  .drawer-meta span {\n    display: block;\n    font-size: 0.68rem;\n    color: var(--muted);\n    text-transform: uppercase;\n  }\n  .drawer-meta strong {\n    font-family: var(--font-mono);\n    font-size: 0.92rem;\n  }\n\n  /* Carriage Formation Strip */\n  .formation-title {\n    font-size: 0.74rem;\n    font-weight: 700;\n    text-transform: uppercase;\n    letter-spacing: 0.06em;\n    color: var(--muted);\n    margin-bottom: 10px;\n  }\n  .formation-cars {\n    display: grid;\n    grid-template-columns: repeat(4, minmax(0, 1fr));\n    gap: 6px;\n  }\n  .car-box {\n    border: 1.5px solid var(--ink);\n    padding: 8px 6px;\n    text-align: center;\n    background: var(--white);\n    border-top: 4px solid var(--ink);\n  }\n  .car-box.first { border-top-color: var(--amber); }\n  .car-box.bistro { border-top-color: var(--sbb-red); }\n  .car-box strong {\n    display: block;\n    font-family: var(--font-mono);\n    font-size: 0.82rem;\n  }\n  .car-box span {\n    font-size: 0.66rem;\n    color: var(--muted);\n  }\n\n  /* Stopping Pattern Timeline */\n  .stops-list {\n    list-style: none;\n    border-left: 2px solid var(--sbb-red);\n    margin-left: 8px;\n    padding-left: 18px;\n    display: flex;\n    flex-direction: column;\n    gap: 14px;\n  }\n  .stops-list li {\n    position: relative;\n    display: flex;\n    justify-content: space-between;\n    align-items: baseline;\n    gap: 10px;\n  }\n  .stops-list li::before {\n    content: '';\n    position: absolute;\n    left: -24px;\n    top: 6px;\n    width: 10px;\n    height: 10px;\n    border-radius: 50%;\n    background: var(--white);\n    border: 2.5px solid var(--sbb-red);\n  }\n  .stops-list li:first-child::before,\n  .stops-list li:last-child::before {\n    background: var(--sbb-red);\n  }\n  .stop-name { font-weight: 600; font-size: 0.92rem; }\n  .stop-time { font-family: var(--font-mono); font-size: 0.84rem; color: var(--muted); }\n\n  footer {\n    max-width: 1180px;\n    margin: 0 auto;\n    padding: 20px 16px 36px;\n    border-top: 1px solid var(--slate-line);\n    display: flex;\n    flex-wrap: wrap;\n    justify-content: space-between;\n    gap: 8px;\n    font-size: 0.74rem;\n    color: var(--muted);\n  }\n\n  @media (min-width: 780px) {\n    .nav-links { display: flex; }\n    .menu-btn { display: none; }\n    .mobile-nav { display: none !important; }\n    .station-hero { grid-template-columns: 1.4fr 0.75fr; padding: 28px 30px; }\n    .controls-bar { grid-template-columns: 1.2fr 180px auto; align-items: center; }\n    .board-cols { display: grid; }\n    .dep-row {\n      grid-template-columns: 76px 90px 1fr 120px 84px 110px;\n      grid-template-areas: \"time cat dest via plat status\";\n      padding: 14px 18px;\n    }\n    .dep-plat { justify-self: start; }\n  }\n</style>\n</head>\n<body>\n<header>\n  <div class=\"header-inner\">\n    <a href=\"#top\" class=\"sbb-brand\">\n      <div class=\"sbb-flag\" aria-hidden=\"true\">\n        <svg viewBox=\"0 0 46 24\" width=\"38\" height=\"20\">\n          <rect x=\"21\" y=\"4\" width=\"4\" height=\"16\" fill=\"#ffffff\"/>\n          <rect x=\"13\" y=\"10\" width=\"20\" height=\"4\" fill=\"#ffffff\"/>\n          <polygon points=\"4,12 11,5 15,5 10,10 15,10 15,14 10,14 15,19 11,19\" fill=\"#ffffff\"/>\n          <polygon points=\"42,12 35,5 31,5 36,10 31,10 31,14 36,14 31,19 35,19\" fill=\"#ffffff\"/>\n        </svg>\n      </div>\n      <div class=\"sbb-brand-text\">\n        SBB CFF FFS\n        <span>Digital Timetable System</span>\n      </div>\n    </a>\n    <nav>\n      <ul class=\"nav-links\">\n        <li><a href=\"#station\">Zürich HB</a></li>\n        <li><a href=\"#departures\">Departures</a></li>\n        <li><a href=\"#info\">Network Status</a></li>\n      </ul>\n    </nav>\n    <button class=\"menu-btn\" id=\"menuBtn\" aria-expanded=\"false\" aria-controls=\"mobileNav\">Menu</button>\n  </div>\n  <div class=\"mobile-nav\" id=\"mobileNav\">\n    <a href=\"#station\">Station Clock &amp; Overview</a>\n    <a href=\"#departures\">Live Departure Board</a>\n    <a href=\"#info\">Network Operations</a>\n  </div>\n</header>\n\n<main class=\"page\" id=\"top\">\n  <section class=\"station-hero\" id=\"station\">\n    <div>\n      <div class=\"station-badge\"><span class=\"live-dot\"></span> Bahnhof Zürich HB &middot; Gleise 3–44</div>\n      <h1>Abfahrt / Departures</h1>\n      <p class=\"station-sub\">\n        Real-time Swiss Federal Railways timetable synchronized to the master impulse clock. Select any departure row to inspect stopping pattern, sector boarding, and carriage occupancy.\n      </p>\n      <div class=\"kpi-strip\">\n        <div class=\"kpi\">\n          <span>Punctuality</span>\n          <strong>93.8%</strong>\n        </div>\n        <div class=\"kpi\">\n          <span>Active Tracks</span>\n          <strong>26 / 26</strong>\n        </div>\n        <div class=\"kpi\">\n          <span>Sync Cycle</span>\n          <strong>58.5s + 1.5s</strong>\n        </div>\n      </div>\n    </div>\n\n    <!-- Live Ticking Mondaine-Style Swiss Railway Clock -->\n    <div class=\"clock-card\">\n      <svg id=\"sbbClock\" viewBox=\"0 0 200 200\" role=\"img\" aria-label=\"Live ticking Swiss Railway Station Clock\">\n        <!-- Brushed Aluminum Rim -->\n        <circle cx=\"100\" cy=\"100\" r=\"96\" fill=\"#d8dde4\" stroke=\"#9aa3b2\" stroke-width=\"2\"/>\n        <circle cx=\"100\" cy=\"100\" r=\"89\" fill=\"#ffffff\" stroke=\"#e2e6ec\" stroke-width=\"1\"/>\n        <!-- Hour & Minute Baton Markers (populated by JS) -->\n        <g id=\"clockMarkers\"></g>\n        <!-- Hour Hand -->\n        <g id=\"sbbHour\" transform=\"translate(100,100)\">\n          <polygon points=\"-4.5,18 4.5,18 3.6,-52 -3.6,-52\" fill=\"#111827\"/>\n        </g>\n        <!-- Minute Hand -->\n        <g id=\"sbbMin\" transform=\"translate(100,100)\">\n          <polygon points=\"-3.6,20 3.6,20 2.6,-76 -2.6,-76\" fill=\"#111827\"/>\n        </g>\n        <!-- Iconic Pausing Red Paddle Second Hand -->\n        <g id=\"sbbSec\" transform=\"translate(100,100)\">\n          <rect x=\"-1.4\" y=\"-58\" width=\"2.8\" height=\"82\" fill=\"#eb0000\"/>\n          <circle cx=\"0\" cy=\"-58\" r=\"7.2\" fill=\"#eb0000\"/>\n          <circle cx=\"0\" cy=\"0\" r=\"3.4\" fill=\"#eb0000\"/>\n        </g>\n      </svg>\n      <div class=\"clock-readout\">\n        <div class=\"digital-time\" id=\"digitalTime\">12:00:00</div>\n        <span class=\"clock-note\" id=\"clockPhase\">Continuous sweep (58.5s)</span>\n      </div>\n    </div>\n  </section>\n\n  <!-- Filter & Search Controls -->\n  <section class=\"controls-bar\" id=\"departures\" aria-label=\"Departure Board Filters\">\n    <input type=\"search\" id=\"destSearch\" class=\"search-input\" placeholder=\"Filter destination, via stop, or train (e.g. Bern, Basel, IC 1)…\" aria-label=\"Search destination or train\">\n    <select id=\"platformSelect\" class=\"platform-select\" aria-label=\"Filter by platform\">\n      <option value=\"all\">All Platforms (Gleise)</option>\n      <option value=\"4\">Gleis 4</option>\n      <option value=\"7\">Gleis 7</option>\n      <option value=\"9\">Gleis 9</option>\n      <option value=\"12\">Gleis 12</option>\n      <option value=\"16\">Gleis 16</option>\n      <option value=\"31\">Gleis 31</option>\n      <option value=\"33\">Gleis 33</option>\n    </select>\n    <div class=\"cat-filters\" role=\"group\" aria-label=\"Train Category Filter\">\n      <button type=\"button\" class=\"cat-btn active\" data-cat=\"all\">All</button>\n      <button type=\"button\" class=\"cat-btn\" data-cat=\"IC\">IC</button>\n      <button type=\"button\" class=\"cat-btn\" data-cat=\"IR\">IR</button>\n      <button type=\"button\" class=\"cat-btn\" data-cat=\"EC\">EC</button>\n      <button type=\"button\" class=\"cat-btn\" data-cat=\"S\">S-Bahn</button>\n    </div>\n  </section>\n\n  <!-- Live Departure Board -->\n  <section class=\"board\" aria-label=\"Live Train Departures\">\n    <div class=\"board-head\">\n      <span class=\"board-title\">Zürich HB &middot; Next Departures</span>\n      <span class=\"board-count\" id=\"boardCount\">8 TRAINS SHOWN</span>\n    </div>\n    <div class=\"board-cols\" aria-hidden=\"true\">\n      <span>Dep.</span>\n      <span>Train</span>\n      <span>Destination</span>\n      <span>Via</span>\n      <span>Gleis</span>\n      <span style=\"text-align:right\">Status</span>\n    </div>\n    <div class=\"dep-list\" id=\"depList\"></div>\n  </section>\n</main>\n\n<!-- Train Detail Drawer -->\n<div class=\"drawer-backdrop\" id=\"drawerBackdrop\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"drawerTitle\">\n  <div class=\"drawer\">\n    <div class=\"drawer-head\">\n      <div>\n        <div id=\"drawerTrainPill\" style=\"margin-bottom:6px;\"></div>\n        <h2 id=\"drawerTitle\" style=\"font-size:1.35rem;font-weight:800;line-height:1.15;\">Genève-Aéroport</h2>\n        <p id=\"drawerSub\" style=\"font-size:0.8rem;color:#a8bddc;margin-top:4px;\">Direct InterCity Service</p>\n      </div>\n      <button type=\"button\" class=\"drawer-close\" id=\"drawerClose\" aria-label=\"Close train details\">&times;</button>\n    </div>\n    <div class=\"drawer-body\">\n      <div class=\"drawer-meta\">\n        <div><span>Departure</span><strong id=\"dTime\">14:02</strong></div>\n        <div><span>Platform</span><strong id=\"dPlat\">Gleis 31</strong></div>\n        <div><span>Sector</span><strong id=\"dSector\">A – D</strong></div>\n      </div>\n\n      <div>\n        <p class=\"formation-title\">Carriage Formation &amp; Occupancy</p>\n        <div class=\"formation-cars\" id=\"dFormation\"></div>\n      </div>\n\n      <div>\n        <p class=\"formation-title\">Stopping Pattern</p>\n        <ul class=\"stops-list\" id=\"dStops\"></ul>\n      </div>\n    </div>\n  </div>\n</div>\n\n<footer id=\"info\">\n  <span>SBB CFF FFS &middot; SWISS FEDERAL RAILWAYS INDUSTRIAL SIGNAGE</span>\n  <span>HANS HILFIKER CLOCK SYSTEM (1944)</span>\n</footer>\n\n<script>\n(function () {\n  // Mobile Nav\n  const menuBtn = document.getElementById('menuBtn');\n  const mobileNav = document.getElementById('mobileNav');\n  menuBtn.addEventListener('click', () => {\n    const open = mobileNav.classList.toggle('open');\n    menuBtn.setAttribute('aria-expanded', String(open));\n  });\n  mobileNav.querySelectorAll('a').forEach(a => a.addEventListener('click', () => {\n    mobileNav.classList.remove('open');\n    menuBtn.setAttribute('aria-expanded', 'false');\n  }));\n\n  // Build Swiss Railway Clock Baton Markers\n  const markers = document.getElementById('clockMarkers');\n  const ns = 'http://www.w3.org/2000/svg';\n  for (let i = 0; i < 60; i++) {\n    const isHour = i % 5 === 0;\n    const rect = document.createElementNS(ns, 'rect');\n    rect.setAttribute('x', isHour ? '-2.8' : '-1.1');\n    rect.setAttribute('y', isHour ? '-82' : '-82');\n    rect.setAttribute('width', isHour ? '5.6' : '2.2');\n    rect.setAttribute('height', isHour ? '20' : '7');\n    rect.setAttribute('fill', '#111827');\n    rect.setAttribute('transform', `translate(100,100) rotate(${i * 6})`);\n    markers.appendChild(rect);\n  }\n\n  // Authentic Swiss Railway Clock Loop (58.5s sweep + 1.5s pause at 12 o'clock)\n  const sbbHour = document.getElementById('sbbHour');\n  const sbbMin = document.getElementById('sbbMin');\n  const sbbSec = document.getElementById('sbbSec');\n  const digitalTime = document.getElementById('digitalTime');\n  const clockPhase = document.getElementById('clockPhase');\n\n  function pad(n) { return String(n).padStart(2, '0'); }\n\n  function updateClock() {\n    const now = new Date();\n    const h = now.getHours();\n    const m = now.getMinutes();\n    const s = now.getSeconds();\n    const ms = now.getMilliseconds();\n    const exactSec = s + ms / 1000;\n\n    // Complete 360 deg in 58.5s, pause at 0 deg from 58.5s to 60.0s\n    let secDeg;\n    const isPausing = exactSec >= 58.5;\n    if (isPausing) {\n      secDeg = 0;\n    } else {\n      secDeg = (exactSec / 58.5) * 360;\n    }\n\n    // Minute hand snaps cleanly at each minute impulse\n    const minDeg = m * 6;\n    const hourDeg = ((h % 12) + m / 60) * 30;\n\n    sbbSec.setAttribute('transform', `translate(100,100) rotate(${secDeg.toFixed(2)})`);\n    sbbMin.setAttribute('transform', `translate(100,100) rotate(${minDeg.toFixed(1)})`);\n    sbbHour.setAttribute('transform', `translate(100,100) rotate(${hourDeg.toFixed(2)})`);\n\n    digitalTime.textContent = `${pad(h)}:${pad(m)}:${pad(s)}`;\n    clockPhase.textContent = isPausing ? 'Synchronization pause at 12:00 (1.5s)' : 'Continuous sweep (58.5s cycle)';\n    clockPhase.classList.toggle('pausing', isPausing);\n\n    requestAnimationFrame(updateClock);\n  }\n  requestAnimationFrame(updateClock);\n\n  // Timetable Dataset (dynamically offset from current local minute for live realism)\n  const baseDate = new Date();\n  function fmtOffset(mins) {\n    const d = new Date(baseDate.getTime() + mins * 60000);\n    return `${pad(d.getHours())}:${pad(d.getMinutes())}`;\n  }\n\n  const departures = [\n    {\n      id: 'ic1', cat: 'IC', num: 'IC 1', pillCls: '',\n      dest: 'Genève-Aéroport', via: 'Bern – Fribourg – Lausanne',\n      offset: 4, plat: '31', sector: 'A – D', status: 'On time', delay: false,\n      note: 'Double-deck FV-Dosto · Restaurant open',\n      cars: [\n        { cls: 'first', label: '1st Cl.', occ: 'Low' },\n        { cls: 'bistro', label: 'Bistro', occ: 'Open' },\n        { cls: '', label: '2nd Cl.', occ: 'Medium' },\n        { cls: '', label: '2nd Cl.', occ: 'Low' }\n      ],\n      stops: [\n        { name: 'Zürich HB', off: 4 },\n        { name: 'Bern', off: 60 },\n        { name: 'Fribourg/Freiburg', off: 82 },\n        { name: 'Lausanne', off: 126 },\n        { name: 'Genève', off: 162 },\n        { name: 'Genève-Aéroport', off: 170 }\n      ]\n    },\n    {\n      id: 'ir36', cat: 'IR', num: 'IR 36', pillCls: 'ir',\n      dest: 'Basel SBB', via: 'Baden – Brugg AG – Frick',\n      offset: 7, plat: '16', sector: 'B – D', status: 'On time', delay: false,\n      note: 'Low-floor step-free boarding · Bike hooks',\n      cars: [\n        { cls: 'first', label: '1st Cl.', occ: 'Low' },\n        { cls: '', label: '2nd Cl.', occ: 'Medium' },\n        { cls: '', label: '2nd Cl.', occ: 'Medium' },\n        { cls: '', label: 'Bike / 2nd', occ: 'Low' }\n      ],\n      stops: [\n        { name: 'Zürich HB', off: 7 },\n        { name: 'Baden', off: 23 },\n        { name: 'Brugg AG', off: 32 },\n        { name: 'Frick', off: 45 },\n        { name: 'Basel SBB', off: 70 }\n      ]\n    },\n    {\n      id: 'ec315', cat: 'EC', num: 'EC 315', pillCls: 'ec',\n      dest: 'Milano Centrale', via: 'Arth-Goldau – Gotthard Base – Lugano',\n      offset: 11, plat: '7', sector: 'A – C', status: '+3 min', delay: true,\n      note: 'Giruno EuroCity · Cross-border ID required',\n      cars: [\n        { cls: 'first', label: '1st Cl.', occ: 'Medium' },\n        { cls: 'bistro', label: 'Ristorante', occ: 'Open' },\n        { cls: '', label: '2nd Cl.', occ: 'High' },\n        { cls: '', label: 'Quiet 2nd', occ: 'Medium' }\n      ],\n      stops: [\n        { name: 'Zürich HB', off: 11 },\n        { name: 'Zug', off: 34 },\n        { name: 'Arth-Goldau', off: 49 },\n        { name: 'Bellinzona', off: 109 },\n        { name: 'Lugano', off: 125 },\n        { name: 'Milano Centrale', off: 205 }\n      ]\n    },\n    {\n      id: 'ic3', cat: 'IC', num: 'IC 3', pillCls: '',\n      dest: 'Chur', via: 'Sargans – Landquart',\n      offset: 15, plat: '9', sector: 'A – D', status: 'On time', delay: false,\n      note: 'Connection in Landquart to RhB Davos / St. Moritz',\n      cars: [\n        { cls: 'first', label: '1st Cl.', occ: 'Low' },\n        { cls: 'bistro', label: 'Bistro', occ: 'Open' },\n        { cls: '', label: '2nd Cl.', occ: 'Medium' },\n        { cls: '', label: 'Family', occ: 'Low' }\n      ],\n      stops: [\n        { name: 'Zürich HB', off: 15 },\n        { name: 'Sargans', off: 69 },\n        { name: 'Landquart', off: 79 },\n        { name: 'Chur', off: 90 }\n      ]\n    },\n    {\n      id: 's12', cat: 'S', num: 'S 12', pillCls: 'sbahn',\n      dest: 'Winterthur', via: 'Zürich Stadelhofen – Stettbach',\n      offset: 18, plat: '33', sector: 'A – C', status: 'On time', delay: false,\n      note: 'ZVV Urban S-Bahn · Double-deck commuter set',\n      cars: [\n        { cls: 'first', label: '1st Cl.', occ: 'Low' },\n        { cls: '', label: '2nd Cl.', occ: 'High' },\n        { cls: '', label: '2nd Cl.', occ: 'Medium' },\n        { cls: '', label: '2nd Cl.', occ: 'Low' }\n      ],\n      stops: [\n        { name: 'Zürich HB', off: 18 },\n        { name: 'Zürich Stadelhofen', off: 22 },\n        { name: 'Stettbach', off: 28 },\n        { name: 'Effretikon', off: 38 },\n        { name: 'Winterthur', off: 46 }\n      ]\n    },\n    {\n      id: 'ir75', cat: 'IR', num: 'IR 75', pillCls: 'ir',\n      dest: 'Luzern', via: 'Thalwil – Zug – Rotkreuz',\n      offset: 22, plat: '4', sector: 'B – D', status: 'On time', delay: false,\n      note: 'Lake Zug panoramic corridor · Wi-Fi Free',\n      cars: [\n        { cls: 'first', label: '1st Cl.', occ: 'Low' },\n        { cls: '', label: '2nd Cl.', occ: 'Medium' },\n        { cls: '', label: '2nd Cl.', occ: 'Low' },\n        { cls: '', label: 'Quiet 2nd', occ: 'Low' }\n      ],\n      stops: [\n        { name: 'Zürich HB', off: 22 },\n        { name: 'Thalwil', off: 32 },\n        { name: 'Zug', off: 45 },\n        { name: 'Rotkreuz', off: 54 },\n        { name: 'Luzern', off: 69 }\n      ]\n    },\n    {\n      id: 'ic5', cat: 'IC', num: 'IC 5', pillCls: '',\n      dest: 'St. Gallen', via: 'Zürich Flughafen – Winterthur – Wil',\n      offset: 26, plat: '12', sector: 'A – D', status: 'On time', delay: false,\n      note: 'Tilting ICN InterCity · Airport express link',\n      cars: [\n        { cls: 'first', label: '1st Cl.', occ: 'Low' },\n        { cls: 'bistro', label: 'Bistro', occ: 'Open' },\n        { cls: '', label: '2nd Cl.', occ: 'Medium' },\n        { cls: '', label: '2nd Cl.', occ: 'Low' }\n      ],\n      stops: [\n        { name: 'Zürich HB', off: 26 },\n        { name: 'Zürich Flughafen', off: 36 },\n        { name: 'Winterthur', off: 49 },\n        { name: 'Wil SG', off: 67 },\n        { name: 'St. Gallen', off: 88 }\n      ]\n    },\n    {\n      id: 'ec195', cat: 'EC', num: 'EC 195', pillCls: 'ec',\n      dest: 'München Hbf', via: 'St. Margrethen – Bregenz – Lindau',\n      offset: 33, plat: '9', sector: 'A – C', status: '+2 min', delay: true,\n      note: 'Astoro EuroCity · Seat reservation recommended',\n      cars: [\n        { cls: 'first', label: '1st Cl.', occ: 'Medium' },\n        { cls: 'bistro', label: 'Bistro', occ: 'Open' },\n        { cls: '', label: '2nd Cl.', occ: 'Medium' },\n        { cls: '', label: '2nd Cl.', occ: 'Medium' }\n      ],\n      stops: [\n        { name: 'Zürich HB', off: 33 },\n        { name: 'Winterthur', off: 55 },\n        { name: 'St. Gallen', off: 93 },\n        { name: 'Bregenz', off: 124 },\n        { name: 'München Hbf', off: 243 }\n      ]\n    }\n  ];\n\n  let activeCat = 'all';\n  const destSearch = document.getElementById('destSearch');\n  const platformSelect = document.getElementById('platformSelect');\n  const depList = document.getElementById('depList');\n  const boardCount = document.getElementById('boardCount');\n\n  function renderBoard() {\n    const q = destSearch.value.trim().toLowerCase();\n    const plat = platformSelect.value;\n\n    const list = departures.filter(d => {\n      if (activeCat !== 'all' && d.cat !== activeCat) return false;\n      if (plat !== 'all' && d.plat !== plat) return false;\n      if (q) {\n        const hay = `${d.num} ${d.dest} ${d.via}`.toLowerCase();\n        if (!hay.includes(q)) return false;\n      }\n      return true;\n    });\n\n    boardCount.textContent = `${list.length} ${list.length === 1 ? 'TRAIN' : 'TRAINS'} SHOWN`;\n    depList.innerHTML = '';\n\n    if (list.length === 0) {\n      depList.innerHTML = '<div class=\"empty-state\">No departures match your current filter. Clear search or select All Platforms.</div>';\n      return;\n    }\n\n    list.forEach(d => {\n      const btn = document.createElement('button');\n      btn.type = 'button';\n      btn.className = 'dep-row';\n      btn.innerHTML = `\n        <span class=\"dep-time\">${fmtOffset(d.offset)}</span>\n        <span class=\"dep-cat\"><span class=\"train-pill ${d.pillCls}\">${d.num}</span></span>\n        <span class=\"dep-dest\">${d.dest}</span>\n        <span class=\"dep-via\">${d.via}</span>\n        <span class=\"dep-plat\">${d.plat}</span>\n        <span class=\"dep-status ${d.delay ? 'delay' : ''}\">${d.status}</span>\n      `;\n      btn.addEventListener('click', () => openDrawer(d));\n      depList.appendChild(btn);\n    });\n  }\n\n  // Detail Drawer\n  const backdrop = document.getElementById('drawerBackdrop');\n  const drawerClose = document.getElementById('drawerClose');\n\n  function openDrawer(d) {\n    document.getElementById('drawerTrainPill').innerHTML = `<span class=\"train-pill ${d.pillCls}\">${d.num}</span>`;\n    document.getElementById('drawerTitle').textContent = d.dest;\n    document.getElementById('drawerSub').textContent = d.note;\n    document.getElementById('dTime').textContent = fmtOffset(d.offset);\n    document.getElementById('dPlat').textContent = `Gleis ${d.plat}`;\n    document.getElementById('dSector').textContent = d.sector;\n\n    const formEl = document.getElementById('dFormation');\n    formEl.innerHTML = d.cars.map(c => `\n      <div class=\"car-box ${c.cls}\">\n        <strong>${c.label}</strong>\n        <span>${c.occ}</span>\n      </div>\n    `).join('');\n\n    const stopsEl = document.getElementById('dStops');\n    stopsEl.innerHTML = d.stops.map(s => `\n      <li>\n        <span class=\"stop-name\">${s.name}</span>\n        <span class=\"stop-time\">${fmtOffset(s.off)}</span>\n      </li>\n    `).join('');\n\n    backdrop.classList.add('open');\n    drawerClose.focus();\n  }\n\n  function closeDrawer() {\n    backdrop.classList.remove('open');\n  }\n  drawerClose.addEventListener('click', closeDrawer);\n  backdrop.addEventListener('click', e => { if (e.target === backdrop) closeDrawer(); });\n  document.addEventListener('keydown', e => { if (e.key === 'Escape') closeDrawer(); });\n\n  destSearch.addEventListener('input', renderBoard);\n  platformSelect.addEventListener('change', renderBoard);\n  document.querySelectorAll('.cat-btn').forEach(b => {\n    b.addEventListener('click', () => {\n      activeCat = b.dataset.cat;\n      document.querySelectorAll('.cat-btn').forEach(x => x.classList.toggle('active', x === b));\n      renderBoard();\n    });\n  });\n\n  renderBoard();\n})();\n</script>\n</body>\n</html>\n"
}
