/* High-contrast departure board. Keep controls and branding secondary. */
.departure-panel{background:#080e18;color:#fff;border-radius:0;padding:18px;font-family:Arial,Helvetica,sans-serif}
.board-header{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:0 0 18px;border-bottom:2px solid #b4bcc8;margin-bottom:18px}
.board-header>div{min-width:0}.board-header h2{font-size:1.7rem;line-height:1.1;font-weight:700;letter-spacing:-.025em;margin:8px 0 0;overflow-wrap:anywhere}
.board-caption{display:flex;align-items:center;gap:10px;font-size:.7rem;color:#ccd4df}
.board-filter{margin:8px 0 0;color:#f8d96b;font-size:.85rem}.board-header .live-clock{font-weight:700;font-size:1.7rem;color:#fff;align-self:center}
.departure-labels,.departure-row{grid-template-columns:48px minmax(0,1fr) 38px 110px;gap:12px}
.departure-labels{color:#c2cbd9;font-size:.65rem;letter-spacing:.07em;border-color:#536070}
.departure-row{padding:14px 0;border-color:#536070;align-items:center}
.line-number,.line-number.sl,.line-number.ul,.line-number.ultrain,.line-number.malartag{font-size:1.05rem;color:#ffe16d;background:transparent;padding:0;text-align:left;font-weight:700;border-radius:0}
.destination>strong{font-size:1.05rem;font-weight:700;color:white;line-height:1.15}
.platform{font-size:1.1rem;font-weight:700;color:white}.departure-time>strong{font-size:1.65rem;font-weight:700;color:#ffe16d}
.departure-time>small{font-size:.8rem;color:#d4dce8;margin-top:5px}.departure-time>small s{color:#ff9999}.departure-time>strong>small{font-size:.75rem;font-weight:700}
.departure-status{margin-top:7px;line-height:1.3}.incident-flag{font-size:.75rem;font-weight:800;letter-spacing:.02em;color:#fff;background:#b82029;padding:4px 7px;display:inline-block}
.incident-flag::before{content:'!';display:inline-block;font-weight:900;margin-right:7px}
.timetable-label{font-size:.72rem;color:#c2cbd9}.departure-row.delayed,.departure-row.canceled{border-left:5px solid #ff474f;padding-left:10px;background:#3a141a}
.delayed .departure-time>strong,.canceled .departure-time>strong{color:#ff858b}
.canceled .destination>strong{color:#fff;text-decoration:none}.canceled .departure-time>strong{font-size:.94rem;font-weight:800}
.canceled .incident-flag{background:#cf2330}.departure-alert{color:#ffb8bc;font-size:.78rem;font-weight:600;line-height:1.4}
.screen-bottom{color:#b2bdce;font-size:.62rem;padding-top:14px;margin-top:12px}.screen-bottom .fresh{color:#b2bdce}
.station-alert,.stale-warning{background:#641c25;color:#fff;font-weight:700;border:1px solid #f35b66;border-radius:0}
.preview{border-radius:0;box-shadow:none}.screen-page,.screen-page.portrait,body:has(.screen-page){background:#080e18}
.screen-page,.screen-page.portrait{padding:16px 2.5vw;max-width:none;min-height:100dvh;gap:0}
.screen-page #screen-board{display:block;flex:0 0 auto}.screen-page .departure-panel{padding:0;min-height:0}
.screen-page .board-header{padding-bottom:14px;margin-bottom:14px}.screen-page .board-caption{font-size:.9rem}.screen-page .board-header h2{font-size:clamp(2rem,3.6vw,4rem)}
.screen-page .board-header .live-clock{font-size:clamp(2.4rem,4vw,4rem)}.screen-page .board-filter{font-size:1.1rem}
.screen-page .departure-labels,.screen-page .departure-row,.screen-page.portrait .departure-labels,.screen-page.portrait .departure-row{grid-template-columns:90px minmax(0,1fr) 80px 230px;gap:20px}
.screen-page .departure-labels{font-size:.85rem;padding-bottom:9px}.screen-page .departure-row{padding-top:14px;padding-bottom:14px}
.screen-page .line-number,.screen-page.portrait .line-number{font-size:clamp(1.5rem,2.6vw,2.8rem);padding:0}
.screen-page .destination>strong,.screen-page.portrait .destination>strong{font-size:clamp(1.5rem,2.65vw,3rem);line-height:1.1}
.screen-page .platform{font-size:clamp(1.5rem,2.6vw,2.8rem)}
.screen-page .departure-time>strong,.screen-page.portrait .departure-time>strong{font-size:clamp(2rem,3.3vw,3.6rem);line-height:1}
.screen-page .departure-time>strong>small{font-size:1rem}.screen-page .departure-time>small{font-size:1.05rem;margin-top:6px}
.screen-page .incident-flag{font-size:1.05rem}.screen-page .canceled .departure-time>strong{font-size:clamp(1.25rem,2.1vw,2.3rem)}
.screen-page .timetable-label{font-size:.9rem}.screen-page .departure-alert{font-size:.95rem}.screen-page .screen-bottom{font-size:.7rem;padding:12px 0 0;margin:0}
.screen-page .screen-footer{margin-top:auto;padding:10px 0 0;justify-content:flex-start;flex-wrap:nowrap;position:relative;min-height:30px;font-size:.65rem;color:#a3aec1}
.screen-page .attribution,.screen-page.portrait .attribution{font-size:.6rem;margin-left:auto;width:auto}
.display-options summary{cursor:pointer;list-style:none;text-decoration:underline;text-underline-offset:3px;padding:4px}
.display-options[open] .screen-controls{position:absolute;bottom:32px;left:0;z-index:2;padding:14px;background:#1b283b;border:1px solid #73849c;box-shadow:0 5px 20px #0008;flex-wrap:wrap;max-width:calc(100vw - 40px)}
.screen-controls .pulse-option{display:flex;align-items:center;gap:8px;font-size:.8rem;margin:0;color:#fff;font-weight:400;white-space:nowrap}
.pulse-warnings .delayed .incident-flag::before,.pulse-warnings .canceled .incident-flag::before{animation:incident-pulse 2s ease-in-out infinite}
@keyframes incident-pulse{0%,100%{opacity:1}50%{opacity:.25}}
@media(prefers-reduced-motion:reduce){.pulse-warnings .incident-flag::before{animation:none!important}}
@media(min-width:781px) and (max-height:850px){.screen-page .board-header{padding-bottom:10px;margin-bottom:10px}.screen-page .board-header h2{font-size:2.2rem}.screen-page .board-header .live-clock{font-size:2.6rem}.screen-page .departure-row{padding-top:9px;padding-bottom:9px}.screen-page .destination>strong,.screen-page.portrait .destination>strong{font-size:2rem}.screen-page .line-number,.screen-page.portrait .line-number,.screen-page .platform{font-size:1.9rem}.screen-page .departure-time>strong,.screen-page.portrait .departure-time>strong{font-size:2.6rem}.screen-page .canceled .departure-time>strong{font-size:1.65rem}.screen-page .incident-flag{font-size:1rem}.screen-page .departure-time>small{font-size:.95rem}.screen-page .screen-bottom{padding-top:9px}}
@media(max-width:780px){.screen-page,.screen-page.portrait{padding:14px}.screen-page .board-header h2{font-size:1.8rem}.screen-page .board-header .live-clock{font-size:2rem}.screen-page .board-caption{font-size:.7rem}.screen-page .board-filter{font-size:.9rem}.screen-page .departure-labels,.screen-page .departure-row,.screen-page.portrait .departure-labels,.screen-page.portrait .departure-row{grid-template-columns:48px minmax(0,1fr) 32px 110px;gap:10px}.screen-page .departure-labels{font-size:.6rem}.screen-page .line-number,.screen-page.portrait .line-number,.screen-page .platform{font-size:1.2rem}.screen-page .destination>strong,.screen-page.portrait .destination>strong{font-size:1.25rem}.screen-page .departure-time>strong,.screen-page.portrait .departure-time>strong{font-size:1.85rem}.screen-page .canceled .departure-time>strong{font-size:1rem}.screen-page .departure-time>small{font-size:.76rem}.screen-page .incident-flag{font-size:.75rem}.screen-page .departure-time>strong>small{font-size:.7rem}.screen-page .departure-alert{font-size:.8rem}.screen-page .departure-row{padding-top:12px;padding-bottom:12px}.screen-page .screen-footer{flex-wrap:wrap}.screen-page .attribution{font-size:.5rem}}
@media(max-width:430px){.departure-labels,.departure-row,.screen-page .departure-labels,.screen-page .departure-row,.screen-page.portrait .departure-labels,.screen-page.portrait .departure-row{grid-template-columns:36px minmax(0,1fr) 26px 90px;gap:8px}.departure-row.delayed,.departure-row.canceled{padding-left:5px;border-left-width:3px}.screen-page .destination>strong,.screen-page.portrait .destination>strong{font-size:1.15rem}.screen-page .incident-flag{font-size:.68rem;padding:4px}.screen-page .canceled .departure-time>strong{font-size:.85rem}.screen-page .board-header{gap:10px}}
.screen-page.portrait{max-width:860px;margin:0 auto}
/* A screen rotates whole pages; each page lays out independent departure objects. */
.page-objects,.layout-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}
.departure-object,.layout-object{min-width:0}.departure-object.full,.layout-object.full{grid-column:1/-1}
.layout-page{border:1px solid #c9d0c7;border-radius:12px;padding:16px;margin:16px 0;background:#fff}
.layout-heading,.object-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.layout-heading{flex-wrap:wrap;margin-bottom:14px}.layout-heading h3{margin:0}.layout-actions{display:flex;gap:6px;flex-wrap:wrap}.layout-actions button,.drag-handle{border:1px solid #b4c1b9;background:#f4f5ef;padding:8px;border-radius:6px;color:#173b35;cursor:pointer}.layout-actions button:disabled{opacity:.35;cursor:default}
.layout-object{border:1px solid #b7c4bc;background:#f7f8f3;padding:12px;border-radius:8px}.layout-object p{font-size:.85rem;margin:8px 0}.object-heading strong{overflow-wrap:anywhere;flex:1}.object-heading .operator{flex:0 0 auto}.drag-handle{cursor:grab;font-size:1.4rem;touch-action:none}.object-controls{display:flex;gap:8px;flex-wrap:wrap}.object-controls label{flex:1;min-width:80px;font-size:.75rem}.object-controls select{padding:8px}.object-drop-end{grid-column:1/-1;border:2px dashed #bac7bd;padding:12px;text-align:center;font-size:.8rem;color:#4b665a;border-radius:6px}.drop-active{outline:3px solid #25705d;outline-offset:2px}.object-disabled{opacity:.65}
.preview .page-objects{grid-template-columns:1fr}.preview .departure-object{grid-column:1/-1}
.screen-page .multiple-objects .board-header h2{font-size:clamp(1.6rem,2.2vw,2.5rem)}
.screen-page .multiple-objects .departure-row,.screen-page .multiple-objects .departure-labels{grid-template-columns:54px minmax(0,1fr) 36px 132px;gap:12px}
.screen-page .multiple-objects .destination>strong,.screen-page .multiple-objects .line-number,.screen-page .multiple-objects .platform{font-size:clamp(1.2rem,1.8vw,2rem)}
.screen-page .multiple-objects .departure-time>strong{font-size:clamp(1.6rem,2.3vw,2.5rem)}
.screen-page .multiple-objects .canceled .departure-time>strong{font-size:1rem}.screen-page .multiple-objects .incident-flag{font-size:.85rem}.screen-page .multiple-objects .departure-time>small{font-size:.85rem}.screen-page .multiple-objects .board-header .live-clock{font-size:1.8rem}
.screen-page .multiple-objects .departure-object{border-bottom:1px solid #536070;padding-bottom:16px}
.screen-page.portrait .page-objects,.portrait .page-objects{grid-template-columns:1fr}.screen-page.portrait .departure-object{grid-column:1/-1}
@media(max-width:780px){.page-objects,.layout-grid{grid-template-columns:1fr}.departure-object,.layout-object{grid-column:1/-1}.screen-page .multiple-objects .departure-row,.screen-page .multiple-objects .departure-labels{grid-template-columns:36px minmax(0,1fr) 26px 90px;gap:8px}.screen-page .multiple-objects .destination>strong{font-size:1.15rem}.screen-page .multiple-objects .departure-time>small{font-size:.75rem}.screen-page .multiple-objects .incident-flag{font-size:.7rem}}
.display-page-title{margin:0;padding:14px 18px;color:#fff;background:#080e18;font-family:Arial,Helvetica,sans-serif;font-size:1.5rem;font-weight:700;line-height:1.15;overflow-wrap:anywhere}.screen-page .display-page-title{padding:0 0 16px;margin-bottom:16px;border-bottom:2px solid #b4bcc8;font-size:clamp(2rem,3.5vw,3.5rem)}
/* Automatic fit: reserve the footer and measure complete rows at readable sizes. */
.screen-page,.screen-page.portrait{height:100dvh;min-height:0;max-width:none}
.screen-page #screen-board{min-height:0;flex:1 1 0}
.screen-page .screen-footer{flex:0 0 auto;flex-wrap:nowrap}
.preview,.preview.portrait{height:600px}
.preview .departure-panel,.preview.portrait .departure-panel{min-height:0;padding:12px}
.departure-row[hidden]{display:none!important}
.layout-probe{position:fixed!important;left:-20000px!important;top:0!important;visibility:hidden!important;height:auto!important;min-height:0!important;max-width:none!important;margin:0!important;padding-top:0!important;padding-bottom:0!important;display:block!important;pointer-events:none}
.display-page-title small{font-size:.5em;color:#c2cbd9;white-space:nowrap;letter-spacing:normal}
.departure-alert,.station-alert,.board-filter,.board-message p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
.screen-page .board-message{padding:12px 0}
.screen-page .board-header h2,.display-page-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
@media(max-height:500px){.screen-page .display-page-title{font-size:1.7rem;padding-bottom:6px;margin-bottom:8px}.screen-page .board-header{padding-bottom:6px;margin-bottom:6px}.screen-page .board-header h2{font-size:1.5rem;margin-top:4px}.screen-page .board-caption{font-size:.7rem}.screen-page .board-filter{margin:4px 0 0;font-size:.8rem}.screen-page .board-header .live-clock{font-size:1.7rem}.screen-page .departure-row{padding-top:7px;padding-bottom:7px}.screen-page .screen-bottom{padding-top:4px}}
