:root{--ink:#20362d;--muted:#69796f;--green:#286749;--bg:#f4f5ef;--line:#dce2d7;--white:#fff;--orange:#df723f}*{box-sizing:border-box}body{margin:0;font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg)}header{display:flex;justify-content:space-between;align-items:center;padding:22px 5vw;border-bottom:1px solid var(--line);background:#fff}header form{display:flex;align-items:center;gap:20px}.brand{font-weight:800;letter-spacing:.1em;color:var(--ink);text-decoration:none;font-size:14px}.brand span{font-size:11px;color:var(--muted)}main{max-width:1320px;margin:0 auto;padding:45px 5vw}h1{font-size:clamp(30px,4vw,48px);letter-spacing:-.055em;line-height:1.1;margin:12px 0 16px}h2{font-size:23px;letter-spacing:-.035em;line-height:1.25;margin:0 0 14px}h3{margin:0 0 15px}p{color:var(--muted);margin:10px 0 20px}.eyebrow{font-size:10px;letter-spacing:.17em;font-weight:800;color:var(--green)}.heading,.section-heading{display:flex;justify-content:space-between;align-items:center;gap:20px}.section-heading{margin:28px 0 18px}.section-heading h2{margin:0}.section-heading p{margin-bottom:0}button,.button{font:inherit;font-weight:600;background:var(--green);color:white;border:1px solid transparent;padding:11px 18px;border-radius:7px;cursor:pointer;white-space:nowrap;text-decoration:none}button:hover{filter:brightness(.94)}button:disabled{opacity:.5;cursor:wait}.secondary{background:white;color:var(--ink);border-color:var(--line)}nav{display:flex;gap:28px;border-bottom:1px solid var(--line);margin:25px 0}.tab{border:0;border-radius:0;background:none;color:var(--muted);padding:15px 0;font-size:13px}.tab.active{color:var(--green);box-shadow:0 2px var(--green)}.two-col{display:grid;grid-template-columns:1.3fr 1fr;gap:22px}.card{padding:27px;border:1px solid var(--line);border-radius:12px;background:white;margin-bottom:20px}.soft{background:#eaf0e5}.soft h2{font-size:29px;margin-top:16px}.soft li{margin:15px 0}.small{font-size:12px}.drop{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;padding:30px 16px;border:1px dashed #98af9a;border-radius:8px;background:#fafbf8;text-align:center;cursor:pointer;margin:22px 0}.drop.over{background:#e1eddc}.drop span{font-size:12px;color:var(--muted)}.drop input{max-width:100%;font-size:12px}label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600}input,select{font:inherit;padding:9px 10px;border:1px solid #cdd6cb;border-radius:5px;color:var(--ink);background:white;width:100%;min-width:0}input:focus,select:focus,button:focus-visible{outline:2px solid #74a283;outline-offset:2px}.fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.check{flex-direction:row;align-items:center;margin:14px 0}.check input{width:auto}details{margin:20px 0}summary{cursor:pointer;font-weight:600;font-size:13px}details p{font-size:12px}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px}.metric{background:white;border:1px solid var(--line);border-radius:8px;padding:20px}.metric b{display:block;font-size:32px;line-height:1.2;font-weight:650}.metric span{font-size:12px;color:var(--muted)}.notice{padding:15px 20px;background:#fff4db;border:1px solid #e7d3a6;border-radius:7px;font-size:13px;margin:16px 0}.error{color:#a3372d}#status:not(:empty){padding:14px 18px;background:#e4edde;border-radius:7px;margin:16px 0;white-space:pre-line}#status.error{background:#fbe8e3}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:13px}th,td{padding:12px;text-align:left;border-bottom:1px solid var(--line)}th{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.text-link{color:var(--green);text-decoration:underline;cursor:pointer;font-size:13px}.pallet-head{display:flex;justify-content:space-between;gap:15px;margin-bottom:18px}.pallet-head input{max-width:300px}.pallet-head button{font-size:12px;padding:6px 12px}.plan-pallet{display:grid;grid-template-columns:1fr 1fr;gap:24px}.plan-pallet canvas{width:100%;max-width:420px;aspect-ratio:1.3;background:#f7f8f3;border:1px solid var(--line);border-radius:8px}.layer-controls{display:flex;align-items:center;gap:12px;margin-bottom:10px}.layer-controls select{max-width:180px}.badge{background:#e9eee4;border-radius:4px;padding:3px 8px;font-size:11px}.history-row{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:16px 0;border-bottom:1px solid var(--line)}.history-row small{display:block;color:var(--muted)}footer{text-align:center;font-size:11px;color:var(--muted);padding:30px}.login{min-height:100vh;display:grid;place-items:center;background:#e7ece1}.login-card{width:min(460px,92vw);padding:45px;background:white;border:1px solid var(--line);border-radius:16px}.login-card label{margin:20px 0}.login-card button{width:100%}.login-card h1{font-size:43px;margin-top:45px}[hidden]{display:none!important}@media(max-width:800px){.two-col,.plan-pallet{grid-template-columns:1fr}.fields{grid-template-columns:repeat(2,minmax(0,1fr))}.metrics{grid-template-columns:repeat(2,1fr)}.heading,.section-heading{align-items:flex-start;flex-direction:column}nav{gap:18px;overflow:auto}.tab{font-size:11px}header{padding:18px}.brand span{display:none}main{padding:28px 18px}.card{padding:20px}header form{gap:10px}}

.plan-pallet{grid-template-columns:260px minmax(0,1fr)}.layer-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.layer-card{border:1px solid var(--line);border-radius:10px;padding:16px;background:#fafbf8}.layer-card h3{margin-bottom:8px}.layer-card canvas{width:100%;max-width:none;aspect-ratio:720/520;margin-top:14px}.layer-item{font-size:13px;overflow-wrap:anywhere}.layer-summary{font-weight:600}.mixed{background:#ffe2bd}@media(max-width:1000px){.plan-pallet{grid-template-columns:1fr}}@media(max-width:600px){.layer-list{grid-template-columns:1fr}}

.catalog-row{display:grid;grid-template-columns:1fr 1.2fr 1.3fr 1fr auto;align-items:end;gap:20px;padding:18px 0;border-bottom:1px solid var(--line)}#formats input{min-width:180px}#plan td{overflow-wrap:anywhere}@media(max-width:650px){.catalog-row{grid-template-columns:1fr}.section-heading{flex-wrap:wrap}}

.pallet-formats{border:1px solid var(--line);border-radius:8px;padding:18px;margin:18px 0 0}.pallet-formats legend{font-weight:700;padding:0 8px}.format-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:0 16px;margin-top:12px;max-height:280px;overflow:auto}.format-options .check{overflow-wrap:anywhere}

.recipe-fields{display:grid;gap:10px}@media(max-width:1000px){.catalog-row{grid-template-columns:1fr 1fr}.catalog-row button{justify-self:start}}@media(max-width:650px){.catalog-row{grid-template-columns:1fr}}

.capacity-block{padding:14px;margin:14px 0;border:1px solid #ccd8c7;border-radius:10px;background:#f4f7f0}.capacity-block p{margin:8px 0}.capacity-block summary{cursor:pointer}.capacity-overview input[type=checkbox]{width:20px;height:20px}

.layer-move-controls{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.layer-move-controls select{min-width:0;max-width:100%;flex:1 1 160px}.drag-hint{font-size:12px;color:#526353;cursor:grab}.layer-card[draggable=true]{cursor:grab}.layer-card.dragging{opacity:.45}.layer-drop-target.drop-active{outline:3px solid #27795b;outline-offset:3px;background:#eff8ea}.new-pallet-zones{display:flex;flex-wrap:wrap;gap:12px}.new-pallet-drop{border:2px dashed #9db69c;border-radius:10px;padding:18px;flex:1;min-width:190px}.layer-count-editor{margin:16px 0;padding:14px;border:1px solid #ccd8c7;border-radius:10px}.layer-count-editor label{display:block;margin-bottom:10px}.layer-count-editor input,.layer-count-editor select{width:100%;max-width:100%;box-sizing:border-box}.layer-move-controls button{cursor:pointer}

.empty-layer-slot{border:2px dashed #809c7e;background:#f5f8f1;min-height:220px;display:flex;flex-direction:column;gap:12px;justify-content:center}.empty-layer-slot select{width:100%;max-width:100%}.empty-layer-slot label{display:block}#layer-error-dialog{max-width:540px;width:calc(100% - 48px);box-sizing:border-box;padding:26px;border:1px solid #b3c3ad;border-radius:16px;color:#20362d}#layer-error-dialog::backdrop{background:rgba(20,35,28,.5)}.layer-error-reason{white-space:pre-line;line-height:1.6}

/* Compact operational view: contents stay visible, secondary controls expand on demand. */
main{max-width:1540px;padding:24px 3vw}header{padding:14px 3vw}h1{font-size:34px}h2{font-size:20px}h3{font-size:16px}p{margin:6px 0 12px}.card{padding:18px;margin-bottom:14px}.section-heading{gap:10px;flex-wrap:wrap;margin:18px 0 12px}.section-heading h2{flex:1 1 230px}button,.button{padding:8px 12px;font-size:13px}.metrics{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-bottom:12px}.metric{padding:12px}.metric b{font-size:25px}.plan-pallet{grid-template-columns:225px minmax(0,1fr);gap:18px}.layer-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:start}.layer-card{padding:10px;border-radius:8px}.layer-card h3{margin:6px 0}.layer-card canvas{margin-top:8px;max-height:165px;object-fit:contain}.layer-item{font-size:12px;line-height:1.5}.drag-hint{font-size:11px;margin:0 0 4px}.move-menu{margin:0 0 8px}.move-menu summary{font-size:11px}.layer-move-controls{margin:8px 0 0}.layer-facts{margin:6px 0}.capacity-block,.layer-count-editor{padding:10px;margin:10px 0;font-size:12px}.capacity-block p,.layer-count-editor p{margin:6px 0}.layer-count-editor button{white-space:normal}.layer-count-editor input{width:70px;padding:5px 8px;margin-left:8px}.layer-count-editor label{display:flex;align-items:center;justify-content:space-between}.pallet-totals{margin:10px 0}.plan-pallet th,.plan-pallet td{padding:6px}.empty-layer-slot{min-height:160px;gap:8px}.layer-editor-help{font-size:13px}.layer-editor-help summary{font-size:13px}.layer-editor-help p{margin-top:8px}.notice{padding:10px 12px}.capacity-overview th,.capacity-overview td{padding:7px 10px}
@media(max-width:1150px){.layer-list{grid-template-columns:repeat(2,minmax(0,1fr))}.metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:850px){.plan-pallet{grid-template-columns:1fr}.plan-pallet>div:first-child{min-width:0}.layer-card canvas{max-height:190px}main{padding:18px}.card{padding:12px}}
@media(max-width:540px){.layer-list{grid-template-columns:1fr}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.metric b{font-size:23px}.section-heading h2{flex:auto}.section-heading{align-items:stretch}.section-heading a,.section-heading button{text-align:center;white-space:normal}.layer-card canvas{max-height:200px}}

.layer-card canvas[role=button]{cursor:zoom-in}.layer-card canvas:focus-visible{outline:2px solid var(--green)}#layer-layout-dialog{width:min(850px,95vw);max-height:95vh;overflow:auto;border:1px solid var(--line);border-radius:12px;padding:20px;color:var(--ink)}#layer-layout-dialog canvas{display:block;width:100%;height:auto;margin:12px 0}#layer-layout-dialog::backdrop{background:rgba(20,35,28,.5)}
