/* =========================================================================
   dopic.app - Water Reflection & Physical Shadow Studio Style (Desktop)
   ========================================================================= */

:root {
  --pri: #0284c7;
  --pri-hover: #0369a1;
  --pri-light: #e0f2fe;
  --bg-app: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-lg: 16px;
  --radius-md: 10px;
}

/* Hero Section: Minimalist & Compact */
.hero-sec {
  text-align: center;
  padding: 1rem 1rem 0.65rem;
}
.hero-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  background: var(--pri-light);
  color: var(--pri);
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 999px;
  margin-bottom: 0.35rem;
}
.hero-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}
.hero-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.4;
}

/* App Main Container: Ultra-wide Studio Layout */
.app-box {
  max-width: 1760px;
  width: calc(100% - 1.5rem);
  margin: 0 auto 2.5rem;
  padding: 0 0.5rem;
}

/* Mobile-Only Mode Bar: Completely hidden on Desktop, only shown on Mobile (<900px) */
.mobile-only-mode-bar {
  display: none;
  justify-content: center;
  margin-bottom: 0.75rem;
}
@media (max-width: 900px) {
  .mobile-only-mode-bar {
    display: flex;
  }
}

.mode-tabs-wrap {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}
.mode-tab-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}
.mode-tab-btn:hover {
  color: var(--pri);
}
.mode-tab-btn.active {
  background: #ffffff;
  color: var(--pri);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Workspace Layout: Left Narrower (280px), Right Canvas Massively Expanded (1fr) */
.workspace-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1080px) {
  .workspace-wrap {
    grid-template-columns: 260px 1fr;
  }
}

@media (max-width: 900px) {
  .workspace-wrap {
    grid-template-columns: 1fr;
  }
}

/* Left Config Controls Card: Compact Minimalist Sidebar */
.config-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.95rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.btn-upload-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.62rem 0.85rem;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.24);
}
.btn-upload-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.32);
}

.section-title-bar {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Form Groups & Sliders: Compact & Clean */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
}
.val-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pri);
  background: var(--pri-light);
  padding: 1px 5px;
  border-radius: 4px;
}
.slider-control {
  width: 100%;
  accent-color: var(--pri);
  height: 4px;
  background: #e2e8f0;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

/* Radio & Switch Button Groups: Horizontal Single-Row Flex */
.choice-row-2,
.btn-choice-group {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  gap: 6px !important;
}
.choice-row-2 .choice-btn,
.btn-choice-group .choice-btn {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.choice-row-4 {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  gap: 4px !important;
}
.choice-row-4 .choice-btn {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  padding: 0.38rem 0.15rem !important;
  font-size: 0.78rem !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.choice-btn {
  padding: 0.42rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}
.choice-btn:hover {
  border-color: var(--pri);
  color: var(--pri);
}
.choice-btn.active {
  background: #ffffff;
  border-color: var(--pri);
  color: var(--pri);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.2);
}

/* AI Cutout Action Box */
.ai-cutout-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.btn-ai-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.65rem 0.9rem;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-ai-trigger:hover {
  background: #0369a1;
}
.btn-ai-trigger.running {
  background: #64748b;
  cursor: not-allowed;
}
.cutout-status-text {
  font-size: 0.75rem;
  color: #0369a1;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Angle Compass Dial */
.angle-dial-box {
  display: flex;
  align-items: center;
  gap: 12px;
}
.angle-presets-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  flex: 1;
}
.angle-pill {
  padding: 3px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 6px;
  color: #475569;
  cursor: pointer;
  text-align: center;
}
.angle-pill:hover, .angle-pill.active {
  background: var(--pri);
  color: #ffffff;
  border-color: var(--pri);
}

/* Action Buttons (Download & Reset) */
.action-buttons-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.btn-download-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  transition: all 0.15s ease;
}
.btn-download-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.btn-reset-secondary {
  width: 100%;
  padding: 0.4rem;
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-reset-secondary:hover {
  background: #f1f5f9;
  color: #334155;
}

/* Right Live Preview Stage */
.preview-board-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.preview-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.preview-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e293b;
}
.preview-status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}
.preview-view-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.btn-sub-view-tool {
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-sub-view-tool:hover {
  border-color: var(--pri);
  color: var(--pri);
}
.btn-sub-view-tool.active {
  background: var(--pri);
  color: #ffffff;
  border-color: var(--pri);
  font-weight: 700;
}
.dim-badge {
  font-size: 0.72rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 2px 7px;
  border-radius: 6px;
  color: #475569;
}

.drag-hint-banner {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Stage Container: Expanded for Large Canvas View, Subtle Modern Grid */
.preview-stage-container {
  background: #f8fafc;
  background-image: 
    linear-gradient(45deg, #f1f5f9 25%, transparent 25%), 
    linear-gradient(-45deg, #f1f5f9 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #f1f5f9 75%), 
    linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.75rem;
  width: 100%;
  max-width: 680px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  position: relative;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.03);
  display: grid;
  gap: 0.85rem;
  align-items: center;
  justify-items: center;
}

/* Dual View: 2 columns */
.preview-stage-container.view-dual {
  grid-template-columns: 1fr 1fr;
  max-width: 100%;
  aspect-ratio: auto;
}
@media (max-width: 900px) {
  .preview-stage-container.view-dual {
    grid-template-columns: 1fr;
  }
}

/* Focus View: single active item */
.preview-stage-container.view-focus {
  grid-template-columns: 1fr;
  padding: 1rem;
  max-width: 680px;
  aspect-ratio: 1 / 1;
}
.preview-stage-container.view-focus .stage-pane-item:not(.active) {
  display: none !important;
}
.preview-stage-container.view-focus .stage-pane-item {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
}
.preview-stage-container.view-focus #canvasReflection,
.preview-stage-container.view-focus #canvasShadow {
  max-height: 100%;
}

.stage-pane-item {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}
.stage-pane-item:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.12);
}
.stage-pane-item.active {
  border-color: #0284c7;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.18), inset 0 0 0 1px #0284c7;
  background: #ffffff;
}

