/* =========================================================
   Premium PDF Compressor - Stylesheet
   ========================================================= */

:root {
  --bg: #fafafa;
  --card-bg: #ffffff;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-light: #eff6ff;
  --success: #16a34a;
  --success-dark: #15803d;
  --danger: #dc2626;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border-light: #eef0f3;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 16px 50px rgba(0, 0, 0, 0.12);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(37, 99, 235, 0.05) 0%, transparent 45%);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
}

.app-wrapper {
  width: 100%;
  max-width: 640px;
}

/* ---------------- Glass Card ---------------- */
.glass-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 44px;
  position: relative;
  overflow: hidden;
  animation: fadeScaleIn 0.5s ease;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------------- Header (fully centered) ---------------- */
.app-header-centered {
  text-align: center;
  margin-bottom: 26px;
}

.app-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
  color: #fff;
}

.app-icon svg {
  width: 29px;
  height: 29px;
}

.app-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.app-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 4px;
  line-height: 1.45;
}

.app-subtitle-hindi {
  text-align: center;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0;
  line-height: 1.5;
}

.glass-card:has(#stepEditor.active) .app-header-centered,
.glass-card:has(#stepCrop.active) .app-header-centered {
  display: none;
}

.glass-card:has(#stepEditor.active),
.glass-card:has(#stepCrop.active) {
  padding: 18px 26px;
}

/* On the final sheet/export screen, the Hindi tagline and the
   WhatsApp/email value-prop badge would be redundant clutter above the
   Back button -- that screen shows its own contextual helper message
   instead (see .sheet-helper-badge). */
.glass-card:has(#stepSheet.active) .app-subtitle-hindi,
.glass-card:has(#stepSheet.active) .value-prop-badge {
  display: none;
}

/* ---------------- Upload Zone ---------------- */
.upload-zone {
  border: 2px dashed #d7dce2;
  border-radius: var(--radius-sm);
  background: #fbfcfd;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.upload-zone .upload-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--accent);
  opacity: 0.85;
}

.upload-zone .upload-text {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.upload-zone .upload-subtext {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.upload-divider {
  color: #b8bfc9;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 10px 0;
}

.btn-choose {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-choose:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.upload-meta {
  margin-top: 16px;
  font-size: 0.78rem;
  color: #9aa2ad;
}

/* ---------------- File Info Card ---------------- */
.file-info-card {
  background: #f8f9fb;
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  animation: fadeScaleIn 0.35s ease;
}

.file-info-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.file-info-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-info-icon svg {
  width: 24px;
  height: 24px;
}

.upload-progress-track {
  width: 100%;
  height: 6px;
  background: #e6e9ee;
  border-radius: 100px;
  overflow: hidden;
  margin-top: 14px;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border-radius: 100px;
  transition: width 0.2s ease;
}

.file-info-details {
  flex: 1;
  min-width: 0;
}

.file-info-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-info-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.file-remove-btn {
  background: none;
  border: none;
  color: #9aa2ad;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: var(--transition);
  flex-shrink: 0;
}

.file-remove-btn:hover {
  background: #fee2e2;
  color: var(--danger);
}

/* ---------------- Target Size ---------------- */
.target-size-group {
  margin-top: 26px;
}

.target-size-label {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
  display: block;
}

.target-size-input-wrap {
  position: relative;
}

.target-size-input {
  width: 100%;
  padding: 16px 128px 16px 18px;
  border-radius: var(--radius-sm);
  border: 2px solid #e6e9ee;
  font-size: 1.15rem;
  font-weight: 600;
  transition: var(--transition);
  background: #fbfcfd;
}

.target-size-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.target-size-unit-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  background: #eef0f3;
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}

.unit-option {
  border: none;
  background: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.unit-option:hover:not(.active) {
  color: var(--text-primary);
}

.unit-option.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.target-size-help {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

/* ---------------- Compress Button ---------------- */
.btn-compress {
  width: 100%;
  margin-top: 28px;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  color: #fff;
  border: none;
  padding: 18px;
  border-radius: var(--radius-sm);
  font-size: 1.08rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.btn-compress:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4);
}

.btn-compress:active:not(:disabled) {
  transform: translateY(0);
}

.btn-compress:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

/* ---------------- Processing Screen ---------------- */
.processing-screen {
  text-align: center;
  padding: 24px 0 8px;
}

.progress-circle-wrap {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 0 auto 28px;
}

.progress-circle-wrap svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-circle-bg {
  fill: none;
  stroke: #eef0f3;
  stroke-width: 10;
}

.progress-circle-fg {
  fill: none;
  stroke: url(#gradient-stroke);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease;
}

.progress-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--accent);
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: #eef0f3;
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border-radius: 100px;
  width: 0%;
  transition: width 0.4s ease;
}

.processing-message {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  min-height: 24px;
  animation: fadeIn 0.3s ease;
}

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

.processing-subtext {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* ---------------- Result Screen ---------------- */
.result-screen {
  animation: fadeScaleIn 0.4s ease;
}

.result-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.result-badge svg {
  width: 32px;
  height: 32px;
}

.result-title {
  text-align: center;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 24px;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.result-stat {
  background: #f8f9fb;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.result-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 6px;
}

.result-stat-value {
  font-size: 1.15rem;
  font-weight: 800;
}

.result-stat-value.accent { color: var(--accent); }
.result-stat-value.success { color: var(--success); }

.quality-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dcfce7;
  color: var(--success-dark);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 100px;
}

/* ---------------- Download Section ---------------- */
.download-section {
  border-top: 1px solid var(--border-light);
  margin-top: 24px;
  padding-top: 24px;
}

.download-label {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 8px;
  display: block;
}

.download-filename-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid #e6e9ee;
  font-size: 0.95rem;
  margin-bottom: 16px;
  transition: var(--transition);
  background: #fbfcfd;
}

.download-filename-input:focus {
  outline: none;
  border-color: var(--success);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.btn-download {
  width: 100%;
  background: linear-gradient(135deg, var(--success), #22c55e);
  color: #fff;
  border: none;
  padding: 18px;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.3);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(22, 163, 74, 0.4);
}

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

.btn-compress-another {
  width: 100%;
  background: #fff;
  border: 2px solid #e6e9ee;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 14px;
  padding: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-compress-another:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ---------------- Toast / Error Popup ---------------- */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1080;
  width: min(420px, 90vw);
}

.toast-error {
  background: #fff;
  border-left: 4px solid var(--danger);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideDown 0.3s ease;
}

.toast-success {
  border-left-color: #16a34a;
}

.toast-success .toast-icon {
  color: #16a34a;
}

@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -16px); }
  to { opacity: 1; transform: translate(0, 0); }
}

.toast-error .toast-icon {
  color: var(--danger);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.toast-error .toast-body {
  flex: 1;
}

.toast-error .toast-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.toast-error .toast-message {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: #9aa2ad;
  cursor: pointer;
  padding: 2px;
}

/* ---------------- Screen transitions ---------------- */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

.app-step {
  display: none;
}

.app-step.active {
  display: block;
  animation: fadeScaleIn 0.35s ease;
}

/* ---------------- Footer ---------------- */
.app-footer {
  text-align: center;
  margin-top: 22px;
  color: #b0b6bf;
  font-size: 0.78rem;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 576px) {
  body {
    padding: 24px 12px;
  }

  .glass-card {
    padding: 32px 22px;
  }

  .app-title {
    font-size: 1.5rem;
  }

  .upload-zone {
    padding: 34px 16px;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .target-size-input {
    padding-right: 112px;
    font-size: 1.05rem;
  }

  .unit-option {
    padding: 6px 10px;
    font-size: 0.74rem;
  }
}

/* ---------------- Accessibility ---------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.upload-zone:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   ID Print Studio specific additions
   ========================================================= */

.app-wrapper.wide {
  max-width: 960px;
}

.step-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 26px;
  margin-top: -10px;
}

.step-subtitle-hindi {
  text-align: center;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
  margin-top: -22px;
  margin-bottom: 26px;
}

.value-prop-badge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--accent-light, #eff6ff);
  border: 1px solid #dbe6fb;
  border-radius: 14px;
  padding: 12px 16px;
  margin-top: 14px;
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.value-prop-badge svg {
  width: 18px;
  height: 18px;
  color: #16a34a;
  flex-shrink: 0;
  margin-top: 2px;
}

.value-prop-hindi {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.sheet-helper-badge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--accent-light, #eff6ff);
  border: 1px solid #dbe6fb;
  border-radius: 14px;
  padding: 12px 16px;
  margin: 4px 0 18px;
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.sheet-helper-badge svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.sheet-helper-hindi {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* ---------------- Big choice cards (type / source select) ---------------- */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 10px;
}

.choice-card {
  background: #f8f9fb;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.choice-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.choice-card .choice-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #fff;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.choice-card .choice-icon svg {
  width: 28px;
  height: 28px;
}

.choice-card .choice-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.choice-card .choice-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.back-nav {
  background: var(--accent-light);
  border: 1px solid #dbe6fb;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 9px 16px 9px 12px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 18px;
  transition: var(--transition);
}

.back-nav:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.back-nav svg {
  width: 16px;
  height: 16px;
}

.yesno-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.yesno-btn {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 2px solid #e6e9ee;
  background: #fbfcfd;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.yesno-btn:hover {
  border-color: var(--accent);
}

.yesno-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ---------------- QR screen ---------------- */
.qr-wrap {
  text-align: center;
}

.qr-prompt-hindi {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 1.5;
  max-width: 420px;
  margin: -6px auto 4px;
}

.qr-box-frame {
  position: relative;
  display: inline-block;
  margin: 16px 0 20px;
  padding: 16px;
}

.qr-box {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  display: inline-block;
  box-shadow: 0 10px 34px rgba(37, 99, 235, 0.18), 0 2px 10px rgba(0, 0, 0, 0.06);
  border: 2px solid var(--accent-light, #eff6ff);
  position: relative;
  z-index: 1;
  animation: qr-glow 2.6s ease-in-out infinite;
}

@keyframes qr-glow {
  0%, 100% { box-shadow: 0 10px 34px rgba(37, 99, 235, 0.18), 0 2px 10px rgba(0, 0, 0, 0.06); }
  50% { box-shadow: 0 10px 40px rgba(37, 99, 235, 0.32), 0 2px 10px rgba(0, 0, 0, 0.06); }
}

.qr-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid var(--accent, #2563eb);
  z-index: 2;
}

.qr-corner-tl { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 10px 0 0 0; }
.qr-corner-tr { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 10px 0 0; }
.qr-corner-bl { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 10px; }
.qr-corner-br { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 10px 0; }

.qr-scan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  color: #fff;
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  padding: 6px 16px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  z-index: 3;
  animation: qr-badge-bounce 2.2s ease-in-out infinite;
}

.qr-scan-badge svg {
  width: 13px;
  height: 13px;
}

@keyframes qr-badge-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

#qrCanvasHolder {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 22px;
}

.qr-timer.urgent {
  background: #fee2e2;
  color: #b91c1c;
}

.qr-waiting-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.qr-received-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 14px 0;
}

.qr-received-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.qr-received-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------------- Editor layout ---------------- */
.editor-layout-split {
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 20px;
  align-items: stretch;
}

/* ---- Crop step (whole photo + drag handles) ---- */
.crop-only-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 380px;
}

.crop-only-actions .rotate-row {
  width: 100%;
}

.crop-only-actions .btn-compress {
  width: 100%;
}

.crop-layout-split {
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 20px;
  align-items: start;
}

.crop-canvas-scroll-wrap {
  max-height: 64vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: var(--radius-sm);
  background: #f8f9fb;
  scroll-behavior: smooth;
}

.editor-canvas-panel {
  background: #f8f9fb;
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

.editor-canvas-panel canvas#editorCanvas {
  max-width: 100%;
  border-radius: 8px;
  touch-action: none;
  cursor: grab;
  display: block;
}

.crop-controls-narrow {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 20px;
}

.btn-view-toggle {
  width: 100%;
  background: #fff;
  border: 2px solid #e6e9ee;
  color: var(--text-primary);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-view-toggle:hover,
.btn-view-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

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

.crop-controls-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.calibration-readout {
  background: #fffbeb;
  border: 2px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.calibration-readout-title {
  font-weight: 800;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #92400e;
  margin-bottom: 8px;
}

.calibration-readout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  padding: 3px 0;
  color: #78350f;
}

.calibration-readout-row strong {
  font-family: 'Courier New', monospace;
  font-size: 0.86rem;
}

.calibration-readout-hint {
  margin-top: 8px;
  font-size: 0.72rem;
  color: #92400e;
  line-height: 1.4;
}

/* ---- Enhance step (cropped result only, sized to fill exactly) ---- */
.enhance-left-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.enhance-canvas-panel {
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 25vh;
  max-height: 34vh;
  padding: 14px;
  overflow: hidden;
}

.enhance-canvas-panel canvas#cropLivePreviewCanvas {
  max-width: 100%;
  max-height: 32vh;
  display: block;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
}

.enhance-left-below-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.enhance-left-below-panel {
  background: #f8f9fb;
  border: 1px solid #e6e9ee;
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crop-live-preview-badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
}

}

.editor-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(248, 249, 251, 0.92);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  z-index: 5;
}

