/* ==========================================================================
   FS PEPTIDES STUDIO — DESIGN MODERNO DUPLA VERSÃO (DESKTOP STUDIO + MOBILE APP)
   Identidade Visual: Azul Elétrico FS, Marinho Farmacêutico & Prata Metálico
   ========================================================================== */

:root {
  --fs-bg-deep: #040914;
  --fs-bg-surface: #0a1326;
  --fs-card-bg: #0e1a33;
  --fs-card-elevated: #142342;
  --fs-blue: #0062ff;
  --fs-blue-bright: #2b7fff;
  --fs-cyan: #38bdf8;
  --fs-emerald: #10b981;
  --fs-silver: #cbd5e1;
  --fs-border: rgba(148, 163, 184, 0.16);
  --fs-border-glow: rgba(43, 127, 255, 0.4);
  --text-main: #f8fafc;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-ui: 'Inter', 'Segoe UI', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-card: 0 12px 32px -8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background: var(--fs-bg-deep);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(0, 98, 255, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 88% 10%, rgba(56, 189, 248, 0.1) 0%, transparent 40%);
  color: var(--text-main);
  font-family: var(--font-ui);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ================= APP SHELL WRAPPER ================= */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Simulador de Celular apenas no Desktop (>= 961px) quando usuário escolhe "App" */
@media (min-width: 961px) {
  body.force-mobile-sim {
    background: #02050c;
    padding: 1.25rem 0;
  }

  body.force-mobile-sim .app-shell {
    width: 420px;
    max-width: 96vw;
    min-height: 820px;
    max-height: 92vh;
    margin: 0 auto;
    border-radius: 34px;
    border: 6px solid #1e293b;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.12);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    background: var(--fs-bg-deep);
  }
}

/* ================= TOP HEADER ================= */
.app-header {
  background: rgba(8, 17, 36, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--fs-border);
  position: sticky;
  top: 0;
  z-index: 60;
}

.header-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #0b1e45, #050f24);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 16px rgba(0, 98, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #ffffff;
}

.badge-pro {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(0, 98, 255, 0.28), rgba(56, 189, 248, 0.2));
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.38);
}

.logo-text p {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.header-right-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Seletor de 3 Idiomas no Topo (PT-BR, EN, 中文) */
.lang-switcher {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--fs-border);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.32rem 0.68rem;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.lang-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.lang-btn.active {
  background: linear-gradient(135deg, #005ff4, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 95, 244, 0.4);
}

/* Seletor de Modo (Auto / Desktop / App Celular) */
.mode-switcher {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--fs-border);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
}

.mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.32rem 0.6rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.mode-btn:hover {
  color: #ffffff;
}

.mode-btn.active {
  background: #1e293b;
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
}

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

.btn-header {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--fs-border);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-header:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-header-print {
  background: linear-gradient(135deg, rgba(0, 98, 255, 0.22), rgba(56, 189, 248, 0.18));
  border-color: rgba(56, 189, 248, 0.4);
  color: #93c5fd;
}

.btn-header-print:hover {
  background: linear-gradient(135deg, rgba(0, 98, 255, 0.38), rgba(56, 189, 248, 0.28));
  color: #ffffff;
}

.batch-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  padding: 0.08rem 0.42rem;
  border-radius: 9999px;
  font-weight: 800;
}

/* ================= DESKTOP STUDIO GRID ================= */
.workspace-grid {
  max-width: 1500px;
  width: 100%;
  margin: 1.25rem auto;
  padding: 0 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(380px, 530px) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}

.left-controls-column,
.right-studio-column {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
}

@media (min-width: 961px) {
  body:not(.force-mobile-sim) .right-studio-column {
    position: sticky;
    top: 4.8rem;
  }
}

/* ================= CARDS & SECTIONS ================= */
.section-card {
  background: var(--fs-card-bg);
  border: 1px solid var(--fs-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-card);
  position: relative;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.step-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--fs-blue), var(--fs-cyan));
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ================= PASSO 1: PEPTÍDEOS ================= */
.search-box-wrap {
  position: relative;
  margin-bottom: 0.7rem;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.7rem 0.85rem 0.7rem 2.4rem;
  background: #070e1d;
  border: 1px solid var(--fs-border);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--fs-blue-bright);
  box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.22);
}

.category-filter-bar {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.45rem;
  margin-bottom: 0.65rem;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.category-filter-bar::-webkit-scrollbar { height: 5px; }
.category-filter-bar::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }

.cat-pill {
  padding: 0.32rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #13203b;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.16s ease;
}

