/* ============================================================
   ClinicAI — Face Mapping / Análise Facial
   Branding: Clínica Mirian de Paula
   ============================================================ */

/* API offline banner */
.fm-api-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; margin: 0 0 12px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #F59E0B; border-radius: 8px;
  color: #92400E; font-size: 12px; font-weight: 500;
  line-height: 1.4;
}
.fm-api-banner svg { flex-shrink: 0; color: #D97706; }

/* ── Variables ─────────────────────────────────────────────── */
.fm-page {
  --fm-champagne: #C8A97E;
  --fm-champagne-light: #DFC5A0;
  --fm-champagne-dark: #A8895E;
  --fm-graphite: #2C2C2C;
  --fm-graphite-light: #4A4A4A;
  --fm-ivory: #F5F0E8;
  --fm-sage: #8A9E88;
  --fm-rosa: #C4937A;
  --fm-bege: #E8DDD0;

  /* Zone colors */
  --fm-zone-ah: #3B82F680;
  --fm-zone-bio: #10B98180;
  --fm-zone-laser: #F59E0B80;
  --fm-zone-botox: #8B5CF680;
  --fm-zone-peel: #EC489980;
  --fm-zone-fio: #06B6D480;
}

/* ── Page layout ───────────────────────────────────────────── */
.fm-page {
  height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', 'Montserrat', sans-serif;
}

.fm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(200,169,126,0.1);
  background: #0A0A0A;
  flex-shrink: 0;
}

.fm-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fm-header-title {
  font-size: 18px;
  font-weight: 600;
  color: rgba(245,240,232,0.85);
}

.fm-patient-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(201,169,110,0.1);
  border: 1px solid rgba(201,169,110,0.25);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--fm-champagne-dark);
  font-weight: 500;
}

.fm-header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  max-width: calc(100vw - 250px);
}

/* Mode toggle */
.fm-mode-toggle {
  display: flex;
  background: rgba(200,169,126,0.1);
  border-radius: var(--radius-md);
  padding: 2px;
  margin-right: 4px;
}

.fm-mode-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: rgba(200,169,126,0.3);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.fm-mode-btn.active {
  background: #0A0A0A;
  color: rgba(245,240,232,0.85);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.fm-mode-btn:hover:not(.active) {
  color: rgba(200,169,126,0.5);
}

.fm-mode-btn svg {
  width: 14px;
  height: 14px;
}

.fm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(200,169,126,0.15);
  border-radius: 6px;
  background: transparent;
  color: rgba(200,169,126,0.6);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.fm-btn:hover {
  border-color: rgba(200,169,126,0.4);
  color: #C8A97E;
}

.fm-btn-primary {
  background: transparent;
  border-color: #C8A97E;
  color: #C8A97E;
  font-weight: 600;
}

.fm-btn-primary:hover {
  background: rgba(200,169,126,0.1);
  border-color: #C8A97E;
  color: #C8A97E;
}

.fm-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Progress bar ──────────────────────────────────────────── */
.fm-progress-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(200,169,126,0.08);
  background: rgba(0,0,0,0.02);
  background: #FAFBFC;
  flex-shrink: 0;
}

.fm-progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.fm-progress-step:hover {
  background: rgba(201,169,110,0.08);
}

.fm-progress-step.active {
  background: rgba(201,169,110,0.12);
  border-color: rgba(201,169,110,0.3);
}

.fm-progress-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.fm-progress-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(245,240,232,0.85);
}

.fm-progress-detail {
  font-size: 10px;
  color: rgba(200,169,126,0.3);
}

