/* ==========================================================================
   LaserCraft Studio - Premium Laser Engraving & Design Web Platform CSS
   Theme: Deep Industrial Charcoal, Cyber Cyan (#00f0ff), Laser Amber (#ff6b00)
   ========================================================================== */

:root {
  --bg-dark: #0a0c10;
  --bg-panel: #121620;
  --bg-card: #181d2a;
  --bg-input: #0f131d;
  --border-color: #262e42;
  --border-focus: #00f0ff;
  
  --text-main: #f0f4fc;
  --text-muted: #8c9ba5;
  --text-dim: #5c6b75;
  
  --laser-cyan: #00f0ff;
  --laser-cyan-glow: rgba(0, 240, 255, 0.35);
  --laser-amber: #ff6b00;
  --laser-amber-glow: rgba(255, 107, 0, 0.4);
  --laser-green: #00ff88;
  --danger-red: #ff3b5c;

  --sidebar-width: 380px;
  --header-height: 60px;
  --footer-height: 50px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(18, 22, 32, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

input, select, textarea, button, a {
  user-select: auto;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--laser-cyan);
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--laser-cyan), var(--laser-amber));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 900;
  box-shadow: 0 0 12px var(--laser-cyan-glow);
}

.brand span {
  color: var(--laser-cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-header-converter {
  display: none !important;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  border-color: var(--laser-cyan);
  color: var(--laser-cyan);
  box-shadow: 0 0 10px var(--laser-cyan-glow);
}

.btn-primary {
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  border: none;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 180, 216, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #00f0ff, #0096c7);
  color: #fff;
  box-shadow: 0 0 20px var(--laser-cyan-glow);
}

.btn-laser {
  background: linear-gradient(135deg, var(--laser-amber), #d93800);
  border: none;
  color: #fff;
  box-shadow: 0 4px 15px var(--laser-amber-glow);
}
.btn-laser:hover {
  background: linear-gradient(135deg, #ff8533, var(--laser-amber));
  color: #fff;
  box-shadow: 0 0 20px var(--laser-amber-glow);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

/* Main Layout */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Sidebar Navigation Tabs */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-tabs {
  display: flex;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 0.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.tab-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn:hover svg {
  stroke: var(--text-main);
}

.tab-btn.active {
  color: var(--laser-cyan);
  border-bottom-color: var(--laser-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.tab-btn.active svg {
  stroke: var(--laser-cyan);
}

/* Tab Content Panels */
.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: none;
}

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

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text-main);
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Product Cards Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.25 ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  border-color: var(--laser-cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.product-card.active {
  border-color: var(--laser-cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 15px var(--laser-cyan-glow);
}

.product-thumb {
  width: 100%;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-bottom: 0.5rem;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.product-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.product-size {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.product-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--laser-amber);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--laser-cyan);
  box-shadow: 0 0 8px var(--laser-cyan-glow);
}

select.form-control option {
  background: var(--bg-card);
  color: var(--text-main);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Font Picker Grid */
.font-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 0.4rem;
}

.font-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-item:hover, .font-item.active {
  border-color: var(--laser-cyan);
  color: var(--laser-cyan);
  background: rgba(0, 240, 255, 0.08);
}

/* Clipart Grid */
.clipart-categories {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.cat-chip {
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.cat-chip.active {
  background: var(--laser-cyan);
  color: #000;
  border-color: var(--laser-cyan);
}

.clipart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  max-height: 300px;
  overflow-y: auto;
}

.clipart-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  aspect-ratio: 1;
  transition: all 0.2s;
}

.clipart-item svg {
  width: 36px;
  height: 36px;
  fill: var(--text-main);
  stroke: var(--text-main);
  stroke-width: 1px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clipart-item svg path {
  fill-rule: evenodd;
}

.clipart-item:hover {
  border-color: var(--laser-cyan);
  background: rgba(0, 240, 255, 0.1);
  transform: scale(1.05);
}

.clipart-item:hover svg {
  stroke: var(--laser-cyan);
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-input);
  transition: all 0.2s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--laser-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.dropzone svg {
  width: 36px;
  height: 36px;
  stroke: var(--laser-cyan);
  margin-bottom: 0.5rem;
}

.dropzone-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Dither & Filter Controls */
.filter-preview-container {
  margin-top: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

.filter-canvas-preview {
  width: 100%;
  height: 150px;
  background: #181d28;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  overflow: hidden;
  padding: 4px;
}

.filter-canvas-preview canvas {
  max-width: 100%;
  max-height: 100%;
}

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

.layer-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  cursor: pointer;
}

.layer-item.active {
  border-color: var(--laser-cyan);
  background: rgba(0, 240, 255, 0.08);
}

.layer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.layer-icon {
  width: 20px;
  height: 20px;
  color: var(--laser-cyan);
}

.layer-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.layer-actions {
  display: flex;
  gap: 0.25rem;
}

.layer-actions button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

.layer-actions button:hover {
  color: var(--laser-cyan);
}

/* Center Workspace / Canvas Area */
.workspace {
  flex: 1;
  background: #07080b;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.canvas-toolbar {
  height: 44px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 5;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toolbar-btn {
  padding: 0.35rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.toolbar-btn:hover {
  border-color: var(--laser-cyan);
  color: var(--laser-cyan);
}

.toolbar-btn.active {
  background: var(--laser-cyan);
  color: #000;
  border-color: var(--laser-cyan);
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 20px 20px;
}

#mainCanvas {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  border-radius: 4px;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  backface-visibility: hidden;
}

/* Floating Action Toolbar on Canvas selection */
.floating-props {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-main);
  z-index: 20;
}

.floating-props .separator {
  width: 1px;
  height: 20px;
  background: var(--border-color);
}

/* Footer & Live Pricing Bar */
.app-footer {
  height: var(--footer-height);
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
}

.price-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.price-item {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.price-total {
  color: var(--laser-cyan);
  font-size: 1.25rem;
  text-shadow: 0 0 10px var(--laser-cyan-glow);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-window,
.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.2rem;
}

.modal-close:hover {
  color: var(--danger-red);
}

.modal-body {
  padding: 1.5rem;
  flex: 1;
}

/* Laser Simulation Modal Spec */
.sim-viewport {
  width: 100%;
  height: 380px;
  background: #050608;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

#simCanvas {
  max-width: 100%;
  max-height: 100%;
}

.sim-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
}

.progress-bar-container {
  flex: 1;
  height: 8px;
  background: var(--bg-dark);
  border-radius: 4px;
  margin: 0 1rem;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--laser-amber), var(--laser-cyan));
  box-shadow: 0 0 10px var(--laser-cyan-glow);
  transition: width 0.1s linear;
}

/* Template Grid Cards */
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: var(--laser-cyan);
  box-shadow: 0 0 12px var(--laser-cyan-glow);
  transform: translateY(-2px);
}

.template-preview {
  width: 100%;
  height: 100px;
  background: #000;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.template-preview svg {
  max-width: 80%;
  max-height: 80%;
}

/* Notification Toast */
.toast-container {
  position: fixed;
  bottom: 70px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  background: var(--bg-panel);
  border: 1px solid var(--laser-cyan);
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.btn-action {
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.btn-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.2);
}

/* ==========================================================================
   Mobile Responsive Layout Optimization (手机端全面适配与响应式排版)
   ========================================================================== */

@media (max-width: 768px) {
  /* 1. Mobile Header Styling - Neat Single Horizontal Row */
  .app-header {
    height: 52px;
    padding: 0 0.4rem;
    gap: 0.25rem;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .brand {
    font-size: 0.88rem;
    gap: 0.25rem;
    flex-shrink: 1;
    white-space: nowrap;
    overflow: hidden;
  }

  .brand span {
    display: none; /* Hide Studio on small mobile to save header space for buttons */
  }

  .brand-icon {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .header-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.25rem;
    flex-shrink: 0;
  }

  .header-actions .lang-selector-wrap {
    padding: 2px 4px !important;
    gap: 0.2rem !important;
  }

  .header-actions .lang-selector-wrap select {
    font-size: 0.72rem !important;
  }

  .header-actions .btn {
    padding: 0.32rem 0.4rem;
    font-size: 0.72rem;
    white-space: nowrap;
    border-radius: 4px;
    gap: 0.2rem;
    flex-shrink: 0;
  }

  .header-actions .btn span:not(.order-badge) {
    font-size: 0.8rem;
  }

  /* 2. Main Layout: Stack Canvas and Controls vertically on Mobile */
  .app-container {
    flex-direction: column;
    height: auto;
    min-height: calc(100dvh - 52px);
    overflow: visible;
    padding-bottom: 75px; /* Leave space so bottom fixed footer never overlaps content */
  }

  /* 3. Footer Bottom Bar on Mobile - Fixed & Always Touchable on Screen Bottom */
  .app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 58px;
    padding: 0.4rem 0.65rem;
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom, 6px));
    gap: 0.4rem;
    justify-content: flex-start;
    z-index: 1000;
    background: #121620;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.9);
  }

  /* Canvas Viewport occupies lengthened upper screen (48vh / min 340px) */
  .workspace {
    height: 48vh;
    min-height: 340px;
    flex: none;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
  }

  /* Prominent floating action bar positioned at top of canvas on mobile */
  .floating-props {
    top: 8px;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 22, 32, 0.96);
    border: 1.5px solid var(--laser-cyan);
    box-shadow: 0 0 12px var(--laser-cyan-glow);
    padding: 3px 6px;
    border-radius: 20px;
    gap: 3px;
    max-width: 98vw;
    box-sizing: border-box;
    z-index: 900;
  }

  .floating-props .toolbar-btn {
    padding: 3px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: -0.2px;
  }

  .floating-props .separator {
    height: 14px;
    margin: 0 1px;
  }

  .canvas-toolbar {
    height: 34px !important;
    min-height: 34px !important;
    padding: 2px 6px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    gap: 0.3rem !important;
    align-items: center !important;
    scrollbar-width: none;
  }

  .canvas-toolbar::-webkit-scrollbar {
    display: none;
  }

  .canvas-toolbar .toolbar-group {
    gap: 0.25rem !important;
    flex-shrink: 0 !important;
  }

  /* Hide WEBP to JPG Converter, Realistic Burn Texture & White Laser button on mobile screens */
  .btn-header-converter,
  #btnToggleBurnShader,
  #btnToggleEngravingColor,
  .canvas-toolbar [data-i18n="label_realtime_sim"],
  .canvas-toolbar [data-i18n="label_rulers"] {
    display: none !important;
  }

  /* Compact button styling on mobile */
  .canvas-toolbar .toolbar-btn {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
    height: 26px !important;
    line-height: 24px !important;
    white-space: nowrap !important;
    gap: 0.2rem !important;
  }

  .canvas-toolbar .toolbar-group > div {
    margin-right: 0.2rem !important;
    padding: 1px !important;
  }

  .canvas-viewport {
    flex: 1;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  /* Control Panel Sidebar occupies lower screen */
  .sidebar {
    width: 100%;
    flex: 1;
    min-height: 0;
    border-right: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-panel);
  }

  .sidebar-tabs {
    flex-shrink: 0;
    background: var(--bg-dark);
  }

  .tab-btn {
    min-width: 62px;
    padding: 0.5rem 0.2rem;
    font-size: 0.7rem;
  }

  .tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  .panel-title {
    font-size: 0.95rem;
  }

  .panel-subtitle {
    font-size: 0.72rem;
    margin-bottom: 0.75rem;
  }

  /* Product Grid on Mobile */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .product-card {
    padding: 0.5rem;
  }

  .product-thumb {
    height: 75px;
  }

  .product-name {
    font-size: 0.78rem;
  }

  .product-size {
    font-size: 0.68rem;
  }

  .product-badge {
    font-size: 0.6rem;
    padding: 1px 4px;
    top: 4px;
    right: 4px;
  }

  /* Font Quick Grid on Mobile */
  .font-grid {
    max-height: 260px;
    grid-template-columns: repeat(2, 1fr);
  }

  /* 3. Footer Price Summary on Mobile */

  .price-summary {
    gap: 0.5rem;
  }

  /* Hide redundant detailed labels on mobile footer */
  .price-item:nth-child(1),
  .price-item:nth-child(2) {
    display: none;
  }

  .price-item:nth-child(3) {
    display: flex;
    align-items: center;
    gap: 0.3rem;
  }

  .price-item:nth-child(3) .price-label,
  .price-item:nth-child(4) .price-label {
    display: none;
  }

  .price-total {
    font-size: 1.1rem;
  }

  #quantityInput {
    width: 50px !important;
    padding: 0.2rem 0.3rem !important;
  }

  .app-footer .btn-primary {
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* 4. Modals on Mobile */
  .modal-window {
    width: 95vw;
    max-height: 88vh;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 0.8rem 1rem;
  }

  .modal-title {
    font-size: 0.95rem;
  }

  .modal-body {
    padding: 0.8rem;
  }

  #adminOrdersModal .modal-window {
    width: 96vw !important;
    max-width: 96vw !important;
  }
}