.magnifier-canvas {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 10;
  background: #000;
}

.editor-controls-narrow {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
  height: 100%;
}

.enhance-controls-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef0f3;
}

.enhance-controls-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.editor-action-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.editor-action-row .btn-reset-edits,
.editor-action-row .btn-compress {
  margin: 0;
}

.control-group {
  margin: 0;
}

.control-group label {
  font-weight: 700;
  font-size: 0.7rem;
  display: block;
  margin-bottom: 2px;
}

.control-group .slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-group input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.control-group .slider-value {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 30px;
  text-align: right;
}

.btn-auto-enhance {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-auto-enhance:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-auto-enhance.active {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.btn-auto-enhance svg {
  width: 18px;
  height: 18px;
}

.btn-bw-toggle {
  width: 100%;
  background: #fff;
  color: var(--text-primary);
  border: 2px solid #e6e9ee;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
}

.btn-bw-toggle:hover {
  border-color: #6b7280;
}

.btn-bw-toggle.active {
  background: linear-gradient(135deg, #374151, #6b7280);
  color: #fff;
  border-color: transparent;
}

.btn-bw-toggle svg {
  width: 18px;
  height: 18px;
}

.rotate-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.rotate-row .btn-rotate {
  flex: 1;
  background: #fff;
  border: 2px solid #e6e9ee;
  color: var(--text-primary);
  padding: 7px 6px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  white-space: normal;
  line-height: 1.2;
}

.btn-rotate:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.rotate-row .btn-rotate svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

#bwSensitivityGroup,
#bwWindowGroup {
  opacity: 0.5;
  transition: var(--transition);
}

#bwSensitivityGroup.enabled,
#bwWindowGroup.enabled {
  opacity: 1;
}

.editor-action-row .btn-reset-edits {
  width: 100%;
  background: none;
  border: 2px solid #e6e9ee;
  color: var(--text-secondary);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-reset-edits:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.editor-controls-narrow .btn-auto-enhance {
  padding: 9px;
  font-size: 0.78rem;
}

.editor-controls-narrow .btn-auto-enhance svg {
  width: 15px;
  height: 15px;
}

.editor-action-row .btn-compress {
  padding: 12px;
  font-size: 0.92rem;
  margin-top: 0;
}

.editor-step-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

@media (max-width: 760px) {
  .editor-layout-split {
    grid-template-columns: 1fr;
  }
  .choice-grid {
    grid-template-columns: 1fr;
  }
  .enhance-left-below-grid {
    grid-template-columns: 1fr;
  }
  .editor-controls-narrow {
    height: auto;
  }
  .enhance-canvas-panel {
    min-height: unset;
    max-height: unset;
    padding: 10px;
  }
  .enhance-canvas-panel canvas#cropLivePreviewCanvas {
    max-height: 32vh;
  }
  .editor-canvas-panel {
    min-height: unset;
    max-height: unset;
    padding: 10px;
  }
  .editor-canvas-panel canvas#editorCanvas {
    max-height: 46vh;
  }
  .magnifier-canvas {
    width: 100px;
    height: 100px;
  }
  .a4-preview-panel {
    max-height: 50vh;
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .editor-canvas-panel canvas#editorCanvas {
    max-height: 40vh;
  }
  .enhance-canvas-panel canvas#cropLivePreviewCanvas {
    max-height: 40vh;
  }
  .editor-controls-narrow {
    gap: 8px;
  }
  .back-nav {
    padding: 8px 14px 8px 10px;
    font-size: 0.8rem;
  }
}

