/* Factory planning extends the existing MiSans/Inter workspace tokens. */
#machineSchedulePanel{max-width:1680px;margin:24px auto;padding:0 24px 100px;color:#1e293b}
#machineSchedulePanel .sc-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
#machineSchedulePanel h1{font-size:24px;font-weight:600;margin:0 0 6px}
#machineSchedulePanel h2{font-size:17px;line-height:1.45;margin:0}
#machineSchedulePanel p,.sc-dialog p{line-height:1.6;margin:8px 0;overflow-wrap:anywhere}
#machineSchedulePanel nav,.sc-dialog nav{display:flex;flex-wrap:wrap;gap:8px}
#machineSchedulePanel button,.sc-dialog button,.sc-dialog .button{min-height:44px!important;touch-action:manipulation}
#machineSchedulePanel a.button{display:inline-flex;align-items:center;min-height:44px}
#machineSchedulePanel .sc-summary{display:flex;flex-wrap:wrap;gap:12px 24px;padding:16px 0;border-block:1px solid #e2e8f0;margin:16px 0}
#machineSchedulePanel .sc-filters{display:grid;grid-template-columns:180px 180px minmax(220px,1fr);gap:16px;margin-bottom:12px}
#machineSchedulePanel label,.sc-dialog label{display:flex;flex-direction:column;gap:7px;font-size:14px;color:#526177}
#machineSchedulePanel :is(input,select),.sc-dialog :is(input,select,textarea){min-height:44px;width:100%;max-width:100%;padding:10px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#1e293b;font:inherit;box-sizing:border-box}
.sc-dialog :is(input[type=checkbox],input[type=radio]){width:22px;min-height:22px;height:22px;accent-color:#2563eb;flex:none}
.sc-dialog label:has(input[type=checkbox]){display:flex;flex-direction:row-reverse;justify-content:flex-end;align-items:center;min-height:44px;gap:10px}
.sc-dialog :is(fieldset,section){min-width:0}
.sc-dialog fieldset{border:1px solid #e2e8f0;border-radius:8px;padding:12px}
#machineSchedulePanel .sc-machines{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-top:20px}
.sc-machine{display:flex;flex-direction:column;gap:6px;min-width:0;padding:20px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 2px 6px #0f172a06}
.sc-machine-head,.sc-job-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.sc-machine-head h2{min-width:0;overflow-wrap:anywhere}
.sc-machine-identity{display:flex;align-items:center;gap:10px;min-width:0}
.sc-machine-head>.sc-machine-identity{flex:1}
.sc-machine-identity :is(h2,h3){min-width:0;overflow-wrap:anywhere}
.sc-dialog-body>.sc-machine-identity{margin-bottom:16px}
.sc-device{--sc-state-ink:#536174;--sc-state-fill:#edf1f6;display:inline-flex;flex:0 0 60px;width:60px;height:54px;color:var(--sc-state-ink)}
.sc-device svg{display:block;width:60px;height:54px;flex:none}
.sc-device svg text{font:600 10px Inter,MiSans,'Microsoft YaHei',sans-serif}
.sc-device .sc-cabinet{fill:var(--sc-state-fill)}
.sc-device .sc-state-dot{fill:var(--sc-state-ink);stroke:var(--sc-state-ink)}
.sc-device.is-idle{--sc-state-ink:#0c7560;--sc-state-fill:#e2f4ec}
.sc-device.is-running{--sc-state-ink:#235ac1;--sc-state-fill:#eaf0ff}
.sc-device.is-waiting{--sc-state-ink:#9a5a12;--sc-state-fill:#fff2d6}
.sc-device.is-paused{--sc-state-ink:#a7432f;--sc-state-fill:#fcebe6}
.sc-device.is-conflict{--sc-state-ink:#b42332;--sc-state-fill:#fff0f2}
.sc-machine nav{margin-top:auto;padding-top:12px}
.sc-availability{font-size:21px;line-height:1.4;font-weight:600;margin-top:8px;font-variant-numeric:tabular-nums}
.sc-badge{display:inline-block;flex:none;padding:4px 8px;border-radius:6px;font-size:12px;line-height:1.5;background:#f1f5f9;color:#475569}
.sc-badge.success{background:#e8f6ed;color:#166534}.sc-badge.working{background:#eff6ff;color:#1e40af}.sc-badge.waiting{background:#fff7ed;color:#9a3412}
.sc-badge.warning,.sc-badge.danger{background:#fef2f2;color:#991b1b}
.sc-help{font-size:13px;color:#526177}.sc-warning{font-size:13px;color:#92400e}
.sc-explainer{margin:10px 0}.sc-explainer>summary{cursor:pointer;min-height:36px;font-size:13px;color:#526177}
.sc-timeline{display:flex;gap:3px;margin-top:8px;min-width:0}.sc-timeline span{display:block;flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:5px 6px;border-radius:4px;font-size:11px}
.sc-timeline .known{background:#e9f1ff;color:#1e40af}.sc-timeline .unknown{background:repeating-linear-gradient(135deg,#f1f5f9,#f1f5f9 5px,#e2e8f0 5px,#e2e8f0 6px);color:#475569}
.sc-job,.sc-impact,.sc-recommend-row{border:1px solid #e2e8f0;border-radius:10px;padding:16px;margin:12px 0;background:#fff;min-width:0;overflow-wrap:anywhere}
.sc-job nav{margin-top:12px}
#scUnassigned{margin-top:28px}
dialog.sc-dialog{width:min(820px,calc(100vw - 32px));padding:0!important;border:1px solid #dce3ec;border-radius:14px;max-height:90dvh;color:#1e293b;background:#fff}
dialog.sc-dialog[open]{display:flex;flex-direction:column}
.sc-dialog::backdrop{background:#0f172a66}
.sc-dialog>header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 20px;border-bottom:1px solid #e2e8f0;background:#fff;flex:none}
.sc-dialog h2{font-size:20px;margin:0!important;background:none!important;border:0!important;padding:0!important}
.sc-dialog .sc-dialog-body{overflow-y:auto;overscroll-behavior:contain;padding:20px;min-height:0}
.sc-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.sc-form-grid>p,.sc-form-grid>fieldset,.sc-form-grid>section{grid-column:1/-1}
.sc-dialog footer{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;padding-top:16px;border-top:1px solid #e2e8f0;margin-top:20px}
.sc-stop-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;border:1px solid #e2e8f0;border-radius:8px;padding:12px;margin:12px 0}
.sc-stop-row label:nth-child(3){grid-column:1/-1}
#scToast{position:fixed;bottom:96px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);padding:12px 18px;background:#ecfdf5;border:1px solid #a7d7bf;border-radius:10px;color:#166534;font-size:14px;z-index:2147483647;box-shadow:0 4px 16px #0f172a12}
#scToast.error{color:#991b1b;background:#fef2f2;border-color:#fecaca}
.sc-recommend{grid-column:1/-1;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:14px;min-width:0}
.sc-recommend h3{font-size:16px;margin:0 0 8px}
.sc-recommend-row p{font-size:13px}
body.ui-v2-preview #fmBottomNav{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1100px){#machineSchedulePanel .sc-machines{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){
 #machineSchedulePanel{padding:0 14px calc(110px + env(safe-area-inset-bottom,0px));margin:16px auto}
 #machineSchedulePanel .sc-heading{align-items:flex-start;flex-direction:column;gap:10px;margin-bottom:12px}
 #machineSchedulePanel .sc-heading nav{width:100%}
 #machineSchedulePanel .sc-filters{grid-template-columns:1fr 1fr;gap:12px}
 #machineSchedulePanel .sc-filters label:last-child{grid-column:1/-1}
 #machineSchedulePanel .sc-machines{grid-template-columns:minmax(0,1fr);gap:14px}
 #machineSchedulePanel :is(input,select),.sc-dialog :is(input,select,textarea){font-size:16px}
 .sc-form-grid,.sc-stop-row{grid-template-columns:minmax(0,1fr)}
 .sc-machine{padding:16px;gap:3px}.sc-dialog .sc-dialog-body{padding:16px}
 #machineSchedulePanel .sc-machine p{margin:2px 0;font-size:13px}
 #machineSchedulePanel .sc-summary{padding:12px 0;margin:12px 0;gap:8px 16px;font-size:13px}
 dialog.sc-dialog{width:calc(100vw - 16px);max-height:calc(94dvh - env(safe-area-inset-top,0px));border-radius:12px}
 .sc-dialog>header{padding:12px 16px}.sc-dialog h2{font-size:18px}
 .sc-dialog footer{position:sticky;bottom:-16px;background:#fff;padding:12px 0 calc(12px + env(safe-area-inset-bottom,0px))}
 .sc-dialog footer button{flex:1;min-width:110px}
}
@media(prefers-reduced-motion:reduce){#machineSchedulePanel *,.sc-dialog *{scroll-behavior:auto!important;transition:none!important}}