.pane-header-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(248, 250, 252, 0.9);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  user-select: none;
}
.pane-badge-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-pane-eraser {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-pane-eraser:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
}
.btn-pane-eraser.active {
  background: #ef4444 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}
.btn-pane-eraser svg {
  flex-shrink: 0;
}

/* Floating Eraser Toolbar */
.eraser-float-bar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  color: #ffffff;
  border-radius: 30px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 70;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.eraser-mode-label {
  color: #f87171;
}
.eraser-size-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #cbd5e1;
}
.eraser-size-group input[type=range] {
  width: 70px;
  height: 4px;
  accent-color: #38bdf8;
  cursor: pointer;
}
.eraser-badge {
  font-size: 0.72rem;
  color: #94a3b8;
  min-width: 28px;
}
.btn-eraser-bar-action {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-eraser-bar-action:hover {
  background: rgba(255, 255, 255, 0.28);
}
.btn-eraser-bar-action.btn-eraser-done {
  background: #10b981;
  border-color: #059669;
}
.btn-eraser-bar-action.btn-eraser-done:hover {
  background: #059669;
}

.badge-active-tag {
  display: none;
  font-size: 0.68rem;
  font-weight: 800;
  color: #0284c7;
  background: #e0f2fe;
  padding: 1px 6px;
  border-radius: 4px;
}
.stage-pane-item.active .badge-active-tag {
  display: inline-block;
}

.canvas-render-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.5rem;
  overflow: hidden;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
}

#canvasReflection, #canvasShadow {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  object-fit: contain;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#canvasReflection:active, #canvasShadow:active {
  cursor: grabbing;
}

/* High-Contrast Crisp Checkerboard for Transparent Canvas & Wrapper */
#canvasShadow.is-transparent,
.canvas-render-wrapper.is-transparent,
#stagePaneShadow .canvas-render-wrapper.is-transparent {
  background-image: 
    linear-gradient(45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #cbd5e1 75%), 
    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%) !important;
  background-size: 16px 16px !important;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px !important;
  background-color: #ffffff !important;
}

/* Interactive Waterline Guideline Overlay with Wide Hit Area */
.waterline-guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 42px;
  margin-top: -21px;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  touch-action: none;
  pointer-events: auto;
}
.waterline-core-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 20px;
  height: 2px;
  background: #0284c7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.95);
  pointer-events: none;
}
.waterline-handle {
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.5), inset 0 1px 0 rgba(255,255,255,0.4);
  pointer-events: auto !important;
  cursor: ns-resize;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.waterline-guide:hover .waterline-handle,
