:root{color-scheme:dark;--bg:#101827;--panel:#182438;--text:#edf4ff;--muted:#afbed2;--accent:#68d5c0;--line:#35506f;--warn:#ffd166}
*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:1rem}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.65 system-ui,-apple-system,"Segoe UI",sans-serif;overflow-wrap:anywhere}
header,main,footer{max-width:1080px;margin:auto;padding:24px}header{border-bottom:1px solid var(--line)}h1,h2,h3{line-height:1.25}h1{font-size:clamp(2.4rem,6vw,4rem);margin:18px 0}h2{color:var(--accent);margin-top:2rem}h3{margin-top:1.5rem}a{color:var(--accent)}a:hover{text-decoration-thickness:2px}a:focus-visible{outline:3px solid var(--warn);outline-offset:4px}.meta,.muted,footer{color:var(--muted)}.brand{font-weight:700;letter-spacing:.08em}.subtitle{font-size:1.25rem}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}.card,.notice{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:16px 20px;margin:18px 0}.notice{border-left:4px solid var(--warn);border-radius:0}.card h3{margin-top:0}nav ol{columns:2;column-gap:40px}nav li{break-inside:avoid;padding:3px 0}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;margin:18px 0;font-size:.93rem}th,td{text-align:left;vertical-align:top;border:1px solid var(--line);padding:8px}th{background:var(--panel)}code,pre{font-family:ui-monospace,Consolas,monospace}code{color:#b8e7ff}pre{background:#0b1320;border:1px solid var(--line);padding:14px;white-space:pre-wrap;overflow-wrap:anywhere}.chapter{border-top:1px solid var(--line);margin-top:36px;padding-top:8px}.chapter>h2:first-child{margin-top:20px}.skip{position:absolute;left:-10000px}.skip:focus{position:static;display:block;padding:12px}.diagram{display:block;width:100%;height:auto;margin:20px auto;color:var(--text)}.diagram text{fill:currentColor;font-family:system-ui,sans-serif}.diagram .box{fill:var(--panel);stroke:var(--accent);stroke-width:2}.diagram .wire{stroke:var(--accent);stroke-width:2;fill:none}.diagram .label{font-size:15px}.diagram .small{font-size:13px}.top{font-size:.85rem}li+li{margin-top:5px}
.cv-list th:first-child,.cv-list td:first-child{white-space:nowrap}.cv-list th:nth-child(2),.cv-list td:nth-child(2){white-space:nowrap}
@media(max-width:650px){header,main,footer{padding:18px}nav ol{columns:1}table{font-size:.85rem}th,td{padding:6px}}
@page{size:A4;margin:16mm 16mm 18mm;@bottom-left{content:"RailPIC · railDECOacc";font:8pt "Segoe UI",Arial,sans-serif;color:#43546b}@bottom-right{content:counter(page);font:8pt "Segoe UI",Arial,sans-serif;color:#43546b}}
@media print{
 :root{color-scheme:light;--bg:#fff;--panel:#f1f5f8;--text:#182438;--muted:#43546b;--accent:#08695b;--line:#bac7d2;--warn:#997000}
 html{scroll-behavior:auto}body{font:9.5pt/1.34 "Segoe UI",Arial,sans-serif;background:white;color:var(--text)}
 header,main,footer{max-width:none;padding:0}header{border:0;break-after:page}header h1{font-size:38pt;margin-top:14mm}header .subtitle{font-size:17pt}
 h2{font-size:20pt}h3{font-size:12pt;margin-top:1.1rem}h2,h3{break-after:avoid}p{orphans:3;widows:3;margin:.7em 0}a{color:var(--accent);text-decoration:none}code{color:#243b55;font-size:8.5pt}pre{background:#f1f5f8;color:#182438;font-size:8.5pt;padding:9px;margin:10px 0}
 .chapter{break-before:page;border:0;margin:0;padding:0}.chapter>h2:first-child{margin-top:0}.notice,.card{padding:10px 13px;margin:12px 0;break-inside:avoid}.cards{gap:12px}nav ol{columns:2}nav li{padding:1px 0}
 table{font-size:9pt;margin:12px 0}th,td{padding:5px 6px}thead{display:table-header-group}tr,pre{break-inside:avoid}.table-wrap{overflow:visible}.diagram{max-height:65mm;break-inside:avoid}.top,.screen-only,.skip{display:none}footer{border-top:1px solid var(--line);margin-top:12px;padding-top:8px;font-size:9pt}
 #hardware,#programming,#examples{font-size:9pt;line-height:1.25}#hardware h3,#programming h3,#examples h3{font-size:11pt;margin-top:.7rem;margin-bottom:.5rem}#hardware p,#programming p,#examples p{margin:.55em 0}#hardware table,#programming table{font-size:8.5pt}#hardware th,#hardware td,#programming th,#programming td{padding:4px 6px}#examples pre{font-size:8.3pt;line-height:1.2;margin:8px 0;padding:8px}
}
