/* ============================================
   Custom Phone Case Design Studio - Styles
   ============================================ */

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-white: #ffffff;
  --bg-dark: #0f172a;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-white: #ffffff;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  --sidebar-width: 320px;
  --left-toolbar-width: 64px;
  --top-bar-height: 64px;
  
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
}

/* ============================================
   App Layout
   ============================================ */

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   Top Bar
   ============================================ */

.top-bar {
  height: var(--top-bar-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.saving-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.saving-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.unsaved-badge {
  background: #ede9fe;
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-secondary);
}

/* ============================================
   Main Layout
   ============================================ */

.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  --dot-hover-x: 50%;
  --dot-hover-y: 50%;
  --dot-hover-opacity: 0;
  background-color: #ffffff;
  background-image: radial-gradient(circle, rgba(148, 163, 184, 0.28) 1px, transparent 1.2px);
  background-size: 16px 16px;
}

.main-layout::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--dot-hover-opacity);
  background-image: radial-gradient(circle, rgba(30, 41, 59, 0.5) 1px, transparent 1.25px);
  background-size: 16px 16px;
  background-position: 0 0;
  mask-image: radial-gradient(circle at var(--dot-hover-x) var(--dot-hover-y), #000 0 54px, rgba(0, 0, 0, 0.58) 92px, transparent 150px);
  -webkit-mask-image: radial-gradient(circle at var(--dot-hover-x) var(--dot-hover-y), #000 0 54px, rgba(0, 0, 0, 0.58) 92px, transparent 150px);
  transition: opacity 120ms ease;
}

/* ============================================
   Left Sidebar
   ============================================ */

.left-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-white);
  border-right: 1px solid var(--border-color);
  position: relative;
  z-index: 50;
  display: flex;
  flex-shrink: 0;
}

.tool-nav {
  width: var(--left-toolbar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}

.tool-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.tool-nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.5);
}

.tool-nav-item.active {
  color: var(--primary-color);
  background: var(--bg-white);
}

.tool-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 32px;
  background: var(--primary-color);
  border-radius: 0 3px 3px 0;
}

.tool-icon {
  width: 24px;
  height: 24px;
}

.tool-icon--text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.tool-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Tool Panel */
.tool-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-white);
}

.tool-panel-content {
  display: none;
  padding: 20px;
}

.tool-panel-content.active {
  display: block;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 20px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.add-text-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 18px;
}

.add-text-input {
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.add-text-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Add Text Button */
.btn-add-text {
  width: auto;
  min-width: 104px;
  height: 42px;
  padding: 0 16px;
  background: #ede9fe;
  border: 1px dashed var(--primary-color);
  border-radius: var(--radius-lg);
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-add-text:hover {
  background: #ddd6fe;
}

.plus-icon {
  font-size: 18px;
  font-weight: 400;
}

/* Control Sections */
.control-section {
  margin-bottom: 24px;
}

.control-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.control-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.control-group {
  flex: 1;
}

.font-family-select,
.font-weight-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg-white);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.font-select-wrap {
  position: relative;
}

.font-family-select:hover,
.font-weight-select:hover {
  border-color: var(--primary-color);
}

.font-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
}

