/**
 * Passport Size Photo Studio Stylesheet
 * High-performance, studio-grade styling for passport creation,
 * crop workspace, multi-photo sheet layouts, and 300 DPI printing.
 */

:root {
  --studio-bg: #f8fafc;
  --panel-bg: #ffffff;
  --accent-blue: #1e3a8a;
  --accent-sky: #0ea5e9;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --border-subtle: #e2e8f0;
  --border-active: #0ea5e9;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--studio-bg);
  color: #1e293b;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-sky) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glass Navbar */
.glass-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding: 0.55rem 0;
  transition: all 0.2s ease;
}

.glass-navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1.5rem;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-link, .nav-links a {
  font-size: 0.86rem;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
  padding: 5px 11px;
  border-radius: 9999px;
  transition: all 0.25s ease;
  letter-spacing: 0.2px;
  text-transform: none;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover, .nav-links a:hover {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.12), rgba(14, 165, 233, 0.18));
  color: var(--accent-blue);
  transform: translateY(-1px);
}

.nav-link.active, .nav-links a.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-sky)) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #0f172a;
  padding: 6px;
}

/* Studio Hero Section */
.studio-hero {
  padding: 0.75rem 1rem 0.25rem 1rem;
  background: linear-gradient(180deg, #eff6ff 0%, var(--studio-bg) 100%);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.08), rgba(14, 165, 233, 0.12));
  color: var(--accent-blue);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 900;
  line-height: 1.2;
  color: #0f172a;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.5px;
}

.hero-desc {
  color: #64748b;
  font-size: 0.9rem;
  max-width: 680px;
  margin: 0 auto;
}

/* Main Studio Full-Page Layout Grid */
.studio-workspace-grid {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.5rem 1rem 1.5rem 1rem;
  align-items: start;
  box-sizing: border-box;
}

@media (min-width: 1320px) {
  .studio-workspace-grid {
    padding: 0.5rem 2rem 2rem 2rem;
    gap: 1.25rem;
  }
}

.studio-panel {
  flex: 1;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.05);
  padding: 1rem;
  box-sizing: border-box;
}

/* Upload Dropzone */
.photo-dropzone {
  border: 2px dashed #93c5fd;
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  background: #f0fdf4;
  transition: all 0.2s ease;
  position: relative;
}

.photo-dropzone:hover, .photo-dropzone.dragover {
  border-color: var(--accent-sky);
  background: #e0f2fe;
  transform: scale(1.01);
}

.dropzone-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 0.85rem auto;
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.1);
}

/* Section Subheadings in Panels */
.panel-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0.85rem 0 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: none !important;
}

.studio-panel hr {
  border: none;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  margin-bottom: 0.75rem;
}

/* Category Filter Tabs */
.size-category-tab {
  transition: all 0.2s ease;
}

.size-category-tab:hover {
  background: #f1f5f9 !important;
  border-color: var(--accent-sky) !important;
}

.size-category-tab.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-sky)) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.2);
}

/* Beauty & Face Clean Preset Buttons */
.beauty-preset-btn {
  transition: all 0.2s ease;
}

.beauty-preset-btn:hover {
  background: #f1f5f9 !important;
  border-color: #0284c7 !important;
}

.beauty-preset-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

/* Size Preset Chips */
.size-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 1rem;
}

.size-preset-grid::-webkit-scrollbar {
  width: 6px;
}

.size-preset-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

.preset-chip {
  flex: 1;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.preset-chip:hover {
  border-color: var(--accent-sky);
  background: #f0f9ff;
}

.preset-chip.active {
  background: #eff6ff;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.15);
}

.preset-chip-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.preset-chip-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
}

/* Control Inputs */
.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 0.85rem;
}