.fm-progress-empty .fm-progress-label { color: rgba(200,169,126,0.3); }
.fm-progress-photo .fm-progress-label { color: #B45309; }
.fm-progress-done .fm-progress-label { color: #059669; }

.fm-progress-line {
  width: 24px;
  height: 2px;
  background: rgba(200,169,126,0.1);
  flex-shrink: 0;
}

.fm-progress-line.done {
  background: #10B981;
}

.fm-progress-summary {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(201,169,110,0.1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ── Disabled zone buttons ─────────────────────────────────── */
.fm-zone-btn.disabled,
.fm-zone-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Body: sidebar + canvas ────────────────────────────────── */
.fm-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Photo strip (left) ────────────────────────────────────── */
.fm-photo-strip {
  width: 100px;
  flex-shrink: 0;
  background: #0A0A0A;
  border-right: 1px solid rgba(200,169,126,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
}

.fm-photo-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(200,169,126,0.15);
  transition: border-color 0.2s;
  background: #1A1A1A;
}

.fm-photo-thumb.active {
  border-color: rgba(200,169,126,0.5);
}

.fm-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fm-photo-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 0;
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.6);
  color: #fff;
}

.fm-photo-upload {
  width: 80px;
  height: 80px;
  border: 1px dashed rgba(200,169,126,0.2);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: rgba(200,169,126,0.35);
  font-size: 9px;
  font-weight: 400;
  transition: all 0.2s;
  background: transparent;
}

.fm-photo-upload:hover {
  border-color: rgba(200,169,126,0.4);
  color: rgba(200,169,126,0.6);
}

.fm-photo-upload svg {
  width: 20px;
  height: 20px;
}

/* ── Canvas area (center) ──────────────────────────────────── */
.fm-canvas-area {
  flex: 1;
  position: relative;
  background: #000000;
  display: flex;
  /* flex-direction controlled by inline style (row for 2x, column for 1x) */
  overflow: hidden;
}

.fm-canvas-wrap {
  position: relative;
  flex: 1;
}

.fm-canvas-wrap canvas {
  display: block;
}

/* Canvas controls */
.fm-canvas-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(44,44,44,0.95);
  border-top: 1px solid rgba(200,169,126,0.15);
  flex-shrink: 0;
  width: 100%;
  justify-content: center;
}

.fm-canvas-ctrl-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(200,169,126,0.3);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #F5F0E8;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fm-canvas-ctrl-btn:hover {
  border-color: #C8A97E;
  color: #C8A97E;
  background: rgba(200,169,126,0.1);
}

.fm-canvas-controls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(200,169,126,0.1);
  border-radius: 2px;
  outline: none;
}

.fm-canvas-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #C8A97E;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Fullscreen mode */
.fm-canvas-area.fm-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: #1a1a1a;
}

.fm-canvas-area.fm-fullscreen .fm-canvas-controls {
  background: rgba(30,30,30,0.95);
  border-color: rgba(255,255,255,0.1);
}

.fm-canvas-area.fm-fullscreen .fm-canvas-ctrl-btn {
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
}

.fm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(200,169,126,0.3);
  text-align: center;
}

.fm-empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.fm-empty-state p {
  font-size: 14px;
  margin: 0;
}

/* ── Toolbar (right) ───────────────────────────────────────── */
.fm-toolbar {
  width: 280px;
  flex-shrink: 0;
  align-self: stretch;
  background: #0A0A0A;
  border-left: 1px solid rgba(200,169,126,0.08);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.fm-tool-section {
  padding: 12px;
  border-bottom: 1px solid rgba(200,169,126,0.06);
}

.fm-tool-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(200,169,126,0.5);
  color: rgba(200,169,126,0.3);
  margin-bottom: 10px;
}

/* Zone buttons */
.fm-zone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.fm-zone-btn {
  padding: 6px 6px;
  border: 1px solid rgba(200,169,126,0.12);
  border-radius: 6px;
  background: transparent;
  font-size: 10px;
  font-weight: 500;
  color: rgba(200,169,126,0.5);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  line-height: 1.3;
}

.fm-zone-btn:hover {
  border-color: rgba(200,169,126,0.3);
  color: rgba(200,169,126,0.7);
}

.fm-zone-btn.active {
  background: #C8A97E;
  border-color: #C8A97E;
  color: #fff;
}

/* Treatment select */
.fm-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(200,169,126,0.15);
  border-radius: 6px;
  font-size: 11px;
  color: rgba(245,240,232,0.85);
  background: #1A1A1A;
  color: rgba(200,169,126,0.7);
  appearance: none;
  cursor: pointer;
}

.fm-select:focus {
  outline: none;
  border-color: #C8A97E;
}

.fm-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(200,169,126,0.15);
  border-radius: 6px;
  font-size: 11px;
  color: rgba(200,169,126,0.7);
  background: #1A1A1A;
}

.fm-input:focus {
  outline: none;
  border-color: var(--fm-champagne);
}

.fm-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fm-input-row label {
  font-size: 12px;
  color: rgba(200,169,126,0.5);
  white-space: nowrap;
  min-width: 30px;
}

/* Annotation list */
.fm-annotations-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.fm-annotation-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #FAFBFC;
  border: 1px solid rgba(200,169,126,0.1);
  font-size: 12px;
}

