/* ReCurve Preview — Bold & Warm Theme */
/* Palette: deep plum bg, dark mauve header/panel, hot pink accent, warm light text */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #2d1f2b; color: #f0dde4; height: 100vh; overflow: hidden; }
#header { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: #3a2838; border-bottom: 1px solid #5a3a52; flex-wrap: nowrap; }
#header h1 { font-size: 18px; color: #e94580; letter-spacing: 1px; margin-right: 0; white-space: nowrap; }
#brand-tagline { font-size: 9px; color: #b89aaa; letter-spacing: 0.5px; font-style: italic; white-space: nowrap; margin-right: 8px; }

/* ===== 3-Column Layout ===== */
#main { display: flex; height: calc(100vh - 45px); overflow: hidden; }
#left-sidebar { width: 240px; min-width: 240px; background: #352530; border-right: 1px solid #5a3a52; display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0; }
/* #step-nav padding set in stepper section below */
#step-content { flex: 1; padding: 0 14px; overflow-y: auto; }
#viewer { flex: 1; position: relative; min-width: 0; overflow: hidden; }
#right-panel { width: 240px; min-width: 240px; padding: 16px; background: #352530; border-left: 1px solid #5a3a52; overflow-y: auto; flex-shrink: 0; }
.right-panel-empty { font-size: 12px; color: #7a5a6a; font-style: italic; padding: 20px 0; }
#right-panel h2 { font-size: 14px; margin-bottom: 10px; color: #e94580; }

/* ===== Horizontal Stepper (top of left sidebar) ===== */
#step-nav { display: flex; align-items: center; justify-content: space-between; gap: 0; padding: 12px 16px 10px; border-bottom: 1px solid #4a2a42; }
.step-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: opacity 0.15s; flex: 1; gap: 4px; }
.step-item:hover { opacity: 0.9; }
.step-item.future { opacity: 0.35; cursor: default; }
.step-item.future:hover { opacity: 0.35; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #5a3a52; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #7a5a6a; flex-shrink: 0; transition: all 0.2s; }
.step-item.current .step-dot { border-color: #e94580; background: #e94580; color: #fff; }
.step-item.completed .step-dot { border-color: #8a5a72; background: #8a5a72; color: #f0dde4; }
.step-label { display: none; }
.step-line { display: none; }

.reset-btn { padding: 5px 12px; font-size: 12px; background: #4a2a42; color: #c8a8b8; border: 1px solid #5a3a52; border-radius: 4px; cursor: pointer; }
.reset-btn:hover { background: #5a3a52; color: #f0dde4; }
#viewer canvas { display: block; }
.measure-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #4a2a42; }
.measure-row.sub { padding-left: 12px; }
.measure-row.sub .measure-label { color: #9a7888; font-size: 12px; }
.measure-row.sub .measure-value { font-size: 13px; }
.measure-row.group-start { margin-top: 10px; border-top: 1px solid #6a4a5a; padding-top: 10px; }
.measure-row.highlight .measure-label { color: #f0dde4; font-size: 14px; }
.measure-row.highlight .measure-value { font-size: 16px; color: #ff6b9d; }
.measure-label { color: #b89aaa; font-size: 13px; }
.measure-value { font-weight: 600; font-size: 14px; }
#loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #b89aaa; font-size: 14px; z-index: 5; }
.band-legend { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.band-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.band-dot.blue { background: #4fc3f7; }
.band-dot.pink { background: #f48fb1; }
.band-dot.amber { background: #ffb74d; }
.band-dot.grey { background: #9e9e9e; }

/* Sagittal plane horizontal sliders */
.hslider-wrap {
  position: absolute;
  left: 80px; right: 0;
  height: 28px;
  z-index: 10;
  display: none;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}
.hslider-wrap.top { top: 4px; }
.hslider-wrap.bottom { bottom: 4px; }
.hslider-label {
  font-size: 10px;
  color: #b89aaa;
  white-space: nowrap;
  min-width: 60px;
}
.hslider-input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #4a2a42;
  outline: none;
}
.hslider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #c87898;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.3);
}
.hslider-value {
  font-size: 10px;
  color: #b89aaa;
  min-width: 30px;
  text-align: right;
}
.band-note { font-size: 10px; color: #7a5a6a; margin-top: 4px; margin-bottom: 8px; }

/* ===== Overlay toggles (left sidebar, below step content) ===== */
#overlay-toggles {
  display: none; /* shown in Step 3+ */
  flex-direction: column;
  gap: 4px;
  padding: 8px 16px;
  border-top: 1px solid #3a2838;
}
.otoggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: #b89aaa; cursor: pointer;
  user-select: none; white-space: nowrap;
}
.otoggle input[type="checkbox"] {
  width: 13px; height: 13px; cursor: pointer;
  accent-color: #e94580;
  flex-shrink: 0;
}
.otoggle-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.otoggle input:not(:checked) ~ .otoggle-dot { opacity: 0.3; }
.otoggle-dot.amber { background: #ffb74d; }
.otoggle-dot.pink { background: #f48fb1; }
.otoggle-dot.lightpink { background: #f8bbd0; }
.otoggle-dot.red { background: #e53935; }
.otoggle-dot.orange { background: #ff8c00; }
.otoggle-dot.blue { background: #3f51b5; }
.otoggle-dot.grey { background: #9e9e9e; }

/* Vertical slider overlay */
#slider-overlay {
  position: absolute;
  left: 10px;
  top: 0; bottom: 0;
  width: 70px;
  display: none;
  z-index: 5;
  pointer-events: none;
}
.vslider-track {
  position: absolute;
  left: 30px;
  width: 2px;
  background: rgba(255,255,255,0.08);
}
.vslider-bracket {
  position: absolute;
  left: 27px;
  width: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  border-top: none;
  border-bottom: none;
  pointer-events: none;
}
.vslider-thumb {
  position: absolute;
  left: 0;
  width: 70px;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translateY(-50%);
  pointer-events: auto;
  cursor: grab;
}
.vslider-thumb:active { cursor: grabbing; }
.vslider-handle {
  width: 36px; height: 6px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
  background: #f48fb1;
}
.vslider-handle.amber { background: #ffb74d; }
.vslider-label {
  font-size: 9px;
  color: #b89aaa;
  white-space: nowrap;
  pointer-events: none;
  background: rgba(45,31,43,0.85);
  padding: 1px 4px;
  border-radius: 3px;
}
/* Auto-detected indicators (not draggable) */
.vslider-auto {
  position: absolute;
  left: 0;
  width: 70px;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translateY(-50%);
  pointer-events: none;
}
.vslider-auto-dot {
  width: 28px; height: 5px;
  border-radius: 2px;
  background: #4fc3f7;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.vslider-auto-dot.pink { background: #f48fb1; }
/* Mode toggle */
.mode-toggle {
  font-size: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #b89aaa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  flex-shrink: 0;
}
.mode-toggle.auto { color: #4fc3f7; border-color: #4fc3f7; }
.mode-toggle.manual { color: #ff8a65; border-color: #ff8a65; }

/* ===== Step Title (current step name, below stepper) ===== */
#step-title { font-size: 16px; font-weight: 600; color: #e94580; padding: 10px 16px 6px; }

/* ===== Step Panels ===== */
.step-panel h2 { font-size: 15px; color: #e94580; margin-bottom: 14px; }
.step-hint { font-size: 11px; color: #9a7a8a; margin-top: 12px; font-style: italic; }
.section-divider { font-size: 10px; color: #7a5a6a; text-transform: uppercase; letter-spacing: 1px; margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid #4a2a42; }

/* ===== Wizard Nav ===== */
#wizard-nav { display: flex; justify-content: space-between; padding: 10px 14px; border-top: 1px solid #4a2a42; flex-shrink: 0; }
.wizard-btn { padding: 6px 16px; font-size: 12px; border-radius: 4px; border: 1px solid #5a3a52; background: transparent; color: #b89aaa; cursor: pointer; }
.wizard-btn:hover:not(:disabled) { background: #4a2a42; color: #f0dde4; }
.wizard-btn:disabled { opacity: 0.3; cursor: default; }
.wizard-btn.primary { background: #e94580; color: #fff; border-color: #e94580; }
.wizard-btn.primary:hover:not(:disabled) { background: #d63570; }
.wizard-btn.primary:disabled { background: #5a3a52; border-color: #5a3a52; color: #9a7a8a; }

/* ===== Import Step ===== */
.scan-name-input { width: 100%; padding: 8px 12px; border-radius: 6px; border: 1px solid #5a3a52; background: #2d1f2b; color: #f0dde4; font-size: 13px; margin-bottom: 12px; }
.scan-name-input::placeholder { color: #7a5a6a; }
.upload-dropzone { border: 2px dashed #5a3a52; border-radius: 8px; padding: 24px 16px; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; margin-bottom: 8px; }
.upload-dropzone:hover, .upload-dropzone.dragover { border-color: #e94580; background: rgba(233,69,128,0.05); }
.upload-icon { font-size: 28px; color: #7a5a6a; margin-bottom: 4px; }
.upload-text { font-size: 11px; color: #9a7a8a; }
.upload-status { font-size: 11px; padding: 4px 0; min-height: 20px; }
.upload-status.loading { color: #b89aaa; }
.upload-status.success { color: #66bb6a; }
.upload-status.error { color: #ef5350; }

.scan-list { max-height: 150px; overflow-y: auto; }
.scan-list-empty { font-size: 11px; color: #7a5a6a; padding: 8px 0; }
.scan-list-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #3a2030; }
.scan-list-name { font-size: 12px; color: #f0dde4; }
.scan-list-meta { font-size: 10px; color: #7a5a6a; }
.scan-list-resume { font-size: 10px; padding: 3px 10px; border-radius: 3px; border: 1px solid #5a3a52; background: transparent; color: #b89aaa; cursor: pointer; }
.scan-list-resume:hover { background: #4a2a42; color: #f0dde4; }

.test-mesh-list { display: flex; flex-wrap: wrap; gap: 4px; }
.test-mesh-btn { font-size: 10px; padding: 4px 8px; border-radius: 3px; border: 1px solid #4a2a42; background: transparent; color: #9a7a8a; cursor: pointer; }
.test-mesh-btn:hover { background: #4a2a42; color: #f0dde4; }

/* ===== Prep Step ===== */
.prep-info { margin-bottom: 12px; }
.prep-info-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; border-bottom: 1px solid #3a2030; }
.prep-info-label { color: #9a7a8a; }
.prep-info-value { color: #f0dde4; font-weight: 500; }
.prep-actions { margin-top: 12px; }
.action-btn { width: 100%; padding: 8px 16px; font-size: 12px; border-radius: 4px; border: 1px solid #66bb6a; background: transparent; color: #66bb6a; cursor: pointer; }
.action-btn:hover { background: rgba(102,187,106,0.1); }

/* ===== Prep Step Controls ===== */
.prep-section-label { font-size: 10px; color: #b89aaa; text-transform: uppercase; letter-spacing: 0.8px; margin: 14px 0 6px; }
.prep-orient-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 4px; margin-bottom: 8px; }
.prep-orient-row.two-col { grid-template-columns: 1fr 1fr; }
.prep-orient-row.five-col { grid-template-columns: 1fr 1fr 1fr 1fr 1fr; }
.prep-orient-sublabel { font-size: 9px; color: #7a5a6a; margin: 6px 0 3px; }
.prep-btn { padding: 6px 8px; font-size: 11px; border-radius: 4px; border: 1px solid #5a3a52; background: transparent; color: #b89aaa; cursor: pointer; white-space: nowrap; }
.prep-btn:hover { background: #4a2a42; color: #f0dde4; }
.prep-btn.small { padding: 4px 10px; font-size: 10px; margin-top: 4px; }
.prep-btn.secondary { border-color: #ef5350; color: #ef5350; }
.prep-btn.secondary:hover { background: rgba(239,83,80,0.1); }
.prep-fine-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.prep-fine-label { font-size: 10px; color: #9a7a8a; min-width: 55px; }
.prep-fine-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 3px; border-radius: 2px; background: #4a2a42; outline: none; }
.prep-fine-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #c87898; cursor: pointer; border: 1px solid rgba(255,255,255,0.2); }
.prep-fine-value { font-size: 10px; color: #b89aaa; min-width: 30px; text-align: right; }
.prep-crop-row { display: flex; flex-direction: column; gap: 6px; }
.prep-crop-field { display: flex; align-items: center; gap: 6px; }
.prep-crop-field label { font-size: 10px; color: #9a7a8a; min-width: 40px; }
.prep-scale-row { display: flex; flex-direction: column; gap: 6px; }
.prep-scale-label { font-size: 11px; color: #9a7a8a; }
.prep-scale-select { padding: 5px 8px; font-size: 11px; border-radius: 4px; border: 1px solid #5a3a52; background: #2d1f2b; color: #f0dde4; }
.prep-actions-row { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* ===== Step Notes (inline at top of each step) ===== */
.step-note { font-size: 11px; color: #9a7a8a; line-height: 1.5; margin-bottom: 14px; padding: 8px 10px; background: rgba(233,69,128,0.04); border-left: 2px solid #5a3a52; border-radius: 0 4px 4px 0; }

/* ===== Inline Technical Notes (bottom of each step) ===== */
.inline-notes { margin-top: 20px; padding-top: 12px; border-top: 1px solid #4a2a42; }

/* ===== Notes (shared styles) ===== */
.notes-section { margin-bottom: 8px; }
.notes-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #9a7a8a; cursor: pointer; padding: 4px 0; user-select: none; }
.notes-toggle:hover { color: #b89aaa; }
.notes-arrow { font-size: 8px; margin-left: auto; }
.notes-content { font-size: 10px; color: #7a5a6a; line-height: 1.5; padding: 4px 0 4px 8px; border-left: 2px solid #3a2030; }
.notes-content p { margin-bottom: 6px; }
.notes-content.collapsed { display: none; }