/* ---------------- Final export screen ---------------- */
.export-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}

.a4-preview-panel {
  background: #eef0f3;
  border-radius: var(--radius-sm);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-height: 50vh;
  overflow-y: auto;
}

.a4-preview-panel canvas {
  max-width: 100%;
  width: 100%;
  height: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  background: #fff;
}

.export-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-export {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-export svg {
  width: 19px;
  height: 19px;
}

.btn-export.jpeg {
  background: #fff;
  color: var(--text-primary);
  border: 2px solid #e6e9ee;
}
.btn-export.jpeg:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-export.pdf {
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  color: #fff;
}
.btn-export.pdf:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-export.print {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
}
.btn-export.print:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.3);
}

@media (max-width: 760px) {
  .export-layout {
    grid-template-columns: 1fr;
  }
}

/* ---------------- Print stylesheet ---------------- */
@media print {
  body * {
    visibility: hidden;
  }
  #printableArea, #printableArea * {
    visibility: visible;
  }
  #printableArea {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #printableArea img {
    width: 210mm;
    height: 297mm;
    object-fit: contain;
  }
  @page {
    size: A4;
    margin: 0;
  }
}

/* =========================================================
   Passport Photo Studio specific additions
   ========================================================= */

/* ---------------- People count step ---------------- */
.count-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 24px 0 10px;
}