.fm-annotation-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fm-annotation-info {
  flex: 1;
  min-width: 0;
}

.fm-annotation-zone {
  font-weight: 600;
  color: rgba(245,240,232,0.85);
}

.fm-annotation-detail {
  color: rgba(200,169,126,0.3);
  font-size: 11px;
}

.fm-annotation-remove {
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: rgba(200,169,126,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.fm-annotation-remove:hover {
  background: #FEE2E2;
  color: var(--danger);
}

/* ── Checklist panel ───────────────────────────────────────── */
.fm-checklist-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fm-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: rgba(200,169,126,0.5);
  cursor: pointer;
  transition: background var(--transition);
}

.fm-check-item:hover {
  background: #FAFBFC;
}

.fm-check-item.done {
  color: var(--accent-emerald);
}

.fm-check-item .check-icon {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(200,169,126,0.1);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fm-check-item.done .check-icon {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #fff;
}

.fm-check-item.done .check-icon svg {
  width: 12px;
  height: 12px;
}

/* ── Export modal / report ─────────────────────────────────── */
.fm-export-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fm-export-modal {
  background: #0A0A0A;
  border-radius: var(--radius-lg);
  width: 90vw;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.fm-export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(200,169,126,0.1);
}

.fm-export-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: rgba(245,240,232,0.85);
  margin: 0;
}

.fm-export-body {
  padding: 24px;
}

/* ── Report card (dark premium) ────────────────────────────── */
.fm-report {
  background: var(--fm-graphite);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: 'Montserrat', 'Inter', sans-serif;
}

.fm-report-header {
  padding: 24px 32px;
  text-align: center;
  border-bottom: 1px solid rgba(200,169,126,0.2);
}

.fm-report-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 300;
  color: var(--fm-ivory);
  letter-spacing: 0.05em;
}

.fm-report-subtitle {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fm-champagne);
  margin-top: 4px;
}

.fm-report-patient {
  font-size: 14px;
  color: rgba(245,240,232,0.6);
  margin-top: 8px;
}

/* Photos row */
.fm-report-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
}

.fm-report-photo-cell {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #1a1a1a;
}

.fm-report-photo-cell img,
.fm-report-photo-cell canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fm-report-photo-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

/* Bottom panels */
.fm-report-panels {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 2px;
  padding: 2px;
  padding-top: 0;
}

.fm-report-panel {
  padding: 24px;
  background: rgba(245,240,232,0.03);
  border: 1px solid rgba(200,169,126,0.1);
}

.fm-report-panel-title {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fm-champagne);
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(200,169,126,0.15);
}

.fm-report-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--fm-ivory);
  line-height: 1.5;
}

.fm-report-check-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.fm-report-check-icon.done {
  background: var(--fm-sage);
}

.fm-report-check-icon.pending {
  background: var(--fm-champagne);
}

.fm-report-check-icon svg {
  width: 12px;
  height: 12px;
  color: #fff;
}

.fm-report-check-text strong {
  display: block;
  font-weight: 600;
  color: var(--fm-ivory);
}

.fm-report-check-text span {
  font-size: 11px;
  color: rgba(245,240,232,0.5);
}

/* Center panel: annotated photo */
.fm-report-center-photo {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.fm-report-center-photo canvas {
  width: 100%;
  display: block;
}

/* Summary bar */
.fm-report-summary {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 20px 32px;
  border-top: 1px solid rgba(200,169,126,0.2);
}

.fm-report-stat {
  text-align: center;
}

.fm-report-stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 300;
  color: var(--fm-champagne);
}

.fm-report-stat-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.4);
  margin-top: 2px;
}

/* ── Canvas cursor states ──────────────────────────────────── */
.fm-canvas-wrap canvas {
  cursor: default;
}

.fm-canvas-wrap.drawing canvas {
  cursor: crosshair;
}

/* ── Zone color dot + icon ──────────────────────────────────── */
.fm-zone-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 2px;
  vertical-align: middle;
  flex-shrink: 0;
}

.fm-zone-icon {
  flex-shrink: 0;
  margin-right: 1px;
}

.fm-zone-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  text-align: left;
  font-size: 10.5px;
  padding: 6px 5px;
  line-height: 1.2;
}

/* ── Photo action buttons (crop + delete) ──────────────────── */
.fm-photo-actions {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}

