.rail-modal-open{overflow:hidden}
.rail-dialog{width:min(760px,calc(100% - 32px));max-width:none;max-height:calc(100dvh - 32px);margin:auto;padding:0;border:1px solid var(--line);border-radius:26px;background:var(--paper);color:var(--ink);box-shadow:var(--shadow);overflow:hidden;font-family:"DM Sans",sans-serif}
.rail-dialog[open]{display:flex;flex-direction:column;animation:rail-enter .2s ease-out}
.rail-dialog::backdrop{background:#061e3688;backdrop-filter:blur(5px)}
.rail-dialog .ui-icon{width:20px;height:20px;flex-shrink:0}
.rail-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:26px 26px 22px;background:radial-gradient(ellipse at top right,color-mix(in srgb,var(--teal) 12%,transparent),transparent 65%),var(--paper);border-bottom:1px solid var(--line)}
.rail-eyebrow{font-size:10px;font-weight:700;letter-spacing:.14em;color:var(--muted)}
.rail-header h2{margin:8px 0;font:700 clamp(26px,5vw,34px)/1.1 "Bricolage Grotesque",sans-serif;letter-spacing:-.035em}
.rail-header p{margin:0;font-size:13px;line-height:1.5;color:var(--muted)}
.rail-dialog button{min-height:44px;border:1px solid var(--line);border-radius:13px;background:var(--cream);color:var(--ink);font:600 12px "DM Sans",sans-serif}
.rail-header button{display:grid;place-items:center;flex-shrink:0;width:44px;padding:10px}
.rail-dialog :is(button,a):focus-visible{outline:3px solid var(--teal);outline-offset:3px}
.rail-dialog button:hover:not(:disabled){background:color-mix(in srgb,var(--teal) 12%,var(--paper))}
.rail-dialog button:disabled{opacity:.65;cursor:wait}
.rail-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 26px;border-bottom:1px solid var(--line)}
.rail-toolbar p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}
.rail-toolbar button{display:flex;align-items:center;gap:7px;flex-shrink:0;padding:9px 12px}
.rail-body{overflow:auto;overscroll-behavior:contain;padding:4px 26px 22px;min-height:0;scrollbar-gutter:stable}
.rail-loading{display:grid;justify-items:center;gap:8px;min-height:220px;padding:30px 18px;text-align:center}
.rail-loading-icon{display:grid;place-items:center;width:46px;height:46px;margin-bottom:4px;border-radius:15px;background:color-mix(in srgb,var(--teal) 14%,var(--paper));color:var(--teal)}
.rail-loading-icon .ui-icon{width:24px;height:24px;animation:rail-loading-spin 1.2s linear infinite}
.rail-loading strong{font:700 18px/1.3 "Bricolage Grotesque",sans-serif}
.rail-loading p{max-width:340px;margin:0;color:var(--muted);font-size:13px;line-height:1.5}
.rail-loading-lines{display:grid;gap:9px;width:min(100%,360px);margin-top:15px}
.rail-loading-lines span{height:12px;border-radius:999px;background:color-mix(in srgb,var(--line) 65%,var(--paper));animation:rail-loading-pulse 1.2s ease-in-out infinite alternate}
.rail-loading-lines span:nth-child(2){width:82%;animation-delay:.15s}
.rail-loading-lines span:nth-child(3){width:64%;animation-delay:.3s}
.rail-operator{padding-top:22px}
.rail-operator+.rail-operator{margin-top:22px;border-top:1px solid var(--line)}
.rail-operator>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.rail-operator h3{margin:0;font:700 21px "Bricolage Grotesque",sans-serif}
.rail-source-state{font-size:11px;color:var(--muted)}
.rail-source-state[data-state=stale],.rail-source-state[data-state=partial]{color:var(--ink);font-weight:700}
.rail-notice{display:flex;align-items:flex-start;gap:10px;margin:0 0 12px;padding:13px 14px;border:1px solid var(--line);border-radius:13px;background:var(--cream);color:var(--ink);font-size:12px;line-height:1.6}
.rail-notice .ui-icon{margin-top:1px}
.rail-lines{list-style:none;padding:0;margin:0}
.rail-line{display:flex;align-items:flex-start;gap:13px;padding:15px 0;border-bottom:1px solid var(--line)}
.rail-number{--rail-line-color:var(--muted);flex:0 0 42px;min-height:42px;display:grid;place-items:center;border-radius:12px;border-left:5px solid var(--rail-line-color);background:var(--cream);color:var(--ink);font:700 20px "Bricolage Grotesque",sans-serif}
.rail-line[data-line="1"]{--rail-color:#171796}.rail-line[data-line="2"]{--rail-color:#007a5e}.rail-line[data-line="3"]{--rail-color:#ed2e38}.rail-line[data-line="15"]{--rail-color:#8f8f8c}.rail-line[data-line="17"]{--rail-color:#d58405}
.rail-line .rail-number{--rail-line-color:var(--rail-color,var(--muted))}
.rail-line-copy{min-width:0;flex:1}
.rail-line-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;min-height:30px}
.rail-line h4{margin:0;font-size:15px;font-weight:700}
.rail-badge{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border-radius:8px;background:var(--cream);color:var(--muted);font-size:11px;font-weight:600;line-height:1.4}
.rail-badge .ui-icon{width:15px;height:15px}
.rail-badge[data-state=normal]{background:var(--green-soft,#e6f5eb);color:#176444}
.rail-badge[data-state=disrupted]{background:var(--gold-soft,#fff3d2);color:#765008}
.rail-badge[data-state=suspended]{background:var(--orange-soft);color:#9c3525}
.rail-line p{margin:6px 0 0;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.rail-line small{display:block;margin-top:6px;font-size:10px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.rail-previous{color:var(--muted)}
.rail-empty{margin:16px 0;color:var(--muted);font-size:13px;line-height:1.6}
.rail-operator>footer{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:10px;padding-top:12px;color:var(--muted);font-size:10px;line-height:1.7}
.rail-operator>footer span{display:block}
.rail-operator a{display:inline-flex;align-items:center;gap:2px;min-height:44px;color:var(--ink);font-size:12px;font-weight:600;text-underline-offset:4px}
.rail-operator a .ui-icon{width:16px;height:16px}
.rail-footer{flex-shrink:0;margin:0;padding:14px 26px;border-top:1px solid var(--line);background:var(--cream);color:var(--muted);font-size:11px;line-height:1.6}
:root[data-theme=dark] .rail-badge[data-state=normal]{color:#99e8cd}
:root[data-theme=dark] .rail-badge[data-state=disrupted]{color:#f1d891}
:root[data-theme=dark] .rail-badge[data-state=suspended]{color:#ffc0a7}
@keyframes rail-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes rail-loading-spin{to{transform:rotate(360deg)}}
@keyframes rail-loading-pulse{to{opacity:.45}}
@media(max-width:520px){.rail-dialog{width:calc(100% - 16px);max-height:calc(100dvh - 16px);border-radius:21px}.rail-header{padding:22px 17px 18px}.rail-toolbar{padding:10px 17px;gap:10px}.rail-body{padding:0 17px 18px}.rail-footer{padding:12px 17px}.rail-line{gap:10px}.rail-line-heading{align-items:flex-start;flex-direction:column;gap:6px}.rail-number{flex-basis:36px;min-height:40px}.rail-source-state{font-size:10px}}
@media(prefers-reduced-motion:reduce){.rail-dialog[open],.rail-loading-icon .ui-icon,.rail-loading-lines span{animation:none}}
