@media screen {
  .step-button[hidden],.step-model-stage[hidden] { display:none!important; }
  .step-controls { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:8px; padding-top:8px; border-top:1px solid #bccbdd; }
  .step-button { display:inline-flex; align-items:center; justify-content:center; padding:7px 10px; min-height:32px; border:1px solid #9bb4d4; border-radius:7px; background:#fff; color:#064ca6; font:600 12px "Segoe UI",sans-serif; cursor:pointer; text-decoration:none; }
  .step-button:hover { background:#e9f1ff; border-color:#075dcc; }
  .step-button:focus-visible { outline:3px solid #075dcc; outline-offset:2px; }
  .step-button:disabled { opacity:.6; cursor:wait; }
  .step-revision { width:100%; color:#475569; font:500 11px "Segoe UI",sans-serif; }
  .step-overlay { position:fixed; inset:0; z-index:25000; display:flex; justify-content:center; align-items:center; padding:16px; background:#071525bb; }
  .step-panel { width:min(1080px,100%); max-height:calc(100dvh - 32px); overflow:auto; background:#f5f7fb; border:2px solid #54759b; border-radius:12px; box-shadow:0 20px 65px #0006; color:#142439; font:14px "Segoe UI",sans-serif; }
  .step-header { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:15px 20px; border-bottom:2px solid #b9c9dc; background:#fff; position:sticky; top:0; z-index:1; }
  .step-header h2 { margin:0; font-size:20px; }
  .step-content { display:flex; flex-direction:column; gap:12px; padding:18px 20px; }
  .step-content p { margin:0; line-height:1.5; }
  .step-identity { font-weight:700; }
  .step-notice { border-left:3px solid #075dcc; padding:10px 12px; background:#e9f1ff; }
  .step-status { margin:0; padding:12px 20px; border-top:1px solid #b9c9dc; min-height:42px; line-height:1.5; }
  .step-field { display:flex; flex-direction:column; gap:7px; font-weight:600; }
  .step-field input { background:#fff; border:1px solid #9bb4d4; padding:10px; border-radius:7px; }
  .step-check { display:flex; align-items:flex-start; gap:10px; line-height:1.5; }
  .step-check input,.step-match-row input { width:20px; height:20px; flex:none; accent-color:#075dcc; }
  .step-match-list { display:flex; flex-direction:column; gap:8px; max-height:45dvh; overflow:auto; }
  .step-match-row { display:grid; grid-template-columns:24px 1fr; gap:5px 10px; padding:12px; border:1px solid #b9c9dc; border-radius:8px; background:#fff; }
  .step-match-row input { grid-column:1; grid-row:1 / span 3; }
  .step-match-row strong,.step-match-row span,.step-match-row small { grid-column:2; overflow-wrap:anywhere; }
  .step-match-reason,.step-match-candidate { grid-column:2; margin:0; overflow-wrap:anywhere; }
  .step-match-reason { color:#84500b; line-height:1.5; }
  .step-match-candidate { display:grid; gap:7px; padding:10px; border:1px solid #b9c9dc; border-left:3px solid #cc851a; border-radius:6px; background:#fffaf1; }
  .step-match-candidate > .step-button { justify-self:start; }
  .step-match-results,.step-review-view { display:flex; flex-direction:column; gap:12px; min-width:0; }
  .step-match-results[hidden],.step-review-view[hidden] { display:none!important; }
  .step-review-view > h3 { margin:0; font-size:19px; }
  .step-review-view > .step-button { align-self:flex-start; }
  .step-review-view > strong,.step-review-view > p { overflow-wrap:anywhere; }
  .step-review-view textarea { width:100%; box-sizing:border-box; resize:vertical; padding:10px; border:1px solid #9bb4d4; border-radius:7px; font:14px "Segoe UI",sans-serif; background:#fff; }
  .step-review-status { min-height:24px; color:#314965; }
  .step-scan-issues { margin:0; padding-left:22px; color:#84500b; line-height:1.6; }
  .step-model-stage { min-height:360px; border:1px solid #9bb4d4; border-radius:8px; background:#edf1f7; position:relative; }
  .step-model-stage canvas { display:block; width:100%; height:100%; touch-action:none; }
  .step-model-frame { display:block; width:100%; height:100%; min-height:360px; border:0; border-radius:7px; }
  .step-model-stage { height:440px; }
  .cad-pdf-hidden { display:none!important; }
  .cad-preview-controls { min-width:0; max-width:100%; margin:6px 0; }
  .cad-preview-tabs { display:flex; flex-wrap:wrap; gap:5px; padding:4px 0; }
  .cad-preview-tab { flex:1 1 auto; min-width:42px; min-height:32px; padding:5px 8px; }
  .cad-preview-tab.active { background:#075dcc; border-color:#075dcc; color:#fff; }
  .cad-preview-tab:disabled { cursor:default; }
  .cad-preview-panel { min-height:180px; height:var(--cad-preview-height,180px); margin:5px 0; }
  .cad-preview-panel .step-model-frame { min-height:180px; height:100%; }
  dialog.step-model-shell { display:block; position:relative; inset:auto; margin:0; padding:0; border:0; width:100%; height:100%; max-width:none; max-height:none; box-sizing:border-box; background:#edf1f7; color:#142439; overflow:hidden; border-radius:7px; }
  dialog.step-model-shell:not([open]) { display:none; }
  dialog.step-model-shell.step-model-expanded { display:grid; grid-template-rows:auto minmax(0,1fr) auto; position:fixed; inset:0; margin:auto; width:min(1400px,calc(100dvw - 24px)); height:min(960px,calc(100dvh - 24px)); max-width:calc(100dvw - 24px); max-height:calc(100dvh - 24px); border:2px solid #075dcc; border-radius:12px; box-shadow:0 20px 65px #0007; }
  .step-model-shell::backdrop { background:#071525bb; }
  .step-model-header { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 16px; border-bottom:2px solid #075dcc; background:#fff; font:700 17px "Segoe UI",sans-serif; }
  .step-model-context { margin:0; padding:8px 14px; border-top:1px solid #bccbdd; background:#fff; color:#45566d; font:12px/1.45 "Segoe UI",sans-serif; overflow-wrap:anywhere; }
  .step-model-header[hidden],.step-model-context[hidden] { display:none!important; }
  .step-model-shell.step-model-expanded .step-model-frame { width:100%; height:100%; min-height:0; border-radius:0; }
  .cad-preview-status { margin:5px 0; overflow-wrap:anywhere; line-height:1.45; }
  .cad-preview-download { display:flex; flex-wrap:wrap; gap:6px; }
  .cad-preview-controls [hidden] { display:none!important; }
  .planning-job-card > .cad-preview-controls { grid-column:1/-1; grid-row:2; }
  .planning-job-card > .planning-job-main { grid-column:2; grid-row:1; }
  @media (max-width:600px) { .step-overlay { padding:6px; } .step-panel { max-height:calc(100dvh - 12px); } .step-header,.step-content,.step-status { padding:12px; } }
}
@media print { [data-step-owned],.step-controls,.step-overlay { display:none!important; } }
