:root {
  --olab-orange: var(--orange);
  --olab-orange-dark: var(--orange-dark);
  --olab-carbon: var(--carbon);
  --olab-paper: var(--paper);
  --olab-cream: var(--cream);
  --olab-muted: var(--muted);
  --olab-line: var(--line);
  --olab-shadow: var(--shadow);
}

.organizer-page { background: var(--olab-paper); }

.organizer-intro,
.organizer-app,
.grid-downloads,
.photo-guide {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.organizer-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  padding: 42px 0 26px;
}
.organizer-intro h1 {
  max-width: 1160px;
  margin-bottom: 14px;
  font-size: clamp(46px, 4.45vw, 66px);
  line-height: .95;
  letter-spacing: -.066em;
}
.organizer-intro p { max-width: 900px; margin: 0; color: var(--olab-muted); font-size: clamp(17px, 1.5vw, 21px); }
.prototype-note { flex: 0 0 auto; padding: 16px 0 3px 24px; border-left: 3px solid var(--olab-orange); }
.prototype-note strong, .prototype-note span { display: block; }
.prototype-note strong { font: 700 15px "Space Grotesk", sans-serif; }
.prototype-note span { margin-top: 3px; color: var(--olab-muted); font-size: 12px; }

.organizer-app { padding-bottom: 28px; }
.step-rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 0;
  margin: 0 0 22px;
  list-style: none;
}
.step-rail li { position: relative; display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 12px; min-width: 0; }
.step-rail li:not(:last-child)::after { content: ""; position: absolute; z-index: 0; top: 24px; left: calc(48px + 82px); right: 16px; height: 1px; background: rgba(32,32,31,.3); }
.step-rail li > span { position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; color: white; background: #a9a49d; font: 700 19px "Space Grotesk", sans-serif; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px)); }
.step-rail strong, .step-rail small { display: block; }
.step-rail strong { font: 700 15px "Space Grotesk", sans-serif; }
.step-rail small { margin-top: 2px; color: var(--olab-muted); font-size: 12px; }
.step-rail li.active > span, .step-rail li.complete > span { background: var(--olab-orange); }
.step-rail li.active strong { color: var(--olab-orange-dark); }

.app-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.12fr) minmax(330px, .88fr) minmax(248px, .46fr);
  border: 1px solid var(--olab-carbon);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.25);
  box-shadow: var(--olab-shadow);
}
.photo-panel, .preview-panel, .parameter-panel { min-width: 0; padding: 20px; }
.photo-panel, .preview-panel { border-right: 1px solid var(--olab-carbon); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; min-height: 52px; gap: 18px; }
.panel-heading h2, .parameter-panel h2 { margin-bottom: 4px; font-size: 20px; line-height: 1.1; letter-spacing: -.035em; }
.panel-heading p { margin: 0; color: var(--olab-muted); font-size: 12px; }
.text-action { padding: 4px 0; border: 0; color: var(--olab-orange-dark); background: transparent; font: 800 12px "DM Sans", sans-serif; cursor: pointer; }
.calibration-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 9px; }
.calibration-option { display: grid; gap: 2px; min-height: 52px; padding: 9px 11px; border: 1px solid var(--olab-line); border-radius: 9px; color: var(--olab-carbon); background: rgba(255,255,255,.46); cursor: pointer; text-align: left; }
.calibration-option strong { font: 700 12px "Space Grotesk", sans-serif; }
.calibration-option span { color: var(--olab-muted); font: 600 9px "DM Sans", sans-serif; }
.calibration-option.active { border-color: var(--olab-orange); box-shadow: inset 0 0 0 1px var(--olab-orange); background: rgba(255,75,22,.055); }
.calibration-option.active span { color: var(--olab-orange-dark); }
.calibration-option:disabled { cursor: not-allowed; opacity: .55; }
.calibration-sheet-download { display: flex; align-items: center; gap: 10px; min-height: 46px; margin-bottom: 12px; padding: 7px 11px; color: white; background: var(--olab-carbon); border-radius: 9px; text-decoration: none; }
.calibration-sheet-download svg { flex: 0 0 auto; width: 20px; fill: none; stroke: var(--olab-orange); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.calibration-sheet-download strong, .calibration-sheet-download small { display: block; }
.calibration-sheet-download strong { font: 700 11px "Space Grotesk", sans-serif; }
.calibration-sheet-download small { margin-top: 1px; color: rgba(255,255,255,.66); font-size: 8px; }

.photo-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 410px;
  overflow: hidden;
  background: #f1eee8;
  border: 1px solid rgba(32,32,31,.24);
  border-radius: 12px;
}
.photo-stage canvas { display: none; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.photo-stage.has-photo canvas { display: block; }
.photo-stage.has-photo .upload-empty { display: none; }
.upload-empty { display: grid; justify-items: center; gap: 10px; width: calc(100% - 30px); padding: 52px 20px; color: var(--olab-orange-dark); border: 1px dashed var(--olab-orange); cursor: pointer; text-align: center; }
.upload-empty svg { width: 38px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.upload-empty strong { font: 700 18px "Space Grotesk", sans-serif; }
.upload-empty span { color: var(--olab-muted); font-size: 13px; }
#photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-tools { display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; margin-top: 14px; }
.photo-tools[hidden] { display: none; }
.instruction { grid-column: 1 / -1; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 8px; background: var(--olab-cream); }
.instruction > span { display: grid; place-items: center; width: 28px; height: 28px; color: white; background: var(--olab-orange); font: 700 13px "Space Grotesk", sans-serif; }
.instruction p { margin: 0; font-size: 13px; font-weight: 700; }
.instruction.error { color: #8f2d16; background: #f5d7ca; }
.instruction.success { color: #1f6335; background: #d9efdf; }
.threshold-control { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 12px; color: var(--olab-muted); font-size: 11px; font-weight: 700; }
.threshold-control input { grid-column: 1 / -1; width: 100%; accent-color: var(--olab-orange); }
.threshold-control output { color: var(--olab-carbon); }
.small-button { align-self: end; min-height: 38px; padding: 0 13px; border: 1px solid var(--olab-line); border-radius: 8px; color: var(--olab-carbon); background: transparent; font: 800 11px "DM Sans", sans-serif; cursor: pointer; }
.ai-detect-button { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border: 1px solid var(--olab-carbon); border-radius: 8px; color: var(--olab-carbon); background: rgba(255,255,255,.5); font: 800 12px "DM Sans", sans-serif; cursor: pointer; }
.ai-detect-button span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: white; background: var(--olab-orange); font-size: 9px; letter-spacing: .04em; }
.ai-detect-button small { color: var(--olab-orange-dark); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.ai-detect-button:disabled { cursor: not-allowed; opacity: .48; }
.ai-note { grid-column: 1 / -1; margin: -5px 0 0; color: var(--olab-muted); font-size: 10px; line-height: 1.45; }
.ai-progress { grid-column: 1 / -1; display: grid; gap: 9px; padding: 12px 13px; border: 1px solid rgba(232,93,42,.38); border-radius: 9px; background: rgba(255,255,255,.54); }
.ai-progress[hidden] { display: none; }
.ai-progress-heading { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; }
.ai-symbol { display: grid; place-items: center; width: 28px; height: 28px; color: white; background: var(--olab-orange); border-radius: 50%; font: 800 9px "DM Sans", sans-serif; letter-spacing: .05em; }
.ai-progress-heading strong, .ai-progress-heading small { display: block; }
.ai-progress-heading strong { font: 700 11px "Space Grotesk", sans-serif; }
.ai-progress-heading small { margin-top: 2px; color: var(--olab-muted); font-size: 9px; }
.ai-progress-heading b { color: var(--olab-orange-dark); font: 700 11px "Space Grotesk", sans-serif; }
.ai-progress progress { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 20px; background: rgba(40,40,39,.12); accent-color: var(--olab-orange); }
.ai-progress progress::-webkit-progress-bar { background: rgba(40,40,39,.12); border-radius: 20px; }
.ai-progress progress::-webkit-progress-value { background: var(--olab-orange); border-radius: 20px; transition: width .3s ease; }
.ai-progress progress::-moz-progress-bar { background: var(--olab-orange); border-radius: 20px; }
.ai-progress.complete { border-color: rgba(37,115,62,.34); }
.ai-progress.complete .ai-symbol, .ai-progress.complete progress::-webkit-progress-value { background: #25733e; }
.ai-progress.complete .ai-progress-heading b { color: #25733e; }
.ai-progress.error { border-color: rgba(166,54,24,.32); background: #fff6f2; }
.ai-progress.error .ai-symbol { background: #a63618; }
.contour-editor { grid-column: 1 / -1; border-top: 1px solid var(--olab-line); }
.contour-editor[hidden] { display: none; }
.contour-editor summary { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 2px 6px; cursor: pointer; list-style: none; }
.contour-editor summary::-webkit-details-marker { display: none; }
.contour-editor summary::after { content: "+"; grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--olab-orange-dark); font: 500 22px "Space Grotesk", sans-serif; }
.contour-editor[open] summary::after { content: "−"; }
.contour-editor summary span { font: 700 13px "Space Grotesk", sans-serif; }
.contour-editor summary small { color: var(--olab-muted); font-size: 9px; }
.contour-editor-body { display: grid; gap: 12px; padding: 9px 0 2px; }
.compare-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.compare-row[hidden] { display: none; }
.compare-row > span { color: var(--olab-muted); font-size: 10px; font-weight: 800; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; max-width: 156px; border: 1px solid var(--olab-line); border-radius: 7px; overflow: hidden; }
.segmented-control button { min-height: 34px; padding: 0 12px; border: 0; color: var(--olab-muted); background: rgba(255,255,255,.45); font: 800 10px "DM Sans", sans-serif; cursor: pointer; }
.segmented-control button + button { border-left: 1px solid var(--olab-line); }
.segmented-control button.active { color: white; background: var(--olab-orange); }
.undo-ai { min-height: 34px; padding: 0; border: 0; color: var(--olab-orange-dark); background: transparent; font: 800 10px "DM Sans", sans-serif; cursor: pointer; }
.editor-controls { display: grid; grid-template-columns: auto minmax(120px, 1fr); gap: 12px; align-items: end; }
.edit-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.edit-mode button, .editor-actions button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 11px; border: 1px solid var(--olab-line); border-radius: 7px; color: var(--olab-carbon); background: rgba(255,255,255,.55); font: 800 10px "DM Sans", sans-serif; cursor: pointer; }
.edit-mode button.active { color: white; border-color: var(--olab-orange); background: var(--olab-orange); }
.edit-mode svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.brush-control { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; color: var(--olab-muted); font-size: 9px; font-weight: 800; }
.brush-control input { grid-column: 1 / -1; width: 100%; accent-color: var(--olab-orange); }
.brush-control output { color: var(--olab-carbon); }
.editor-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.editor-actions .apply-edits:not(:disabled) { color: white; border-color: var(--olab-carbon); background: var(--olab-carbon); }
.edit-mode button:disabled, .editor-actions button:disabled { cursor: not-allowed; opacity: .4; }
.editor-help { margin: 0; color: var(--olab-muted); font-size: 9px; line-height: 1.45; }
.photo-stage.is-editing { border-color: var(--olab-orange); box-shadow: inset 0 0 0 1px var(--olab-orange); }
.photo-stage.edit-add canvas { cursor: cell; }
.photo-stage.edit-remove canvas { cursor: not-allowed; }
.small-button:disabled { opacity: .38; cursor: not-allowed; }
.local-note { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 14px 0 0; color: var(--olab-muted); font-size: 11px; }
.local-note svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.preview-panel { display: flex; flex-direction: column; }
.view-label { color: var(--olab-muted); font-size: 11px; font-weight: 700; }
#preview-canvas { width: 100%; flex: 1; min-height: 410px; background: #fbfaf7; border: 1px solid rgba(32,32,31,.16); border-radius: 12px; }
.preview-summary { display: flex; justify-content: space-between; gap: 18px; padding: 14px 4px 0; font-size: 12px; }
.preview-summary strong { color: var(--olab-orange-dark); font: 700 13px "Space Grotesk", sans-serif; }
.preview-summary span { color: var(--olab-muted); text-align: right; }

.parameter-panel { background: rgba(255,255,255,.34); }
.parameter-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.parameter-heading p { margin: 3px 0 0; color: var(--olab-muted); font-size: 11px; }
.parameter-toggle { display: none; min-height: 42px; padding: 0 13px; border: 1px solid var(--olab-carbon); border-radius: 8px; color: var(--olab-carbon); background: transparent; font: 800 11px "DM Sans", sans-serif; }
.field-stack { display: grid; gap: 17px; }
.field-stack > label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.number-input { display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 44px; border: 1px solid var(--olab-line); border-radius: 8px; background: rgba(255,255,255,.72); }
.field-help { display: block; margin-top: 5px; color: var(--olab-muted); font-size: 9px; font-weight: 600; line-height: 1.4; }
.number-input input, .number-input select { width: 100%; min-width: 0; height: 42px; padding: 0 11px; border: 0; outline: 0; color: var(--olab-carbon); background: transparent; font: 700 14px "DM Sans", sans-serif; }
.number-input b { padding-right: 11px; color: var(--olab-muted); font-size: 11px; }
.module-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.module-fields label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; }
.module-fields input { min-width: 0; width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--olab-line); border-radius: 8px; color: var(--olab-carbon); background: rgba(255,255,255,.72); font: 700 14px "DM Sans", sans-serif; }
.generate-button, .download-button { width: 100%; min-height: 52px; margin-top: 22px; border: 0; font: 800 14px "DM Sans", sans-serif; cursor: pointer; }
.generate-button { display: flex; align-items: center; justify-content: center; gap: 12px; color: white; background: var(--olab-orange); clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.generate-button svg, .download-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.generate-button:disabled { opacity: .38; cursor: not-allowed; }
.download-button { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 10px; border-radius: 8px; color: var(--olab-carbon); background: #dfdcd6; }
.download-button:not(:disabled) { color: white; background: var(--olab-carbon); }
.download-button:disabled { opacity: .6; cursor: not-allowed; }
.generation-status { min-height: 34px; margin: 9px 0 17px; color: var(--olab-muted); font-size: 11px; line-height: 1.4; }
.generation-status.error { color: #a63618; }
.generation-status.success { color: #25733e; font-weight: 700; }
.format-note { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 13px; border-radius: 12px; background: rgba(32,32,31,.055); }
.format-note svg { width: 25px; fill: none; stroke: var(--olab-carbon); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.format-note strong, .format-note span { display: block; }
.format-note strong { font-size: 11px; }
.format-note span { margin-top: 2px; color: var(--olab-muted); font-size: 10px; line-height: 1.4; }

.grid-downloads { padding: 66px 0 78px; }
.grid-downloads-heading { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); align-items: end; gap: 42px; margin-bottom: 28px; }
.section-kicker { display: block; margin-bottom: 10px; color: var(--olab-orange-dark); font: 800 12px "DM Sans", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.grid-downloads h2 { max-width: 840px; margin: 0; font-size: clamp(34px, 4.4vw, 62px); line-height: .96; letter-spacing: -.058em; }
.grid-downloads-heading > p { max-width: 470px; margin: 0; color: var(--olab-muted); font-size: 15px; line-height: 1.55; }
.grid-download-list { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--olab-carbon); border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.25); box-shadow: var(--olab-shadow); }
.grid-download-card { position: relative; display: grid; grid-template-columns: 118px 1fr; align-items: center; gap: 22px; min-width: 0; padding: 28px; border-right: 1px solid var(--olab-carbon); }
.grid-download-card:last-child { border-right: 0; }
.grid-download-card.featured { background: var(--olab-cream); }
.recommended-badge { position: absolute; top: 14px; right: 14px; padding: 5px 9px; color: white; background: var(--olab-orange); font: 800 10px "DM Sans", sans-serif; letter-spacing: .04em; text-transform: uppercase; clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }
.baseplate-visual { display: grid; gap: 3px; align-self: center; justify-self: center; height: 166px; max-width: 112px; padding: 7px; border: 2px solid var(--olab-carbon); border-radius: 7px; background: var(--olab-orange); box-shadow: 7px 7px 0 rgba(40,40,39,.12); transform: rotate(-4deg); }
.baseplate-visual span { display: block; min-width: 15px; min-height: 15px; border: 1px solid rgba(40,40,39,.74); border-radius: 3px; background: var(--olab-paper); box-shadow: inset 0 0 0 2px rgba(232,93,42,.18); }
.grid-card-label { color: var(--olab-orange-dark); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.grid-card-copy h3 { margin: 5px 0 4px; font-size: 23px; letter-spacing: -.04em; }
.grid-card-copy p { margin: 0; color: var(--olab-carbon); font-size: 14px; font-weight: 700; }
.grid-card-copy small { display: block; margin-top: 4px; color: var(--olab-muted); font-size: 10px; }
.grid-download-button { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; margin-top: 2px; color: white; background: var(--olab-carbon); font: 800 13px "DM Sans", sans-serif; text-decoration: none; clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px); }
.featured .grid-download-button { background: var(--olab-orange); }
.grid-download-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.grid-standard-note { display: flex; align-items: center; gap: 18px; padding: 17px 20px; color: white; background: var(--olab-carbon); }
.grid-standard-note strong { flex: 0 0 auto; font: 700 13px "Space Grotesk", sans-serif; }
.grid-standard-note span { color: rgba(255,255,255,.72); font-size: 11px; }

.mobile-download-bar { display: none; }
.mobile-download-bar[hidden] { display: none !important; }

.photo-guide { padding: 30px 0 85px; border-top: 1px solid var(--olab-line); }
.photo-guide h2 { margin: 0 0 24px; font-size: clamp(27px, 3vw, 38px); }
.photo-guide ol { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin: 0; list-style: none; }
.photo-guide li { display: grid; grid-template-columns: 42px 1fr; gap: 15px; padding: 0 34px; border-left: 1px solid var(--olab-line); }
.photo-guide li:first-child { padding-left: 0; border-left: 0; }
.photo-guide li > span { display: grid; place-items: center; width: 38px; height: 38px; color: white; background: var(--olab-orange); font: 700 15px "Space Grotesk", sans-serif; }
.photo-guide strong { font: 700 15px "Space Grotesk", sans-serif; }
.photo-guide p { margin: 5px 0 0; color: var(--olab-muted); font-size: 13px; }
.prototype-limit { max-width: 960px; padding-top: 24px; }
.prototype-limit strong { color: var(--olab-carbon); font-family: "DM Sans", sans-serif; }

@media (hover: hover) {
  .generate-button:not(:disabled), .download-button:not(:disabled), .small-button:not(:disabled), .upload-empty, .text-action, .grid-download-button, .calibration-option:not(:disabled), .calibration-sheet-download, .ai-detect-button:not(:disabled), .edit-mode button, .editor-actions button:not(:disabled) { transition: transform .18s ease, background .18s ease, opacity .18s ease; }
  .generate-button:not(:disabled):hover, .download-button:not(:disabled):hover, .small-button:not(:disabled):hover, .grid-download-button:hover, .calibration-sheet-download:hover { transform: translateY(-2px); }
  .generate-button:not(:disabled):hover { background: var(--olab-orange-dark); }
  .upload-empty:hover { background: rgba(255,75,22,.04); }
}

@media (max-width: 1120px) {
  .app-grid { grid-template-columns: 1fr 1fr; }
  .preview-panel { border-right: 0; }
  .parameter-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 180px 1fr 230px; gap: 22px; align-items: start; border-top: 1px solid var(--olab-carbon); }
  .parameter-heading { grid-column: 1; grid-row: 1; margin: 4px 0 0; }
  .field-stack { grid-template-columns: repeat(3, 1fr); }
  .module-fields { grid-column: 1 / -1; max-width: 280px; }
  .parameter-panel .generate-button { margin-top: 0; }
  .parameter-panel .download-button { grid-column: 3; margin-top: -10px; }
  .generation-status { grid-column: 3; margin: -8px 0 0; }
  .format-note { grid-column: 1 / 3; grid-row: 2; }
  .grid-download-card { grid-template-columns: 94px 1fr; padding: 22px; }
  .baseplate-visual { height: 145px; max-width: 98px; }
}

@media (max-width: 800px) {
  .organizer-intro { align-items: start; padding-top: 50px; }
  .organizer-intro h1 { font-size: clamp(46px, 11vw, 68px); }
  .prototype-note { display: none; }
  .step-rail { grid-template-columns: repeat(5, auto); justify-content: space-between; }
  .step-rail li { display: block; }
  .step-rail li:not(:last-child)::after { left: 47px; right: auto; width: calc((100vw - 48px - 240px) / 4); }
  .step-rail li div { display: none; }
  .app-grid { grid-template-columns: 1fr; }
  .photo-panel, .preview-panel { border-right: 0; border-bottom: 1px solid var(--olab-carbon); }
  .parameter-panel { grid-column: auto; display: block; border-top: 0; }
  .parameter-heading { align-items: center; margin-bottom: 0; }
  .parameter-toggle { display: block; flex: 0 0 auto; }
  .parameter-panel.is-open .parameter-heading { margin-bottom: 20px; }
  .parameter-panel:not(.is-open) .field-stack,
  .parameter-panel:not(.is-open) .generate-button,
  .parameter-panel:not(.is-open) .download-button,
  .parameter-panel:not(.is-open) .format-note { display: none; }
  .field-stack { grid-template-columns: 1fr; }
  .module-fields { max-width: none; }
  .parameter-panel .generate-button { margin-top: 22px; }
  .parameter-panel .download-button { margin-top: 10px; }
  .generation-status { margin-top: 9px; }
  .format-note { margin-top: 16px; }
  .grid-downloads { padding: 54px 0 62px; }
  .grid-downloads-heading { grid-template-columns: 1fr; gap: 15px; }
  .grid-downloads h2 { font-size: clamp(34px, 8vw, 52px); }
  .grid-download-list { grid-template-columns: 1fr; }
  .grid-download-card { grid-template-columns: 112px 1fr; border-right: 0; border-bottom: 1px solid var(--olab-carbon); }
  .grid-download-card:last-child { border-bottom: 0; }
  .baseplate-visual { height: 150px; }
  .grid-standard-note { align-items: flex-start; flex-direction: column; gap: 5px; }
  .photo-guide ol { grid-template-columns: 1fr; gap: 24px; }
  .photo-guide li, .photo-guide li:first-child { padding: 0 0 24px; border-left: 0; border-bottom: 1px solid var(--olab-line); }
}

@media (max-width: 520px) {
  .organizer-intro, .organizer-app, .grid-downloads, .photo-guide { width: min(calc(100% - 28px), var(--max)); }
  .organizer-intro { padding: 34px 0 24px; }
  .organizer-intro h1 { font-size: 40px; line-height: .98; }
  .organizer-intro p { font-size: 16px; }
  .step-rail li > span { width: 42px; height: 42px; font-size: 16px; }
  .step-rail li:not(:last-child)::after { top: 21px; left: 41px; width: calc((100vw - 28px - 210px) / 4); }
  .photo-panel, .preview-panel, .parameter-panel { padding: 15px; }
  .photo-stage, #preview-canvas { min-height: 300px; }
  .photo-tools { grid-template-columns: 1fr; }
  .calibration-choice { grid-template-columns: 1fr; }
  .small-button { width: 100%; }
  .compare-row { grid-template-columns: 1fr auto; }
  .compare-row > span { grid-column: 1 / -1; }
  .undo-ai { padding-inline: 8px; }
  .editor-controls { grid-template-columns: 1fr; }
  .brush-control, .editor-actions { grid-column: auto; }
  .local-note { align-items: flex-start; text-align: left; }
  .grid-download-card { grid-template-columns: 92px 1fr; gap: 17px; padding: 22px 18px; }
  .baseplate-visual { height: 132px; max-width: 82px; padding: 5px; gap: 2px; }
  .grid-card-copy h3 { font-size: 21px; }
  .grid-download-button { min-height: 54px; font-size: 14px; }
  .organizer-page.download-ready { padding-bottom: 92px; }
  .mobile-download-bar { position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 11px max(14px, env(safe-area-inset-right)) calc(11px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); color: white; background: var(--olab-carbon); border-top: 1px solid rgba(255,255,255,.18); box-shadow: 0 -8px 24px rgba(0,0,0,.18); }
  .mobile-download-bar span, .mobile-download-bar strong { display: block; }
  .mobile-download-bar span { color: rgba(255,255,255,.72); font-size: 10px; }
  .mobile-download-bar strong { margin-top: 2px; font: 700 12px "Space Grotesk", sans-serif; }
  .mobile-download-bar button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 52px; padding: 0 16px; border: 0; color: white; background: var(--olab-orange); font: 800 13px "DM Sans", sans-serif; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
  .mobile-download-bar svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
}

@media (prefers-reduced-motion: reduce) {
  .generate-button, .download-button, .small-button, .upload-empty, .text-action { transition: none !important; }
}

/* One action at a time; retain the existing brand and geometric preview. */
.organizer-page [hidden] { display: none !important; }
.experience-hint { margin: 0 0 14px; color: var(--olab-orange-dark); font-weight: 700; }
.app-grid[data-stage="photo"] { grid-template-columns: 1fr; max-width: 720px; margin-inline: auto; }
.app-grid[data-stage="photo"] .photo-panel { border: 0; }
.app-grid[data-stage="result"] { grid-template-columns: 1fr 1fr; }
.app-grid[data-stage="result"] .preview-panel { border-right: 0; }
.app-grid .parameter-panel { grid-column: 1 / -1; display: block; border-top: 1px solid var(--olab-carbon); }
.app-grid .parameter-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.app-grid .parameter-toggle { display: block; }
.app-grid .field-stack { grid-template-columns: 1fr; max-width: 560px; margin-top: 22px; }
.app-grid .parameter-panel #download-button:not([hidden]),
.app-grid .parameter-panel #generate-button:not([hidden]) { display: flex; max-width: 560px; margin-top: 18px; }
.app-grid .parameter-panel .generation-status { margin: 12px 0 0; }
.photo-preparation, .contour-options, .ready-grids { margin: 12px 0; }
.photo-preparation > summary, .contour-options > summary, .background-options > summary,
.ready-grids > summary, .photo-guide > summary { min-height: 44px; padding-block: 12px; color: var(--olab-orange-dark); font: 700 13px "DM Sans", sans-serif; cursor: pointer; }
.photo-preparation p { font-size: 13px; line-height: 1.5; color: var(--olab-muted); }
.contour-options { grid-column: 1 / -1; }
.contour-options .threshold-control { margin-top: 12px; }
.contour-options .small-button { margin-top: 12px; }
.grid-offer { max-width: 560px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--olab-line); }
.grid-offer h3 { margin: 0 0 8px; }
.grid-offer p { color: var(--olab-muted); font-size: 13px; line-height: 1.5; }
.grid-offer .text-action { margin-top: 16px; min-height: 44px; }
.organizer-page #matching-grid-download { display: flex; }
.grid-entry { width: min(calc(100% - 40px), var(--max)); margin: 12px auto; }
.grid-entry button { min-height: 44px; }
.photo-guide { padding-block: 18px; }
.photo-guide[open] > summary { margin-bottom: 18px; }
@media (max-width: 800px) {
  .app-grid[data-stage="result"] { grid-template-columns: 1fr; }
  .app-grid .parameter-heading { align-items: start; flex-direction: column; }
  .app-grid .photo-panel { border-right: 0; }
}
@media (max-width: 520px) {
  .app-grid .parameter-panel #download-button:not([hidden]) { display: none; }
  .organizer-page:not(.download-ready) .parameter-panel #download-button:not([hidden]) { display: flex; }
  .grid-entry { width: calc(100% - 28px); }
}

/* Mobile control language: soft geometry, one task and comfortable touch targets. */
.touch-stepper { display: block; }
.touch-stepper > button, .touch-select-value, .touch-choices { display: none; }
.touch-precision { display: contents; }
.touch-precision > summary { display: none; }
.touch-precision > .number-input { display: flex; }
.mobile-sheet { color: var(--olab-carbon); }
@media (max-width: 520px) {
  .organizer-app, .mobile-sheet, .grid-downloads, .mobile-download-bar { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
  .organizer-intro h1 { font-size: 34px; line-height: 1.06; letter-spacing: -.035em; }
  .organizer-page button, .organizer-page .grid-download-button, .organizer-page .calibration-sheet-link { min-height: 44px; border-radius: 14px; clip-path: none; touch-action: manipulation; }
  .organizer-app button, .mobile-sheet button, .grid-downloads button { font-family: inherit; font-size: 15px; }
  .organizer-page button:focus-visible, .organizer-page summary:focus-visible, .organizer-page input:focus-visible, .organizer-page select:focus-visible { outline: 3px solid var(--olab-orange); outline-offset: 3px; }
  .organizer-app .app-grid { border: 1px solid var(--olab-line); border-radius: 22px; box-shadow: 0 8px 28px rgba(40,40,39,.05); }
  .photo-stage { min-height: 260px; border-radius: 16px; }
  .upload-empty { border-radius: 14px; }
  .photo-tools .instruction { border-radius: 14px; }
  .photo-preparation > summary, .contour-options > summary, .background-options > summary, .photo-guide > summary, .ready-grids > summary { font-size: 15px; line-height: 1.4; }
  .generation-status, .grid-offer p, .panel-heading p, .field-help { font-size: 14px; line-height: 1.45; }
  .mobile-download-bar { background: rgba(250,247,237,.95); color: var(--olab-carbon); border-top: 1px solid var(--olab-line); box-shadow: 0 -4px 24px rgba(40,40,39,.08); backdrop-filter: blur(16px); }
  .mobile-download-bar span { color: var(--olab-muted); font-size: 12px; }
  .mobile-download-bar strong { font-size: 13px; }
  .mobile-download-bar button { min-height: 52px; font-size: 15px; border-radius: 14px; }
  .touch-stepper { display: flex; align-items: center; width: 100%; min-width: 0; gap: 8px; }
  .touch-stepper > button { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 0; border: 0; color: var(--olab-carbon); background: rgba(40,40,39,.07); border-radius: 12px; }
  .touch-stepper > button:disabled { opacity: .3; }
  .touch-stepper svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .touch-stepper > input { width: 0; flex: 1; min-width: 0; padding: 10px 4px; text-align: center; font: 600 17px -apple-system, BlinkMacSystemFont, sans-serif; border: 0; border-radius: 10px; background: transparent; appearance: textfield; }
  .touch-stepper > input::-webkit-inner-spin-button, .touch-stepper > input::-webkit-outer-spin-button { appearance: none; margin: 0; }
  .touch-stepper > select { display: none; }
  .touch-select-value { display: block; flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
  .number-input { gap: 8px; border-radius: 14px; }
  .module-fields .touch-stepper { padding: 6px; background: rgba(40,40,39,.035); border-radius: 14px; }
  .touch-choices { display: flex; gap: 4px; padding: 4px; background: rgba(40,40,39,.07); border-radius: 14px; }
  .touch-choices button { flex: 1; border: 0; background: transparent; color: var(--olab-muted); border-radius: 10px; }
  .touch-choices button[aria-pressed="true"] { color: var(--olab-carbon); background: var(--olab-paper, #faf7ed); box-shadow: 0 1px 5px rgba(40,40,39,.12); font-weight: 600; }
  .touch-precision { display: block; margin-top: 8px; }
  .touch-precision > summary { display: list-item; min-height: 44px; padding: 12px 0; font-size: 14px; color: var(--olab-orange-dark); cursor: pointer; }
  .touch-precision:not([open]) > .number-input { display: none; }
  .mobile-sheet-open { overflow: hidden; }
  .mobile-sheet { position: fixed; inset: auto 0 0; box-sizing: border-box; width: 100%; max-width: none; max-height: 88vh; max-height: 88dvh; margin: 0; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); border: 0; border-radius: 24px 24px 0 0; background: #faf7ed; overflow-y: auto; overscroll-behavior: contain; animation: sheet-rise .2s ease-out; }
  .mobile-sheet::backdrop { background: rgba(25,25,24,.32); backdrop-filter: blur(3px); }
  .mobile-sheet[open] { display: flex; flex-direction: column; overflow: hidden; }
  #mobile-sheet-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .mobile-sheet-heading { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 14px; background: #faf7ed; border-bottom: 1px solid var(--olab-line); }
  .mobile-sheet-heading h2 { margin: 0; font: 700 22px -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: -.02em; }
  .mobile-sheet-heading button { padding: 0 14px; border: 0; background: rgba(40,40,39,.06); color: var(--olab-orange-dark); font-weight: 600; }
  .mobile-sheet .field-stack { display: grid; gap: 20px; margin: 22px 0; }
  .mobile-sheet .field-stack > label > span:first-child { display: block; margin-bottom: 8px; font-weight: 600; }
  .mobile-sheet .module-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .mobile-sheet .field-help { display: block; margin-top: 8px; }
  .mobile-sheet #generate-button { position: sticky; bottom: 0; width: 100%; min-height: 52px; margin-top: 18px; }
  .mobile-sheet > #generate-button, .mobile-sheet > #custom-grid-generate { flex: 0 0 auto; width: 100%; min-height: 52px; margin-top: 18px; }
  .mobile-sheet .grid-downloads { width: 100%; margin: 0; padding: 20px 0 0; }
  .mobile-sheet .grid-downloads-heading { display: none; }
  .mobile-sheet .grid-download-list { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .mobile-sheet .grid-download-card { padding: 18px 0; border: 0; }
  .mobile-sheet .grid-download-card:has(#custom-grid-preview) { display: block; padding: 16px 0 0; }
  .mobile-sheet #custom-grid-title, .mobile-sheet #custom-grid-preview { display: none; }
  .mobile-sheet #custom-grid-summary { font-size: 17px; font-weight: 600; }
  .mobile-sheet #custom-grid-fit { font-size: 13px; }
  .mobile-sheet .grid-download-card:has(#custom-grid-extra) { display: block; }
  .mobile-sheet .grid-download-card .grid-card-label { display: none; }
  .mobile-sheet .grid-card-copy small { font-size: 13px; line-height: 1.45; }
  .mobile-sheet .grid-download-card .module-fields { margin-bottom: 20px; }
  .mobile-sheet #custom-grid-download { display: none; }
  .mobile-sheet .grid-standard-note { font-size: 13px; }
  @keyframes sheet-rise { from { transform: translateY(24px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { .mobile-sheet { animation: none; } }

/* Contour editing stays readable at phone widths and with enlarged text. */
#ai-refine-edits { width: 100%; margin: 0; }
@media (max-width: 800px) {
  .photo-panel, .preview-panel, .parameter-panel, .photo-tools,
  .contour-editor-body, .ai-progress-heading > div { min-width: 0; }
  .ai-note, .editor-help, .brush-control, .threshold-control,
  .contour-editor summary small, .compare-row > span, .local-note { font-size: 14px; line-height: 1.5; }
  .ai-note { margin: 10px 0; }
  .ai-progress-heading strong, .ai-progress-heading small, .ai-progress-heading b { font-size: 13px; line-height: 1.4; }
  .contour-editor summary span, .instruction p { font-size: 15px; line-height: 1.45; }
  .contour-editor summary small { grid-column: 1; }
  .editor-controls { grid-template-columns: 1fr; align-items: stretch; }
  .brush-control, .editor-actions { grid-column: 1; }
  .edit-mode button, .editor-actions button, .segmented-control button,
  .undo-ai, .ai-detect-button { min-height: 44px; font-size: 14px; line-height: 1.4; padding: 10px; white-space: normal; }
  .ai-detect-button { flex-wrap: wrap; }
  .ai-detect-button span { flex: 0 0 26px; }
  .ai-detect-button small { font-size: 11px; }
  .editor-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .local-note { align-items: flex-start; overflow-wrap: anywhere; }
  .local-note svg { flex: 0 0 18px; }
  .brush-control input, .threshold-control input { min-height: 36px; }
  .brush-control output { grid-column: 2; grid-row: 1; }
  .brush-control input { grid-row: 2; }
  .calibration-option strong, .calibration-sheet-download strong { font-size: 15px; line-height: 1.4; }
  .calibration-option span, .calibration-sheet-download small, .upload-empty span { font-size: 14px; line-height: 1.45; }
  .compare-row { grid-template-columns: minmax(0, 1fr) auto; }
  .compare-row > span { grid-column: 1 / -1; }
  .segmented-control { max-width: none; }
}
@media (max-width: 520px) {
  .organizer-page.download-ready { scroll-padding-bottom: 120px; }
  .organizer-app button, .organizer-app summary { scroll-margin-bottom: 120px; }
}