.control-group {
  margin-bottom: 0.85rem;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.studio-input, .studio-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

.studio-input:focus, .studio-select:focus {
  border-color: var(--accent-sky);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Color Swatches */
.color-swatch-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.color-swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  outline: none;
}

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

.color-swatch-btn.active {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px var(--accent-sky);
}

/* Interactive Crop Workspace in Preview */
.preview-card {
  flex: 1.2;
  background: transparent;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 80px;
  width: 100%;
  box-sizing: border-box;
}

.preview-tabs {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 9999px;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 420px;
}

.preview-tab-btn {
  flex: 1;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.25s ease;
}

.preview-tab-btn.active {
  background: #ffffff;
  color: var(--accent-blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Interactive Crop Stage */
.crop-stage-container {
  width: 100%;
  max-width: 440px;
  height: 370px;
  min-height: 370px;
  max-height: 370px;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(15, 23, 42, 0.15);
  padding: 1rem;
  box-sizing: border-box;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.crop-canvas-wrapper {
  position: relative;
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.crop-canvas-wrapper:active {
  cursor: grabbing;
}

.crop-canvas-wrapper canvas {
  max-height: 335px;
  max-width: 85%;
  object-fit: contain;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
  border-radius: 4px;
}

.single-photo-canvas {
  max-width: 100%;
  max-height: 280px;
  height: auto;
  object-fit: contain;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 4px solid #fff;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

/* Face Alignment Guide Overlay - Proportional Portrait Oval */
.face-guide-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 190px;
  height: 250px;
  border: 1.5px dashed rgba(255, 255, 255, 0.65);
  border-radius: 50% / 60%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

.guide-eye-line {
  position: absolute;
  top: 42%;
  left: 12%;
  right: 12%;
  border-top: 1px dashed rgba(255, 255, 255, 0.6);
}

/* Multi-Photo Sheet Stage (A4 / 4x6 / A5) */
.sheet-stage-container {
  width: 100%;
  background: #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(360px, calc(100vh - 260px), 620px);
  max-height: clamp(400px, calc(100vh - 200px), 760px);
  overflow: auto;
  box-sizing: border-box;
}

.sheet-paper-canvas {
  background: #ffffff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid #cbd5e1;
  max-width: 100%;
  max-height: clamp(340px, calc(100vh - 240px), 700px);
  height: auto;
  object-fit: contain;
  display: block;
}

/* Sheet Controls Bar */
.sheet-controls-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  border-radius: 10px;
}

/* Action Buttons Bar & Group */
.action-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 0.75rem;
}

.btn-action-studio {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.btn-action-studio:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  filter: brightness(1.05);
}

.btn-action-studio:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-studio-print {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #ffffff;
}

.btn-studio-download {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
}

.btn-studio-share {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.btn-studio-share:hover {
  background: #1eb857;
  transform: translateY(-2px);
}

/* Sliders */
input[type="range"] {
  width: 100%;
  accent-color: var(--accent-sky);
}

/* =========================================================================
   300 DPI PHYSICAL PRINTING STYLESHEET
   ========================================================================= */
@media print {
  @page {
    size: auto;
    margin: 0;
  }

  body {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  header,
  .studio-hero,
  .studio-panel,
  .mobile-bottom-nav,
  .action-toolbar,
  .action-buttons-group,
  .preview-tabs,
  .crop-stage-container,
  .sheet-controls-bar,
  .mobile-menu-btn {
    display: none !important;
  }

  .studio-workspace-grid, .preview-card {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  .sheet-stage-container {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
  }

  .sheet-paper-canvas {
    box-shadow: none !important;
    border: none !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid !important;
  }
}

/* Mobile Responsive Optimization */
@media (max-width: 991px) {
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .nav-content {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff !important;
    padding: 1.25rem 1.5rem !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
    border-bottom: 2px solid var(--accent-blue);
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    z-index: 9999;
  }

  .nav-content.active {
    display: flex !important;
  }

  .nav-links {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .nav-links a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 14px !important;
    background: #f8fafc;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    text-decoration: none;
    border-left: 3px solid transparent;
  }

  .nav-links a:hover, .nav-links a.active {
    background: rgba(30, 58, 138, 0.08) !important;
    border-left-color: var(--accent-blue) !important;
    color: var(--accent-blue) !important;
  }

  .nav-actions {
    margin-top: 6px;
    width: 100%;
  }

  .nav-actions .btn {
    width: 100%;
    text-align: center;
    padding: 0.75rem !important;
    font-size: 0.88rem !important;
    display: block;
  }

  .studio-workspace-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 0.5rem 0.75rem 2rem 0.75rem !important;
  }

  .preview-card {
    position: static !important;
    width: 100% !important;
    padding: 1rem !important;
  }

  .crop-stage-container {
    height: 320px !important;
    min-height: 320px !important;
    max-height: 320px !important;
  }

  .crop-canvas-wrapper canvas {
    max-height: 290px !important;
    max-width: 90% !important;
  }

  .single-photo-canvas {
    max-height: 290px !important;
  }

  .face-guide-overlay {
    width: 160px !important;
    height: 210px !important;
  }
}

@media (max-width: 900px) {
  /* Hide top email bar and hero banner on mobile (Bottom Nav + Compact Glass Navbar active) */
  header > div:first-child {
    display: none !important;
  }

  .studio-hero {
    display: none !important;
  }

  .glass-navbar {
    padding: 0.35rem 0.6rem !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04) !important;
  }

  .glass-navbar .brand-group {
    width: auto !important;
  }

  .mobile-menu-btn {
    display: block !important;
    background: transparent !important;
    border: none !important;
    color: #0f172a !important;
    padding: 2px !important;
    cursor: pointer !important;
  }

  .studio-workspace-grid {
    display: flex !important;
    flex-direction: column !important;
    padding: 0.2rem 0.35rem 5.5rem 0.35rem !important;
    margin-top: 0 !important;
    gap: 0.3rem !important;
    width: 100% !important;
  }

  /* PHOTO PREVIEW STAGE: Large Photo Card */
  .preview-card {
    order: 1 !important;
    width: 100% !important;
    padding: 0.35rem 0.5rem !important;
    margin: 0 0 6px 0 !important;
    position: relative !important;
    z-index: 900 !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
    transition: all 0.25s ease !important;
  }

  /* Pinned / Frozen Photo Position Mode */
  .preview-card.freeze-pinned {
    position: sticky !important;
    top: 0px !important;
    z-index: 9999 !important;
    background: #ffffff !important;
    border: 2px solid #2563eb !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25) !important;
  }

  .preview-card.freeze-pinned #singlePreviewContainer > div:first-child {
    height: 140px !important;
    max-height: 140px !important;
  }

  .preview-card.freeze-pinned #singleCanvas {
    max-height: 135px !important;
    max-width: 110px !important;
  }

  /* Compact top upload & camera bar */
  .preview-card > div:first-child {
    margin-bottom: 2px !important;
    gap: 4px !important;
  }
  .preview-card > div:first-child .btn-action-studio {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.72rem !important;
  }

  /* Compact tab selector */
  .preview-tabs {
    margin-bottom: 3px !important;
    padding: 2px !important;
  }
  .preview-tab-btn {
    padding: 2px 6px !important;
    font-size: 0.7rem !important;
  }

  /* Mobile Preview Layout: Large Centered Photo */
  #singlePreviewContainer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 2px 0 !important;
  }

  #singlePreviewContainer > div:first-child {
    min-height: unset !important;
    max-height: 180px !important;
    height: 180px !important;
    width: auto !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #singleCanvas {
    max-height: 175px !important;
    max-width: 145px !important;
    border-radius: 5px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
  }

  /* Checkbox & Collapsible Action Container */
  .preview-card > div:last-child label {
    padding: 3px 6px !important;
    font-size: 0.72rem !important;
    margin-top: 2px !important;
  }

  /* Action Buttons in a compact 4-across row for mobile */
  .action-buttons-group {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 3px !important;
    margin-top: 3px !important;
  }

  .action-buttons-group .btn-action-studio {
    padding: 0.3rem 0.15rem !important;
    font-size: 0.68rem !important;
    flex-direction: column !important;
    gap: 1px !important;
    border-radius: 4px !important;
  }
  .action-buttons-group .btn-action-studio svg {
    width: 11px !important;
    height: 11px !important;
  }

  /* EDITING CONTROLS PANEL: SPACIOUS & SMOOTHLY SCROLLABLE BELOW */
  .studio-panel {
    order: 2 !important;
    width: 100% !important;
    padding: 0.75rem !important;
    margin: 10px 0 0 0 !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  }

  .panel-section-title {
    font-size: 0.8rem !important;
    margin: 0.65rem 0 0.3rem 0 !important;
  }

  /* Mobile Touch-Friendly Beauty Preset Buttons (2x2 Grid) */
  .studio-panel .beauty-preset-btn {
    flex: 1 1 45% !important;
    padding: 7px 10px !important;
    font-size: 0.76rem !important;
    text-align: center !important;
  }

  /* Mobile Touch Sliders (Buttery Smooth Dragging) */
  .studio-panel input[type="range"] {
    height: 8px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }

  .studio-panel input[type="range"]::-webkit-slider-thumb {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: #0284c7 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
  }

  /* Mobile Touch-Friendly Dropdowns & Buttons */
  .studio-panel select, .studio-panel .studio-select, .studio-panel input[type="text"] {
    min-height: 38px !important;
    font-size: 0.82rem !important;
    padding: 6px 10px !important;
  }

  .studio-panel .color-swatch-btn {
    width: 34px !important;
    height: 34px !important;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 75px !important;
  }

  .btn-action-studio {
    padding: 0.6rem 0.5rem !important;
    font-size: 0.78rem !important;
  }

  .size-preset-grid {
    max-height: 200px !important;
  }

  .sheet-stage-container {
    min-height: 380px !important;
    max-height: 480px !important;
    padding: 0.75rem !important;
  }

  .sheet-controls-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .control-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .size-preset-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .preset-chip {
    padding: 6px 8px !important;
  }

  .preset-chip-title {
    font-size: 0.78rem !important;
  }

  .preset-chip-sub {
    font-size: 0.68rem !important;
  }

  .crop-stage-container {
    height: 300px !important;
    min-height: 300px !important;
    max-height: 300px !important;
  }

  .face-guide-overlay {
    width: 140px !important;
    height: 180px !important;
  }
}

/* Fix for modals overlapping with mobile top and bottom navigation bars */
.modal {
    z-index: 9999999 !important;
}

/* Mobile Bottom Navigation (Always Visible with Safe Padding) */
@media (max-width: 992px) {
  body {
    padding-bottom: 95px !important;
  }

  .mobile-bottom-nav {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 999999 !important;
  }

  .mobile-bottom-nav-inner {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 3px 6px !important;
    gap: 4px !important;
  }

  .mobile-bottom-nav-inner::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .mobile-bottom-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: #475569 !important;
    font-size: 0.66rem !important;
    font-weight: 700 !important;
    padding: 4px 6px !important;
    border-radius: 10px !important;
    min-width: 62px !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    pointer-events: auto !important;
    white-space: nowrap !important;
  }
}

/* ==========================================================================
   PASSPORT PHOTO MAKER — UNIVERSAL PC SCREEN AUTO-FIT ENGINE
   ========================================================================== */
html, body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: clip !important;
}

.studio-main-container,
.passport-container,
.container {
  width: 100% !important;
  max-width: min(1440px, 94vw) !important;
  margin: 0 auto !important;
}

@media (min-width: 993px) {
  .studio-workspace-grid {
    display: grid !important;
    grid-template-columns: minmax(340px, 420px) 1fr !important;
    gap: 1.5rem !important;
    align-items: start !important;
  }
}

@media (max-width: 992px) {
  .studio-workspace-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    padding: 0.5rem !important;
  }

  .crop-stage-container {
    height: clamp(280px, 45vh, 420px) !important;
    min-height: 280px !important;
    max-height: 420px !important;
    width: 100% !important;
  }

  .preview-sheet-canvas-wrapper,
  .passport-sheet-preview {
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  .preview-sheet-canvas-wrapper canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  .passport-actions-row,
  .studio-actions-bar {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .btn-studio-action,
  .btn-print,
  .btn-download-passport {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.75rem 1rem !important;
  }
}

@media (max-width: 480px) {
  .size-preset-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
}