.count-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #e6e9ee;
  background: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.count-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.count-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.count-display {
  min-width: 90px;
  text-align: center;
}

.count-display .count-number {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.count-display .count-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 4px;
}

/* ---------------- Color edit panel ---------------- */
.panel-section-label {
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 18px 0 10px;
}

.panel-section-label:first-child {
  margin-top: 0;
}

/* ---------------- Border controls ---------------- */
.border-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn-bg-remove {
  width: 100%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  border: none;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.btn-bg-remove:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
}

.btn-bg-remove:disabled {
  opacity: 0.75;
  cursor: wait;
}

.btn-bg-remove.active {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.btn-bg-remove svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.bg-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  opacity: 0.4;
  pointer-events: none;
  transition: var(--transition);
}

.bg-color-row.enabled {
  opacity: 1;
  pointer-events: auto;
}

.bg-color-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 2px;
}

.bg-color-row .bg-swatch,
.bg-color-row .bg-swatch-custom {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #e6e9ee;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.bg-color-row .bg-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.bg-color-row .bg-swatch-custom {
  overflow: hidden;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
}

.bg-color-row .bg-swatch-custom input[type="color"] {
  width: 140%;
  height: 140%;
  margin: -20%;
  border: none;
  cursor: pointer;
}

.border-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #e6e9ee;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.border-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.border-swatch-custom {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #e6e9ee;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
}