.cat-pill:hover {
  background: #1d2f54;
  color: #ffffff;
}

.cat-pill.active {
  background: linear-gradient(135deg, var(--fs-blue), var(--fs-blue-bright));
  color: #ffffff;
  border-color: rgba(147, 197, 253, 0.45);
  box-shadow: 0 3px 10px rgba(0, 98, 255, 0.35);
}

.peptides-grid-wrap {
  max-height: 225px;
  overflow-y: auto;
  background: #060c1a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.45rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.42rem;
  scrollbar-width: thin;
}

.peptide-item {
  padding: 0.55rem 0.68rem;
  background: #111e38;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}

.peptide-item:hover {
  background: #182b50;
  border-color: rgba(56, 189, 248, 0.38);
  transform: translateY(-1px);
}

.peptide-item.active {
  background: linear-gradient(135deg, #0057e7, #1d4ed8);
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(0, 98, 255, 0.38);
}

.peptide-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peptide-cat-sub {
  font-size: 0.67rem;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peptide-item.active .peptide-cat-sub {
  color: #dbeafe;
}

.name-edit-wrap {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.name-edit-wrap label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-with-actions {
  display: flex;
  gap: 0.4rem;
}

.text-input-field {
  flex: 1;
  min-width: 0;
  padding: 0.62rem 0.82rem;
  background: #070e1d;
  border: 1px solid var(--fs-border);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.text-input-field:focus {
  outline: none;
  border-color: var(--fs-blue-bright);
  box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.22);
}

.btn-icon-action {
  background: #1e293b;
  border: 1px solid var(--fs-border);
  color: #ffffff;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.15s;
}

.btn-icon-action:hover {
  background: #334155;
}

/* ================= PASSO 2: DOSAGEM ================= */
.unit-toggle-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.38rem;
  margin-bottom: 0.75rem;
}

.unit-btn {
  padding: 0.55rem 0.35rem;
  background: #111e38;
  border: 1px solid var(--fs-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: center;
}

.unit-btn:hover {
  background: #1a2d52;
  color: #ffffff;
}

.unit-btn.active {
  background: linear-gradient(135deg, #005ff4, #2563eb);
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 95, 244, 0.35);
}

.dosage-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  max-height: 145px;
  overflow-y: auto;
  padding: 0.2rem 0;
}

.dose-chip {
  padding: 0.42rem 0.78rem;
  background: #111e38;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dose-chip:hover {
  background: #1c3159;
  border-color: var(--fs-cyan);
  color: #ffffff;
}

.dose-chip.active {
  background: linear-gradient(135deg, #0284c7, #0062ff);
  border-color: #7dd3fc;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 98, 255, 0.4);
}

.custom-dosage-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.select-unit {
  padding: 0.62rem 0.8rem;
  background: #070e1d;
  border: 1px solid var(--fs-border);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

/* ================= PASSO 3: COMPOSIÇÃO & AJUSTES ================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control-sm {
  width: 100%;
  padding: 0.52rem 0.72rem;
  background: #070e1d;
  border: 1px solid var(--fs-border);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-control-sm:focus {
  outline: none;
  border-color: var(--fs-blue-bright);
}

.checkbox-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.35rem 0;
  cursor: pointer;
  user-select: none;
}

.checkbox-toggle-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--fs-blue-bright);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-toggle-row span {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.collapsible-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--fs-border);
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  padding: 0.58rem 0.75rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s;
  margin-top: 0.6rem;
}

.collapsible-trigger:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.collapsible-content {
  display: none;
  padding-top: 0.85rem;
  margin-top: 0.5rem;
}

.collapsible-content.open {
  display: block;
}

.sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.range-slider {
  width: 100%;
  accent-color: var(--fs-blue-bright);
  cursor: pointer;
}

/* ================= PREVIEW STAGE (RIGHT ON DESKTOP / PINNED TOP ON MOBILE) ================= */
.preview-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preview-title-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-title-area h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.tag-live {
  background: rgba(0, 98, 255, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.35);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.14rem 0.48rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.live-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  flex-shrink: 0;
}

.mobile-summary-pill {
  display: none;
  font-size: 0.7rem;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(0, 98, 255, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.3);
  padding: 0.16rem 0.52rem;
  border-radius: 9999px;
  white-space: nowrap;
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-toggle-btns {
  display: inline-flex;
  background: #070e1d;
  border: 1px solid var(--fs-border);
  border-radius: 9999px;
  padding: 2px;
}

.btn-view-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.68rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-view-toggle.active {
  background: var(--fs-blue);
  color: #ffffff;
}

.canvas-container {
  width: 100%;
  max-width: 100%;
  background: linear-gradient(145deg, #050914, #091326);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.7);
}

#stickerCanvas,
#sampleCompareImg {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: block;
}

#sampleCompareImg {
  display: none;
}

.canvas-specs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ================= EXPORT PANEL ================= */
.export-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.btn-primary-action {
  padding: 0.78rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  transition: all 0.2s ease;
  border: none;
  color: #ffffff;
}

.btn-download-png {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}
.btn-download-png:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.48);
}

.btn-download-hd {
  background: linear-gradient(135deg, #0052d4, #0072ff);
  box-shadow: 0 4px 16px rgba(0, 98, 255, 0.38);
}
.btn-download-hd:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 98, 255, 0.5);
}

.btn-secondary-action {
  background: #13203b;
  border: 1px solid var(--fs-border);
  color: #ffffff;
  padding: 0.68rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.16s ease;
}

.btn-secondary-action:hover {
  background: #1c2e54;
  border-color: rgba(147, 197, 253, 0.35);
}

.btn-full-width {
  grid-column: 1 / -1;
}

.btn-batch-add {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.32);
}

.btn-print-sheet {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

/* ================= MOBILE BOTTOM NAVIGATION BAR ================= */
.mobile-bottom-nav {
  display: none;
}

/* ================= MODO APP CELULAR (AUTOMÁTICO <= 960px OU SIMULADO NO PC) ================= */
@media (max-width: 960px) {
  .mode-switcher,
  .header-desktop-actions,
  .logo-text p {
    display: none !important;
  }

  .header-container {
    padding: 0.55rem 0.85rem;
  }

  .logo-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .logo-text h1 {
    font-size: 0.96rem;
  }

  .lang-btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.48rem;
  }

  .workspace-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    padding: 0.6rem 0.75rem 5.4rem;
    margin: 0;
    gap: 0.75rem;
  }

  .section-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .left-controls-column,
  .right-studio-column {
    display: contents;
  }

  /* Preview Fixa / Pinned no Topo como App Nativo */
  .preview-stage-card {
    order: -1;
    position: sticky;
    top: 52px;
    z-index: 40;
    padding: 0.7rem;
    border-radius: 16px;
    background: rgba(10, 19, 38, 0.96);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  }

  .preview-top-bar {
    margin-bottom: 0.45rem;
    flex-wrap: nowrap;
  }

  .preview-title-area h2 {
    display: none;
  }

  .mobile-summary-pill {
    display: inline-flex;
  }

  .canvas-container {
    padding: 0.4rem;
  }

  .canvas-specs-bar {
    display: none;
  }

  /* Sistema de Abas de Tela Única no Celular */
  .tab-panel {
    display: none;
    animation: appTabFade 0.2s ease-out;
  }

  body[data-mobile-tab="peptide"] .panel-peptide,
  body[data-mobile-tab="dosage"]  .panel-dosage,
  body[data-mobile-tab="adjust"]  .panel-adjust,
  body[data-mobile-tab="export"]  .panel-export {
    display: block;
  }

  .peptides-grid-wrap {
    max-height: 230px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .peptide-item {
    min-width: 0;
  }

  .unit-toggle-row {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Barra Inferior Fixa Tipo App iOS / Android */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 70;
    background: rgba(8, 15, 32, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0.35rem 0.35rem calc(0.4rem + env(safe-area-inset-bottom));
  }

  .bottom-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.35rem 0.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    transition: all 0.18s ease;
    position: relative;
  }

  .bottom-nav-btn.active {
    color: #38bdf8;
    background: rgba(0, 98, 255, 0.16);
  }

  .bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: 16%;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    padding: 0 4px;
    border-radius: 99px;
    font-weight: 800;
  }
}

