/* Shared density for operational tools; leave schedules and other app pages unchanged. */
.content.tool-view{padding:12px 18px 18px;max-width:1800px}
.tool-view .tool-heading{display:flex;align-items:center;gap:18px;flex-wrap:wrap;border-bottom:1px solid #d5dfeb;padding-bottom:8px;margin-bottom:10px}
.tool-view .tool-heading h1{font-size:22px;line-height:1.25;letter-spacing:-.025em;margin:0;flex-shrink:0}
.tool-view .tool-tabs{display:flex;gap:4px;flex-wrap:wrap;border:0;padding:0;margin:0;margin-left:auto}
.tool-view .tool-tabs button{font-size:12px;line-height:1.4;padding:7px 10px;border-radius:6px}
.tool-view .tool-heading .tool-refresh{margin-left:0}
.tool-view .btn{font-size:12px;line-height:1.4;padding:7px 10px;min-height:32px;border-radius:6px}
.tool-view .input{font-size:13px;line-height:1.4;padding:7px 10px;min-height:34px}
.tool-view h2{font-size:16px;line-height:1.3;margin-bottom:10px}
.tool-view .sub{font-size:12px;line-height:1.5;margin:6px 0 12px}
.tool-view #sort-message,.tool-view .handover-message{font-size:12px;line-height:1.5;margin:0 0 8px;padding:0;min-height:0}
.tool-view #sort-message:empty,.tool-view .handover-message:empty{display:none}

/* Sort Code: one-line counters and a viewport-sized, independently scrolling workspace. */
.tool-view .sort-metrics{display:flex;align-items:center;flex-wrap:wrap;gap:0;margin:0 0 9px;font-size:12px;min-height:20px}
.tool-view .sort-metrics>div{display:flex;flex-direction:row;align-items:baseline;gap:5px;padding:0 12px;background:none;border:0;border-right:1px solid #cbd8e8;border-radius:0}
.tool-view .sort-metrics>div:first-child{padding-left:0}
.tool-view .sort-metrics>div:last-child{border-right:0}
.tool-view .sort-metrics b{font-size:13px;line-height:1.4}
.tool-view .sort-metrics span{font-size:12px}
.tool-view .sort-workspace{grid-template-columns:minmax(250px,280px) minmax(0,1fr);gap:12px;height:calc(100dvh - 180px);min-height:360px;align-items:stretch}
.tool-view .sort-entry-pane{display:flex;flex-direction:column;min-height:0}
.tool-view .sort-pane-heading{padding:12px;gap:10px;flex-wrap:wrap}
.tool-view .sort-pane-heading>div{flex:1;min-width:125px}
.tool-view .sort-pane-heading h2{margin:0 0 4px}
.tool-view .sort-pane-heading p{font-size:11px;line-height:1.45}
.tool-view .sort-pane-heading .btn{font-size:12px;padding:7px 9px}
.tool-view .sort-panels{flex:1;min-height:0;max-height:none;padding:10px;gap:8px}
.tool-view .sort-scan-card{padding:10px;border-radius:8px}
.tool-view .sort-card-heading h3{font-size:13px}
.tool-view .sort-list-pane{height:100%;min-height:0}
.tool-view .sort-list-title{padding:12px;font-size:16px}
.tool-view .sort-list-filters{padding:8px 12px;gap:8px;flex-wrap:nowrap}
.tool-view .sort-list-filters input{flex-basis:auto;width:0}
.tool-view .sort-list-pane .data-table{flex:1;min-height:0;max-height:none}
.tool-view #sort-rows .sort-empty-cell{height:220px}
.tool-view .sort-list-pane .sort-export{padding:10px 12px;gap:8px}
.tool-view .sort-box:not(.sort-entry-pane):not(.sort-list-pane){padding:14px;margin-bottom:12px}
.tool-view .sort-history .sort-toolbar,.tool-view .sort-toolbar{margin-bottom:10px}
.tool-view #sort-history-search{margin:10px 0}
.tool-view #sort-catalog>p{font-size:12px;line-height:1.5;margin:6px 0 10px}
.tool-view #sort-catalog>.actions{margin-bottom:8px}

/* Handover: compact controls, more room for trip rows, same review/export safeguards. */
.tool-view .handover-stepbar{padding:5px 10px;gap:10px;margin-bottom:10px;border-radius:7px;flex-direction:row;align-items:center;flex-wrap:wrap}
.tool-view .handover-stepbar .handover-steps{font-size:12px;gap:16px;padding:3px 0;min-width:200px}
.tool-view .handover-stepbar>.btn{font-size:12px;padding:6px 9px;min-height:30px}
.tool-view .handover-layout{grid-template-columns:minmax(250px,280px) minmax(0,1fr);gap:12px}
.tool-view .handover-layout.import-collapsed{grid-template-columns:minmax(0,1fr)}
.tool-view .handover-import,.tool-view .handover-results,.tool-view .handover-history{padding:14px;border-radius:9px}
.tool-view .handover-result-head{gap:12px}
.tool-view .handover-result-head h2{margin:0}
.tool-view #handover-summary{font-size:12px;margin:8px 0}
.tool-view #handover-table{max-height:calc(100dvh - 240px);min-height:220px}
.tool-view .handover-drop{gap:8px;padding:14px 10px;font-size:13px}
.tool-view #handover-source{font-size:12px;overflow-wrap:anywhere;margin:10px 0}
.tool-view .handover-history{margin:0}
.tool-view .handover-history .toolbar{margin-top:12px}
.tool-view .handover-history>p{font-size:12px;margin:10px 0}
.tool-view .handover-rules-panel{padding:14px;margin:0 0 10px}
.tool-view .handover-rules-grid{gap:14px;margin:10px 0}
.tool-view .handover-review{padding:14px;margin-top:14px}
.tool-view .handover-review-heading{padding-bottom:10px;gap:12px}
.tool-view .handover-review-heading h2{font-size:16px;margin-bottom:4px}
.tool-view .handover-review-heading p{font-size:12px}
.tool-view .handover-review-warning{padding:10px 12px;margin:12px 0;font-size:12px;line-height:1.5}
.tool-view .handover-review-warning p{margin:4px 0}
.tool-view .handover-review-trip{margin:10px 0}
.tool-view .handover-review-trip-heading{padding:10px 12px}
.tool-view .handover-review-body{padding:12px;gap:12px;grid-template-columns:minmax(200px,230px) minmax(0,1fr)}
.tool-view .handover-review-info{padding:12px;font-size:12px}
.tool-view .handover-review-info h3{font-size:14px;margin-bottom:10px;padding-bottom:10px}
.tool-view .handover-review-info dl{margin:10px 0}
.tool-view .handover-review-info dl>div{margin:6px 0}
.tool-view .handover-export{margin-top:10px;padding:8px 12px}

@media(max-width:1050px){.tool-view .tool-heading{gap:8px 12px}.tool-view .tool-heading h1{font-size:20px}.tool-view .tool-tabs{margin-left:0}.tool-view .handover-layout{grid-template-columns:1fr}}
@media(max-width:760px){.content.tool-view{padding:12px}.tool-view .tool-heading h1{flex-basis:100%}.tool-view .tool-tabs{flex:1}.tool-view .sort-workspace{grid-template-columns:1fr;height:auto;min-height:0}.tool-view .sort-panels{max-height:45dvh;flex:auto}.tool-view .sort-list-pane{height:65dvh;min-height:360px}.tool-view .sort-list-filters{flex-wrap:wrap}.tool-view .sort-list-filters input{flex-basis:100%;width:100%}.tool-view .handover-review-body{grid-template-columns:1fr}.tool-view .handover-result-head{flex-wrap:wrap}.tool-view #handover-table{max-height:60dvh}}
.tool-view .sort-card-heading{gap:6px}
.tool-view .sort-card-heading h3{flex:1;min-width:0}
.tool-view .sort-card-heading .actions{gap:4px}
.tool-view .sort-card-heading .sort-action{display:grid;place-items:center;width:28px;height:28px;flex:0 0 28px;border:1px solid transparent;border-radius:5px;padding:0;font-size:20px;line-height:1}
.tool-view .sort-card-heading [data-panel-edit]>span{display:block;font-family:"Segoe UI Symbol","Segoe UI",sans-serif;font-size:14px;font-weight:400;line-height:1;font-variant-emoji:text}
.tool-view .sort-card-heading .sort-action:hover{background:#edf4fb;border-color:#d5dfeb}
.tool-view .sort-card-heading .sort-action.danger:hover{background:#fff1f0;border-color:#f1c5c0}
.tool-view .sort-panels textarea{height:36px;min-height:36px;max-height:36px;padding:7px 9px;line-height:20px;resize:none;overflow:auto;font-family:inherit}
.sort-history-popover{position:fixed;inset:auto;margin:0;box-sizing:border-box;width:360px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:0;border:1px solid #cbd8e8;border-radius:10px;background:#fff;color:#172033;box-shadow:0 8px 30px #10223e26;font-size:12px;overflow:auto}
.sort-history-popover::backdrop{background:transparent}
.sort-history-popover>header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:12px 14px;border-bottom:1px solid #e2e8f0;background:#f8fafc}
.sort-history-popover h3{font-size:14px;margin:0 0 4px}
.sort-history-popover header b{font-size:12px;overflow-wrap:anywhere}
.sort-history-close{display:grid;place-items:center;flex:0 0 28px;width:28px;height:28px;padding:0;border:0;border-radius:5px;background:none;color:#526983;font-size:20px;cursor:pointer}
.sort-history-close:hover{background:#eaf0f7}.sort-history-close:focus-visible{outline:2px solid #78b4ed;outline-offset:1px}
.sort-history-popover-content{padding:12px 14px;line-height:1.5}
.sort-history-popover-content p{margin:0 0 10px}.sort-history-popover-content p:last-child{margin-bottom:0}
.sort-history-draft{color:#a54708}.sort-history-count,.sort-history-empty{color:#526983}
.sort-history-popover-list{max-height:310px;overflow:auto;overscroll-behavior:contain}
.sort-history-popover-list article{padding:10px 0;border-bottom:1px solid #e2e8f0}.sort-history-popover-list article:first-child{padding-top:0}.sort-history-popover-list article:last-child{border:0;padding-bottom:0}
.sort-history-popover-list time{font-weight:650;font-variant-numeric:tabular-nums}
.sort-history-popover-list dl{margin:8px 0 0}.sort-history-popover-list dl>div{display:grid;grid-template-columns:74px minmax(0,1fr);gap:8px;margin:4px 0}.sort-history-popover-list dt{color:#71859c}.sort-history-popover-list dd{margin:0;overflow-wrap:anywhere}
.sort-check-labels{display:flex;flex-direction:column;align-items:flex-start;gap:5px;white-space:normal;line-height:1.5}
.sort-check-labels .sort-status-draft{font-size:12px;font-weight:600;color:#075aa0}
.sort-check-labels .sort-status-exported{font-size:12px;font-weight:600;color:#a54708;line-height:1.5;white-space:normal}
.sort-check-labels .sort-status-exported:hover{text-decoration:underline}
.tool-view #sort-panel-form{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.tool-view .sort-destination-search-label{margin-top:10px}
.tool-view .sort-destination-count{margin:6px 0;font-size:11px;line-height:1.4;color:#526983}
.tool-view .sort-destination-count:empty{display:none}
.sort-destination-results{max-height:170px;overflow:auto;background:#fff;border:1px solid #cbd8e8;border-radius:6px;margin-top:8px;overscroll-behavior:contain}
.sort-destination-results button{display:flex;flex-direction:column;gap:3px;width:100%;padding:9px 10px;border:0;border-bottom:1px solid #e2e8f0;background:#fff;text-align:left;cursor:pointer;font-size:12px;line-height:1.4;white-space:normal;overflow-wrap:anywhere;color:#172033}
.sort-destination-results button:last-child{border:0}.sort-destination-results button:hover,.sort-destination-results button:focus-visible{background:#edf4fb}
.sort-destination-results button span{font-size:11px;color:#526983}.sort-destination-results p{padding:10px;margin:0;font-size:12px;color:#526983}
.tool-view .sort-sort-hint{display:block;margin-top:5px;color:#71859c;font-size:11px;line-height:1.4}
.tool-view #sort-panel-form select:disabled{background:#edf2f7;color:#425069;opacity:1;cursor:default}
