*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root, [data-theme="light"] {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --text: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --danger: #ef4444;
  --success: #10b981;
  --mockup-scale: 0.8;
}

[data-theme="dark"] {
  --primary: #818cf8; --primary-hover: #6366f1; --primary-light: #312e81;
  --bg: #0f172a; --bg-secondary: #1e293b; --bg-tertiary: #334155;
  --text: #f1f5f9; --text-secondary: #94a3b8;
  --border: #334155; --border-strong: #475569; --card: #1e293b;
}

[data-theme="ocean"] { --primary: #0891b2; --primary-light: #cffafe; --bg: #ecfeff; --bg-secondary: #cffafe; --bg-tertiary: #a5f3fc; --text: #083344; --text-secondary: #155e75; --border: #67e8f9; --card: #ffffff; }
[data-theme="sunset"] { --primary: #f97316; --primary-light: #fed7aa; --bg: #fff7ed; --bg-secondary: #ffedd5; --bg-tertiary: #fed7aa; --text: #7c2d12; --text-secondary: #9a3412; --border: #fdba74; --card: #ffffff; }
[data-theme="forest"] { --primary: #16a34a; --primary-light: #dcfce7; --bg: #f0fdf4; --bg-secondary: #dcfce7; --bg-tertiary: #bbf7d0; --text: #14532d; --text-secondary: #166534; --border: #86efac; --card: #ffffff; }
[data-theme="lavender"] { --primary: #a855f7; --primary-light: #f3e8ff; --bg: #faf5ff; --bg-secondary: #f3e8ff; --bg-tertiary: #e9d5ff; --text: #581c87; --text-secondary: #6b21a8; --border: #d8b4fe; --card: #ffffff; }
[data-theme="midnight"] { --primary: #a78bfa; --primary-light: #4c1d95; --bg: #0a0a1f; --bg-secondary: #1a1535; --bg-tertiary: #2d2555; --text: #ede9fe; --text-secondary: #c4b5fd; --border: #4c1d95; --card: #1a1535; }
[data-theme="solarized"] { --primary: #b58900; --primary-light: #fdf6e3; --bg: #fdf6e3; --bg-secondary: #eee8d5; --bg-tertiary: #d8d2bd; --text: #586e75; --text-secondary: #657b83; --border: #d8d2bd; --card: #fffbf0; }

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
}
[data-reduce-motion="true"] *, [data-reduce-motion="true"] *::before, [data-reduce-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

.navbar { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand-icon { font-size: 1.4rem; }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-link { display: block; padding: 8px 14px; color: var(--text-secondary); text-decoration: none; border-radius: 8px; font-weight: 500; font-size: 0.95rem; transition: 0.2s; }
.nav-link:hover { background: var(--bg-tertiary); color: var(--text); }
.nav-link.active { background: var(--primary-light); color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.container { max-width: 1200px; margin: 0 auto; padding: 32px 20px 60px; }
.container.narrow { max-width: 800px; }

.hero { text-align: center; padding: 20px 0 40px; }
.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.hero-subtitle { font-size: clamp(1rem, 2vw, 1.15rem); color: var(--text-secondary); max-width: 600px; margin: 0 auto 32px; }

.upload-zone { border: 2px dashed var(--border-strong); border-radius: 16px; padding: 48px 20px; background: var(--bg-secondary); cursor: pointer; transition: 0.3s; max-width: 700px; margin: 0 auto; outline: none; }
.upload-zone:hover, .upload-zone.dragover, .upload-zone:focus-visible { border-color: var(--primary); background: var(--primary-light); transform: translateY(-2px); }
.upload-content { text-align: center; pointer-events: none; }
.upload-content > * { pointer-events: auto; }
.upload-icon { width: 56px; height: 56px; color: var(--primary); margin-bottom: 12px; }
.upload-zone h3 { font-size: 1.2rem; margin-bottom: 6px; }
.upload-hint { font-size: 0.85rem; color: var(--text-secondary); margin-top: 8px; }
.link-btn { background: none; border: none; color: var(--primary); font-weight: 600; cursor: pointer; font-size: inherit; text-decoration: underline; font-family: inherit; padding: 0; }

.section { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--border); }
.section[hidden] { display: none !important; }
.section-header { margin-bottom: 20px; }
.section-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.section-sub { color: var(--text-secondary); font-size: 0.95rem; }
.badge { display: inline-block; background: var(--primary); color: white; padding: 2px 10px; border-radius: 12px; font-size: 0.85rem; margin-left: 8px; vertical-align: middle; }

.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.device-card { background: var(--card); border: 2px solid var(--border); border-radius: 12px; padding: 16px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: 0.2s; font-family: inherit; color: inherit; }
.device-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.device-card.selected { border-color: var(--primary); background: var(--primary-light); }
.device-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.device-thumb { display: flex; align-items: center; justify-content: center; height: 70px; }
.device-name { font-size: 0.85rem; font-weight: 600; }

/* Thumbnails */
.thumb-frame { position: relative; }
.thumb-iphone { width: 32px; height: 64px; background: linear-gradient(150deg, #3a3a3c 0%, #1c1c1e 100%); border-radius: 9px; padding: 2.5px; position: relative; }
.thumb-iphone .thumb-screen { width: 100%; height: 100%; background: linear-gradient(135deg, #4f46e5, #ec4899); border-radius: 7px; }
.thumb-iphone .thumb-island { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 14px; height: 4px; background: #000; border-radius: 2px; }
.thumb-ipad { width: 54px; height: 64px; background: linear-gradient(150deg, #d4d4d6 0%, #8e8e93 100%); border-radius: 5px; padding: 4px; }
.thumb-ipad .thumb-screen { width: 100%; height: 100%; background: linear-gradient(135deg, #06b6d4, #3b82f6); border-radius: 2px; }
.thumb-android { width: 32px; height: 64px; background: linear-gradient(150deg, #2c2c2e 0%, #0a0a0a 100%); border-radius: 9px; padding: 2.5px; position: relative; }
.thumb-android .thumb-screen { width: 100%; height: 100%; background: linear-gradient(135deg, #10b981, #3b82f6); border-radius: 7px; }
.thumb-android .thumb-punch { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; background: #000; border-radius: 50%; }
.thumb-watch { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 64px; }
.thumb-watch-band { width: 22px; height: 8px; background: linear-gradient(180deg, #2c2c2e, #1c1c1e); }
.thumb-band-top { border-radius: 3px 3px 0 0; margin-bottom: -2px; }
.thumb-band-bottom { border-radius: 0 0 3px 3px; margin-top: -2px; }
.thumb-watch-body { width: 30px; height: 40px; background: linear-gradient(150deg, #2c2c2e 0%, #0a0a0a 100%); border-radius: 8px; padding: 2px; position: relative; z-index: 2; }
.thumb-watch-screen { width: 100%; height: 100%; background: linear-gradient(135deg, #a855f7, #3b82f6); border-radius: 6px; }
.thumb-watch-crown { position: absolute; right: -2px; top: 50%; transform: translateY(-50%); width: 3px; height: 6px; background: #4a4a4c; border-radius: 1px; z-index: 3; }
.thumb-macbook-stack { display: flex; flex-direction: column; align-items: center; }
.thumb-lid { width: 76px; height: 46px; background: linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%); border-radius: 4px 4px 0 0; padding: 3px 3px 4px; position: relative; }
.thumb-lid .thumb-screen { width: 100%; height: 100%; background: linear-gradient(135deg, #a855f7, #ec4899); border-radius: 1px; }
.thumb-lid .thumb-notch { position: absolute; top: 1px; left: 50%; transform: translateX(-50%); width: 8px; height: 3px; background: #000; border-radius: 0 0 2px 2px; }
.thumb-base { width: 86px; height: 5px; background: linear-gradient(180deg, #c8c8ca 0%, #8e8e93 100%); border-radius: 0 0 4px 4px; position: relative; }
.thumb-base::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 16px; height: 1.5px; background: #48484a; border-radius: 0 0 1px 1px; }
.thumb-laptop-stack { display: flex; flex-direction: column; align-items: center; }
.thumb-laptop-lid { width: 80px; height: 48px; background: linear-gradient(180deg, #1f1f1f 0%, #0a0a0a 100%); border-radius: 4px 4px 0 0; padding: 5px; position: relative; }
.thumb-laptop-lid::before { content: ''; position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 3px; height: 3px; background: #2a2a2a; border-radius: 50%; }
.thumb-laptop-lid .thumb-screen { width: 100%; height: 100%; background: linear-gradient(135deg, #16a34a, #0891b2); }
.thumb-laptop-base { width: 92px; height: 6px; background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%); border-radius: 0 0 4px 4px; position: relative; }
.thumb-laptop-base::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 14px; height: 2px; background: #050505; }
.thumb-imac-stack { display: flex; flex-direction: column; align-items: center; }
.thumb-imac-display { width: 76px; height: 50px; background: linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%); padding: 3px 3px 5px; border-radius: 5px 5px 0 0; position: relative; }
.thumb-imac-display::before { content: ''; position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: radial-gradient(circle at 30% 30%, #4a4a4c, #0a0a0a); border-radius: 50%; }
.thumb-imac-display .thumb-screen { width: 100%; height: 100%; background: linear-gradient(135deg, #16a34a, #0891b2); border-radius: 1px; }
.thumb-imac-stand { width: 6px; height: 8px; background: linear-gradient(180deg, #aeaeb2, #8e8e93); }
.thumb-imac-foot { width: 28px; height: 4px; background: linear-gradient(180deg, #aeaeb2, #6e6e73); border-radius: 0 0 6px 6px; }
.thumb-tv-stack { display: flex; flex-direction: column; align-items: center; }
.thumb-tv-bezel { width: 84px; height: 50px; background: linear-gradient(180deg, #1c1c1e 0%, #0a0a0a 100%); padding: 3px; border-radius: 3px; }
.thumb-tv-bezel .thumb-screen { width: 100%; height: 100%; background: linear-gradient(135deg, #ec4899, #f59e0b); border-radius: 2px; }
.thumb-tv-legs { display: flex; justify-content: space-between; width: 60px; padding: 0 6px; margin-top: -1px; }
.thumb-tv-leg { width: 3px; height: 6px; background: #1c1c1e; }

.orientation-toggle { display: flex; align-items: center; gap: 10px; }
.orientation-toggle[hidden] { display: none !important; }
.orientation-toggle label { font-weight: 500; font-size: 0.9rem; }
.seg-btn { padding: 8px 16px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--text-secondary); font-family: inherit; transition: 0.2s; }
.seg-btn:hover { background: var(--bg-tertiary); }
.seg-btn.selected { background: var(--primary); color: white; border-color: var(--primary); }
.seg-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.options-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; padding: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 20px; }
.opt-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.color-pills, .bg-pills, .format-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.color-pill { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; transition: 0.2s; padding: 0; }
.color-pill:hover { transform: scale(1.05); }
.color-pill.selected { border-color: var(--primary); transform: scale(1.1); box-shadow: 0 0 0 2px var(--primary-light); }
.bg-pill { width: 36px; height: 36px; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; transition: 0.2s; padding: 0; position: relative; overflow: hidden; }
.bg-pill:hover { transform: scale(1.05); }
.bg-pill.selected { border-color: var(--primary); transform: scale(1.05); box-shadow: 0 0 0 2px var(--primary-light); }
.bg-pill-custom::after { content: '🎨'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 14px; filter: drop-shadow(0 0 1px rgba(0,0,0,0.5)); }
.format-pill { padding: 8px 14px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 600; font-family: inherit; color: var(--text); transition: 0.2s; }
.format-pill:hover { background: var(--bg-tertiary); }
.format-pill.selected { background: var(--primary); color: white; border-color: var(--primary); }
.format-pill:focus-visible, .color-pill:focus-visible, .bg-pill:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1; }
.range-row span { min-width: 40px; font-weight: 600; font-size: 0.9rem; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; background: var(--bg-tertiary); border-radius: 3px; outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; background: var(--primary); border-radius: 50%; cursor: pointer; transition: 0.2s; }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; background: var(--primary); border-radius: 50%; cursor: pointer; border: none; }

.custom-bg-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; background: var(--bg-secondary); border-radius: 8px; }
.custom-bg-controls[hidden] { display: none !important; }
.custom-bg-controls .mini-label { font-size: 0.85rem; font-weight: 600; margin: 0; }
.color-input-inline { width: 40px; height: 32px; border: 1px solid var(--border-strong); border-radius: 6px; cursor: pointer; padding: 2px; background: var(--bg); }
.hint-text { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-top: 6px; font-style: italic; }

.adjust-panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.adjust-panel[hidden] { display: none !important; }
.adjust-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.adjust-header h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.adjust-sub { color: var(--text-secondary); font-size: 0.85rem; }
.adjust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 16px; }
.zoom-buttons { display: flex; gap: 6px; align-items: center; }
.zoom-buttons .btn { min-width: 36px; }
.position-controls { display: flex; align-items: center; gap: 12px; }
.position-pad { width: 80px; height: 80px; background: var(--bg-secondary); border: 2px solid var(--border-strong); border-radius: 8px; position: relative; cursor: move; user-select: none; outline: none; flex-shrink: 0; touch-action: none; }
.position-pad:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.position-pad::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 1px; height: 100%; background: var(--border); }
.position-pad::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: 1px; background: var(--border); }
.position-dot { position: absolute; width: 14px; height: 14px; background: var(--primary); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 0 3px var(--primary-light), 0 2px 4px rgba(0,0,0,0.2); }
.position-info { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.position-info small { font-size: 0.75rem; color: var(--text-secondary); font-family: 'Courier New', monospace; background: var(--bg-secondary); padding: 2px 8px; border-radius: 4px; }
.adjust-actions { display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--border); }

.preview-stage { background: var(--bg-secondary); border-radius: 12px; padding: 40px 20px; display: flex; align-items: center; justify-content: center; min-height: 400px; overflow: auto; }

.mockup-wrapper {
  display: inline-block;
  transform-origin: center center;
  transform: scale(var(--mockup-scale, 0.8));
  transition: transform 0.3s ease;
  user-select: none;
}

/* ============================================
   ★★★ DEVICE MOCKUPS — SIMPLIFIED FOR HTML2CANVAS ★★★

   Key principles:
   - No complex inset shadows that html2canvas breaks
   - No nested overflow:hidden chains
   - Background: black only on screen-area (single layer)
   - <img> directly inside screen-area with object-fit
   - All transforms on the img itself (not wrappers)
   ============================================ */

.mockup { display: inline-block; }

/* ----- iPhone ----- */
.mockup.iphone {
  width: 300px;
  height: 623px;
  background: #1c1c1e;
  border-radius: 44px;
  padding: 11px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.mockup.iphone.silver { background: linear-gradient(145deg, #f0f0f3, #c8c8cc); }
.mockup.iphone.gold { background: linear-gradient(145deg, #f7e7c4, #d4b87a); }
.mockup.iphone.blue { background: linear-gradient(145deg, #5a8fd0, #1e40af); }
.mockup.iphone.red { background: linear-gradient(145deg, #e87570, #8b1f1a); }

.mockup.iphone .screen-area {
  width: 100%; height: 100%;
  background: #000;
  border-radius: 34px;
  overflow: hidden;
  position: relative;
}
.mockup.iphone .screen-area img.screen-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.mockup.iphone .dynamic-island {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 95px; height: 30px;
  background: #000;
  border-radius: 18px;
  z-index: 5;
}
.mockup.iphone .side-button {
  position: absolute;
  background: #1c1c1e;
  border-radius: 2px;
}
.mockup.iphone .side-button.mute { left: -2px; top: 90px; width: 2px; height: 22px; }
.mockup.iphone .side-button.volume-up { left: -2px; top: 125px; width: 2px; height: 36px; }
.mockup.iphone .side-button.volume-down { left: -2px; top: 170px; width: 2px; height: 36px; }
.mockup.iphone .side-button.power { right: -2px; top: 140px; width: 2px; height: 50px; }
.mockup.iphone.silver .side-button { background: #8e8e93; }
.mockup.iphone.gold .side-button { background: #b89554; }
.mockup.iphone.blue .side-button { background: #1e40af; }
.mockup.iphone.red .side-button { background: #8b1f1a; }
.mockup.iphone.landscape { width: 623px; height: 300px; }

/* ----- iPad ----- */
.mockup.ipad {
  width: 380px;
  height: 527px;
  background: #c8c8cc;
  border-radius: 18px;
  padding: 18px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
}
.mockup.ipad.dark { background: #1c1c1e; }
.mockup.ipad.gold { background: linear-gradient(145deg, #f5e6c8, #d4b87a); }
.mockup.ipad.blue { background: linear-gradient(145deg, #5a8fd0, #1e40af); }
.mockup.ipad.red { background: linear-gradient(145deg, #e87570, #8b1f1a); }

.mockup.ipad .screen-area {
  width: 100%; height: 100%;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.mockup.ipad .screen-area img.screen-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.mockup.ipad .camera-dot {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 6px;
  background: #1a1a1a;
  border-radius: 50%;
  z-index: 5;
}
.mockup.ipad.landscape { width: 527px; height: 380px; }

/* ----- Android ----- */
.mockup.android {
  width: 300px;
  height: 619px;
  background: #1a1a1c;
  border-radius: 36px;
  padding: 10px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.mockup.android.silver { background: linear-gradient(145deg, #d4d4d6, #8e8e93); }
.mockup.android.gold { background: linear-gradient(145deg, #f5e6c8, #b89554); }
.mockup.android.blue { background: linear-gradient(145deg, #5a8fd0, #1e40af); }
.mockup.android.red { background: linear-gradient(145deg, #e87570, #8b1f1a); }

.mockup.android .screen-area {
  width: 100%; height: 100%;
  background: #000;
  border-radius: 26px;
  overflow: hidden;
  position: relative;
}
.mockup.android .screen-area img.screen-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.mockup.android .punch-hole {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 12px; height: 12px;
  background: #000;
  border-radius: 50%;
  z-index: 5;
}
.mockup.android.landscape { width: 619px; height: 300px; }

/* ----- Apple Watch ----- */
.mockup.watch {
  width: 200px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.4));
}
.mockup.watch .band-top,
.mockup.watch .band-bottom {
  width: 100px; height: 56px;
  background: #1c1c1e;
}
.mockup.watch .band-top { border-radius: 14px 14px 4px 4px; }
.mockup.watch .band-bottom { border-radius: 4px 4px 14px 14px; }
.mockup.watch.silver .band-top,
.mockup.watch.silver .band-bottom { background: #8e8e93; }
.mockup.watch.gold .band-top,
.mockup.watch.gold .band-bottom { background: #b89554; }

.mockup.watch .watch-body {
  width: 200px;
  height: 240px;
  background: #0a0a0a;
  border-radius: 50px;
  padding: 12px;
  position: relative;
  z-index: 2;
}
.mockup.watch.silver .watch-body { background: linear-gradient(145deg, #d4d4d6, #8e8e93); }
.mockup.watch.gold .watch-body { background: linear-gradient(145deg, #e5d5b8, #b89554); }

.mockup.watch .screen-area {
  width: 100%; height: 100%;
  background: #000;
  border-radius: 38px;
  overflow: hidden;
  position: relative;
}
.mockup.watch .screen-area img.screen-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.mockup.watch .crown {
  position: absolute;
  right: -6px; top: 38%;
  width: 8px; height: 28px;
  background: #1c1c1e;
  border-radius: 2px 4px 4px 2px;
}
.mockup.watch.silver .crown { background: #8e8e93; }
.mockup.watch.gold .crown { background: #b89554; }
.mockup.watch .side-button {
  position: absolute;
  right: -3px; top: 22%;
  width: 4px; height: 18px;
  background: #1c1c1e;
  border-radius: 1px 2px 2px 1px;
}
.mockup.watch.silver .side-button { background: #8e8e93; }
.mockup.watch.gold .side-button { background: #b89554; }

/* ----- MacBook ----- */
.mockup.macbook {
  width: 560px;
  position: relative;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,0.4));
}
.mockup.macbook .lid {
  background: #1c1c1e;
  padding: 14px 14px 16px;
  border-radius: 14px 14px 2px 2px;
  position: relative;
}
.mockup.macbook.silver .lid { background: #8e8e93; }
.mockup.macbook.gold .lid { background: linear-gradient(180deg, #f5e6c8, #b89554); }

.mockup.macbook .lid::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 8px;
  background: #000;
  border-radius: 0 0 10px 10px;
  z-index: 5;
}

.mockup.macbook .screen-area {
  background: #000;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 10;
}
.mockup.macbook .screen-inner {
  width: 100%; height: 100%;
  position: relative;
}
.mockup.macbook .screen-area img.screen-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

.mockup.macbook .base {
  background: linear-gradient(180deg, #c8c8ca, #8e8e93);
  height: 16px;
  margin: 0 -14px;
  border-radius: 0 0 16px 16px;
}
.mockup.macbook.silver .base { background: linear-gradient(180deg, #d4d4d6, #8e8e93); }
.mockup.macbook.gold .base { background: linear-gradient(180deg, #e5d5a8, #b89554); }

/* ----- Laptop ----- */
.mockup.laptop {
  width: 540px;
  position: relative;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,0.4));
}
.mockup.laptop .lid {
  background: #1c1c1e;
  padding: 18px;
  border-radius: 8px 8px 2px 2px;
  position: relative;
}
.mockup.laptop.silver .lid { background: #8e8e93; }

.mockup.laptop .screen-area {
  background: #000;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 10;
}
.mockup.laptop .screen-area img.screen-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.mockup.laptop .base {
  background: #1a1a1c;
  height: 20px;
  margin: 0 -10px;
  border-radius: 0 0 10px 10px;
}
.mockup.laptop.silver .base { background: linear-gradient(180deg, #c8c8ca, #8e8e93); }

/* ----- iMac ----- */
.mockup.imac {
  width: 540px;
  position: relative;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,0.4));
}
.mockup.imac .display {
  background: #1c1c1e;
  padding: 12px 12px 24px;
  border-radius: 10px 10px 4px 4px;
  position: relative;
}
.mockup.imac.silver .display { background: linear-gradient(180deg, #d4d4d6, #aeaeb2); }

.mockup.imac .screen-area {
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 10;
}
.mockup.imac .screen-area img.screen-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.mockup.imac .stand {
  width: 160px; height: 50px;
  margin: -4px auto 0;
  background: linear-gradient(180deg, #aeaeb2, #8e8e93, #6e6e73);
  clip-path: polygon(25% 0%, 75% 0%, 90% 100%, 10% 100%);
}
.mockup.imac.silver .stand { background: linear-gradient(180deg, #c8c8cc, #8e8e93, #6e6e73); }
.mockup.imac .foot {
  width: 220px; height: 16px;
  background: linear-gradient(180deg, #aeaeb2, #6e6e73);
  margin: 0 auto;
  border-radius: 50% / 100% 100% 0 0;
}
.mockup.imac.silver .foot { background: linear-gradient(180deg, #c8c8cc, #8e8e93); }

/* ----- Smart TV ----- */
.mockup.tv {
  width: 580px;
  position: relative;
  filter: drop-shadow(0 25px 35px rgba(0,0,0,0.4));
}
.mockup.tv .bezel {
  background: #0a0a0a;
  padding: 12px;
  border-radius: 4px;
}
.mockup.tv.silver .bezel { background: #8e8e93; }

.mockup.tv .screen-area {
  background: #000;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
}
.mockup.tv .screen-area img.screen-img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.mockup.tv .legs {
  display: flex;
  justify-content: center;
  gap: 180px;
  padding: 0 20px;
  margin-top: -6px;
}
.mockup.tv .leg {
  width: 10px; height: 36px;
  background: #1c1c1e;
  clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}
.mockup.tv.silver .leg { background: #8e8e93; }

/* ============================================
   BACKGROUND PRESETS
   ============================================ */
.bg-white { background-color: #ffffff; }
.bg-light { background: radial-gradient(circle at 30% 30%, #f9fafb, #e5e7eb); }
.bg-dark { background: radial-gradient(circle at 30% 30%, #1f2937, #111827); }
.bg-sunset { background: radial-gradient(circle at 30% 30%, #fbbf24, #ec4899); }
.bg-ocean { background: radial-gradient(circle at 30% 30%, #06b6d4, #3b82f6); }
.bg-forest { background: radial-gradient(circle at 30% 30%, #10b981, #065f46); }
.bg-purple { background: radial-gradient(circle at 30% 30%, #a855f7, #6b21a8); }
.bg-custom { background-color: var(--custom-bg, #6366f1); }
.bg-transparent { background: transparent !important; }

/* Batch, Export, Buttons, Forms, Cards, Pages, Settings, Help, About, PWA — same as before */
.batch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.batch-item { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px; cursor: pointer; transition: 0.2s; }
.batch-item:hover { border-color: var(--primary); }
.batch-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.batch-item img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; display: block; }
.batch-item .batch-name { font-size: 0.8rem; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.batch-item .batch-device { font-size: 0.7rem; color: var(--primary); font-weight: 600; margin-top: 2px; }
.batch-item .remove-batch { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; background: rgba(0,0,0,0.6); color: white; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; padding: 0; }
.batch-item .remove-batch:hover { background: rgba(239, 68, 68, 0.9); }
.batch-actions { display: flex; gap: 8px; }

.export-panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.export-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }
.export-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.export-actions .btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer; font-family: inherit; transition: 0.2s; text-decoration: none; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: var(--shadow); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-tertiary); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.text-input, .select-input { padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.95rem; width: 100%; max-width: 200px; transition: 0.2s; }
.text-input:focus, .select-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.color-input { width: 48px; height: 36px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; background: var(--bg); padding: 2px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.page-header { margin-bottom: 24px; text-align: center; }
.page-header h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: 8px; }
.page-subtitle { color: var(--text-secondary); font-size: 1rem; }

.about-hero { text-align: center; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); position: relative; }
.version-tag { position: absolute; top: 0; right: 0; background: var(--primary-light); color: var(--primary); padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; font-family: 'Courier New', monospace; }
.about-avatar { font-size: 4rem; width: 100px; height: 100px; margin: 16px auto 16px; background: var(--bg-tertiary); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.developer-name { font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.developer-role { color: var(--text-secondary); margin-bottom: 16px; }
.about-section { margin-bottom: 20px; }
.about-section h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.about-section p, .about-section li { color: var(--text-secondary); }
.feature-list { padding-left: 20px; }
.feature-list li { margin-bottom: 6px; }
.about-meta { text-align: center; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 0.9rem; }

.help-step { display: flex; gap: 16px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.help-step:last-of-type { border-bottom: none; }
.step-number { flex-shrink: 0; width: 36px; height: 36px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.step-content h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step-content p, .step-content li { color: var(--text-secondary); margin-bottom: 6px; }
.step-content ul { padding-left: 20px; }
.tip { margin-top: 10px; padding: 10px 14px; background: var(--primary-light); border-radius: 8px; font-size: 0.9rem; color: var(--text); }
.help-section h3 { margin-bottom: 12px; }
.faq-item { background: var(--bg-secondary); border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; cursor: pointer; }
.faq-item summary { font-weight: 600; cursor: pointer; }
.faq-item p { margin-top: 8px; color: var(--text-secondary); font-size: 0.95rem; }

.settings-section-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 16px; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-row > div:first-child { flex: 1; }
.setting-label { font-weight: 600; display: block; margin-bottom: 2px; }
.setting-desc { font-size: 0.85rem; color: var(--text-secondary); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.theme-card { background: var(--card); border: 2px solid var(--border); border-radius: 10px; padding: 10px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: inherit; color: var(--text); font-size: 0.85rem; transition: 0.2s; }
.theme-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.theme-card.selected { border-color: var(--primary); background: var(--primary-light); }
.theme-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-preview { width: 100%; height: 40px; border-radius: 6px; }
.theme-preview-light { background: linear-gradient(135deg, #fff 50%, #f3f4f6); border: 1px solid #e5e7eb; }
.theme-preview-dark { background: linear-gradient(135deg, #0f172a 50%, #334155); }
.theme-preview-ocean { background: linear-gradient(135deg, #ecfeff 50%, #0891b2); }
.theme-preview-sunset { background: linear-gradient(135deg, #fff7ed 50%, #f97316); }
.theme-preview-forest { background: linear-gradient(135deg, #f0fdf4 50%, #16a34a); }
.theme-preview-lavender { background: linear-gradient(135deg, #faf5ff 50%, #a855f7); }
.theme-preview-midnight { background: linear-gradient(135deg, #0a0a1f 50%, #a78bfa); }
.theme-preview-solarized { background: linear-gradient(135deg, #fdf6e3 50%, #b58900); }

.switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--border-strong); transition: 0.3s; border-radius: 26px; }
.slider::before { position: absolute; content: ''; height: 20px; width: 20px; left: 3px; bottom: 3px; background: white; transition: 0.3s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background: var(--primary); }
input:checked + .slider::before { transform: translateX(22px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--primary); outline-offset: 2px; }

.install-banner { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #ec4899)); color: white; padding: 12px 20px; text-align: center; font-size: 0.9rem; }
.install-banner[hidden] { display: none !important; }
.install-content { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.install-actions { display: flex; gap: 8px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 24px; border-radius: 8px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 1000; animation: slideUp 0.3s; max-width: 90vw; text-align: center; }
.toast[hidden] { display: none !important; }
@keyframes slideUp { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 12px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); transform: translateY(-10px); opacity: 0; pointer-events: none; transition: 0.2s; }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links li { width: 100%; }
  .nav-link { display: block; padding: 12px; }
  .container { padding: 20px 14px 40px; }
  .upload-zone { padding: 32px 16px; }
  .device-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
  .device-card { padding: 12px 8px; }
  .options-bar { grid-template-columns: 1fr; padding: 16px; }
  .adjust-grid { grid-template-columns: 1fr; }
  .preview-stage { padding: 20px 10px; min-height: 300px; }
  .mockup-wrapper { --mockup-scale: 0.6; }
  .mockup.iphone, .mockup.android { width: 230px; height: auto; aspect-ratio: 300/623; }
  .mockup.ipad { width: 270px; height: auto; aspect-ratio: 380/527; }
  .mockup.watch { width: 150px; }
  .mockup.watch .watch-body { width: 150px; height: 180px; }
  .mockup.macbook { width: 360px; }
  .mockup.laptop { width: 340px; }
  .mockup.imac { width: 360px; }
  .mockup.tv { width: 380px; }
  .batch-list { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .export-actions { flex-direction: column; }
  .export-actions .btn { width: 100%; }
  .setting-row { flex-direction: column; align-items: stretch; }
  .text-input, .select-input { max-width: 100%; }
  .help-step { flex-direction: column; gap: 10px; }
  .version-tag { position: static; display: inline-block; margin-bottom: 8px; }
  .about-hero { padding-top: 12px; }
  .install-content { justify-content: center; text-align: center; }
  .custom-bg-controls { flex-wrap: wrap; }
  .position-controls { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .mockup-wrapper { --mockup-scale: 0.45; }
  .mockup.iphone, .mockup.android { width: 190px; }
  .mockup.ipad { width: 230px; }
  .mockup.watch { width: 130px; }
  .mockup.watch .watch-body { width: 130px; height: 156px; }
  .mockup.macbook { width: 300px; }
  .mockup.laptop { width: 290px; }
  .mockup.imac { width: 300px; }
  .mockup.tv { width: 320px; }
}