/* Regras idênticas quando o usuário força o "Modo App" no computador */
body.force-mobile-sim .header-desktop-actions,
body.force-mobile-sim .logo-text p {
  display: none !important;
}

body.force-mobile-sim .header-container {
  padding: 0.6rem 0.85rem;
}

body.force-mobile-sim .logo-badge {
  width: 34px;
  height: 34px;
}

body.force-mobile-sim .logo-text h1 {
  font-size: 0.95rem;
}

body.force-mobile-sim .lang-btn {
  font-size: 0.68rem;
  padding: 0.24rem 0.44rem;
}

body.force-mobile-sim .workspace-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.75rem 5.4rem;
  margin: 0;
  gap: 0.75rem;
}

body.force-mobile-sim .section-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

body.force-mobile-sim .left-controls-column,
body.force-mobile-sim .right-studio-column {
  display: contents;
}

body.force-mobile-sim .preview-stage-card {
  order: -1;
  position: sticky;
  top: 54px;
  z-index: 40;
  padding: 0.7rem;
  border-radius: 16px;
  background: rgba(10, 19, 38, 0.96);
}

body.force-mobile-sim .preview-top-bar { margin-bottom: 0.45rem; flex-wrap: nowrap; }
body.force-mobile-sim .preview-title-area h2 { display: none; }
body.force-mobile-sim .mobile-summary-pill { display: inline-flex; }
body.force-mobile-sim .canvas-specs-bar { display: none; }