.waterline-handle:hover,
.waterline-handle:active {
  transform: scale(1.06);
  box-shadow: 0 5px 18px rgba(2, 132, 199, 0.7);
}
.handle-arrow {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Canvas Interaction Target Toggle */
.canvas-action-toggle-group {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.btn-action-mode {
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-action-mode:hover {
  color: var(--pri);
}
.btn-action-mode.active {
  background: #ffffff;
  color: var(--pri);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.waterline-step-btns {
  display: inline-flex;
  gap: 3px;
}

/* Right-Edge Vertical Waterline Ruler */
.waterline-vertical-ruler {
  position: absolute;
  right: 14px;
  top: 24px;
  bottom: 24px;
  width: 22px;
  z-index: 20;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.ruler-track {
  width: 4px;
  height: 100%;
  background: rgba(148, 163, 184, 0.45);
  border-radius: 4px;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
.ruler-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  left: -7px;
  background: #0284c7;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transform: translateY(-50%);
  pointer-events: none;
}

/* Toast Message */
#toast {
  position: fixed !important;
  top: auto !important;
  bottom: 2.5rem !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(30px) !important;
  background: rgba(15, 23, 42, 0.94) !important;
  backdrop-filter: blur(10px) !important;
  color: #ffffff !important;
  padding: 0.65rem 1.6rem !important;
  border-radius: 9999px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999999 !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  max-width: 90vw !important;
  height: auto !important;
  min-height: unset !important;
  max-height: unset !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
  text-align: center !important;
}
#toast.show {
  transform: translateX(-50%) translateY(0) !important;
  opacity: 1 !important;
}

/* Stage Pane Bottom Upload Action Bar (Dual Showcase Mode) */
.stage-pane-bottom-bar {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-stage-container.view-focus .stage-pane-bottom-bar,
.preview-stage-container.has-uploaded .stage-pane-bottom-bar {
  display: none !important;
}

.btn-pane-upload-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.65rem 1.35rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.btn-pane-upload-cta.btn-pane-ref {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%);
}
.btn-pane-upload-cta.btn-pane-ref:hover {
  background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.45);
}

.btn-pane-upload-cta.btn-pane-shd {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.95) 0%, rgba(219, 39, 119, 0.95) 100%);
}
.btn-pane-upload-cta.btn-pane-shd:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #be185d 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.45);
}

.btn-pane-upload-cta svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.btn-pane-upload-cta:hover svg {
  transform: translateY(-2px);
}

/* =========================================================================
   Dual Core Light & Shadow Showcase (2 Feature Comparison Cards)
   ========================================================================= */
.hero-showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 960px;
  margin: 1.5rem auto 1.75rem;
}
.showcase-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  text-align: left;
  position: relative;
}
.showcase-card:hover {
  transform: translateY(-3px);
  border-color: var(--pri);
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.15);
}
.showcase-card.active {
  border-color: var(--pri);
  box-shadow: 0 0 0 2px var(--pri), 0 8px 20px rgba(2, 132, 199, 0.18);
}
.showcase-img-box {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.showcase-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.showcase-card:hover .showcase-img-box img {
  transform: scale(1.05);
}
.showcase-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.showcase-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
}
.showcase-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
  flex: 1;
}
.showcase-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pri);
  background: var(--pri-light);
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.15s ease;
}
.showcase-card:hover .showcase-btn {
  background: var(--pri);
  color: #ffffff;
}

@media (max-width: 680px) {
  .hero-showcase-grid {
    grid-template-columns: 1fr;
  }
}

.btn-upload-cutout-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28);
  transition: all 0.2s ease;
}
.btn-upload-cutout-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.38);
}
.btn-upload-cutout-main.running {
  background: #64748b;
  cursor: not-allowed;
}

/* =========================================================================
   Fullscreen AI Generation Loading Overlay & Interaction Blocker
   ========================================================================= */
.ai-processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: all !important;
  user-select: none;
  animation: aiOverlayFadeIn 0.25s ease-out forwards;
}

.ai-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 29, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ai-overlay-modal {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(2, 132, 199, 0.15);
  padding: 2.25rem 2rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: aiModalZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* AI Spinner Halo */
.ai-spinner-halo {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.ai-spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3.5px solid transparent;
  border-top-color: #0284c7;
  border-right-color: #6366f1;
  animation: aiSpinRing 1.2s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.ai-spinner-ring-inner {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-bottom-color: #ec4899;
  border-left-color: #0ea5e9;
  animation: aiSpinRingRev 0.9s linear infinite;
}

.ai-spinner-core {
  font-size: 1.6rem;
  animation: aiCorePulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.5));
}

/* Typography */
.ai-overlay-content {
  width: 100%;
}

.ai-overlay-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.ai-overlay-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0 0 1.25rem;
}

/* Glowing Progress Track */
.ai-progress-track {
  width: 100%;
  height: 7px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.25rem;
}

.ai-progress-bar {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, #0284c7, #6366f1, #0ea5e9);
  border-radius: 10px;
  position: relative;
  transition: width 0.3s ease;
  animation: aiProgressGlide 2.2s ease-in-out infinite;
}

.ai-progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: aiShimmer 1.5s infinite;
}