.fm-photo-thumb:hover .fm-photo-actions {
  opacity: 1;
}

.fm-photo-action-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(0,0,0,0.55);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fm-photo-action-btn:hover {
  background: rgba(0,0,0,0.8);
}

.fm-photo-delete-btn:hover {
  background: #EF4444;
}

.fm-photo-action-btn svg {
  width: 11px;
  height: 11px;
}

/* ── Crop modal slider ─────────────────────────────────────── */
#fmCropZoom {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(200,169,126,0.1);
  border-radius: 2px;
  outline: none;
}

#fmCropZoom::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fm-champagne, #C8A97E);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

#fmCropZoom::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fm-champagne, #C8A97E);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ── Loading Spinner ────────────────────────────────────────── */
.fm-loading {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.fm-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(200,169,126,0.2);
  border-top-color: #C8A97E;
  border-radius: 50%;
  animation: fmSpin 0.8s linear infinite;
}

.fm-loading-text {
  font-size: 13px;
  font-weight: 500;
  color: #F5F0E8;
  letter-spacing: 0.03em;
}

@keyframes fmSpin {
  to { transform: rotate(360deg); }
}

@keyframes fmFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Crop Modal (dark theme) ────────────────────────────────── */
.fm-crop-modal {
  background: #2C2C2C;
  border-radius: 14px;
  width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  overflow: hidden;
}

.fm-crop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(200,169,126,0.15);
}

.fm-crop-title {
  font-size: 14px;
  font-weight: 600;
  color: #F5F0E8;
}

.fm-crop-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  cursor: pointer;
  color: #C8A97E;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fm-crop-close:hover {
  background: rgba(255,255,255,0.15);
}

.fm-crop-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.fm-crop-box {
  overflow: hidden;
  border-radius: 8px;
  border: 2px solid rgba(200,169,126,0.2);
  position: relative;
  cursor: grab;
  background: #111;
}

.fm-crop-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  /* Oval cutout: dark overlay outside, clear inside */
  background: radial-ellipse(42% 48% at 50% 45%, transparent 98%, rgba(0,0,0,0.4) 100%);
  border: none;
}

/* Fallback for browsers without radial-ellipse */
.fm-crop-guide::after {
  content: '';
  position: absolute;
  top: 8%;
  left: 15%;
  width: 70%;
  height: 80%;
  border: 2px dashed rgba(200,169,126,0.3);
  border-radius: 50%;
  pointer-events: none;
}

.fm-crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.fm-crop-zoom-label {
  font-size: 11px;
  color: rgba(200,169,126,0.6);
}

.fm-crop-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
}

.fm-crop-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #C8A97E;
  cursor: pointer;
  border: 2px solid #2C2C2C;
}

.fm-crop-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.fm-crop-btn-cancel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(200,169,126,0.2);
  border-radius: 10px;
  background: transparent;
  color: #F5F0E8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.fm-crop-btn-cancel:hover {
  border-color: rgba(200,169,126,0.4);
}

.fm-crop-btn-confirm {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: #C8A97E;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.fm-crop-btn-confirm:hover {
  background: #A8895E;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .fm-toolbar { width: 220px; }
  .fm-photo-strip { width: 80px; }
  .fm-photo-thumb, .fm-photo-upload { width: 64px; height: 64px; }
}

@media (max-width: 600px) {
  .fm-body { flex-direction: column; }
  .fm-photo-strip {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
    border-right: none;
    border-bottom: 1px solid rgba(200,169,126,0.1);
  }
  .fm-photo-thumb, .fm-photo-upload {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
  }
  .fm-toolbar {
    width: 100%;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid rgba(200,169,126,0.1);
  }
  .fm-canvas-area { min-height: 40vh; }
  .fm-header { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .fm-header-actions { flex-wrap: wrap; }
  .fm-progress-bar { overflow-x: auto; padding: 8px 12px; }
  .fm-crop-modal { width: 95vw; max-width: 420px; }
  .fm-export-modal { width: 95vw; }
}

/* ── Region overlay intensity slider ─────────────────────── */
.fm-toolbar input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(200,169,126,0.12);
  outline: none;
  cursor: pointer;
}
.fm-toolbar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #C8A97E;
  border: 2px solid #0A0A0A;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(200,169,126,0.4);
}
.fm-toolbar input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #C8A97E;
  border: 2px solid #0A0A0A;
  cursor: pointer;
}