body.force-mobile-sim .tab-panel { display: none; animation: appTabFade 0.2s ease-out; }
body.force-mobile-sim[data-mobile-tab="peptide"] .panel-peptide,
body.force-mobile-sim[data-mobile-tab="dosage"]  .panel-dosage,
body.force-mobile-sim[data-mobile-tab="adjust"]  .panel-adjust,
body.force-mobile-sim[data-mobile-tab="export"]  .panel-export {
  display: block;
}

body.force-mobile-sim .peptides-grid-wrap {
  max-height: 220px;
  grid-template-columns: repeat(2, 1fr);
}

body.force-mobile-sim .unit-toggle-row {
  grid-template-columns: repeat(2, 1fr);
}

body.force-mobile-sim .mobile-bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  margin-top: auto;
  z-index: 70;
  background: rgba(8, 15, 32, 0.96);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.4rem;
}

body.force-mobile-sim .bottom-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.35rem 0.2rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  position: relative;
}

body.force-mobile-sim .bottom-nav-btn.active {
  color: #38bdf8;
  background: rgba(0, 98, 255, 0.16);
}

@keyframes appTabFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= MODAIS (FOLHA A4 & BATCH ZIP) ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 18, 0.86);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 0.85rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-window {
  background: var(--fs-card-bg);
  border: 1px solid var(--fs-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1080px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.modal-header {
  padding: 0.95rem 1.2rem;
  background: #070e1d;
  border-bottom: 1px solid var(--fs-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.modal-body {
  padding: 1.15rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.15rem;
}

@media (max-width: 860px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

.modal-controls-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.a4-preview-pane {
  background: #060b16;
  border: 1px solid var(--fs-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  justify-content: center;
  overflow: auto;
  max-height: 62vh;
}

.sheet-a4 {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 8mm 6mm;
  display: grid;
  gap: 3mm 3mm;
  align-content: start;
}

.sheet-a4.grid-24 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(8, 1fr); }
.sheet-a4.grid-18 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(6, 1fr); }
.sheet-a4.grid-14 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(7, 1fr); }
.sheet-a4.grid-12 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(6, 1fr); }

.sheet-sticker-slot {
  border: 1px dashed #cbd5e1;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}
.sheet-sticker-slot.no-border { border: none; }
.sheet-sticker-slot img { width: 100%; height: 100%; object-fit: contain; display: block; }

.modal-footer {
  padding: 0.85rem 1.2rem;
  background: #070e1d;
  border-top: 1px solid var(--fs-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.batch-table th,
.batch-table td {
  padding: 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--fs-border);
}

.batch-table th {
  background: #0b1428;
  color: var(--text-muted);
  font-weight: 600;
}

.batch-thumb {
  width: 64px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
}

.batch-empty-msg {
  text-align: center;
  padding: 2.2rem 1rem;
  color: var(--text-muted);
}

/* ================= TOAST ================= */
.toast-notice {
  position: fixed;
  bottom: 5.2rem;
  right: 1.5rem;
  background: linear-gradient(135deg, #005ff4, #0284c7);
  color: #ffffff;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(147, 197, 253, 0.35);
  transform: translateY(120px);
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

@media (min-width: 961px) {
  body:not(.force-mobile-sim) .toast-notice {
    bottom: 1.75rem;
  }
}

/* ================= IMPRESSÃO A4 ================= */
@media print {
  body * { visibility: hidden; }
  #printSheetContainer,
  #printSheetContainer * { visibility: visible; }
  #printSheetContainer {
    position: absolute;
    left: 0;
    top: 0;
    width: 210mm !important;
    min-height: 297mm !important;
    padding: 8mm 6mm !important;
    margin: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }
  @page { size: A4 portrait; margin: 0mm; }
}