/* Safe Interaction Lock Badge */
.ai-overlay-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.4rem 0.9rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.ai-overlay-lock-badge .ai-lock-icon {
  font-size: 0.85rem;
}

/* Animations */
@keyframes aiOverlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes aiModalZoomIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes aiSpinRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes aiSpinRingRev {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes aiCorePulse {
  0%, 100% { transform: scale(0.95); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; }
}

@keyframes aiProgressGlide {
  0% { width: 15%; margin-left: 0%; }
  50% { width: 55%; margin-left: 30%; }
  100% { width: 25%; margin-left: 75%; }
}

@keyframes aiShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* =========================================================================
   Interactive Modal: Select Subject Type (Product vs Portrait)
   ========================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: modalFadeIn 0.25s ease-out forwards;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.subject-choice-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(2, 132, 199, 0.12);
  padding: 2rem 1.75rem 1.75rem;
  animation: modalPopIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.subject-choice-header {
  margin-bottom: 1.35rem;
  text-align: left;
}

.subject-choice-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}

.subject-choice-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.subject-choice-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.subject-choice-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.subject-choice-item:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.18);
}

.subject-choice-icon {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.subject-choice-info {
  flex: 1;
}

.subject-choice-name {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.subject-choice-item:hover .subject-choice-name {
  color: #0284c7;
}

.subject-choice-hint {
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.45;
}

.subject-choice-arrow {
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: 700;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.subject-choice-item:hover .subject-choice-arrow {
  color: #0284c7;
  transform: translateX(4px);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* =========================================================================
   Cutout / Text-Remover Unified Top Stage & Controls Layout Styles
   ========================================================================= */
.container {
  max-width: 1080px;
  margin: 0 auto 3rem auto;
  padding: 0 1rem;
}

.main-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.shadow-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* AI Laser Light Sweep Showcase (Ultra-lightweight GPU CSS) */
.ai-scan-stage {
  position: relative;
  width: 100% !important;
  max-width: 480px !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
  user-select: none;
  background: #ffffff;
  cursor: pointer;
}

.ai-scan-clean-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #ffffff;
}

.ai-scan-clean-layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ai-scan-text-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  animation: aiShadowWipe 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: clip-path, opacity;
}

.ai-scan-text-layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ai-scan-beam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3.5px;
  background: #ffffff;
  z-index: 5;
  pointer-events: none;
  animation: aiShadowBeamSweep 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: left, opacity;
  box-shadow: 
    0 0 10px 2px #38bdf8,
    0 0 24px 6px rgba(2, 132, 199, 0.9),
    0 0 48px 12px rgba(3, 105, 161, 0.6);
}

.ai-scan-beam-glow {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 90px;
  background: linear-gradient(to left, rgba(2, 132, 199, 0.4), rgba(56, 189, 248, 0.15), transparent);
  pointer-events: none;
}

@keyframes aiShadowWipe {
  0%, 15% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
  45% {
    clip-path: inset(0 0 0 100%);
    opacity: 1;
  }
  75% {
    clip-path: inset(0 0 0 100%);
    opacity: 1;
  }
  85% {
    clip-path: inset(0 0 0 100%);
    opacity: 0;
  }
  90% {
    clip-path: inset(0 0 0 0);
    opacity: 0;
  }
  96%, 100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

@keyframes aiShadowBeamSweep {
  0%, 14% {
    left: 0%;
    opacity: 0;
  }
  15% {
    left: 0%;
    opacity: 1;
  }
  45% {
    left: 100%;
    opacity: 1;
  }
  48%, 100% {
    left: 100%;
    opacity: 0;
  }
}

/* In-Canvas Floating Upload Button (Clean Cutout Style) */
.canvas-floating-upload {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  user-select: none;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  width: auto;
  max-width: 90%;
}

.btn-cutout-minimal {
  position: relative;
  overflow: hidden;
  padding: 9px 24px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  width: auto;
  white-space: nowrap;
}

.btn-cutout-minimal:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
  background: #f8fafc;
}

.upload-specs-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.btn-upload-svg {
  width: 16px;
  height: 16px;
  stroke: #0284c7;
  flex-shrink: 0;
}

/* In-Canvas Processing Overlay (覆盖在画布正上方) */
.canvas-processing-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 1.5rem;
  text-align: center;
  border-radius: inherit;
  pointer-events: auto;
  user-select: none;
}

.processing-spinner {
  width: 46px;
  height: 46px;
  border: 3.5px solid rgba(255, 255, 255, 0.2);
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: shadowSpinnerSpin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

.processing-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.processing-tip {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 320px;
  line-height: 1.45;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

