/* =========================================================
   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: center;
  justify-content: center;
  padding: 32px 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: 48px 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 ---------------- */
.app-icon {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
  color: #fff;
}

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

.app-title {
  text-align: center;
  font-size: 1.85rem;
  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.98rem;
  margin-bottom: 34px;
  line-height: 1.5;
}

/* ---------------- 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;
}

@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) {
  .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;
}

/* ---------------- 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-box {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  display: inline-block;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  margin: 10px 0 20px;
}

#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 {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

.editor-canvas-panel {
  background: #f8f9fb;
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 780px;
  position: relative;
}

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

.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-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

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

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

.control-group .slider-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 34px;
  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: 10px;
  margin-bottom: 10px;
}

.btn-rotate {
  flex: 1;
  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: 7px;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-rotate svg {
  width: 17px;
  height: 17px;
}

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

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

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

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

.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 {
    grid-template-columns: 1fr;
  }
  .choice-grid {
    grid-template-columns: 1fr;
  }
  .editor-canvas-panel {
    min-height: unset;
    padding: 10px;
  }
  .editor-canvas-panel canvas#editorCanvas {
    max-height: 62vh;
  }
  .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: 52vh;
  }
  .editor-controls-panel {
    gap: 14px;
  }
  .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;
  }
}

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