/* ================================================
   華樂比影片工房 — Style Sheet
   Design: Warm, friendly, mobile-first, premium
   ================================================ */

/* -------- CSS Variables -------- */
:root {
  --primary: #f49d39;
  --primary-dark: #e07820;
  --primary-light: #fff8ec;
  --primary-gradient: linear-gradient(135deg, #f49d39 0%, #e07820 100%);
  --secondary: #eff6ff;
  --secondary-dark: #2563eb;

  --bg: #fffbf5;
  --bg-card: #ffffff;
  --bg-hover: #fff8ec;
  --bg-modal: rgba(0, 0, 0, 0.45);

  --text: #3d2e1a;
  --text-secondary: #7c7062;
  --text-muted: #bdae9c;
  --text-on-primary: #fff;

  --border: #ffedd5;
  --border-focus: var(--primary);

  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --info: #2196f3;

  --shadow-sm: 0 2px 6px rgba(61, 46, 26, 0.04);
  --shadow-md: 0 6px 18px rgba(61, 46, 26, 0.06);
  --shadow-lg: 0 10px 30px rgba(61, 46, 26, 0.1);
  --shadow-xl: 0 20px 50px rgba(61, 46, 26, 0.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 50%;

  --font-ui: 'Noto Sans TC', -apple-system, sans-serif;
  --font-cn: 'Noto Sans TC', -apple-system, sans-serif;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* -------- Reset -------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-cn);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* -------- Header -------- */
.app-header {
  background: #ffffff;
  color: var(--text);
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
}

.tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-badge {
  font-size: 0.72rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(244, 157, 57, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 700;
}

/* -------- Compat Warning -------- */
.compat-warning {
  background: #fff3e0;
  border-bottom: 1px solid #ffe0b2;
  padding: 12px 20px;
}

.warning-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

/* -------- Wizard Container -------- */
.wizard {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px 40px;
  flex: 1;
}

/* -------- Step Navigation -------- */
.step-nav {
  padding: 24px 0 8px;
  position: sticky;
  top: 64px;
  z-index: 50;
  background: var(--bg);
}

.step-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 8px;
  color: var(--text-muted);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.dot-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: #e0e0e0;
  color: #999;
  transition: all var(--transition) var(--bounce);
}

.step-dot.active .dot-circle {
  background: var(--primary-gradient);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(240, 98, 146, 0.4);
}

.step-dot.completed .dot-circle {
  background: var(--success);
  color: #fff;
}

.step-dot.active .dot-label,
.step-dot.completed .dot-label {
  color: var(--text);
}

.dot-label {
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.step-line {
  flex: 1;
  max-width: 48px;
  height: 3px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
}

.step-line-fill {
  width: 0%;
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* -------- Step Content -------- */
.step {
  display: none;
  animation: fadeSlideIn 0.35s ease;
}

.step.active { display: block; }

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

.step-header {
  text-align: center;
  margin-bottom: 24px;
}

.step-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.step-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  gap: 12px;
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  transition: all var(--transition);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(240, 98, 146, 0.3);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(240, 98, 146, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) {
  background: #f5f5f5;
}

.btn-outline {
  background: transparent;
  color: var(--primary-dark);
  border: 2px solid var(--primary);
  padding: 8px 24px;
  font-weight: 600;
}
.btn-outline:hover {
  background: var(--primary-light);
}

.btn-text { background: none; border: none; color: var(--text-secondary); padding: 6px 12px; }
.btn-text:hover { color: var(--text); }

.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { color: #c62828; }

.btn-icon {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.btn-icon:hover { background: #f0f0f0; color: var(--text); }
.btn-icon:disabled { opacity: 0.3; }
.btn-icon.btn-danger:hover { background: #ffebee; color: var(--danger); }

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }

.btn-export {
  background: var(--primary-gradient);
  color: #fff;
  font-size: 1.15rem;
  padding: 16px 40px;
  border-radius: var(--radius-xl);
  box-shadow: 0 6px 24px rgba(240, 98, 146, 0.35);
  width: 100%;
  max-width: 320px;
}
.btn-export:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(240, 98, 146, 0.5);
}

.btn-download {
  text-decoration: none;
  font-size: 1.1rem;
  padding: 14px 32px;
}

/* -------- Drop Zone -------- */
.drop-zone {
  border: 2.5px dashed var(--primary);
  border-radius: var(--radius-xl);
  padding: 8px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
}

.drop-zone:hover, .drop-zone.dragover {
  background: var(--primary-light);
  border-color: var(--primary-dark);
  transform: scale(1.01);
}

.drop-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 8px;
}

.drop-icon {
  color: var(--primary);
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

.drop-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.drop-or {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drop-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* -------- Photo Grid -------- */
.photo-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 8px;
}

.photo-count {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.95rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.photo-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
  animation: popIn 0.3s var(--bounce);
}

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

.photo-card img,
.video-grid-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: .75rem;
  background: rgba(0,0,0,.55);
  border-radius: 4px;
  padding: 1px 4px;
}
.slide-video-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: .7rem;
  background: rgba(0,0,0,.5);
  border-radius: 3px;
  padding: 1px 3px;
}
.video-slide-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card:hover { transform: scale(1.04); }

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  cursor: pointer;
}

.photo-card:hover .photo-remove { opacity: 1; }

.photo-number {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------- Edit Toolbar -------- */
.edit-toolbar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toolbar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ratio-selector {
  display: flex;
  gap: 8px;
}

.ratio-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.ratio-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.ratio-icon-v, .ratio-icon-h {
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 2px;
}
.ratio-icon-v { width: 10px; height: 16px; }
.ratio-icon-h { width: 16px; height: 10px; }

/* -------- Slide List -------- */
.slide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slide-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  animation: fadeSlideIn 0.25s ease;
}

.slide-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.slide-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

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

.slide-number {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.slide-text-preview {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-text-preview.empty {
  color: var(--text-muted);
  font-style: italic;
}

.slide-duration-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.slide-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.music-upload {
  border: 2.5px dashed #c084fc;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
}

.music-upload:hover {
  background: #faf5ff;
  border-color: #a855f7;
}

.music-upload-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  gap: 8px;
}

.music-upload-icon {
  color: #a855f7;
  margin-bottom: 8px;
}

.music-upload-text {
  font-size: 1.05rem;
  font-weight: 600;
}

.music-upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.music-player {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.music-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.music-badge {
  font-size: 1.2rem;
}

.music-filename {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-remove { color: var(--danger); }
.btn-remove:hover { background: #ffebee !important; }

.music-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-play {
  width: 40px !important;
  height: 40px !important;
  border-radius: var(--radius-full) !important;
  background: var(--primary-light) !important;
  color: var(--primary-dark) !important;
  font-size: 1rem !important;
}

.volume-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-label { font-size: 1.1rem; }

.volume-pct {
  font-size: 0.8rem;
  color: var(--text-secondary);
  width: 36px;
  text-align: right;
}

/* -------- Form Elements -------- */
.text-input, .select-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color var(--transition);
  outline: none;
}

.text-input:focus, .select-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(240, 98, 146, 0.15);
}

.select-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.range-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: #e0e0e0;
  outline: none;
  cursor: pointer;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(240, 98, 146, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.color-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-input {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
  background: none;
}

.color-hex {
  font-size: 0.8rem;
  font-family: monospace;
  color: var(--text-secondary);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-half { flex: 1; }

/* -------- Preview Section -------- */
.preview-area {
  margin-bottom: 20px;
}

.preview-frame {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1d1b18;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 9 / 16;
}

.preview-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  transition: opacity var(--transition);
  cursor: pointer;
}

.preview-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.preview-play-btn {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.9);
  border: none;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s var(--bounce);
  cursor: pointer;
}

.preview-play-btn:hover {
  transform: scale(1.1);
}

.preview-bar {
  max-width: 360px;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  flex: 1;
  height: 5px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.time-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* -------- Export Section -------- */
.export-info-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.export-options-row {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 0.88rem;
}

.export-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.export-progress {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.progress-bar-lg {
  height: 10px;
  background: #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill-lg {
  width: 0%;
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 5px;
  transition: width 0.2s ease;
}

.progress-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.progress-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.export-done {
  text-align: center;
  animation: popIn 0.4s var(--bounce);
}

.done-check {
  font-size: 3rem;
  margin-bottom: 8px;
}

.done-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* -------- Modal -------- */
dialog.modal {
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 680px;
  width: calc(100% - 32px);
  max-height: 90dvh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s var(--bounce);
}

dialog.modal::backdrop {
  background: var(--bg-modal);
  animation: fadeIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-x {
  color: var(--text-muted);
}

.modal-body {
  display: flex;
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
}

.modal-preview {
  flex-shrink: 0;
  width: 180px;
}

.modal-preview canvas {
  width: 100%;
  border-radius: var(--radius-sm);
  background: #1a1a2e;
  box-shadow: var(--shadow-sm);
}

.modal-form {
  flex: 1;
  min-width: 0;
}

.modal-bottom {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

/* -------- Toast -------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: all 0.3s var(--bounce);
  pointer-events: auto;
  max-width: 90vw;
  text-align: center;
}

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

.toast-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.toast-warning { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
.toast-error   { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.toast-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* -------- Footer -------- */
.app-footer {
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  background: #ffffff;
}

.footer-hint {
  font-size: 0.78rem;
  color: #9ca3af;
  font-weight: 500;
  margin-bottom: 4px;
}

.footer-brand {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.footer-hint-sub {
  font-size: 0.72rem;
  color: #c084fc;
  font-weight: 600;
}

/* ================================================
   Responsive
   ================================================ */

/* Mobile: stack modal vertically */
@media (max-width: 640px) {
  .modal-body {
    flex-direction: column;
    align-items: center;
  }

  .modal-preview {
    width: 200px;
  }

  .header-badge { display: none; }

  .step-nav { top: 56px; }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .step-header h2 { font-size: 1.2rem; }

  .btn-lg { padding: 12px 20px; font-size: 0.92rem; }

  .edit-toolbar { flex-direction: column; gap: 14px; }

  .export-info-row { gap: 12px; font-size: 0.82rem; }

  .preview-frame { max-width: 280px; }
  .preview-bar { max-width: 280px; }

  .slide-card {
    gap: 8px;
    padding: 8px;
  }

  .slide-thumb {
    width: 72px;
    height: 72px;
  }

  .slide-actions { gap: 0; }
  .slide-actions .btn-icon { width: 32px; height: 32px; font-size: 0.95rem; }
}

/* Large screens */
@media (min-width: 900px) {
  .wizard { padding: 0 24px 60px; }
  .step-header { margin-bottom: 32px; }
  .preview-frame { max-width: 400px; }
  .preview-bar { max-width: 400px; }
}

/* Touch devices: always show remove button */
@media (hover: none) {
  .photo-remove { opacity: 0.8; }
}

/* ====== Position Grid ====== */
.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 32px);
  gap: 4px;
}
.pos-btn {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.pos-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.pos-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ====== Slide Inline Edit ====== */
.slide-text-preview { cursor: pointer; }
.slide-text-preview:hover { text-decoration: underline dotted; color: var(--primary); }

.slide-inline-edit { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.slide-text-input {
  width: 100%;
  padding: 5px 8px;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-card);
  outline: none;
}
.slide-dur-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary);
}
.slide-dur-input {
  width: 52px;
  padding: 4px 6px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-card);
  text-align: center;
}

/* Inline position grid */
.inline-pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 3px;
}
.inline-pos-btn {
  width: 28px; height: 28px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--bg-card);
  cursor: pointer;
  padding: 0;
  transition: all 0.12s;
}
.inline-pos-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.inline-pos-btn.active { background: var(--primary); border-color: var(--primary); }
