.live-search{display:flex;align-items:stretch;gap:10px;max-width:760px;margin:18px 0}.live-search input{margin:0;flex:1;min-width:0}.live-search button{margin:0;flex:0 0 auto}.search-picker>label{margin:0}.button-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:18px 0}.table-page{margin:16px 0}.table-page .table-scroll{margin:0}.table-page table{width:100%;border-collapse:collapse}.table-page th{background:#e7e7e7;font-size:12px;letter-spacing:.02em;text-align:left;padding:12px}.table-page td{padding:10px 12px;border-bottom:1px solid #d4d4d4}.table-page tbody tr:hover{background:#f2f2f2}.table-page button{margin:0;white-space:normal}.pager{justify-content:flex-end}.editor-backdrop{position:fixed;inset:0;background:#0007;z-index:4000;display:flex;align-items:center;justify-content:center;padding:24px}.editor-dialog{background:#fafafa;border:1px solid #888;border-top:5px solid #A02619;border-radius:4px;box-shadow:0 16px 60px #0004;width:min(100%,1000px);max-height:92dvh;overflow:auto;padding:24px}.editor-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.editor-dialog>header h2{margin:0}.editor-dialog>button{margin:16px 10px 0 0}.editor-dialog details{margin-top:24px}.toast{left:50%;right:auto;transform:translateX(-50%);bottom:22px;width:80vw;max-width:80vw;box-sizing:border-box;z-index:6000;display:flex;justify-content:space-between;border-radius:4px;border-left-width:6px}.toast-success{background:#edf8ef;border-color:#277b3b;color:#154824}.toast-error{background:#fff0ef;border-color:#b12822;color:#771911}.toast-warning{background:#fff8dd;border-color:#d1a10a;color:#614905}.toast>span{flex:1}.toast button{flex:0 0 auto;background:#fff9;color:inherit;border-color:currentColor}.menu-icon{width:22px;height:22px;flex:0 0 22px}.sidebar nav>a{display:flex;align-items:center;gap:10px}.sidebar .nav-group{margin:0}.sidebar .nav-group-toggle{margin:0}.nav-group-toggle .nav-chevron{flex:0 0 16px}.nav-group-links span{font-size:inherit;width:auto}.wizard-steps{display:flex;gap:12px;margin:20px 0}.wizard-steps span{flex:1;border-bottom:3px solid #ccc;padding:10px;color:#666}.wizard-steps .active{border-color:#A02619;color:#A02619;font-weight:700}.alphabet-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.machine-list{display:flex;flex-direction:column;gap:10px}.machine-list button{text-align:left;display:flex;justify-content:space-between;align-items:center;gap:15px;padding:14px;min-height:52px}.touch-workspace .machine-list button{min-height:70px}.touch-workspace .editor-dialog button{min-height:52px;font-size:18px}.touch-workspace .table-page td{padding:14px}.activity-chart{margin:24px 0;padding:22px;background:#fafafa;border:1px solid #c6c6c6;border-radius:4px}.activity-chart figcaption{font-size:19px;font-weight:700}.chart-legend{display:flex;gap:20px;margin:14px 0}.chart-legend span:before{content:'';display:inline-block;width:12px;height:12px;margin-right:7px;background:var(--series)}.chart-legend .out,.chart-bars .out{--series:#A02619}.chart-legend .returned,.chart-bars .returned{--series:#728d67}.chart-legend .scrap,.chart-bars .scrap{--series:#E3AC07}.chart-columns{display:flex;gap:10px;height:220px;overflow-x:auto;padding:0 0 10px}.chart-day{flex:1;min-width:35px;display:flex;flex-direction:column;text-align:center}.chart-bars{height:180px;display:flex;align-items:end;gap:3px;border-bottom:1px solid #aaa}.chart-bars div{background:var(--series);flex:1;min-height:1px;border-radius:3px 3px 0 0}.chart-day small{margin-top:8px;font-size:10px}.activity-chart details{margin-top:15px}.bin-map{position:relative;background:#d2d2d2;border:3px solid #666;margin:20px 0;max-height:560px;min-height:200px;width:100%}.bin-map .bin-cell{position:absolute;margin:0;padding:8px;border:2px solid #999;border-radius:0;color:#262626;background:#e7e7e7;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:0;font-size:12px;line-height:1.2;gap:5px;box-sizing:border-box}.bin-cell.new{background:#f1dbd7;border-color:#A02619}.bin-cell.used{background:#f7e8b8;border-color:#9B7620}.bin-cell.selected{outline:4px solid #A02619;outline-offset:-5px;box-shadow:inset 0 0 0 8px #fff7}.bin-cell small{font-size:11px}.map-legend{display:flex;gap:20px;font-size:12px}.cell-resizer{position:absolute;right:0;top:0;height:100%;width:10px;background:#A0261955;cursor:ew-resize;touch-action:none}.cascading-tree{display:flex;overflow:auto;align-items:stretch;gap:12px}.tree-column{flex:1 0 210px;max-width:340px}.tree-column.collapsed{flex:0 0 48px;max-width:48px;padding:0}.tree-expand{writing-mode:vertical-rl;max-height:400px;height:100%;width:48px;margin:0!important;padding:12px!important}.form-grid{gap:18px}.form-grid label{margin:0}.panel h2+button{margin-bottom:16px}.warning{background:#fff8dd;border-left:4px solid #d1a10a;padding:14px}.dashboard-cards .panel p{margin-bottom:8px}@media(max-width:680px){.editor-backdrop{padding:8px}.editor-dialog{padding:16px;max-height:96dvh}.toast{width:90vw;max-width:90vw;bottom:12px}.wizard-steps{gap:5px;font-size:12px}.alphabet-tabs button{flex:1 0 22%}.table-page td,.table-page th{padding:8px}.live-search button{padding:8px}.bin-cell small{display:none}}
.sidebar nav>a>span{font-size:13px;width:auto;display:inline;flex:1}.sidebar .nav-group-toggle[aria-expanded="true"]{background:#e7e7e7;border-color:#858585;box-shadow:inset 3px 0 var(--red)}.report-action{margin:0;flex:0 0 auto}.report-action button{margin:0}.cell-resizer.vertical{right:0;top:auto;bottom:0;width:100%;height:10px;cursor:ns-resize}.bin-map .bin-cell{touch-action:manipulation}.editor-dialog .table-page{min-width:0}.tool-workspace:not(.touch-workspace) .slot-buttons button,.tool-workspace:not(.touch-workspace) .reason-buttons button{min-height:42px;font-size:13px}.tool-workspace:not(.touch-workspace) .picker-results button{padding:9px 12px}

/* Refinement: stable fields, compact animated tree and evenly sized cards. */
.lookup-field{display:flex;flex-direction:column;gap:7px;min-width:0}.lookup-value{display:flex;align-items:center;gap:10px;min-height:42px;border:1px solid #b7b7b7;padding:0 8px;border-radius:4px}.lookup-value span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lookup-value button{margin:4px 0!important}.form-grid{align-items:start}.form-grid>label{display:flex;flex-direction:column;gap:7px}.form-grid label.check{flex-direction:row}.tree-column{flex:0 0 240px;max-width:240px;height:340px;overflow:hidden;transition:flex-basis .24s ease,max-width .24s ease}.tree-column.collapsed{flex-basis:38px;max-width:38px;height:340px}.tree-column [role=listbox]{height:264px;overflow:auto}.tree-expand{height:340px;max-height:340px;width:38px;font-size:16px;font-weight:750;display:flex;align-items:center;gap:12px}.tree-expand strong{overflow:hidden;text-overflow:ellipsis}.panel,.detail-body{min-width:0}.detail-body{padding-top:20px}.detail-body>form,.detail-body>h2{margin-top:24px}.system-grid,.pilot-metrics{align-items:stretch}.system-grid>.panel,.pilot-metrics>.panel{height:100%;box-sizing:border-box}button+a,a+button{margin-left:8px}.editor-dialog .button-row{margin-top:20px}.editor-dialog .editor-dialog{width:min(850px,95vw)}.editor-backdrop .editor-backdrop{z-index:4500}.setting-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:20px 0}.table-wrap{overflow:auto}.number-small{max-width:110px}.bin-map .bin-cell.selected{outline:5px solid #9b3427;background:#f9dc86}.supplier-bars{display:grid;gap:12px}.supplier-bar{height:14px;background:#a02619;border-radius:3px;max-width:100%}@media(prefers-reduced-motion:reduce){.tree-column{transition:none}}

.pilot-modules{align-items:stretch;grid-auto-rows:1fr}.pilot-modules>.panel{height:100%;display:flex;flex-direction:column;box-sizing:border-box}.pilot-modules>.panel .button,.pilot-modules>.panel .badge{margin-top:auto;align-self:flex-start}.pilot-metrics>.panel{margin:0}

nav.setting-tabs{flex-direction:row;align-items:center}nav.setting-tabs>button{width:auto;flex:0 0 auto;margin:0}.editor-dialog .tool-fieldset>button{margin-right:8px;margin-top:10px}.form-grid .lookup-field>label{line-height:normal}
.cascading-tree .tree-column{min-width:0}.cascading-tree .tree-column.collapsed{min-width:38px;max-width:38px;flex-basis:38px}.cascading-tree .tree-column.collapsed .tree-expand{width:38px;min-width:0;box-sizing:border-box;white-space:nowrap;padding:10px 6px!important}.tree-expand strong{font-size:16px;font-weight:750}

nav.button-row{flex-direction:row;flex-wrap:wrap;justify-content:flex-start}nav.button-row>a{color:#fff}nav.button-row>a.secondary{color:#222}.editor-dialog .bin-map{width:min(100%,calc(280px * var(--drawer-width) / var(--drawer-depth)));max-height:280px;min-height:0}.touch-workspace .editor-dialog .bin-cell{font-size:13px;min-height:0}.touch-workspace .editor-dialog details>summary{padding:12px 0;font-size:17px}

/* Guided data exchange shares the existing colors and control styles. */
.data-exchange .wizard-steps { list-style:none; padding:0; }
.data-exchange .wizard-steps li { flex:1; min-width:0; border-bottom:3px solid #ccc; padding:10px 0; color:#666; overflow-wrap:anywhere; }
.data-exchange .wizard-steps li.active { border-color:#A02619; color:#A02619; font-weight:700; }
.data-exchange .form-grid > label { min-width:0; }
.data-exchange select { max-width:100%; }
.data-exchange td { vertical-align:top; overflow-wrap:anywhere; }
.data-exchange td select { min-width:180px; }
.data-exchange .form-grid .check { display:flex; align-items:center; gap:8px; overflow-wrap:anywhere; }
.data-exchange .form-grid .check input { flex:0 0 auto; width:auto; margin:0; }
@media (max-width:680px) {
    .panel.data-exchange .field-mapping table { min-width:0; }
    .data-exchange .field-mapping table,
    .data-exchange .field-mapping tbody,
    .data-exchange .field-mapping tr,
    .data-exchange .field-mapping td { display:block; width:100%; min-width:0; }
    .data-exchange .field-mapping thead { display:none; }
    .data-exchange .field-mapping tr { margin-bottom:12px; border-bottom:1px solid #ccc; }
    .data-exchange .field-mapping td { border:0; padding:8px 0; white-space:normal; box-sizing:border-box; }
    .data-exchange .field-mapping td select { width:100%; min-width:0; box-sizing:border-box; }
    .data-exchange .field-mapping td:first-child { font-weight:600; }
    .data-exchange .field-mapping td[data-label]::before { content:attr(data-label); display:block; color:#666; font-size:12px; margin-bottom:4px; }
}