.border-swatch-custom input[type="color"] {
  width: 140%;
  height: 140%;
  margin: -20%;
  border: none;
  cursor: pointer;
}

/* ---------------- Sheet margin control ---------------- */
.sheet-controls {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  justify-content: flex-start;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.per-person-copies {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.per-person-copy-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fb;
  border: 1px solid #e6e9ee;
  padding: 8px 12px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
}

.per-person-copy-item .person-label {
  color: var(--text-secondary);
  white-space: nowrap;
}

.per-person-copy-item input[type="number"] {
  width: 48px;
  border: 1px solid #e6e9ee;
  border-radius: 8px;
  padding: 4px 6px;
  font-weight: 700;
  text-align: center;
}

.copy-presets {
  display: flex;
  gap: 4px;
}

.copy-preset-btn {
  background: #fff;
  border: 1px solid #e6e9ee;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.copy-preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-preset-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sheet-controls .control-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fb;
  padding: 10px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
}

.sheet-controls input[type="number"] {
  width: 56px;
  border: 1px solid #e6e9ee;
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 700;
  text-align: center;
}

.sheet-controls select {
  border: 1px solid #e6e9ee;
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
}

.sheet-count-badge {
  background: var(--accent-light);
  color: var(--accent);
  padding: 10px 18px;
  border-radius: 100px;
  font-weight: 800;
  font-size: 0.85rem;
}

/* ---------------- Mini crop thumbnails (progress through people) ---------------- */
.people-progress-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.people-progress-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eef0f3;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: var(--transition);
}

