/* Redesigned Loads screen (redesign track S2). Scope every rule under .screen[data-screen="<page id>"] and use --rt-* tokens only. */
/* The drawer (.ui-drawer) and the Ironworks window (dialog.ld-window) sit on <body>, outside the screen's box, so a page
   refresh cannot remove them while they are open; their rules use the ld- class names only this screen makes. */
.screen[data-screen="iw-loads"] .ld-flow{display:grid;grid-template-columns:repeat(3,1fr);margin-bottom:16px;background:var(--rt-panel);border:1px solid var(--rt-line);border-radius:var(--rt-r-lg);overflow:hidden}
.screen[data-screen="iw-loads"] .ld-stage{position:relative;text-align:left;border:0;border-right:1px solid var(--rt-line);background:none;color:var(--rt-ink);padding:12px 18px 12px 22px;min-height:var(--rt-touch);cursor:pointer;font:inherit}
.screen[data-screen="iw-loads"] .ld-stage:last-child{border-right:0}
.screen[data-screen="iw-loads"] .ld-stage:hover{background:var(--rt-brand-tint)}
.screen[data-screen="iw-loads"] .ld-stage[aria-pressed="true"]{background:var(--rt-brand-tint);box-shadow:inset 0 -3px var(--rt-brand)}
.screen[data-screen="iw-loads"] .ld-stage:focus-visible{outline:3px solid var(--rt-focus);outline-offset:-3px}
.screen[data-screen="iw-loads"] .ld-stage b{display:block;font-size:calc(var(--v2-size,16px)*1.625);font-weight:650;letter-spacing:-.03em}
.screen[data-screen="iw-loads"] .ld-stage.tone-warn b{color:var(--rt-warn)}
.screen[data-screen="iw-loads"] .ld-stage-name{display:block;font-weight:600}
.screen[data-screen="iw-loads"] .ld-stage small{display:block;font-size:calc(var(--v2-size,16px)*.78125);color:var(--rt-muted);margin-top:2px}
.screen[data-screen="iw-loads"] .ld-stage .ld-money{color:var(--rt-ink);font-weight:600}
.screen[data-screen="iw-loads"] .ld-alert{display:flex;gap:10px;align-items:flex-start;margin-bottom:14px;padding:12px 14px;border:1px solid var(--rt-stop-edge);border-left-width:4px;border-radius:var(--rt-r);background:var(--rt-stop-bg);color:var(--rt-ink)}
.screen[data-screen="iw-loads"] .ld-alert .ui-icon{flex:none;width:20px;height:20px;color:var(--rt-stop);stroke:currentColor;fill:none;stroke-width:2}
.screen[data-screen="iw-loads"] .ui-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px}
.screen[data-screen="iw-loads"] .ui-search{flex:1 1 260px;max-width:420px}
.screen[data-screen="iw-loads"] .ld-driver select{min-height:36px;padding:4px 8px;border:1px solid var(--rt-line);border-radius:var(--rt-r-sm);background:var(--rt-panel);color:var(--rt-ink);font:inherit}
.screen[data-screen="iw-loads"] .ld-spacer{flex:1}
.screen[data-screen="iw-loads"] .ld-count{color:var(--rt-muted);font-size:calc(var(--v2-size,16px)*.8125)}
.screen[data-screen="iw-loads"] .ld-note{margin:4px 0 10px;color:var(--rt-muted);font-size:calc(var(--v2-size,16px)*.84375)}
.screen[data-screen="iw-loads"] .ld-link{border:0;background:none;padding:0;color:var(--rt-brand-ink);text-decoration:underline;font:inherit;cursor:pointer}
.screen[data-screen="iw-loads"] .ld-table-wrap{overflow-x:auto;background:var(--rt-panel);border:1px solid var(--rt-line);border-radius:var(--rt-r-lg)}
.screen[data-screen="iw-loads"] .ld-table{width:100%;border-collapse:collapse}
.screen[data-screen="iw-loads"] .ld-table th{text-align:left;font-size:calc(var(--v2-size,16px)*.78125);font-weight:600;color:var(--rt-muted);padding:8px 12px;border-bottom:1px solid var(--rt-line)}
.screen[data-screen="iw-loads"] .ld-table td{padding:10px 12px;border-bottom:1px solid var(--rt-line-soft);vertical-align:middle}
.screen[data-screen="iw-loads"] .ld-table tr:last-child td{border-bottom:0}
.screen[data-screen="iw-loads"] .ld-table .num{text-align:right;white-space:nowrap}
.screen[data-screen="iw-loads"] .ld-route b{display:inline}
.screen[data-screen="iw-loads"] .ld-sub{display:block;font-size:calc(var(--v2-size,16px)*.78125);color:var(--rt-muted)}
.screen[data-screen="iw-loads"] .ld-acts{text-align:right;white-space:nowrap}
.screen[data-screen="iw-loads"] .ld-acts .ui-btn+.ui-btn{margin-left:6px}
.screen[data-screen="iw-loads"] .ld-muted{color:var(--rt-muted)}
.screen[data-screen="iw-loads"] .ld-tag{display:inline-block;margin-left:6px;padding:0 6px;border:1px solid var(--rt-line);border-radius:4px;font-size:calc(var(--v2-size,16px)*.71875);color:var(--rt-muted)}
.screen[data-screen="iw-loads"] .ld-tag.tone-stop{border-color:var(--rt-stop-edge);color:var(--rt-stop)}
.screen[data-screen="iw-loads"] .ld-nobol,.ld-drawer .ld-nobol{display:inline-flex;align-items:center;gap:4px;color:var(--rt-warn);font-weight:600}
.screen[data-screen="iw-loads"] .ld-nobol .ui-icon,.ld-drawer .ld-nobol .ui-icon{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2}
@media (max-width:760px){
 .screen[data-screen="iw-loads"] .ld-flow{grid-template-columns:1fr}
 .screen[data-screen="iw-loads"] .ld-stage{border-right:0;border-bottom:1px solid var(--rt-line)}
 .screen[data-screen="iw-loads"] .ld-stage:last-child{border-bottom:0}
 /* A phone: each load row becomes a card and every cell says which column it is (data-label in loads.js), so Total and
    the buttons stay on screen and the page never scrolls sideways. */
 .screen[data-screen="iw-loads"] .ui-search{flex:1 1 100%;max-width:none;min-width:0}
 .screen[data-screen="iw-loads"] .ld-table-wrap{overflow:visible;background:none;border:0;border-radius:0}
 .screen[data-screen="iw-loads"] .ld-table,.screen[data-screen="iw-loads"] .ld-table tbody,.screen[data-screen="iw-loads"] .ld-table tr,.screen[data-screen="iw-loads"] .ld-table td{display:block;width:100%;box-sizing:border-box}
 .screen[data-screen="iw-loads"] .ld-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 .screen[data-screen="iw-loads"] .ld-table tr.ld-row{margin:0 0 10px;padding:4px 0;border:1px solid var(--rt-line);border-radius:var(--rt-r);background:var(--rt-panel)}
 .screen[data-screen="iw-loads"] .ld-table td{padding:6px 12px;border-bottom:0;overflow-wrap:anywhere}
 .screen[data-screen="iw-loads"] .ld-table td[data-label]::before{content:attr(data-label);display:block;font-size:calc(var(--v2-size,16px)*.75);font-weight:600;color:var(--rt-muted);margin-bottom:2px}
 .screen[data-screen="iw-loads"] .ld-table .num{text-align:left;white-space:normal}
 .screen[data-screen="iw-loads"] .ld-table td.ld-acts{display:flex;flex-wrap:wrap;gap:6px;text-align:left;white-space:normal}
 .screen[data-screen="iw-loads"] .ld-acts .ui-btn+.ui-btn{margin-left:0}
}
/* The drawer: timeline, facts and actions. It sits on <body>, outside #app, so it gets the app's normal letters and weights here
   (style.css makes everything outside #app and dialogs upper case and bold). */