.font-option {
  width: 100%;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e5eaf3;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.font-option:hover,
.font-option.active {
  border-color: #4f46e5;
  background: #f7f5ff;
}

.font-option__preview {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 24px;
  line-height: 1.25;
  color: #111827;
}

.font-option__footer {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.font-option__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.font-option__meta,
.font-dropdown-empty {
  color: var(--text-muted);
  font-size: 12px;
}

.font-dropdown-empty {
  grid-column: 1 / -1;
  padding: 12px 10px;
}

.dropdown-arrow {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.number-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.number-input input {
  width: 60px;
  padding: 10px;
  border: none;
  font-size: 14px;
  text-align: center;
  outline: none;
}

.number-arrows {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-color);
}

.number-arrows button {
  width: 24px;
  height: 18px;
  border: none;
  background: var(--bg-secondary);
  cursor: pointer;
  font-size: 8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.number-arrows button:hover {
  background: var(--border-color);
}

.arrow-up {
  border-bottom: 1px solid var(--border-color);
}

/* Color Swatches */
.color-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px #ede9fe;
}

.color-picker-btn {
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-picker-btn svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

/* Alignment Buttons */
.alignment-buttons {
  display: flex;
  gap: 8px;
}

.align-btn {
  flex: 1;
  height: 40px;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.align-btn svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.align-btn:hover {
  border-color: var(--primary-color);
}

.align-btn.active {
  background: #ede9fe;
  border-color: var(--primary-color);
}

.align-btn.active svg {
  color: var(--primary-color);
}

/* Upload Panel */
.upload-area {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 180px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: #f8fafc;
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: #fafafa;
}

.upload-icon-wrap {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: #eef2ff;
  color: var(--primary-color);
  margin-bottom: 14px;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: currentColor;
}

.upload-title {
  display: block;
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 8px;
}

.upload-hint {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.upload-area.dragover,
.upload-area:hover {
  border-color: var(--primary-color);
  background: #ede9fe;
}

.uploaded-image-section {
  margin-top: 24px;
  width: 100%;
}

.uploaded-image-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.uploaded-image-empty {
  display: block;
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: #f8fafc;
  text-align: center;
}

.uploaded-image-empty[data-state="loading"] {
  color: var(--primary-color);
}

.uploaded-image-empty[data-state="error"] {
  color: #dc2626;
}

.uploaded-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.uploaded-image-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.uploaded-image-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.14);
  transform: translateY(-1px);
}

.uploaded-image-item:disabled {
  cursor: wait;
  opacity: 0.72;
}

.uploaded-image-item__preview {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.uploaded-image-item.is-loading::after {
  content: "添加中";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.54);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

/* Template & Sticker Grid */
.template-grid,
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.template-item,
.sticker-item {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.template-item:hover,
.sticker-item:hover {
  border-color: var(--primary-color);
  transform: scale(1.02);
}

.template-item img,
.sticker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sticker Categories */
.sticker-categories {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.sticker-cat {
  padding: 8px 16px;
  border: none;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.sticker-cat.active {
  background: var(--primary-color);
  color: var(--text-white);
}

/* Layers List */
.layers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  cursor: grab;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
  position: relative;
}

.layer-item:active {
  cursor: grabbing;
}

.layer-item:hover {
  background: var(--border-color);
}

.layer-item.active {
  border-color: var(--primary-color);
  background: #ede9fe;
}

.layer-item.dragging {
  opacity: 0.48;
}

.layer-item.drop-before::before,
.layer-item.drop-after::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  height: 3px;
  border-radius: 999px;
  background: var(--primary-color);
}

.layer-item.drop-before::before {
  top: -7px;
}

.layer-item.drop-after::after {
  bottom: -7px;
}

.layer-thumb {
  width: 40px;
  height: 40px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.layer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.layer-thumb span {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layer-thumb-text {
  padding: 3px;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
  word-break: break-all;
  overflow: hidden;
}

.layer-thumb-shape {
  border-radius: inherit;
}

.layer-thumb-empty {
  background: #f8fafc;
}

.layer-info {
  flex: 1;
}

.layer-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.layer-type {
  font-size: 12px;
  color: var(--text-muted);
}

.layer-actions {
  display: flex;
  gap: 4px;
}

.layer-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.layer-action-btn:hover {
  background: var(--bg-white);
  color: var(--text-primary);
}

.tool-panel--layers .layers-list {
  align-items: center;
}

.tool-panel--layers .layer-item {
  width: 88px;
  height: 64px;
  padding: 5px;
  gap: 6px;
  justify-content: flex-start;
}

.tool-panel--layers .layer-thumb {
  width: 52px;
  height: 52px;
}

.tool-panel--layers .layer-actions {
  position: static;
  flex: 0 0 auto;
}

.tool-panel--layers .layer-action-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  font-size: 12px;
  line-height: 1;
}

.tool-panel--layers .layer-item.drop-before::before,
.tool-panel--layers .layer-item.drop-after::after {
  left: 6px;
  right: 6px;
}

/* ============================================
   Canvas Area
   ============================================ */

.canvas-area {
  flex: 1;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.canvas-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-case-base {
  position: relative;
  width: min(100%, 360px);
  height: 100%;
  filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.15));
}

.phone-case-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Safe Zone Marker */
.safe-zone-marker {
  position: absolute;
  top: 60px;
  left: 20px;
  right: 20px;
  height: 600px;
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: 40px;
  pointer-events: none;
}

.safe-zone-label {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.bleed-area-label {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

/* Layers Container */
.layers-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 48px;
}

.canvas-layer {
  position: absolute;
  cursor: move;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-layer.selected {
  z-index: 1000 !important;
}

.canvas-layer-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
}

.canvas-layer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.canvas-layer-image-stack {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.canvas-layer-image-stack.is-cropped {
  overflow: hidden;
}

.canvas-layer-crop-source {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.canvas-layer-stroke {
  position: absolute;
  max-width: none !important;
  max-height: none !important;
  object-fit: fill !important;
  pointer-events: none;
  z-index: 0;
}

.canvas-layer-image {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  z-index: 1;
}

.canvas-layer--template img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.canvas-layer-text {
  font-family: 'Manrope', sans-serif;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
}

/* Layer Controls */
.layer-controls {
  position: absolute;
  border: 2px solid var(--primary-color);
  pointer-events: none;
  z-index: 1001;
}

.control-frame {
  position: absolute;
  inset: 0;
}

.control-btn {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.control-btn:hover {
  background: var(--primary-color);
  color: var(--text-white);
  transform: scale(1.1);
}

.delete-btn {
  top: -14px;
  left: -14px;
  color: var(--danger-color);
}

.delete-btn:hover {
  background: var(--danger-color);
}

.move-btn {
  top: -14px;
  right: -14px;
  cursor: move;
}

.copy-btn {
  bottom: -14px;
  left: -14px;
}

.rotate-btn {
  bottom: -14px;
  right: -14px;
  cursor: nwse-resize;
}

.rotate-btn:active {
  cursor: nwse-resize;
}

/* Canvas Toolbar */
.canvas-toolbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
}

.toolbar-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.toolbar-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.toolbar-btn.active {
  background: #eef2ff;
  color: #4f46e5;
}

.toolbar-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   Right Sidebar
   ============================================ */

.right-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-white);
  border-left: 1px solid var(--border-color);
  padding: 24px;
  overflow-y: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.inspector-panel {
  height: 100%;
}

.inspector-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.inspector-icon {
  width: 40px;
  height: 40px;
  background: #ede9fe;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.inspector-icon svg {
  width: 22px;
  height: 22px;
}

.inspector-title h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.inspector-title span {
  font-size: 12px;
  color: var(--text-muted);
}

.inspector-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.inspector-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  letter-spacing: 0.5px;
}

.inspector-tab:hover {
  color: var(--text-primary);
}

.inspector-tab.active {
  color: var(--primary-color);
  background: #ede9fe;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Specs Section */
.specs-section {
  margin-bottom: 28px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.spec-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Appearance Section */
.appearance-section {
  margin-bottom: 28px;
}

.slider-control {
  margin-bottom: 20px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.slider-header label {
  font-size: 13px;
  color: var(--text-primary);
}

.slider-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 2;
  opacity: 0;
}

.slider-track {
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  margin-top: -12px;
  position: relative;
  overflow: hidden;
}

.slider-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: var(--radius-full);
  transition: width 0.1s ease;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}

/* QR Section */
.qr-section {
  text-align: center;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.qr-placeholder {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.qr-placeholder svg {
  width: 40px;
  height: 40px;
}

.qr-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ============================================
   Color Picker Modal
   ============================================ */

.color-picker-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.color-picker-content {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  width: 320px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.color-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.color-picker-header h4 {
  font-size: 16px;
  font-weight: 600;
}

.color-picker-body {
  padding: 20px;
}

.color-gradient {
  height: 160px;
  background: linear-gradient(to bottom, transparent, #000), 
              linear-gradient(to right, #fff, #ff0000);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  cursor: crosshair;
  position: relative;
}

.hue-slider {
  margin-bottom: 16px;
}

.hue-slider input {
  width: 100%;
  height: 12px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, 
    #ff0000 0%, #ffff00 17%, #00ff00 33%, 
    #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.hue-slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--bg-white);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  border: 2px solid var(--border-color);
}

.color-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hex-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  text-transform: uppercase;
  font-family: monospace;
}

.color-preview {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: #000000;
  border: 1px solid var(--border-color);
}

/* ============================================
   Toast
   ============================================ */

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  color: var(--text-white);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  z-index: 3000;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1200px) {
  .right-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .left-sidebar {
    position: fixed;
    left: 0;
    top: var(--top-bar-height);
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }
  
  .left-sidebar.open {
    transform: translateX(0);
  }
  
  .phone-case-base {
    width: 280px;
    height: 560px;
  }
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   Web Login
   ============================================ */

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(156, 255, 0, 0.12), transparent 28%),
    linear-gradient(135deg, #31363a 0%, #101112 100%);
  overflow: auto;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-card {
  width: 100%;
  max-width: 720px;
  background: var(--bg-white);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  padding: 40px 32px;
}

.login-card__header {
  margin-bottom: 28px;
}

.login-card__title {
  font-family: 'Manrope', sans-serif;
  font-size: 44px;
  line-height: 1.1;
  color: #111827;
  margin-bottom: 14px;
}

.login-card__subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: #64748b;
}

.login-message,
.login-status {
  font-size: 15px;
  line-height: 1.7;
}

.login-message {
  min-height: 32px;
  margin-bottom: 20px;
}

.login-status {
  text-align: center;
  margin-top: 20px;
  min-height: 28px;
}

.login-message.is-loading,
.login-status.is-loading,
.login-message.is-idle,
.login-status.is-idle {
  color: #4f46e5;
}

.login-message.is-success,
.login-status.is-success {
  color: var(--success-color);
}

.login-message.is-error,
.login-status.is-error {
  color: var(--danger-color);
}

.login-qrcode-box {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  border-radius: 0;
  border: 0;
  background: transparent;
  height: 360px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.login-qrcode {
  width: 430px;
  min-height: 430px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

.login-qrcode iframe {
  border: 0;
  background: transparent;
  transform: scale(0.86);
  transform-origin: top center;
}

.login-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.login-actions .btn {
  min-width: 240px;
  height: 54px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 16px;
}

/* ============================================
   Canvas Auth
   ============================================ */

.auth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.94);
  z-index: 9999;
  transition: opacity 180ms ease;
}

.auth-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  display: none;
}

.auth-overlay__panel {
  width: min(420px, calc(100vw - 32px));
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow-xl);
  text-align: center;
}

.auth-overlay__spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border-radius: 999px;
  border: 3px solid rgba(79, 70, 229, 0.18);
  border-top-color: var(--primary-color);
  animation: spin 0.9s linear infinite;
}

.auth-overlay__text {
  font-size: 15px;
  color: var(--text-primary);
}

.editor-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.editor-busy-overlay.is-visible {
  display: flex;
}

.editor-busy-overlay__panel {
  width: min(360px, calc(100vw - 48px));
  padding: 28px 24px 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.92);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  text-align: center;
}

.editor-busy-overlay__spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border-radius: 999px;
  border: 4px solid rgba(79, 70, 229, 0.18);
  border-top-color: var(--primary-color);
  animation: spin 0.85s linear infinite;
}

.editor-busy-overlay__text {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.editor-busy-overlay__hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .login-card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .login-card__title {
    font-size: 32px;
  }

  .login-card__subtitle {
    font-size: 16px;
  }

  .login-qrcode-box {
    min-height: 320px;
  }

  .login-qrcode {
    width: 260px;
    min-height: 260px;
  }
}


.login-card--split {
  max-width: 1440px;
  min-height: min(720px, calc(100vh - 80px));
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 1px minmax(420px, 560px);
  gap: 0;
  align-items: stretch;
  padding: 0;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 30px;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}

.login-column {
  min-width: 0;
}

.login-wechat-column[hidden] {
  display: none;
}

.login-auth-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100%;
  padding: 86px 72px 64px;
}

.login-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 10px;
  margin-bottom: 34px;
  border: 0;
  border-radius: 18px;
  background: #f1f5f9;
}

.login-mode-tab {
  height: 62px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.login-mode-tab.is-active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.login-mode-panel[hidden] {
  display: none;
}

.login-mode-panel {
  height: 550px;
  overflow: hidden;
}

.login-wechat-column {
  display: flex;
  flex-direction: column;
}

.login-auth-column .login-card__title {
  font-size: 42px;
}

.login-auth-column .login-card__header {
  display: none;
}

.login-rive-column {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  padding: 64px 56px 0;
}

.login-rive-panel {
  position: relative;
  width: 100%;
  height: min(560px, calc(100vh - 270px));
  min-height: 420px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.login-rive-canvas {
  width: 100%;
  height: 100%;
  display: block;
  transform: translateY(28%) scale(1.22);
  transform-origin: center bottom;
}

.login-rive-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  background: #ffffff;
}

.login-rive-fallback.is-hidden {
  display: none;
}

.login-divider {
  width: 1px;
  background: #e2e8f0;
}

.login-card__section-title {
  font-family: 'Manrope', sans-serif;
  font-size: 42px;
  line-height: 1.2;
  color: #111827;
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 550px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-field__label {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.login-input {
  height: 64px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  padding: 0 18px;
  font-size: 17px;
  color: #111827;
  background: #ffffff;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-input::placeholder {
  color: #7b8190;
}

.login-password-control {
  position: relative;
  display: block;
}

.login-password-control .login-input {
  width: 100%;
  padding-right: 58px;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 150ms ease;
}

.login-password-toggle:hover {
  background: #f1f5f9;
}

.login-password-toggle canvas {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.login-field.is-error {
  animation: login-field-shake 0.4s ease-in-out;
}

.login-field.is-error .login-input {
  border-color: var(--danger-color);
}

.login-field.is-error .login-field__label {
  color: var(--danger-color);
}

.login-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(183, 255, 0, 0.12);
}

@keyframes login-field-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-6px); }
}

.login-form__message {
  min-height: 24px;
  font-size: 15px;
  line-height: 1.6;
}

.login-form__message.is-idle,
.login-form__message.is-loading {
  color: #64748b;
}

.login-form__message.is-success {
  color: var(--success-color);
}

.login-form__message.is-error {
  color: var(--danger-color);
}

.login-form__submit {
  width: 100%;
  height: 64px;
  font-weight: 600;
  border-radius: 16px;
  background: #565762;
  color: #ffffff;
  border: 0;
}

@media (max-width: 960px) {
  .login-card--split {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 0;
    background: #ffffff;
  }

  .login-divider {
    width: 100%;
    height: 1px;
  }

  .login-auth-column {
    padding: 32px 22px 48px;
  }

  .login-rive-column {
    min-height: 430px;
    padding: 32px 20px 0;
  }

  .login-rive-panel {
    height: 360px;
    min-height: 360px;
  }

  .login-rive-canvas {
    height: 100%;
  }

  .login-auth-column .login-card__title {
    font-size: 34px;
  }

  .login-card__section-title {
    font-size: 34px;
  }

  .login-mode-tab {
    height: 54px;
    font-size: 16px;
  }

  .login-mode-panel {
    height: 550px;
    min-height: 0;
    overflow: hidden;
  }

  .login-form {
    height: 550px;
    min-height: 0;
  }
}


/* ============================================
   Canvas Refresh
   ============================================ */

body:not(.login-page) {
  background: #ffffff;
}

.main-layout {
  gap: 12px;
  padding: 12px;
  position: relative;
}

.top-bar {
  height: 60px;
  padding: 0 18px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: none;
}

.logo {
  font-size: 18px;
  font-weight: 700;
}

.saving-status {
  font-size: 12px;
  color: #6366f1;
}

.unsaved-badge {
  background: transparent;
  padding: 0;
  font-size: 12px;
  color: #6366f1;
}

.top-bar-center {
  display: none;
}

.top-bar-right {
  gap: 8px;
}

.btn {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.left-sidebar,
.right-sidebar {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: none;
  overflow: hidden;
}

.left-sidebar {
  width: 72px;
  position: relative;
  overflow: visible;
  background: transparent;
  border: none;
}

.right-sidebar {
  width: 460px;
  border-left: 1px solid #e5e7eb;
}

.tool-nav {
  width: 72px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
}

.tool-nav-item {
  gap: 6px;
  padding: 16px 8px;
  color: #94a3b8;
}

.tool-nav-item.active {
  background: #f8fafc;
}

.tool-label {
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tool-panel-content {
  padding: 20px 18px;
}

.tool-panel {
  position: absolute;
  top: 0;
  left: 84px;
  width: 640px;
  height: 100%;
  display: none;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  z-index: 100;
  pointer-events: auto;
}

.tool-panel.is-open {
  display: block;
}

.tool-panel.tool-panel--layers {
  width: 136px;
}

.tool-panel.tool-panel--upload {
  width: 442px;
}

.tool-panel.tool-panel--upload .tool-panel-content {
  padding: 20px 24px;
}

.tool-panel.tool-panel--layers .tool-panel-content {
  padding: 18px 12px;
}

.tool-panel.tool-panel--layers .panel-header {
  margin-bottom: 14px;
}

.tool-panel.tool-panel--layers .panel-header h3 {
  font-size: 14px;
}

.panel-header h3 {
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}

.btn-add-text {
  padding: 0 16px;
  border-style: solid;
  background: #f8fafc;
}

.canvas-container {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
  width: 100%;
  padding: 25px 0;
  border-radius: 0;
  background-color: transparent;
  background-image: none;
  border: none;
  box-shadow: none;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.canvas-stage {
  width: 100%;
  height: calc(100vh - 210px);
  min-height: calc(100vh - 210px);
  background: transparent;
  padding: 0 24px;
  transform-origin: center center;
}

.phone-case-base {
  box-shadow: none;
}

.canvas-toolbar {
  top: 16px;
  right: 16px;
  left: auto;
  transform: none;
  bottom: auto;
  padding: 8px 10px;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e7eb;
  box-shadow: none;
  border-radius: 999px;
}

.canvas-image-toolbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  z-index: 12;
}

.toolbar-btn {
  width: 38px;
  height: 38px;
  background: transparent;
  box-shadow: none;
  border: 1px solid transparent;
}

.toolbar-btn.active {
  border-color: rgba(79, 70, 229, 0.18);
}

.toolbar-btn.layer-image-action,
.tool-nav-item.layer-image-action {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}

.canvas-image-toolbar .toolbar-btn.layer-image-action {
  width: auto;
  min-width: 62px;
  padding: 0 14px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
}

.toolbar-btn.layer-image-action:hover,
.tool-nav-item.layer-image-action:hover {
  color: #111827;
  background: #f8fafc;
}

.toolbar-btn.layer-image-action:disabled,
.tool-nav-item.layer-image-action:disabled,
.toolbar-btn.layer-image-action.is-loading,
.tool-nav-item.layer-image-action.is-loading {
  opacity: 0.45;
  cursor: not-allowed;
}

.image-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(2px);
}

.image-edit-modal.is-open {
  display: flex;
}

.image-edit-modal__panel {
  width: min(620px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 20px;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.16);
  padding: 20px;
  will-change: transform;
}

.image-edit-modal__panel.is-dragging {
  cursor: grabbing;
}

.image-edit-modal.is-previewing .image-edit-modal__panel {
  cursor: progress;
}

.image-edit-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px -6px 0;
  padding: 6px;
  border-radius: 14px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.image-edit-modal__header:active {
  cursor: grabbing;
}

.image-edit-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.image-edit-modal__footer #imageEditDisableBtn {
  margin-right: auto;
}

.image-edit-modal__header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #020617;
}

.image-edit-modal__close {
  border: none;
  background: #f3f6fb;
  color: #536179;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.image-edit-modal__close:hover {
  background: #e8eef7;
  color: #1f2937;
}

.image-edit-modal__body {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

.image-edit-preview {
  position: relative;
  min-height: 260px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f8fafc;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

.image-edit-preview img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.image-edit-crop-box {
  position: absolute;
  border: 2px solid #4f46e5;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.42);
  pointer-events: none;
}

.image-edit-controls {
  display: grid;
  gap: 14px;
}

.image-edit-controls label {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 700;
  color: #66758d;
}

.image-edit-controls input[type="range"] {
  width: 100%;
  accent-color: #4f46e5;
}

.image-edit-controls input[type="color"] {
  width: 76px;
  height: 34px;
  padding: 3px;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  background: #ffffff;
  cursor: pointer;
}

.image-edit-controls select {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 9px 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #1f2937;
  font: inherit;
  font-weight: 700;
}

.image-edit-modal__footer .btn {
  min-width: 86px;
  border-radius: 12px;
  font-weight: 800;
}

.canvas-container.is-pan-mode {
  cursor: grab;
}

.canvas-container.is-pan-mode .canvas-layer,
.canvas-container.is-pan-mode .phone-case-base {
  cursor: grab;
}

.canvas-container.is-panning,
.canvas-container.is-panning .canvas-layer,
.canvas-container.is-panning .phone-case-base {
  cursor: grabbing;
}

.inspector-panel {
  background: transparent;
}

.inspector-header {
  padding-bottom: 20px;
  margin-bottom: 16px;
}

.inspector-icon,
.inspector-tabs,
.inspector-content {
  display: none !important;
}

.inspector-title h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
}

.inspector-title span {
  color: var(--text-secondary);
  font-size: 11px;
}

.inspector-tab {
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 8px;
}

.summary-empty,
.qr-text,
.upload-hint,
.control-label,
.spec-label {
  color: #64748b;
}

.template-grid,
.sticker-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-item--modern,
.sticker-item--emoji {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  aspect-ratio: 1 / 1;
}

.template-item__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-item__name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.template-item__desc {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(15, 23, 42, 0.7);
}

.template-item__accent {
  width: 36px;
  height: 6px;
  border-radius: 999px;
}

.sticker-item--emoji {
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(226, 232, 240, 0.85);
}

.sticker-item__emoji {
  font-size: 42px;
  line-height: 1;
}

.sticker-item__name {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.layer-item {
  border-radius: 16px;
  background: #f8fafc;
}

@media (max-width: 1440px) {
  .left-sidebar {
    width: 72px;
  }

  .tool-panel {
    width: clamp(360px, calc(100vw - 560px), 600px);
  }

  .tool-panel.tool-panel--layers {
    width: 136px;
  }

  .tool-panel.tool-panel--upload {
    width: 442px;
  }

  .right-sidebar {
    width: 420px;
  }
}


.upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  cursor: pointer;
}

.upload-area > *:not(.upload-input) {
  pointer-events: none;
}

.phone-case-line-art {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  transform: translateX(-50%);
}

.phone-case-line-art--bottom {
  z-index: 0;
}

.phone-case-image {
  position: relative;
  z-index: 0;
}

.layers-container {
  z-index: 1;
}

.safe-zone-marker {
  display: none !important;
  z-index: 2;
}

.phone-case-line-art--top {
  z-index: 3;
}

.template-category-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.template-category-chip {
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(99, 102, 241, 0.06);
  color: #4f46e5;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.template-category-chip.active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

.tool-panel-content.asset-panel.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.asset-panel .panel-header {
  flex: 0 0 auto;
}

.asset-panel-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.asset-category-rail {
  align-self: stretch;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 14px 4px 0;
  border-right: 1px solid #eef2f7;
}

.asset-category-rail.template-category-list,
.asset-category-rail.sticker-categories {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-bottom: 4px;
  overflow-x: hidden;
}

.asset-category-rail .template-category-chip,
.asset-category-rail .sticker-cat {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  white-space: normal;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 10px;
  border-color: transparent;
  background: transparent;
  color: #94a3b8;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.asset-category-rail .template-category-chip.active,
.asset-category-rail .sticker-cat.active {
  background: #f3efff;
  color: #4f46e5;
  border-color: #eee7ff;
}

.asset-category-rail .sticker-cat {
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
}

.asset-category-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.asset-category-icon--image {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}

.asset-category-icon--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-category-icon__svg {
  width: 18px;
  height: 18px;
}

.asset-category-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-category-loading {
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.asset-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.asset-search {
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid #e5eaf3;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: #94a3b8;
  background: #ffffff;
}

.asset-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.asset-search input {
  min-width: 0;
  width: 100%;
  border: none;
  outline: none;
  color: #1f2937;
  font: inherit;
  background: transparent;
}

.asset-search input::placeholder {
  color: #b6c0cf;
}

.background-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.background-actions .btn {
  padding: 8px 12px;
}

.background-color-swatches {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.background-color-swatch {
  width: 26px;
  height: 26px;
}

.panel-empty {
  display: none;
  padding: 18px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  color: #64748b;
  font-size: 13px;
  text-align: center;
  margin-bottom: 16px;
}

.template-item--image,
.sticker-item--image {
  padding: 10px;
}

.template-item--image {
  aspect-ratio: 3 / 4;
  justify-content: center;
  align-items: center;
  background: #f8fafc;
}

.sticker-item--image {
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.template-item__preview,
.sticker-item__preview {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 14px;
  background: rgba(255,255,255,0.75);
}

.template-item__preview {
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.sticker-item__preview {
  width: auto !important;
  height: auto !important;
  max-width: 82%;
  max-height: 82%;
  object-fit: contain !important;
  object-position: center;
  border-radius: 0;
  background: transparent;
}

.asset-panel .sticker-grid {
  grid-template-columns: repeat(auto-fill, 112px) !important;
  justify-content: start;
  align-items: start;
  gap: 12px;
}

.asset-panel .sticker-item--emoji {
  width: 112px;
  height: 112px;
  padding: 8px;
  aspect-ratio: auto;
  border-radius: 10px;
}

.asset-panel .sticker-item__preview {
  max-width: 72px;
  max-height: 72px;
}

.ai-status {
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
  margin-bottom: 12px;
}

.ai-file-input {
  display: none;
}

.ai-status[data-state="loading"] {
  color: #4f46e5;
  font-weight: 600;
}

.ai-status[data-state="error"] {
  color: #ef4444;
}

.ai-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ai-template-item {
  position: relative;
  border: 1px solid rgba(226,232,240,0.9);
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  transition: all 160ms ease;
  overflow: hidden;
}

.ai-template-item:hover {
  border-color: rgba(99,102,241,0.35);
  transform: translateY(-1px);
}

.ai-template-item__preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}

.ai-template-item__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ai-template-item__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-weight: 700;
}

.ai-template-item__mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 8px 8px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(180deg, rgba(15,23,42,0), rgba(15,23,42,0.72));
}

.inspector-section,
.pending-section {
  margin-bottom: 18px;
  border-radius: 18px;
}

.inspector-section__header,
.pending-section__header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(226,232,240,0.95);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,250,252,0.88));
  padding: 18px 18px;
  margin-bottom: 0;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.inspector-section__header:hover {
  border-color: rgba(99,102,241,0.32);
  box-shadow: 0 14px 34px rgba(79,70,229,0.08);
  transform: translateY(-1px);
}

.inspector-section.is-open .inspector-section__header {
  border-color: rgba(99,102,241,0.34);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(238,242,255,0.78));
}

.inspector-section__header .section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-bottom: 0;
  color: #64748b;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.inspector-section__header .section-title::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #c7d2fe;
  box-shadow: 0 0 0 6px rgba(99,102,241,0.08);
}

.inspector-section:nth-of-type(2) .section-title::before {
  background: #bae6fd;
  box-shadow: 0 0 0 6px rgba(14,165,233,0.08);
}

.inspector-section__right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

.inspector-section__chevron {
  color: #94a3b8;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  transition: transform 160ms ease;
}

.inspector-section.is-open .inspector-section__chevron {
  transform: rotate(90deg);
}

.inspector-section__body {
  padding: 14px;
  margin-top: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #eef2f7;
}

.inspector-section:not(.is-open) .inspector-section__body {
  display: none;
}

.pending-section__meta {
  display: none;
  font-size: 18px;
  color: #6366f1;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.pending-status,
.product-status {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.pending-item {
  width: 100%;
  border: 1px solid rgba(226,232,240,0.9);
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 160ms ease;
}

.pending-item:hover {
  border-color: rgba(99,102,241,0.35);
  transform: translateY(-1px);
}

.pending-item.active {
  border-color: #4f46e5;
  box-shadow: none;
  background: #f8fafc;
}

.pending-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.pending-item__order,
.pending-item__seq {
  font-size: 12px;
  color: #64748b;
}

.pending-item__title {
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 6px;
}

.pending-item__meta {
  font-size: 12px;
  color: #475569;
}

.product-catalog {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 430px;
  overflow-y: auto;
}

.product-picker {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.product-picker__step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-picker__label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.product-picker__chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
}

.product-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(226,232,240,0.95);
  background: #ffffff;
  color: #64748b;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 160ms ease;
}

.product-chip.active {
  border-color: #4f46e5;
  background: #4f46e5;
  color: #ffffff;
}

.product-option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-option {
  width: 100%;
  border: 1px solid rgba(226,232,240,0.9);
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 160ms ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-option:hover,
.product-sku-item:hover {
  border-color: rgba(99,102,241,0.35);
  transform: translateY(-1px);
}

.product-option.active {
  border-color: #4f46e5;
  background: #f8fafc;
}

.product-option__title {
  display: block;
  font-size: 13px;
  color: #0f172a;
  font-weight: 800;
  line-height: 1.45;
  flex: 1;
}

.product-option__image {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(226,232,240,0.9);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.product-option__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-option__placeholder {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 800;
}

.product-spu-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-spu-title {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.product-sku-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-sku-item {
  width: 100%;
  border: 1px solid rgba(226,232,240,0.9);
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 160ms ease;
}

.product-sku-item.active {
  border-color: #4f46e5;
  background: #f8fafc;
}

.product-sku-item__name {
  font-size: 13px;
  line-height: 1.45;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 5px;
}

.product-sku-item__meta {
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

/* Product navigator: 01 category, 02 SPU, 03 SKU, 04 pending tasks */
.right-sidebar {
  padding: 14px;
}

.inspector-panel {
  height: 100%;
  padding: 22px 24px;
  background: #ffffff;
  border-radius: 18px;
  overflow-y: auto;
}

.inspector-section,
.pending-section {
  margin: 0;
  border-radius: 0;
  border-bottom: 1px solid #e5e7eb;
}

.inspector-section__header,
.pending-section__header {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 18px 0;
}

.inspector-section__header:hover {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.inspector-section.is-open .inspector-section__header {
  border-color: transparent;
  background: transparent;
}

.inspector-section__header .section-title {
  gap: 8px;
  color: #020617;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: normal;
}

.inspector-section__header .section-title::before {
  display: none;
}

.section-index {
  font-weight: 900;
  letter-spacing: 0.01em;
}

.inspector-section__chevron {
  color: #020617;
  font-size: 28px;
  font-weight: 500;
  transform-origin: center;
}

.inspector-section.is-open .inspector-section__chevron {
  transform: rotate(45deg);
}

.inspector-section__body {
  padding: 0 0 18px;
  margin-top: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.pending-status,
.product-status {
  margin-bottom: 14px;
  color: #64748b;
  font-size: 13px;
}

.pending-status {
  font-size: 12px;
  line-height: 1.45;
}

.product-category-list,
.product-spu-list,
.product-sku-list,
.pending-list {
  max-height: 420px;
  overflow-y: auto;
}

.right-sidebar,
.inspector-panel,
.product-category-list,
.product-spu-list,
.product-sku-list,
.pending-list {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.right-sidebar::-webkit-scrollbar,
.inspector-panel::-webkit-scrollbar,
.product-category-list::-webkit-scrollbar,
.product-spu-list::-webkit-scrollbar,
.product-sku-list::-webkit-scrollbar,
.pending-list::-webkit-scrollbar {
  display: none;
}

.sidebar-toggle {
  position: absolute;
  z-index: 130;
  width: 30px;
  height: 30px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  transition: color 160ms ease, transform 160ms ease, background 160ms ease;
}

.sidebar-toggle:hover {
  color: #111827;
  background: #ffffff;
}

.sidebar-toggle svg {
  width: 16px;
  height: 16px;
}

.sidebar-toggle--left {
  top: 14px;
  right: -15px;
}

.sidebar-toggle--right {
  top: 14px;
  right: 14px;
}

.left-sidebar,
.right-sidebar {
  transition: width 180ms ease, min-width 180ms ease;
}

.left-sidebar.is-collapsed {
  width: 42px;
  min-width: 42px;
}

.left-sidebar.is-collapsed .tool-nav,
.left-sidebar.is-collapsed .tool-panel {
  display: none;
}

.left-sidebar.is-collapsed .sidebar-toggle--left svg {
  transform: rotate(180deg);
}

.right-sidebar.is-collapsed {
  width: 46px;
  min-width: 46px;
  padding: 0;
  border-radius: 18px;
}

.right-sidebar.is-collapsed .inspector-panel {
  display: none;
}

.right-sidebar.is-collapsed .sidebar-toggle--right {
  top: 14px;
  right: 8px;
}

.right-sidebar.is-collapsed .sidebar-toggle--right svg {
  transform: rotate(180deg);
}

.product-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-category-card {
  min-height: 70px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.product-category-card:hover,
.product-category-card.active {
  border-color: #020617;
}

.product-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 30px;
  row-gap: 34px;
}

.product-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  text-align: center;
  box-shadow: none;
}

.product-option:hover,
.product-sku-item:hover {
  border-color: transparent;
  transform: none;
}

.product-option.active {
  border-color: transparent;
  background: transparent;
}

.product-option__image {
  width: 132px;
  height: 132px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fafafa;
}

.product-option.active .product-option__image {
  border: 2px solid #020617;
}

.product-option__title {
  color: #111827;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  flex: 0 1 auto;
}

.product-sku-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-sku-item,
.pending-item {
  border-radius: 18px;
  padding: 16px;
}

.product-sku-item.active,
.pending-item.active {
  border-color: #020617;
  background: #ffffff;
}

.product-spec-selector {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.product-spec-summary {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.product-spec-row {
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.product-spec-row__title {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.product-spec-row__options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.product-spec-option {
  min-height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.product-spec-option.active {
  border-color: #020617;
  background: #020617;
  color: #ffffff;
}

.product-spec-option:disabled {
  cursor: not-allowed;
  color: #cbd5e1;
  background: #f8fafc;
  border-color: #eef2f7;
}
