/* ============================================================
   صانع الستيكرات التعليمية — Design System
   ============================================================ */

:root {
  --ink: #2f2a44;
  --ink-soft: #6a6480;
  --ink-faint: #9a94ad;

  --bg: #fff9f0;
  --surface: #ffffff;
  --surface-2: #fff4e3;
  --line: #ece5f5;

  --brand: #7c5cff;
  --brand-2: #4cc9f0;
  --brand-3: #ff6b9d;
  --accent: #ffb703;
  --mint: #2ec4b6;
  --coral: #ff6b6b;
  --grape: #9b5de5;

  --grad-brand: linear-gradient(135deg, #7c5cff 0%, #4cc9f0 100%);
  --grad-sun: linear-gradient(135deg, #ffd166 0%, #ff9f1c 100%);
  --grad-pink: linear-gradient(135deg, #ff8fab 0%, #ff6b9d 100%);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  --sh-sm: 0 4px 14px rgba(84, 60, 160, .07);
  --sh-md: 0 12px 30px rgba(84, 60, 160, .10);
  --sh-lg: 0 24px 60px rgba(84, 60, 160, .14);
  --sh-brand: 0 14px 30px rgba(124, 92, 255, .32);

  --font: 'Tajawal', 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 800; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
small { font-weight: 500; }

.container { width: min(1240px, 92vw); margin-inline: auto; }

/* ===== Background decor ===== */
.bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.blob-1 { width: 460px; height: 460px; background: #ffe0f0; top: -120px; inset-inline-start: -100px; }
.blob-2 { width: 420px; height: 420px; background: #dcd6ff; top: 40%; inset-inline-end: -140px; }
.blob-3 { width: 400px; height: 400px; background: #d3f6ff; bottom: -140px; inset-inline-start: 30%; }
.float {
  position: absolute; font-size: 34px; opacity: .55;
  animation: floaty 7s ease-in-out infinite;
}
.float-1 { top: 14%; inset-inline-start: 6%; animation-delay: 0s; }
.float-2 { top: 62%; inset-inline-start: 3%; animation-delay: 1.1s; }
.float-3 { top: 22%; inset-inline-end: 5%; animation-delay: .6s; }
.float-4 { top: 74%; inset-inline-end: 9%; animation-delay: 1.8s; }
.float-5 { top: 44%; inset-inline-end: 2%; animation-delay: 2.4s; }
.float-6 { top: 84%; inset-inline-start: 22%; animation-delay: 1.4s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

main { position: relative; z-index: 1; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px;
  font-size: 15px; font-weight: 800; color: var(--ink);
  background: #fff; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 16px 30px; font-size: 17px; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-emoji { font-size: 17px; }

.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover { box-shadow: 0 18px 38px rgba(124, 92, 255, .42); }
.btn-soft { background: #fff; color: var(--ink); box-shadow: var(--sh-sm); border: 2px solid var(--line); }
.btn-soft:hover { border-color: #d9ccff; background: #fdfbff; }
.btn-ghost { background: transparent; color: var(--brand); border: 2px solid #e0d8ff; }
.btn-ghost:hover { background: #f6f2ff; }
.btn-danger-soft { background: #fff2f2; color: #d64545; border: 2px solid #ffd6d6; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 249, 240, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(236, 229, 245, .9);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; }
.header-right-group, .header-left-group { display: flex; align-items: center; gap: 12px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hayyi-icon-badge {
  width: 40px; height: 40px; border-radius: 12px; object-fit: contain;
  box-shadow: 0 4px 14px rgba(124, 92, 255, .20); background: #fff;
  border: 1.5px solid #e2d9f3; padding: 2px; flex-shrink: 0;
}
.hayyi-logo-img { height: 36px; width: auto; object-fit: contain; display: block; }
.brand-divider { width: 1.5px; height: 26px; background: #dcd6e8; margin: 0 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; font-weight: 900; color: #1e1b2e; }
.brand-text small { color: var(--ink-faint); font-size: 11px; font-weight: 600; }

.header-nav { display: flex; align-items: center; gap: 6px; }
.header-nav > a {
  text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: 14px;
  padding: 8px 14px; border-radius: 999px; transition: .2s;
}
.header-nav > a:hover { background: #fff; color: var(--brand); }

/* Hayyi Quick Tools Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 999px;
  background: #ffffff; border: 1.5px solid var(--line); font-size: 13px; font-weight: 800;
  color: var(--ink); box-shadow: var(--sh-sm); transition: all .18s;
}
.nav-dropdown-trigger:hover { border-color: var(--brand); color: var(--brand); }
.dropdown-arrow { font-size: 10px; transition: transform .2s; }
.nav-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute; top: 100%; inset-inline-end: 0; margin-top: 8px;
  width: 270px; background: #ffffff; border: 1px solid #e5e0f0; border-radius: var(--r-md);
  box-shadow: var(--sh-lg); padding: 8px; display: none; flex-direction: column; gap: 4px;
  z-index: 60; animation: dropAnim .18s ease-out forwards;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: flex; }

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

.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--ink); transition: background .15s;
}
.menu-item:hover { background: #f6f3ff; }
.menu-icon { font-size: 20px; width: 32px; height: 32px; display: grid; place-items: center; background: #f0ecff; border-radius: 8px; }
.menu-item strong { display: block; font-size: 13px; font-weight: 800; color: #1e1b2e; }
.menu-item small { display: block; font-size: 11px; color: var(--ink-soft); }

.btn-back {
  background: #ffffff; border-color: #d1c4e9; color: #4324d4; font-weight: 800;
  padding: 8px 15px; font-size: 13px; text-decoration: none;
}
.btn-back:hover { background: #f3efff; border-color: var(--brand); }
.back-icon { font-size: 14px; margin-inline-end: 4px; }

.eb-dash { text-decoration: none; color: var(--brand); font-weight: 800; }
.eb-dash:hover { background: #f0eaff; color: #3b1fb5; }

/* ===== Hero ===== */
.hero { padding: 70px 0 40px; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 2px solid var(--line); color: var(--brand);
  padding: 7px 16px; border-radius: 999px; font-weight: 800; font-size: 13px;
  box-shadow: var(--sh-sm);
}
.hero h1 {
  font-size: clamp(34px, 5vw, 58px); font-weight: 900; margin: 18px 0 14px;
  letter-spacing: -.5px;
}
.hero h1 .sparkle { display: inline-block; animation: pop 2.4s ease-in-out infinite; }
@keyframes pop { 0%,100%{ transform: scale(1) rotate(0);} 50%{ transform: scale(1.25) rotate(14deg);} }
.hero-sub { font-size: clamp(17px, 2vw, 22px); color: var(--ink-soft); font-weight: 600; }
.hero-actions { display: flex; gap: 12px; margin: 26px 0 30px; flex-wrap: wrap; }
.hero-stats { list-style: none; display: flex; gap: 28px; padding: 0; margin: 0; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 26px; font-weight: 900; color: var(--brand); }
.hero-stats span { font-size: 13px; color: var(--ink-faint); font-weight: 700; }

.hero-art { position: relative; height: 420px; }
.art-card { position: absolute; animation: floaty 6s ease-in-out infinite; }
.art-1 { top: 0; inset-inline-end: 22%; }
.art-2 { top: 42%; inset-inline-start: 2%; animation-delay: 1s; }
.art-3 { bottom: 4%; inset-inline-end: 6%; animation-delay: .5s; }
.sticker-demo {
  width: 150px; height: 150px; display: grid; place-items: center;
  font-weight: 900; font-size: 22px; color: #3a2e58;
  box-shadow: 0 20px 40px rgba(84, 60, 160, .18), inset 0 0 0 10px #fff;
  text-align: center;
}
.demo-star {
  background: var(--grad-sun);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  width: 170px; height: 170px;
}
.demo-circle { background: var(--grad-brand); color: #fff; border-radius: 50%; font-size: 56px; }
.demo-heart {
  background: var(--grad-pink); color: #fff; border-radius: 22px;
  transform: rotate(-8deg);
}
.art-kid { position: absolute; font-size: 74px; top: 40%; inset-inline-start: 30%; animation: floaty 5s ease-in-out infinite; }
.art-kid-2 { top: 8%; inset-inline-start: 8%; font-size: 60px; animation-delay: 1.4s; }

/* ===== Studio ===== */
.studio { padding: 40px 0 70px; }
.studio-head { text-align: center; margin-bottom: 28px; }
.studio-head h2 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 900; }
.studio-head p { color: var(--ink-soft); font-size: 17px; margin-top: 8px; }

.studio-grid { display: grid; grid-template-columns: 1fr 400px; gap: 26px; align-items: start; }
.controls { display: flex; flex-direction: column; gap: 20px; }

.panel {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--sh-md); border: 1px solid var(--line);
  animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.panel-head h3 { font-size: 21px; font-weight: 900; }
.panel-sub { color: var(--ink-faint); font-size: 14px; font-weight: 600; }
.step-badge {
  flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 13px; background: var(--grad-brand); color: #fff;
  font-weight: 900; font-size: 18px; box-shadow: var(--sh-brand);
}
.step-badge-photo { background: var(--grad-pink); box-shadow: 0 10px 22px rgba(255, 107, 157, .32); }

/* ===== Category cards ===== */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.category-card {
  position: relative; text-align: start; border: 2px solid var(--line); background: #fff;
  border-radius: var(--r-md); padding: 16px 14px; display: flex; flex-direction: column; gap: 8px;
  transition: .2s ease; overflow: hidden;
}
.category-card::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 90px; height: 90px;
  border-radius: 50%; background: var(--card-tint, #f4f0ff); opacity: .8; transition: .3s;
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: #ddd2ff; }
.category-card:hover::after { transform: scale(1.6); }
.category-card.active {
  border-color: var(--brand); box-shadow: 0 12px 26px rgba(124, 92, 255, .22);
  background: linear-gradient(180deg, #faf8ff, #fff);
}
.category-card.active::before {
  content: "✓"; position: absolute; top: 10px; inset-inline-end: 10px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 900;
}
.category-icon { font-size: 30px; position: relative; z-index: 1; }
.category-title { font-size: 15px; font-weight: 800; position: relative; z-index: 1; }
.category-count { font-size: 12px; color: var(--ink-faint); font-weight: 700; position: relative; z-index: 1; }

/* ===== Chips ===== */
.sub-title { font-size: 14px; font-weight: 900; color: var(--ink-soft); margin: 18px 0 10px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  border: 2px solid var(--line); background: #fff; border-radius: 999px;
  padding: 9px 17px; font-size: 14px; font-weight: 800; color: var(--ink-soft);
  transition: .18s;
}
.chip:hover { border-color: #d9ccff; color: var(--brand); transform: translateY(-2px); }
.chip.active { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: var(--sh-brand); }

.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 9px; margin-top: 12px; }
.char-btn {
  aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--line); background: #fff;
  font-size: 22px; font-weight: 900; color: var(--ink); transition: .18s;
}
.char-btn:hover { transform: translateY(-3px); border-color: var(--brand); color: var(--brand); }
.char-btn.active { background: var(--grad-sun); border-color: transparent; box-shadow: 0 10px 20px rgba(255,159,28,.3); }

/* ===== Fields ===== */
.field { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.field-label { font-size: 13px; font-weight: 800; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.field-label small { font-size: 12px; color: var(--brand); background: #f4f0ff; padding: 1px 9px; border-radius: 999px; }
.field input[type="text"], .field input[type="number"] {
  border: 2px solid var(--line); border-radius: 14px; padding: 12px 15px;
  font-size: 15px; font-weight: 700; color: var(--ink); background: #fff; transition: .18s; width: 100%;
}
.field input[type="text"]:focus, .field input[type="number"]:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124, 92, 255, .12);
}
.field input[type="color"] {
  width: 100%; height: 46px; border: 2px solid var(--line); border-radius: 14px;
  background: #fff; padding: 4px; cursor: pointer;
}
.field input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, #d9ccff, #bfe9ff); outline: none;
}
.field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 4px solid var(--brand); box-shadow: var(--sh-sm); cursor: pointer;
}
.field input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); cursor: pointer;
}
.field-inline { flex: 1 1 130px; margin-top: 0; }

.color-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.palette-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.swatch {
  width: 38px; height: 38px; border-radius: 12px; border: 3px solid #fff; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.12); transition: .18s;
}
.swatch:hover { transform: translateY(-3px) scale(1.06); }
.swatch.active { outline: 3px solid var(--brand); outline-offset: 2px; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.theme-card {
  border: 2px solid var(--line); border-radius: var(--r-sm); padding: 10px 8px; background: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: .18s;
}
.theme-card:hover { transform: translateY(-3px); box-shadow: var(--sh-sm); }
.theme-card.active { border-color: var(--brand); box-shadow: 0 10px 22px rgba(124,92,255,.2); }
.theme-dot { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255,255,255,.7); }
.theme-name { font-size: 11px; font-weight: 800; color: var(--ink-soft); }

.toggle-row { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 52px; height: 30px; border-radius: 999px; background: #e6e0f0;
  padding: 3px; display: flex; transition: .22s; flex: 0 0 auto;
}
.switch-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--sh-sm); transition: .22s; }
.switch input:checked + .switch-track { background: var(--grad-brand); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(-22px); }
html[dir="rtl"] .switch input:checked + .switch-track .switch-thumb { transform: translateX(-22px); }
.switch-text { font-size: 14px; font-weight: 700; color: var(--ink-soft); }

/* ===== Emoji picker ===== */
.emoji-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-btn {
  width: 46px; height: 46px; border-radius: 14px; border: 2px solid var(--line);
  background: #fff; font-size: 22px; display: grid; place-items: center; transition: .16s;
}
.emoji-btn:hover { transform: translateY(-3px) scale(1.05); border-color: #ffd166; }
.emoji-btn.active { background: #fff8e6; border-color: var(--accent); box-shadow: 0 8px 18px rgba(255,183,3,.25); }

/* ===== Shape & size ===== */
.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.shape-card {
  border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff;
  padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: .18s;
}
.shape-card:hover { transform: translateY(-3px); box-shadow: var(--sh-sm); }
.shape-card.active { border-color: var(--brand); background: #faf8ff; box-shadow: 0 10px 22px rgba(124,92,255,.18); }
.shape-visual { width: 42px; height: 42px; background: var(--grad-brand); }
.shape-visual.shape-circle { border-radius: 50%; }
.shape-visual.shape-square { border-radius: 6px; }
.shape-visual.shape-rect { width: 54px; height: 34px; border-radius: 6px; background: var(--grad-sun); }
.shape-visual.shape-rounded { width: 52px; height: 38px; border-radius: 14px; background: var(--grad-pink); }
.shape-visual.shape-star {
  background: var(--grad-sun);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.shape-visual.shape-heart {
  background: var(--grad-pink);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21C12 21 3 15.5 3 9.5A5.5 5.5 0 0 1 12 6a5.5 5.5 0 0 1 9 3.5C21 15.5 12 21 12 21Z' fill='%23000'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21C12 21 3 15.5 3 9.5A5.5 5.5 0 0 1 12 6a5.5 5.5 0 0 1 9 3.5C21 15.5 12 21 12 21Z' fill='%23000'/></svg>") center/contain no-repeat;
}
.shape-visual.shape-free { background: var(--grad-brand); border-radius: 50% 40% 55% 45% / 45% 55% 40% 50%; }
.shape-name { font-size: 12px; font-weight: 800; color: var(--ink-soft); }

.size-custom { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: 18px; }
.size-note { font-size: 13px; color: var(--ink-faint); font-weight: 700; margin-top: 10px; }

/* ===== Photo panel ===== */
.panel-photo { background: linear-gradient(180deg, #fff9fd, #fff); }
.drop-zone {
  border: 3px dashed #ffd0e4; border-radius: var(--r-lg); padding: 30px 20px; text-align: center;
  background: #fffafc; transition: .2s; cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag { border-color: var(--brand-3); background: #fff4f9; transform: translateY(-2px); }
.drop-icon { font-size: 42px; }
.drop-title { font-size: 16px; font-weight: 900; margin-top: 8px; }
.drop-sub { font-size: 13px; color: var(--ink-faint); font-weight: 600; margin-top: 4px; }

.photo-controls { margin-top: 18px; animation: rise .35s ease both; }
.photo-preview-mini { display: flex; align-items: center; gap: 14px; }
.photo-preview-mini img {
  width: 92px; height: 92px; object-fit: cover; border-radius: 18px;
  border: 3px solid #fff; box-shadow: var(--sh-md); background: #f4f0ff;
}
.photo-actions { display: flex; flex-direction: column; gap: 8px; }

/* ===== Preview ===== */
.preview { position: sticky; top: 92px; }
.preview-card {
  background: var(--surface); border-radius: var(--r-xl); padding: 20px;
  box-shadow: var(--sh-lg); border: 1px solid var(--line);
}
.preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.preview-head h3 { font-size: 17px; font-weight: 900; }
.preview-size { font-size: 12px; font-weight: 800; color: var(--brand); background: #f4f0ff; padding: 4px 12px; border-radius: 999px; }
.preview-stage {
  position: relative; aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden;
  background:
    linear-gradient(45deg, #f4f1fb 25%, transparent 25%, transparent 75%, #f4f1fb 75%),
    linear-gradient(45deg, #f4f1fb 25%, #fff 25%, #fff 75%, #f4f1fb 75%);
  background-size: 26px 26px; background-position: 0 0, 13px 13px;
  display: grid; place-items: center; border: 1px solid var(--line);
}
#stickerCanvas { max-width: 100%; max-height: 100%; display: none; filter: drop-shadow(0 16px 26px rgba(84,60,160,.22)); }
.stage-empty { position: absolute; text-align: center; color: var(--ink-faint); padding: 20px; }
.stage-empty span { font-size: 46px; display: block; }
.stage-empty p { font-size: 14px; font-weight: 700; margin-top: 6px; }

.preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.preview-actions .btn-primary { grid-column: 1 / -1; }
.preview-note {
  font-size: 12.5px; color: var(--ink-faint); font-weight: 600; margin-top: 14px;
  background: var(--surface-2); padding: 10px 14px; border-radius: var(--r-sm);
}
.preview-note strong { color: var(--brand); }

/* ===== Gallery ===== */
.gallery, .how { padding: 60px 0; }
.section-head { text-align: center; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(24px, 3.2vw, 36px); font-weight: 900; }
.section-head p { color: var(--ink-soft); font-size: 16px; margin-top: 8px; }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.idea-card {
  background: #fff; border-radius: var(--r-lg); padding: 18px; border: 1px solid var(--line);
  box-shadow: var(--sh-sm); display: flex; flex-direction: column; align-items: center; gap: 12px;
  transition: .2s;
}
.idea-card:hover { transform: translateY(-6px); box-shadow: var(--sh-md); }
.idea-chip {
  width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: 18px; color: #3a2e58; text-align: center; padding: 8px;
  box-shadow: inset 0 0 0 7px #fff, 0 12px 24px rgba(84,60,160,.16);
}
.idea-card h4 { font-size: 15px; font-weight: 800; }
.idea-card .btn { width: 100%; }

/* ===== How ===== */
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.how-card {
  background: #fff; border-radius: var(--r-lg); padding: 26px 22px; border: 1px solid var(--line);
  box-shadow: var(--sh-sm); text-align: center; transition: .2s;
}
.how-card:hover { transform: translateY(-5px); box-shadow: var(--sh-md); }
.how-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.how-card h4 { font-size: 18px; font-weight: 900; margin-bottom: 6px; }
.how-card p { color: var(--ink-soft); font-size: 14px; font-weight: 600; }

/* ===== Footer ===== */
.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 30px 0; margin-top: 30px; }
.footer-inner { text-align: center; }
.footer-inner p { font-weight: 800; }
.footer-note { color: var(--ink-faint); font-size: 13px; font-weight: 600; margin-top: 6px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 26px; inset-inline-start: 50%; transform: translateX(50%) translateY(120%);
  background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 999px;
  font-weight: 800; font-size: 14px; z-index: 90; transition: transform .3s ease; box-shadow: var(--sh-lg);
}
.toast.show { transform: translateX(50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .studio-grid { grid-template-columns: 1fr; }
  .preview { position: static; }
  .preview-card { max-width: 560px; margin-inline: auto; }
}
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { height: 300px; margin-top: 20px; }
  .header-nav { display: none; }
}
@media (max-width: 560px) {
  .panel { padding: 18px; }
  .preview-actions { grid-template-columns: 1fr; }
  .hero-stats { gap: 18px; }
  .color-row .field-inline { flex: 1 1 100%; }
  .header-cta { display: none; }
}

/* =====================================================================
   EDITOR — صانع الستيكرات التعليمية
   ===================================================================== */

.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }

/* ---- landing/editor visibility ---- */
.editor { display: none; }
body.editor-open { overflow: hidden; height: 100vh; }
body.editor-open #landing { display: none; }
body.editor-open .bg-decor { display: none; }
body.editor-open #editor { display: flex; flex-direction: column; height: 100vh; width: 100vw; background: #f6f3fb; }

/* ---- generic form controls ---- */
.inp {
  width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px;
  font-size: 14px; font-weight: 700; color: var(--ink); background: #fff; transition: .16s;
  font-family: inherit;
}
.inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,92,255,.14); }
.inp-text { font-weight: 600; }
.inp-area { resize: vertical; min-height: 74px; line-height: 1.6; }
.inp-num { text-align: center; }
.inp-select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9a94ad 50%), linear-gradient(135deg, #9a94ad 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-inline-end: 30px; }
.inp-color { padding: 3px; height: 40px; cursor: pointer; }
.inp-color.mini { width: 46px; height: 38px; }
.inp-range { -webkit-appearance: none; appearance: none; height: 8px; padding: 0; border: 0; border-radius: 999px; background: linear-gradient(90deg,#d9ccff,#bfe9ff); cursor: pointer; }
.inp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 3px 8px rgba(84,60,160,.25); }
.inp-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }

.ctl { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ctl-label { font-size: 12.5px; font-weight: 800; color: var(--ink-soft); display: flex; align-items: center; gap: 7px; }
.ctl-label em { font-style: normal; font-size: 11px; color: var(--brand); background: #f4f0ff; padding: 1px 8px; border-radius: 999px; font-weight: 700; }
.range-wrap { display: flex; align-items: center; gap: 10px; }
.range-wrap .inp-range { flex: 1; }
.range-val { font-size: 12px; font-weight: 800; color: var(--brand); background: #f4f0ff; padding: 2px 9px; border-radius: 999px; min-width: 42px; text-align: center; }
.color-wrap { display: flex; align-items: center; gap: 8px; }
.color-wrap .inp-color { flex: 1; }
.mini-btn { border: 2px solid var(--line); background: #fff; border-radius: 10px; width: 40px; height: 40px; font-size: 16px; color: var(--ink-faint); cursor: pointer; }
.mini-btn:hover { border-color: var(--brand); color: var(--brand); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.size-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mini-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.mini-row .btn, .row-btns .btn { flex: 1 1 auto; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg.wrap-seg { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.seg-btn {
  border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 12px;
  font-size: 12.5px; font-weight: 800; color: var(--ink-soft); cursor: pointer; transition: .16s;
}
.seg-btn:hover { border-color: #d9ccff; color: var(--brand); }
.seg-btn.active { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(124,92,255,.25); }

.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 800; color: var(--ink-soft); cursor: pointer; transition: .16s;
}
.chip:hover { border-color: #d9ccff; color: var(--brand); transform: translateY(-2px); }
.chip.active { background: var(--grad-brand); border-color: transparent; color: #fff; }
.chip-dyn { background: #f6f0ff; border-color: #ddd0ff; color: var(--brand); font-family: 'Cairo', monospace; }
.chip-grid.dyn { margin-bottom: 6px; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; margin: 8px 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 46px; height: 26px; border-radius: 999px; background: #e6e0f0; padding: 3px; display: flex; transition: .22s; flex: 0 0 auto; }
.switch-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.16); transition: .22s; }
.switch input:checked + .switch-track { background: var(--grad-brand); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(-20px); }
.switch-text { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.switch-tiny .switch-track { width: 38px; height: 22px; }
.switch-tiny .switch-thumb { width: 16px; height: 16px; }
.switch-tiny input:checked + .switch-track .switch-thumb { transform: translateX(-16px); }
.switch-tiny .switch-text { font-size: 11.5px; }

.icon-btn {
  border: 2px solid var(--line); background: #fff; border-radius: 10px; width: 34px; height: 34px;
  display: grid; place-items: center; font-size: 15px; cursor: pointer; transition: .16s; padding: 0;
}
.icon-btn:hover { border-color: var(--brand); background: #faf8ff; }
.icon-btn.is-on { border-color: var(--brand); background: #f4f0ff; }

/* ---- editor top bar ---- */
.editor-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff;
  border-bottom: 1px solid var(--line); box-shadow: 0 2px 12px rgba(84,60,160,.06); z-index: 20; flex: 0 0 auto;
}
.eb-name { flex: 1 1 auto; max-width: 280px; }
.inp-name { border-color: transparent; background: #f6f3fb; font-weight: 900; font-size: 15px; }
.inp-name:hover { background: #f0ebfa; }
.eb-group { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; flex-wrap: nowrap; }
.batch-active-badge {
  display: flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: #f0fdf4; border: 1.5px solid #86efac; border-radius: 999px;
  font-size: 11px; font-weight: 800; color: #166534; margin-inline-end: 6px;
}
.batch-badge-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2); animation: pulseDot 2s infinite;
}
@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } }
.batch-badge-btn {
  border: 0; background: #dcfce7; color: #15803d; border-radius: 8px;
  padding: 3px 8px; font-size: 10.5px; font-weight: 800; cursor: pointer; transition: .14s;
}
.batch-badge-btn:hover { background: #bbf7d0; color: #14532d; }
.eb-btn {
  border: 0; background: transparent; border-radius: 12px; padding: 7px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--ink-soft);
  font-size: 11px; font-weight: 800; transition: .16s; min-width: 52px;
}
.eb-btn:hover:not(:disabled) { background: #f4f0ff; color: var(--brand); }
.eb-btn:disabled { opacity: .35; cursor: not-allowed; }
.eb-btn.is-on { background: #f4f0ff; color: var(--brand); }
.eb-btn .ebi { font-size: 17px; line-height: 1; }
.eb-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 8px 18px rgba(124,92,255,.3); }
.eb-primary:hover:not(:disabled) { background: var(--grad-brand); color: #fff; filter: brightness(1.05); }

/* ---- editor body ---- */
.editor-body { flex: 1 1 auto; display: flex; min-height: 0; overflow: hidden; }

.rail {
  flex: 0 0 auto; width: 84px; background: #fff; border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 6px; overflow-y: auto;
}
.rail-btn {
  border: 0; background: transparent; border-radius: 14px; padding: 10px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-soft);
  font-size: 11px; font-weight: 800; transition: .16s;
}
.rail-btn:hover { background: #f6f3fb; color: var(--brand); }
.rail-btn.active { background: var(--grad-brand); color: #fff; box-shadow: 0 10px 20px rgba(124,92,255,.28); }
.rail-icon { font-size: 22px; line-height: 1; }
.rail-label { font-size: 11px; }

.tool-panel {
  flex: 0 0 auto; width: 320px; background: #fff; border-inline-end: 1px solid var(--line);
  overflow-y: auto; padding: 16px;
}
.panel-body { display: flex; flex-direction: column; }
.panel-title { font-size: 17px; font-weight: 900; margin-bottom: 4px; }
.panel-title.spaced { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }
.panel-sub { font-size: 13.5px; font-weight: 900; color: var(--ink-soft); margin: 16px 0 8px; }
.panel-hint { font-size: 12px; color: var(--ink-faint); font-weight: 600; line-height: 1.6; margin-bottom: 10px; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 10px; }
.tpl-grid.landing { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.tpl-card {
  border: 2px solid var(--line); border-radius: var(--r-md); padding: 14px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: .18s; text-align: center;
}
.tpl-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: #ddd2ff; }
.tpl-card.active { border-color: var(--brand); }
.tpl-icon { font-size: 30px; }
.tpl-name { font-size: 13px; font-weight: 900; }
.tpl-meta { font-size: 11px; color: var(--ink-faint); font-weight: 700; }

.el-list { display: flex; flex-direction: column; gap: 4px; }
.el-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.el-grid.small { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.el-item {
  border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 8px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; transition: .16s;
}
.el-item:hover { transform: translateY(-3px); border-color: #ffd166; box-shadow: var(--sh-sm); }
.el-preview { font-size: 24px; line-height: 1; }
.el-preview.is-shape { width: 30px; height: 30px; border-radius: 8px; }
.el-name { font-size: 10px; font-weight: 800; color: var(--ink-soft); }

.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 8px; }
.style-grid.compact { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
.style-card {
  border: 2px solid var(--line); border-radius: 14px; background: #fff; padding: 10px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; transition: .16s; text-align: center;
}
.style-card:hover { transform: translateY(-3px); border-color: #ddd2ff; box-shadow: var(--sh-sm); }
.style-card.active { border-color: var(--brand); background: #faf8ff; box-shadow: 0 8px 18px rgba(124,92,255,.16); }
.style-icon { font-size: 22px; }
.style-name { font-size: 12px; font-weight: 900; }
.style-desc { font-size: 10px; color: var(--ink-faint); font-weight: 600; line-height: 1.4; }

.drop-zone { border: 3px dashed #d9ccff; border-radius: var(--r-lg); padding: 22px 16px; text-align: center; background: #faf8ff; cursor: pointer; transition: .18s; }
.drop-zone:hover, .drop-zone.drag { border-color: var(--brand); background: #f4f0ff; transform: translateY(-2px); }
.drop-icon { font-size: 36px; }
.drop-title { font-size: 14px; font-weight: 900; margin-top: 6px; }
.drop-sub { font-size: 11.5px; color: var(--ink-faint); font-weight: 600; margin-top: 3px; }

/* ---- stage ---- */
.stage-col { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.stage-wrap {
  flex: 1 1 auto; overflow: hidden; display: grid; place-items: center; position: relative;
  background:
    radial-gradient(circle at 20% 20%, rgba(124,92,255,.06), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(76,201,240,.06), transparent 50%),
    #f6f3fb;
}
#stage { display: block; touch-action: none; will-change: transform; }
body.preview-mode .stage-wrap { background: #ece7f6; }

.zoom-bar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; background: #fff; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.zb-group { display: flex; align-items: center; gap: 4px; }
.zb-btn { border: 0; background: #f6f3fb; border-radius: 10px; min-width: 34px; height: 34px; font-size: 16px; font-weight: 900; color: var(--ink-soft); cursor: pointer; transition: .16s; padding: 0 10px; }
.zb-btn:hover { background: #ece4fb; color: var(--brand); }
.zb-btn.zb-text { font-size: 12px; }
.zb-btn.is-on { background: var(--grad-brand); color: #fff; }
.zb-val { width: 62px; height: 34px; text-align: center; border: 2px solid var(--line); border-radius: 10px; font-weight: 900; font-size: 13px; color: var(--ink); }
.zb-pct { font-size: 12px; font-weight: 800; color: var(--ink-faint); }

/* ---- properties panel ---- */
.props-panel {
  flex: 0 0 auto; width: 340px; background: #fff; border-inline-start: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.props-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.pt-title { font-size: 15px; font-weight: 900; }
.props-body { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px; min-height: 120px; }
.props-empty { text-align: center; color: var(--ink-faint); padding: 26px 10px; }
.pe-icon { font-size: 40px; }
.props-empty h4 { font-size: 15px; font-weight: 900; color: var(--ink-soft); margin: 8px 0 4px; }
.props-empty p { font-size: 12.5px; font-weight: 600; line-height: 1.7; }
.props-empty .row-btns { justify-content: center; }
.props-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ph-title { display: flex; align-items: center; gap: 8px; }
.ph-icon { font-size: 22px; }
.props-head h3 { font-size: 15px; font-weight: 900; }
.ph-actions { display: flex; gap: 6px; }
.prop-group { margin-bottom: 12px; }

.acc { border: 2px solid var(--line); border-radius: 16px; margin-bottom: 10px; overflow: hidden; background: #fff; }
.acc.is-advanced { display: none; }
body.advanced-on .acc.is-advanced { display: block; }
.acc-head {
  width: 100%; border: 0; background: #fbfaff; padding: 11px 12px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 900; color: var(--ink);
}
.acc-head:hover { background: #f5f1ff; }
.acc-icon { font-size: 16px; }
.acc-title { flex: 1; text-align: start; }
.acc-caret { transition: .2s; color: var(--ink-faint); }
.acc-head.collapsed .acc-caret { transform: rotate(-90deg); }
.tag-adv { font-size: 10px; font-weight: 800; color: #B8860B; background: #FFF6E0; padding: 1px 7px; border-radius: 999px; }
.acc-body { padding: 12px; border-top: 1px solid var(--line); }
.acc .acc { margin: 8px 0 0; border-radius: 12px; }
.adv-gate { display: none; }
body.advanced-on .adv-gate { display: block; }

.layers-block { flex: 0 0 auto; max-height: 34%; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.lb-title { font-size: 13px; font-weight: 900; padding: 10px 14px 6px; }
.layer-list { overflow-y: auto; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.layer-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px;
  border: 2px solid transparent; background: #fbfaff; cursor: pointer; transition: .14s;
}
.layer-row:hover { background: #f4f0ff; }
.layer-row.active { border-color: var(--brand); background: #f6f2ff; }
.layer-row.locked { opacity: .65; }
.layer-row.drop { border-top-color: var(--brand); border-top-width: 3px; }
.lr-drag { color: var(--ink-faint); cursor: grab; font-size: 12px; letter-spacing: -2px; }
.lr-icon { font-size: 16px; }
.lr-name { flex: 1; font-size: 12.5px; font-weight: 800; color: var(--ink); outline: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-name:focus { background: #fff; border-radius: 6px; padding: 0 4px; }
.lr-actions { display: flex; gap: 3px; }
.lr-actions .icon-btn { width: 26px; height: 26px; font-size: 12px; border-radius: 8px; }

/* ---- modals ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(47,42,68,.55); backdrop-filter: blur(4px);
  display: grid; place-items: center; z-index: 200; padding: 18px; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal-card {
  background: #fff; border-radius: var(--r-xl); width: min(620px, 100%); max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--sh-lg); animation: rise .22s ease both; overflow: hidden;
}
.modal-card.wide { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 18px; font-weight: 900; }
.modal-x { border: 0; background: #f4f0ff; width: 34px; height: 34px; border-radius: 10px; font-size: 15px; color: var(--ink-soft); cursor: pointer; }
.modal-x:hover { background: #ece4fb; color: var(--brand); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-start; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfaff; flex-wrap: wrap; }

.ctx-menu {
  position: fixed; z-index: 300; background: #fff; border-radius: 16px; padding: 6px;
  box-shadow: var(--sh-lg); border: 1px solid var(--line); min-width: 200px; animation: rise .14s ease both;
}
.ctx-item { display: block; width: 100%; border: 0; background: transparent; text-align: start; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 800; color: var(--ink); cursor: pointer; }
.ctx-item:hover { background: #f4f0ff; color: var(--brand); }
.ctx-item.danger { color: #d64545; }
.ctx-item.danger:hover { background: #fff2f2; }
.ctx-sep { height: 1px; background: var(--line); margin: 5px 8px; }

/* ---- misc editor widgets ---- */
.batch-info { font-size: 12.5px; font-weight: 800; color: var(--brand); background: #f6f2ff; padding: 8px 12px; border-radius: 10px; margin-top: 10px; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 12px; }
.batch-item { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 14px; padding: 8px; background: #fbfaff; }
.batch-item img { width: 100%; max-width: 110px; height: auto; border-radius: 10px; }
.batch-item span { font-size: 12px; font-weight: 800; color: var(--ink-soft); }

.sheet-preview { display: grid; place-items: center; margin: 8px 0; background: #f6f3fb; border-radius: 14px; padding: 12px; }
.sheet-preview img { max-height: 340px; width: auto; max-width: 100%; box-shadow: var(--sh-md); border-radius: 4px; background: #fff; }

.print-quick-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.pq-btn {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-soft);
  padding: 6px 12px; border-radius: 10px; font-size: 11.5px; font-weight: 800;
  cursor: pointer; transition: .14s;
}
.pq-btn:hover { border-color: var(--brand); color: var(--brand); background: #faf8ff; }
.pq-btn.active { border-color: var(--brand); background: #f4f0ff; color: var(--brand); box-shadow: 0 2px 8px rgba(124,92,255,0.18); }

.size-manual-box {
  display: flex; align-items: center; gap: 10px; background: #faf8ff;
  border: 1.5px dashed #dcd0ff; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
}
.size-manual-box label { font-size: 12px; font-weight: 800; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.size-manual-box input { width: 68px; }

.fmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fmt-card { border: 2px solid var(--line); border-radius: 16px; background: #fff; padding: 14px; cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: .16s; }
.fmt-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--sh-md); }
.fmt-icon { font-size: 26px; }
.fmt-title { font-size: 14px; font-weight: 900; }
.fmt-desc { font-size: 11px; color: var(--ink-faint); font-weight: 600; line-height: 1.5; }

/* ---- mobile bottom sheet ---- */
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 150; background: #fff;
  border-radius: 24px 24px 0 0; box-shadow: 0 -18px 50px rgba(47,42,68,.22);
  transform: translateY(105%); transition: transform .26s ease; max-height: 78vh;
  display: flex; flex-direction: column;
}
.sheet.open { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-size: 16px; font-weight: 900; }
.sheet-content { padding: 16px 18px 26px; overflow-y: auto; }

/* ---- responsive editor ---- */
@media (max-width: 1200px) {
  .tool-panel { width: 276px; }
  .props-panel { width: 300px; }
}
@media (max-width: 980px) {
  .editor-bar { flex-wrap: wrap; }
  .eb-name { max-width: none; flex: 1 1 140px; }
  .ebl { display: none; }
  .eb-btn { min-width: 40px; }
  .eb-group { margin-inline-start: 0; }
  .tool-panel { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(360px, 88vw); z-index: 160; transform: translateX(-105%); transition: transform .26s ease; box-shadow: var(--sh-lg); }
  html[dir="rtl"] .tool-panel { transform: translateX(105%); }
  body.sheet-tools .tool-panel { transform: translateX(0); }
  .props-panel { width: 0; border: 0; overflow: hidden; }
  .props-panel .props-body, .props-panel .props-top, .props-panel .layers-block { display: none; }
  .rail {
    position: fixed; inset-inline: 0; bottom: 0; width: 100%; height: auto; flex-direction: row;
    justify-content: space-around; border-top: 1px solid var(--line); border-inline-end: 0; padding: 6px 4px; z-index: 120;
  }
  .rail-btn { padding: 6px 4px; }
  .zoom-bar { padding-bottom: 74px; }
  .sheet-content .props-body, .sheet-content .props-top, .sheet-content .layers-block,
  .sheet-content .tool-panel, .sheet-content .panel-body { display: block !important; position: static !important; transform: none !important; width: auto !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
}
@media (max-width: 560px) {
  .hero-stats { flex-wrap: wrap; gap: 14px; }
  .grid2, .size-row { grid-template-columns: 1fr; }
  .modal-card { border-radius: 20px; max-height: 94vh; }
}

@media print {
  .modal-overlay, .site-header, .editor-bar, .rail, .tool-panel, .props-panel, .zoom-bar, .bg-decor {
    display: none !important;
  }
}