.ld-drawer,.ld-drawer *{text-transform:none;font-weight:400!important}
.ld-drawer :is(h2,h3,b,strong,.ld-next,.ld-warn,.ld-nobol){font-weight:650!important}
.ld-drawer button,.ld-drawer .ld-fact dd{font-weight:600!important}
.ld-drawer .ld-drawer-sub{margin:-8px 0 8px}
.ld-drawer .ld-muted{color:var(--rt-muted)}
.ld-drawer .ld-warn{color:var(--rt-warn);font-weight:600}
.ld-drawer .ld-timeline{list-style:none;padding:0;margin:14px 0}
.ld-drawer .ld-timeline li{display:grid;grid-template-columns:22px 1fr auto;gap:8px;padding:6px 0;align-items:center}
.ld-drawer .ld-tick{width:14px;height:14px;border-radius:50%;border:2px solid var(--rt-line);background:var(--rt-panel)}
.ld-drawer .ld-timeline .on .ld-tick{background:var(--rt-ok);border-color:var(--rt-ok)}
.ld-drawer .ld-timeline .now .ld-tick{background:var(--rt-warn-bg);border-color:var(--rt-warn-edge)}
.ld-drawer .ld-next{margin:0 0 10px;font-weight:600}
.ld-drawer .ld-facts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0 16px}
.ld-drawer .ld-fact dt{font-size:calc(var(--v2-size,16px)*.75);color:var(--rt-muted)}
.ld-drawer .ld-fact dd{margin:0;font-weight:600}
.ld-drawer .ld-drawer-acts{display:flex;flex-wrap:wrap;gap:8px}
/* The Ironworks window. */
dialog.ld-window{width:min(980px,calc(100vw - 32px));height:min(860px,calc(100vh - 32px));padding:0;border:1px solid var(--rt-line);border-radius:var(--rt-r-lg);background:var(--rt-panel);color:var(--rt-ink);box-shadow:var(--rt-shadow-float);overflow:hidden}
dialog.ld-window[open]{display:flex;flex-direction:column}
dialog.ld-window::backdrop{background:rgba(0,0,0,.35)}
dialog.ld-window .ld-window-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--rt-line)}
dialog.ld-window .ld-window-head h2{margin:0;font-size:var(--rt-text-lg)}
dialog.ld-window .ld-frame{flex:1;width:100%;min-height:0;border:0;background:var(--rt-panel)}