.people-progress-dot.done {
  background: #dcfce7;
  color: var(--success-dark, #15803d);
}

.people-progress-dot.current {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

@media (max-width: 576px) {
  .count-stepper {
    gap: 14px;
  }
  .count-btn {
    width: 48px;
    height: 48px;
  }
}

/* ---------------- Small inline loading spinner ---------------- */
.thumb-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(37, 99, 235, 0.25);
  border-top-color: var(--accent, #2563eb);
  border-radius: 50%;
  animation: thumb-spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes thumb-spin {
  to { transform: rotate(360deg); }
}

/* ---------------- Aadhaar Print Studio specific ---------------- */
.page-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.page-pick-card {
  background: #f8f9fb;
  border: 2px solid #e6e9ee;
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.page-pick-card:hover {
  border-color: var(--accent);
}

.page-pick-card img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
  display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.page-pick-card-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.crop-side-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  flex-wrap: wrap;
}

.crop-side-badge {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 7px 18px;
  border-radius: 100px;
}

.crop-side-hint {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.enhance-preview-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}

.enhance-card-preview {
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 14px 14px;
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.enhance-card-label {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.enhance-card-preview canvas {
  max-width: 280px;
  max-height: 46vh;
  display: block;
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.14);
}

.export-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #f0fdf4;
  color: var(--success-dark, #15803d);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.export-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.export-layout-split {
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 20px;
  align-items: start;
}

.final-card-preview {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px;
  background: #f8f9fb;
  border-radius: var(--radius-sm);
  max-height: 50vh;
  overflow-y: auto;
}

.final-card-preview canvas {
  width: 100%;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
}

.export-controls-narrow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.export-controls-section {
  padding-bottom: 16px;
  border-bottom: 1px solid #eef0f3;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.export-controls-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.export-controls-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.sheet-count-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sheet-count-row input[type="number"] {
  width: 52px;
  border: 2px solid #e6e9ee;
  border-radius: 8px;
  padding: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  flex-shrink: 0;
}

.copy-presets {
  display: flex;
  gap: 6px;
  padding-left: 12px;
  border-left: 1px solid #e6e9ee;
}

.copy-preset-btn {
  background: #f8f9fb;
  border: 1px solid #e6e9ee;
  border-radius: 8px;
  min-width: 30px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.copy-preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-preset-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.export-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-export-secondary,
.btn-export-primary,
.btn-export-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  width: 100%;
}

.back-nav.wide {
  width: 100%;
  justify-content: center;
}

.btn-export-secondary svg,
.btn-export-primary svg,
.btn-export-success svg {
  width: 18px;
  height: 18px;
}

.btn-export-secondary {
  background: #fff;
  border: 2px solid #e6e9ee;
  color: var(--text-primary);
}

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

.btn-export-primary {
  background: var(--accent);
  color: #fff;
}

.btn-export-primary:hover {
  background: #1d4ed8;
}

.btn-export-success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
}

.btn-export-success:hover {
  filter: brightness(1.05);
}

@media (max-width: 640px) {
  .export-actions {
    grid-template-columns: 1fr;
  }
  .enhance-preview-row {
    flex-direction: column;
    align-items: center;
  }
}

/* ---------------- PDF password modal ---------------- */
.pdf-password-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pdf-password-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: fadeScaleIn 0.3s ease;
}

.pdf-password-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.pdf-password-icon svg {
  width: 26px;
  height: 26px;
}

.pdf-password-card h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.pdf-password-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 18px;
}

.pdf-password-input {
  width: 100%;
  border: 2px solid #e6e9ee;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.pdf-password-input:focus {
  outline: none;
  border-color: var(--accent);
}

.pdf-password-error {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.pdf-password-hint-col {
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: left;
  margin-bottom: 20px;
}

.pdf-password-hint-title {
  font-weight: 800;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 6px;
}

.pdf-password-hint-body {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.pdf-password-hint-body code {
  background: #fff;
  border: 1px solid #dbe6fb;
  border-radius: 6px;
  padding: 1px 6px;
  font-weight: 700;
  color: var(--accent);
}

.pdf-password-actions {
  display: flex;
  gap: 10px;
}

.pdf-password-actions .back-nav {
  flex-shrink: 0;
}

.pdf-password-actions .btn-compress {
  flex: 1;
}

.pricing-strip {
  background: #1E293B;
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  text-align: center;
  padding: 8px 12px;
}
.pricing-strip strong { color: #FDE68A; }
