/* CORTENIUM v0.79 online layout editor — isolated from CRM/production */
.cwDialog{width:min(1500px,98vw);max-width:98vw;height:min(900px,96vh);max-height:96vh;border:1px solid #526e6b;border-radius:14px;color:#e9efec;background:#111b1d;padding:0;overflow:hidden}
.cwDialog::backdrop{background:rgba(0,0,0,.82)}
.cwShell{height:100%;display:flex;flex-direction:column;padding:16px;gap:10px}
.cwTop,.cwTools{display:flex;align-items:center;justify-content:space-between;gap:9px;flex-wrap:wrap}
.cwTop h2{font-size:20px;margin:4px 0}.cwTop small{font-size:12px;color:#aac4be}.cwEyebrow{color:#c57e59;font-size:10px;font-weight:700;letter-spacing:1.5px}
.cwTools{justify-content:flex-start;padding:8px;background:#1a2b2c;border:1px solid #355353;border-radius:9px}
.cwTools button{font-size:12px;padding:7px 10px}.cwTools select{min-height:32px;max-width:260px;width:200px}.cwTools span{font-size:12px;color:#bcd5cf}
.cwMain{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:12px;flex:1;min-height:0}
.cwStage{min-width:0;display:flex;flex-direction:column;gap:7px;background:#0c1719;border:1px solid #395557;border-radius:10px;padding:12px;min-height:0}
#cwSvg{width:100%;height:100%;min-height:250px;max-height:100%;background:#132526;touch-action:none;cursor:crosshair;display:block}
#cwSvg .cwItem{cursor:move}#cwSvg .cwItem:hover path{stroke:#fff2dc;stroke-width:2.5px}#cwSvg .cwItem.active path{stroke:#f6cf76;stroke-width:2.5px}#cwSvg .cwItem.pinned path{stroke:#72c9a1}#cwSvg .cwItem.pinned{cursor:not-allowed}
.cwStage small{color:#9fbbb5;font-size:11px}
.cwSide{min-height:0;overflow:auto;border-radius:9px;border:1px solid #3c5858;padding:12px;background:#1b2a2d}
.cwSide h3{font-size:15px;margin:0 0 7px}.cwSide p{font-size:12px;color:#c0d0cd}.cwXY{display:grid;grid-template-columns:1fr 1fr;gap:8px}.cwXY label:last-child{grid-column:1/-1}.cwXY input,.cwXY select{padding:7px;min-height:34px}
.cwSideButtons,.cwExports{display:grid;gap:6px}.cwSideButtons{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:12px}.cwSideButtons button{font-size:12px;padding:6px 8px}.cwExports button{font-size:12px;text-align:left;padding:8px 10px}
.cwFile{display:block;cursor:pointer;border:1px solid #496364;border-radius:7px;padding:8px 10px;background:#293a3c;font-size:12px;font-weight:600;color:#e8eeec}.cwFile input{margin-top:6px;font-size:10px}
.cwCaution{font-size:11px;color:#e2bc89;line-height:1.45;margin-top:9px}.cwSide hr{border:0;border-top:1px solid #395456;margin:15px 0}#cwMessage{min-height:34px;padding:7px 11px;color:#9cd7bd;background:#223c36;border-radius:7px;font-size:12px}#cwMessage[data-error="true"]{color:#ffb4a3;background:#4c2b24}
@media(max-width:850px){.cwDialog{width:100vw;max-width:100vw;height:100vh;max-height:100vh;border-radius:0}.cwShell{padding:8px}.cwMain{grid-template-columns:1fr;grid-template-rows:minmax(240px,1fr) minmax(140px,35vh)}.cwSide{overflow:auto}.cwStage{padding:5px}.cwTools{gap:4px}.cwTools select{max-width:140px}.cwXY{grid-template-columns:repeat(3,1fr)}.cwXY label:last-child{grid-column:auto}}
/* v0.80 advanced group tools */
#cwSvg .cwItem.found path{stroke:#5dbadd;stroke-width:2px}
#cwSvg .cwItem.active path{stroke:#f6cf76;stroke-width:3px}
.cwFindLabel{font-size:12px;display:grid;gap:4px;margin:8px 0}
.cwFindLabel input{padding:7px;min-height:34px;width:100%}
.cwPickButtons{display:flex;align-items:center;justify-content:space-between;gap:6px}
.cwPickButtons button{font-size:11px;padding:6px}
.cwFullButton{margin-top:8px;width:100%;padding:8px}
#cwSelectedCount{color:#aad1d2;font-weight:600}
@media(min-width:851px){.cwDialog .cwMain{grid-template-columns:minmax(0,1fr) 325px}}

/* v0.81 global layout optimization controls */
.cwPrimaryOptimize{background:#b9724c;color:#fff;border:1px solid #d19470;font-weight:700}
.cwPrimaryOptimize:disabled{opacity:.5;cursor:progress}
.cwTools button{white-space:normal}

/* v0.88.4 — deliberate free-placement draft; never CAM-exportable until validated */
.cwDraftEnter{background:#24505a!important;border:1px solid #56a0ad!important;color:#ecfcff!important;font-weight:700}
.cwDraftFix{background:#23735c!important;border:1px solid #65af96!important;color:#fff!important;font-weight:700}
.cwDraftFix:disabled{opacity:.42;cursor:not-allowed}
.cwDraftNotice{padding:10px 13px;background:#40361f;border:1px solid #bc9a58;color:#ffe5aa;border-radius:8px;font-size:13px;font-weight:600}
.cwDraftNotice[hidden]{display:none!important}
#cwSvg .cwItem.draftTouched path{stroke:#ffc470;stroke-width:2.4px;stroke-dasharray:6 4}
#cwSvg .cwItem.draftTouched.active path{stroke:#f7dd8b;stroke-width:3.4px}
.cwExports button:disabled,.cwExports input:disabled{opacity:.4;cursor:not-allowed}

/* v0.88.5: recoverable draft checkpoints and transparent before/after comparison */
.cwDraftSave{background:#315c61!important;color:#eafaff!important;border:1px solid #67a4a6!important;font-weight:700}
.cwDraftSave:disabled{opacity:.42;cursor:not-allowed}
.cwDraftCheckpoint{margin:0 0 14px;padding:10px;border:1px solid #66827a;border-radius:8px;background:#203938}
.cwDraftCheckpoint strong{font-size:13px;color:#c5f0e3}
.cwDraftCheckpoint p{margin:6px 0 9px;line-height:1.5;color:#c4d6d0;font-size:11px}
.cwDraftCheckpoint .cwFile{background:#294344}
.cwComparison{border:1px solid #587c78;border-radius:9px;padding:10px 13px;background:#182e2e;max-height:175px;overflow:auto;font-size:12px;color:#f0f4ef}
.cwComparison[hidden]{display:none!important}
.cwComparison strong{font-size:13px}
.cwComparison table{border-collapse:collapse;margin:7px 0;width:100%}
.cwComparison th,.cwComparison td{border-bottom:1px solid #385354;padding:5px 8px;text-align:left}
.cwComparison th{color:#b1d5d0}
.cwComparison small{display:block;font-size:11px;color:#d7b98e}
@media(max-width:850px){.cwComparison{max-height:140px}.cwComparison th,.cwComparison td{padding:4px}}

/* v0.88.6 — CAD-style pivot and accessible rotation controls */
#cwSvg .cwGizmo {pointer-events:none}
#cwSvg .cwPivot {fill:#b2f6de;stroke:#102b2b;stroke-width:2px}
#cwSvg .cwOrbit {fill:none;stroke:#88d6c7;stroke-dasharray:10 8;opacity:.75}
#cwSvg .cwArm {stroke:#e5f6df;opacity:.95}
#cwSvg .cwRotateHandle {fill:#f3b46e;stroke:#fff5d1;cursor:grab;pointer-events:all;filter:drop-shadow(0 1px 3px #061b1b)}
#cwSvg .cwRotateHandle:hover {fill:#ffe39c;stroke:#fff}
#cwSvg .cwAngleLabel {fill:#fff1c9;font-weight:800;stroke:#112828;stroke-width:1.5px;paint-order:stroke fill;pointer-events:none}
.cwRotationOption{display:flex;align-items:center;gap:8px;margin:12px 0 4px;padding:10px;background:#294343;border:1px solid #537f77;border-radius:8px;color:#f1faf5;font-size:12px;font-weight:650}
.cwRotationOption input{width:17px;height:17px;accent-color:#6fbaa1;flex:none}
.cwRotationOption:has(input:disabled){opacity:.6}
.cwRotateHint{display:block;color:#bdd8d1;font-size:11px;line-height:1.4}
.cwStripDense{background:#28493e!important;border:1px solid #689b7b!important;color:#eefdf0!important;font-weight:700}
.cwStripDense:disabled{opacity:.45;cursor:not-allowed}

/* v0.88.7 — prominent but nonintrusive approval for grain-direction changes */
.calcArcRotation { display:flex;flex-direction:column;gap:7px;padding:12px 14px;margin:8px 0 14px;border:1px solid #416461;border-radius:10px;background:#14292b;}
.calcArcRotation button {align-self:flex-start;min-height:42px;}
.calcArcRotation small {color:#b3cbca;line-height:1.5;}
