:root{--bg: #f3f5f4;--panel: #ffffff;--panel-strong: #f9fbfa;--text: #1e292b;--muted: #617074;--border: #d8dfdd;--border-strong: #b8c4c1;--primary: #1f6b63;--primary-dark: #174f49;--primary-soft: #e3f1ee;--accent: #b55f25;--danger: #a4342b;--danger-soft: #fbe8e5;--warning: #8b6815;--warning-soft: #fff3cf;--success: #226b3a;--success-soft: #e5f4e9;--waste: #d9d2c5;--shadow: 0 14px 36px rgba(31, 43, 45, .08)}*{box-sizing:border-box}[hidden]{display:none!important}html{min-height:100%;background:var(--bg);overflow-x:hidden}body{min-height:100%;margin:0;color:var(--text);background:linear-gradient(180deg,#1f6b6317,#f3f5f400 320px),var(--bg);font-family:Arial,Helvetica,sans-serif;font-size:16px;line-height:1.5;letter-spacing:0;overflow-x:hidden}button,input{font:inherit;letter-spacing:0}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}.app-shell{width:min(1180px,calc(100% - 32px));margin:0 auto;max-width:100%}.app-header{background:#243433;color:#fff;border-bottom:5px solid var(--accent)}.header-inner{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:8px 0}.header-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;min-width:0}.auth-status{display:inline-flex;align-items:center;gap:8px;min-width:0}.auth-email{max-width:210px;color:#d8e5e2;font-size:.88rem;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eyebrow,.section-kicker{margin:0 0 6px;color:inherit;font-size:.76rem;font-weight:700;letter-spacing:0;text-transform:uppercase}.eyebrow{color:#b8d8d2}h1,h2,h3,p{margin-top:0}h1{margin-bottom:0;font-size:clamp(2.1rem,4vw,4rem);line-height:1;letter-spacing:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.header-brand{display:flex;align-items:center;width:fit-content;min-height:72px;flex-shrink:0}.header-title{margin:0;color:#fff;font-size:clamp(2rem,4vw,3.25rem);font-weight:800;line-height:1}.header-note{margin:0 0 7px;color:#d8e5e2;font-size:1rem}main{padding:28px 0 48px}.panel{margin-bottom:22px;padding:24px;background:var(--panel);border:1px solid var(--border);border-radius:8px;box-shadow:var(--shadow);min-width:0}.section-heading{display:flex;align-items:start;justify-content:space-between;gap:18px;margin-bottom:22px}.section-heading>*,.stock-header>*{min-width:0}.section-heading h2{margin-bottom:0;font-size:1.45rem;line-height:1.2}.section-kicker{color:var(--primary)}.form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.field{display:grid;gap:7px}.field-wide{grid-column:span 2}.field span,.row-field span{color:#37484b;font-size:.88rem;font-weight:700}input{width:100%;min-height:44px;padding:10px 12px;color:var(--text);background:#fff;border:1px solid var(--border-strong);border-radius:6px;outline:none;transition:border-color .15s ease,box-shadow .15s ease,background .15s ease}input:focus{border-color:var(--primary);box-shadow:0 0 0 4px #1f6b6324}input[aria-invalid=true]{background:snow;border-color:var(--danger)}.button-group,.form-actions,.row-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;min-width:0;max-width:100%}.button{display:inline-flex;min-height:40px;align-items:center;justify-content:center;gap:8px;padding:9px 14px;border:1px solid transparent;border-radius:6px;font-weight:700;text-align:center;text-decoration:none;transition:transform .12s ease,background .12s ease,border-color .12s ease}.button:hover:not(:disabled){transform:translateY(-1px)}.button.primary{color:#fff;background:var(--primary);border-color:var(--primary)}.button.primary:hover:not(:disabled){background:var(--primary-dark);border-color:var(--primary-dark)}.button.secondary{color:var(--primary-dark);background:var(--primary-soft);border-color:#b8d8d2}.button.subtle{color:#37484b;background:#f3f5f4;border-color:var(--border)}.button.row-button{min-height:34px;padding:6px 9px;color:#314244;background:#fff;border-color:var(--border);font-size:.82rem}.button.row-button.danger{color:var(--danger);border-color:#efc4bf}.save-controls{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:14px;align-items:end;margin-bottom:18px}.save-name-field{min-width:0}.saved-status{margin:-8px 0 18px;color:var(--muted);font-weight:700}.saved-list{display:grid;gap:10px;min-width:0}.saved-empty{padding:14px;color:var(--muted);background:var(--panel-strong);border:1px dashed var(--border-strong);border-radius:8px;font-weight:700}.saved-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;padding:14px;background:var(--panel-strong);border:1px solid var(--border);border-radius:8px;min-width:0}.saved-item.is-selected{border-color:var(--primary);box-shadow:0 0 0 3px #1f6b631f}.saved-item h3{margin:0 0 4px;font-size:1rem;line-height:1.25;overflow-wrap:anywhere}.saved-meta{margin:0;color:var(--muted);font-size:.86rem;font-weight:700;overflow-wrap:anywhere}.saved-actions{justify-content:flex-end}.cut-table{overflow:hidden;border:1px solid var(--border);border-radius:8px;background:var(--panel-strong)}.cut-table-header,.cut-row{display:grid;grid-template-columns:minmax(140px,.9fr) minmax(110px,.55fr) minmax(180px,1.2fr) minmax(260px,1fr);gap:12px;align-items:center}.cut-table-header{padding:12px 14px;color:var(--muted);border-bottom:1px solid var(--border);font-size:.78rem;font-weight:700;text-transform:uppercase}.cut-row{padding:14px;background:#fff;border-bottom:1px solid var(--border)}.cut-row:last-child{border-bottom:0}.row-field{display:grid;gap:6px}.row-field .mobile-label{display:none}.form-actions{justify-content:flex-end;margin-top:18px}.message{position:fixed;top:18px;left:50%;z-index:9500;width:min(720px,calc(100% - 32px));max-height:min(50vh,360px);margin:0;padding:14px 16px;overflow-y:auto;border:1px solid var(--border);border-radius:8px;box-shadow:0 18px 44px #1f2b2d2e;font-weight:700;transform:translate(-50%)}.message.error{color:var(--danger);background:var(--danger-soft);border-color:#efc4bf}.message.success{color:var(--success);background:var(--success-soft);border-color:#bdddc6}.message.warning{color:var(--warning);background:var(--warning-soft);border-color:#eed690}.summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;min-width:0}.summary-item{min-height:92px;padding:15px;background:var(--panel-strong);border:1px solid var(--border);border-radius:8px;min-width:0}.summary-item span{display:block;color:var(--muted);font-size:.78rem;font-weight:700;text-transform:uppercase}.summary-item strong{display:block;margin-top:8px;color:var(--text);font-size:1.32rem;line-height:1.15;overflow-wrap:anywhere}.insights{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px;min-width:0}.insight{padding:12px 14px;color:#344548;background:#f8faf9;border:1px solid var(--border);border-radius:8px;font-weight:700;min-width:0;overflow-wrap:anywhere}.insight.warning{color:var(--warning);background:var(--warning-soft);border-color:#eed690}.plans{display:grid;gap:18px;min-width:0}.stock-plan{padding:18px;background:var(--panel-strong);border:1px solid var(--border);border-radius:8px;min-width:0}.stock-header{display:flex;justify-content:space-between;gap:14px;margin-bottom:14px}.stock-header h3{margin-bottom:4px;font-size:1.15rem}.stock-pattern-summary{margin:0 0 10px;color:var(--muted);font-size:.92rem;font-weight:700;overflow-wrap:anywhere}.stock-meta{display:flex;flex-wrap:wrap;gap:8px;margin:0;min-width:0}.pill{display:inline-flex;align-items:center;flex-shrink:1;min-height:28px;max-width:100%;padding:4px 9px;border-radius:999px;color:#314244;background:#fff;border:1px solid var(--border);font-size:.82rem;font-weight:700;overflow-wrap:anywhere;white-space:normal}.pill.good{color:var(--success);background:var(--success-soft);border-color:#bdddc6}.pill.bad{color:var(--muted);background:#eef1f0}.bar{display:flex;width:100%;max-width:100%;min-width:0;height:46px;overflow:hidden;background:#eef1f0;border:1px solid var(--border-strong);border-radius:6px}.bar-segment{display:flex;min-width:0;align-items:center;justify-content:center;padding:0 4px;color:#fff;border-right:1px solid rgba(255,255,255,.7);font-size:.78rem;font-weight:700;line-height:1;overflow:hidden;white-space:nowrap}.bar-segment span{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis}.bar-segment:last-child{border-right:0}.bar-segment.tone-0{background:#1f6b63}.bar-segment.tone-1{background:#356f8c}.bar-segment.tone-2{background:#6f6b36}.bar-segment.tone-3{background:#8b5944}.bar-segment.tone-4{background:#4f6c42}.bar-segment.tone-5{background:#6d5973}.bar-segment.kerf{min-width:2px;padding:0;background:#263433}.bar-segment.waste{color:#39474a;background:repeating-linear-gradient(135deg,var(--waste),var(--waste) 8px,#eee7dc 8px,#eee7dc 16px);border-left:1px solid rgba(49,66,68,.2)}.bar-segment.offcut{color:#23543c;background:repeating-linear-gradient(135deg,#d9efdf,#d9efdf 8px,#eef8f0 8px,#eef8f0 16px);border-left:1px solid rgba(34,107,58,.25)}.cut-list{display:grid;gap:8px;margin:14px 0 0;padding:0;list-style:none}.cut-list li{display:grid;grid-template-columns:minmax(110px,.45fr) minmax(120px,1fr);gap:12px;padding:8px 0;border-bottom:1px solid var(--border);min-width:0}.cut-list li:last-child{border-bottom:0}.cut-length{font-weight:800;min-width:0;overflow-wrap:anywhere}.cut-label{color:var(--muted);min-width:0;overflow-wrap:anywhere}.manual-stock-plan{position:relative;transition:border-color .12s ease,box-shadow .12s ease,background .12s ease}.manual-stock-plan.is-drop-target{background:#f2faf7;border-color:var(--success);box-shadow:0 0 0 3px #226b3a29}.manual-stock-plan.is-drop-invalid{background:#fff8f7;border-color:var(--danger);box-shadow:0 0 0 3px #a4342b24}.manual-cut-list{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}.manual-cut-list li.manual-cut{grid-template-columns:minmax(92px,.5fr) minmax(100px,1fr);align-items:center;min-height:48px;padding:9px 11px;background:#fff;border:1px solid var(--border);border-radius:8px;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;transition:border-color .12s ease,box-shadow .12s ease,opacity .12s ease}.manual-cut-list li.manual-cut:hover,.manual-cut-list li.manual-cut:focus{border-color:var(--primary);box-shadow:0 0 0 3px #1f6b631f;outline:none}.manual-cut-list li.manual-cut:active{cursor:grabbing}.manual-cut-list li.manual-cut.is-dragging-source{opacity:.35}.manual-drag-ghost{position:fixed;top:0;left:0;z-index:10000;display:grid;grid-template-columns:minmax(92px,.5fr) minmax(100px,1fr);gap:12px;align-items:center;min-height:48px;margin:0;padding:9px 11px;color:var(--text);background:#fff;border:1px solid var(--primary);border-radius:8px;box-shadow:0 16px 34px #1f2b2d2e;list-style:none;pointer-events:none}.manual-empty-state{margin-top:14px;padding:12px 14px;color:var(--muted);background:#fff;border:1px dashed var(--border-strong);border-radius:8px;font-weight:700}.bar-segment.empty{width:100%;color:var(--muted);background:#eef1f0;border-right:0}@media(max-width:980px){.form-grid,.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cut-table-header,.cut-row{grid-template-columns:minmax(120px,.9fr) minmax(90px,.55fr) minmax(150px,1fr)}.cut-table-header span:last-child{display:none}.row-actions{grid-column:1 / -1}.insights,.save-controls,.saved-item{grid-template-columns:1fr}.saved-actions{justify-content:flex-start}}@media(max-width:700px){.app-shell{width:calc(100% - 22px);max-width:1180px}.header-inner,.section-heading,.stock-header{align-items:stretch;flex-direction:column}.header-inner{flex-wrap:wrap;gap:12px;padding:24px 0 22px}.header-brand{order:-1;width:100%;height:92px;justify-content:center}.header-title{font-size:clamp(2.5rem,12vw,3.4rem)}.header-note{margin-bottom:0}main{padding-top:18px}.panel{padding:18px}.form-grid,.summary-grid{grid-template-columns:1fr}.field-wide{grid-column:auto}.button-group,.form-actions{align-items:stretch;flex-direction:column}.button{width:100%}.cut-table{border:0;background:transparent}.cut-table-header{display:none}.cut-rows{display:grid;gap:12px}.cut-row{grid-template-columns:1fr;gap:10px;border:1px solid var(--border);border-radius:8px}.row-field .mobile-label{display:block}.row-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.button.row-button{width:100%}.bar{height:38px}.bar-segment{font-size:.7rem}.cut-list li{grid-template-columns:1fr;gap:2px}.auth-status{width:100%;justify-content:center;flex-wrap:wrap}.auth-email{max-width:100%}}@media print{:root{--shadow: none}body{background:#fff;color:#000}.app-header{color:#000;background:#fff;border-bottom:2px solid #000000}.header-title{color:#000}.eyebrow,.section-kicker,.header-note,.cut-label{color:#333}.button,#cut-form,.message,.saved-panel{display:none!important}.app-shell{width:100%}main{padding:18px 0}.panel,.stock-plan,.summary-item,.insight{break-inside:avoid;border-color:#999;box-shadow:none}.bar{border-color:#555}.guide-overlay,.auth-overlay,.header-website-link,.header-guide-button,.auth-status{display:none!important}}.header-website-link,.header-guide-button{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:7px 16px;color:#fff;background:#ffffff1a;border:1px solid rgba(255,255,255,.22);border-radius:6px;font-size:.88rem;font-weight:700;cursor:pointer;transition:background .15s ease,border-color .15s ease,transform .12s ease;align-self:center;flex-shrink:0}.header-website-link{color:#fff;background:#b55f253d;border-color:#ffffff3d}.header-website-link:hover{background:#b55f255c;border-color:#ffffff61;transform:translateY(-1px)}.header-guide-button:hover{background:#ffffff2e;border-color:#ffffff5c;transform:translateY(-1px)}.guide-icon{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;background:var(--accent);border-radius:50%;font-size:.82rem;font-weight:800;line-height:1}.guide-overlay,.auth-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9000;display:flex;align-items:center;justify-content:center;padding:24px;background:#1e292b8c;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);animation:guideOverlayIn .2s ease}.auth-overlay{z-index:9200}.guide-overlay[hidden],.auth-overlay[hidden]{display:none}.guide-modal,.auth-modal{position:relative;width:min(680px,100%);max-height:calc(100vh - 48px);display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 64px #1f2b2d2e,0 4px 12px #1f2b2d14;animation:guideModalIn .25s cubic-bezier(.16,1,.3,1)}.auth-modal{width:min(460px,100%)}.guide-modal-header,.auth-modal-header{display:flex;align-items:start;justify-content:space-between;gap:16px;padding:24px 28px 18px;border-bottom:1px solid var(--border)}.guide-modal-header h2,.auth-modal-header h2{margin-bottom:0;font-size:1.35rem;line-height:1.2}.guide-close{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;min-height:auto;padding:0;color:var(--muted);background:var(--panel-strong);border:1px solid var(--border);border-radius:8px;font-size:1.4rem;line-height:1;cursor:pointer;flex-shrink:0;transition:background .12s ease,color .12s ease}.guide-close:hover{color:var(--text);background:#eef1f0}.auth-form{display:grid;gap:14px;padding:22px 28px 16px}.auth-copy{margin:0;color:var(--muted);font-weight:700}.auth-modal-actions{display:flex;justify-content:flex-end}.auth-mode-actions{display:flex;flex-wrap:wrap;gap:8px;padding:0 28px 22px}.auth-mode-actions .button[aria-pressed=true]{color:#fff;background:var(--primary);border-color:var(--primary)}.inline-message{margin:0 28px 24px;padding:12px 14px;color:var(--muted);background:var(--panel-strong);border:1px solid var(--border);border-radius:8px;font-weight:700}.inline-message.error{color:var(--danger);background:var(--danger-soft);border-color:#efc4bf}.inline-message.success{color:var(--success);background:var(--success-soft);border-color:#bdddc6}.guide-modal-body{padding:24px 28px 28px;overflow-y:auto;overscroll-behavior:contain}.guide-section{margin-bottom:28px}.guide-section:last-child{margin-bottom:0}.guide-section-title{display:flex;align-items:center;gap:12px;margin:0 0 14px;font-size:1.05rem;line-height:1.3;color:var(--text)}.guide-step-number{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--primary);color:#fff;border-radius:50%;font-size:.82rem;font-weight:800;flex-shrink:0}.guide-steps,.guide-tips{margin:0;padding:0 0 0 22px}.guide-steps li,.guide-tips li{margin-bottom:10px;color:#37484b;font-size:.94rem;line-height:1.55}.guide-steps li:last-child,.guide-tips li:last-child{margin-bottom:0}.guide-steps li strong,.guide-tips li strong{color:var(--text)}.guide-definitions{margin:0;display:grid;gap:0}.guide-def-item{display:grid;grid-template-columns:180px 1fr;gap:12px;padding:12px 14px;border-bottom:1px solid var(--border)}.guide-def-item:first-child{border-radius:8px 8px 0 0}.guide-def-item:last-child{border-bottom:0;border-radius:0 0 8px 8px}.guide-def-item:only-child{border-radius:8px}.guide-definitions dt{font-weight:700;color:var(--text);font-size:.92rem}.guide-definitions dd{margin:0;color:#37484b;font-size:.92rem;line-height:1.5}.guide-def-item{background:var(--panel-strong)}.guide-def-item:nth-child(odd){background:#fff}.guide-paragraph{margin:0 0 10px;color:#37484b;font-size:.94rem;line-height:1.6}.guide-paragraph:last-child{margin-bottom:0}.guide-paragraph strong{color:var(--text)}@keyframes guideOverlayIn{0%{opacity:0}to{opacity:1}}@keyframes guideModalIn{0%{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}@media(max-width:700px){.header-actions{width:100%;justify-content:center;gap:8px}.header-actions .button{width:auto}.header-website-link{flex:0 1 auto;max-width:calc(100% - 52px);min-height:36px;padding:7px 12px;font-size:.84rem}.header-guide-button span:not(.guide-icon){display:none}.header-guide-button{padding:7px 10px;min-height:36px}.guide-overlay,.auth-overlay{padding:12px}.guide-modal-header,.auth-modal-header{padding:18px 20px 14px}.auth-form,.auth-mode-actions{padding-left:20px;padding-right:20px}.auth-modal-actions,.auth-mode-actions{align-items:stretch;flex-direction:column}.inline-message{margin-left:20px;margin-right:20px}.guide-modal-body{padding:18px 20px 22px}.guide-def-item{grid-template-columns:1fr;gap:4px}}@media print{.auth-overlay,.guide-overlay,.auth-status,.saved-panel{display:none!important}}
