:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #0f172a;
    --bg-gradient: radial-gradient(circle at top left, #f8fafc, #e2e8f0);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.05);
    --shadow-depth: 0 20px 60px rgba(0, 0, 0, 0.2);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
}/* end @media */

* { box-sizing: border-box; outline: none; }
body { margin: 0; font-family: 'Inter', 'Heebo', sans-serif; background: var(--bg-gradient); color: var(--text-main); height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

[dir="rtl"] { text-align: right; }
[dir="ltr"] { text-align: left; }

svg { display: block; }

/* Glass Utilities */
.glass { 
    background: var(--glass-bg); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px); 
    border-bottom: var(--glass-border); 
    box-shadow: var(--shadow-soft); 
}
.glass-panel { 
    background: rgba(255,255,255,0.9); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px); 
    border: 1px solid rgba(255,255,255,0.8); 
    border-radius: 24px; 
    box-shadow: var(--shadow-soft); 
}
.glass-dark { 
    background: rgba(15, 23, 42, 0.95); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px); 
    color: white; 
}

/* Navbar */
.navbar { 
    padding: 0.8rem 0; 
    z-index: 1000; 
    flex-shrink: 0; 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px); 
}

@media (min-width: 769px) {
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        margin: 0;
        height: 80px;
    }

    .app-wrapper {
        margin-top: 80px;
        padding-top: 0;
    }

    .canvas-toolbar {
        margin-top: 0;
    }
}
.nav-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: grid; place-items: center; }
.logo-text { font-weight: 700; font-size: 1.3rem; color: var(--accent); }
.badge-pro { background: var(--accent); color: #fbbf24; font-size: 0.6rem; padding: 3px 6px; border-radius: 4px; letter-spacing: 1px; font-weight: 800; }

.nav-controls { display: flex; align-items: center; gap: 15px; }
.status-indicator { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--success); background: rgba(16, 185, 129, 0.1); padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(16, 185, 129, 0.2); }
.dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

/* Language Button Fix */
button.btn-icon-text {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #cbd5e1; /* Fixed default border */
    padding: 6px 12px;
    border-radius: 8px;
    font: inherit;
    color: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    outline: none;
    box-shadow: none;
}
button.btn-icon-text:hover {
    background: white;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    :root { --mobile-header-height: 56px; }
    header {
        position: relative;
        height: auto;
        padding: 10px;
    }
    .navbar { 
        padding: 0.35rem 0; 
        position: relative; 
        top: auto; left: auto; right: auto; 
        z-index: 2000; 
        background: white;
    }
    .nav-content { padding: 0 10px; justify-content: space-between; flex-wrap: nowrap; row-gap: 6px; }
    .logo { gap: 6px; }
    .logo-text { font-size: 1rem; }
    .badge-pro { font-size: 0.55rem; padding: 2px 5px; }
    .nav-controls { gap: 6px; flex-shrink: 0; }
    .status-indicator { display: none; }
    #headerActivateBtn,
    .btn-secondary,
    button.btn-icon-text {
        font-size: 10px;
        padding: 4px 6px;
    }
    .app-wrapper { padding-top: 0; }
    #landingView { padding-top: 0; }
    .canvas-toolbar {
        position: relative;
        top: 0;
        margin-top: 0;
        z-index: 1000;
        gap: 5px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .canvas-toolbar > * { flex: 0 0 auto; }
    .nav-btn { width: 28px; height: 28px; font-size: 0.85rem; }
    .page-badge { font-size: 0.75rem; padding: 4px 8px; }

    /* Hide buy/activate in editor sidebar on mobile to prevent overlap */
    .editor-layout #buyBtnSidebar,
    .editor-layout #activateLicenseBtn {
        display: none !important;
    }
}

/* Landing View */
.app-wrapper { flex: 1; position: relative; overflow: hidden; padding-top: 0; }
#landingView { overflow-y: auto; height: 100%; position: relative; }
.hero-bg-glow { position: absolute; top: -20%; left: 50%; transform: translateX(-50%); width: 80%; height: 600px; background: radial-gradient(circle, rgba(59,130,246,0.15), transparent 70%); pointer-events: none; z-index: -1; }

.hero-section { text-align: center; padding: 4rem 0 3rem; }
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.hero-badge { display: inline-block; background: #eff6ff; color: var(--primary); font-size: 0.8rem; font-weight: 700; padding: 6px 12px; border-radius: 20px; border: 1px solid #dbeafe; margin-bottom: 1rem; }
.hero-section h1 { 
    font-size: 4rem; 
    font-weight: 900; 
    margin: 0 0 1rem; 
    letter-spacing: -2px; 
    line-height: 1.1; 
    background: linear-gradient(to right, #1e293b, #2563eb); 
    -webkit-background-clip: text; 
    background-clip: text; 
    color: transparent; 
}
.hero-section p { 
    font-size: 1.25rem; 
    color: #475569; 
    line-height: 1.6; 
    max-width: 700px; 
    margin: 0 auto 3rem; 
}

.hero-upload-card { max-width: 600px; margin: 0 auto; padding: 2.5rem; }
.drop-zone { border: 2px dashed #cbd5e1; border-radius: 16px; padding: 3rem 2rem; cursor: pointer; transition: 0.3s; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: rgba(255,255,255,0.5); }
.drop-zone:hover { border-color: var(--primary); background: #f0f9ff; transform: scale(1.01); }
.upload-graphic { margin-bottom: 1rem; }
.specs-row { margin-top: 1.5rem; display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.spec-item { display: flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.8); padding: 4px 10px; border-radius: 6px; border: 1px solid #e2e8f0; font-size: 0.75rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin: 4rem auto; }
.feat-card { padding: 2rem; border-radius: 20px; text-align: center; transition: transform 0.3s; }
.feat-card:hover { transform: translateY(-5px); }
.f-icon-box { width: 60px; height: 60px; background: #eff6ff; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 15px; font-size: 1.5rem; }
.feat-card h4 { margin: 0 0 10px; font-size: 1.2rem; }

.pricing-section {
  padding: 4rem 0 6rem;
  text-align: center;
  position: relative;
}
.pricing-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(37,99,235,0.12), transparent 55%);
  pointer-events: none;
  z-index: -1;
}
.pricing-section h2 {
  font-size: 2.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.pricing-section p.subtitle {
  margin: 0 auto;
  max-width: 520px;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.pricing-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.price-card {
  background: white;
  padding: 3rem 2.2rem;
  border-radius: 26px;
  width: 320px;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #dbe3f0;
  box-shadow: 0 18px 45px rgba(15,23,42,0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.price-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 60px rgba(15,23,42,0.22);
  border-color: var(--primary);
}
.price-card.featured {
  border: 2px solid var(--primary);
  transform: scale(1.05);
  z-index: 10;
  overflow: hidden;
  background: radial-gradient(circle at top left, #eef2ff, #ffffff);
}
.price-card.featured:hover {
  transform: translateY(-6px) scale(1.05);
}
.glow-effect {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59,130,246,0.18), transparent 60%);
  pointer-events: none;
}
.popular-tag {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: #22c55e;
  color: #022c22;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Highlight price line / marketing focus */
.price-card .price-display {
  margin: 1rem 0 1.2rem;
  font-size: 2.6rem;
  font-weight: 900;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  color: var(--accent);
}
.price-card .price-display .period {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.price-card h3 {
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-main);
}

/* === Price Ordering (Unified) === */
.price, .price-container { 
    display: flex; 
    align-items: baseline; 
    justify-content: center; 
    gap: 5px;
    font-size: 3rem; 
    font-weight: 900; 
    margin: 1rem 0; 
    color: var(--accent);
    direction: ltr !important; 
}

.price .period, .price-container .period { 
    font-size: 1rem; 
    color: var(--text-muted); 
    font-weight: 400; 
}

html[lang="he"] .price { flex-direction: row-reverse; }
html[lang="en"] .price { flex-direction: row; }
.price .period { font-size: 1rem; color: var(--text-muted); font-weight: 400; }

.features-list { list-style: none; padding: 0; margin: 2rem 0; flex: 1; text-align: start; }
.features-list li { margin-bottom: 12px; color: var(--text-muted); display: flex; gap: 10px; font-size: 0.95rem; }
.features-list li::before { content: "✓"; color: var(--success); font-weight: bold; }
.btn-outline { 
    background: transparent; 
    border: 2px solid #cbd5e1; 
    width: 100%; 
    padding: 12px; 
    border-radius: 12px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: 0.2s; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
}
.btn-outline:hover { 
    border-color: var(--primary); 
    color: var(--primary); 
    box-shadow: 0 2px 6px rgba(37,99,235,0.1); 
}
.btn-gradient { 
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)); 
    color: white; 
    border: none; 
    width: 100%; 
    padding: 14px; 
    border-radius: 12px; 
    font-weight: 700; 
    cursor: pointer; 
    box-shadow: 0 4px 12px rgba(37,99,235,0.2); 
    transition: 0.2s; 
}
.btn-gradient:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 16px rgba(37,99,235,0.3); 
}

.main-footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid rgba(0,0,0,0.05); }

/* --- Editor View Layout (Desktop) --- */
.editor-layout { display: flex; height: 100%; overflow: hidden; }
.glass-sidebar { background: rgba(255,255,255,0.9); border-inline-end: 1px solid #cbd5e1; }
.sidebar { width: 320px; display: flex; flex-direction: column; z-index: 20; flex-shrink: 0; }
.sidebar-header { padding: 1rem; border-bottom: 1px solid #e2e8f0; }
.btn-icon-small { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid #e2e8f0; border-radius: 6px; cursor: pointer; padding: 6px 10px; font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
.btn-icon-small:hover { border-color: var(--primary); color: var(--primary); }
.file-meta { margin-top: 15px; }
.fname { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsub { font-size: 0.75rem; color: var(--text-muted); }

.tools-container { padding: 1.5rem; flex: 1; overflow-y: auto; }
.section-label { display: block; font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; font-weight: 700; letter-spacing: 0.5px; }
.search-box { display: flex; gap: 5px; margin-bottom: 25px; }
.search-box input { flex: 1; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 0.9rem; }
.btn-icon { background: white; border: 1px solid #cbd5e1; border-radius: 8px; width: 36px; cursor: pointer; display: grid; place-items: center; }

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: white; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: 0.2s; }
.tool-btn:hover { border-color: var(--primary); }
.tool-btn.active { background: #eff6ff; border-color: var(--primary); color: var(--primary); }
.tool-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; line-height: 1.4; }

.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 25px; font-size: 0.9rem; font-weight: 600; padding: 10px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.stats-panel { background: #f1f5f9; padding: 15px; border-radius: 12px; margin-top: 25px; font-size: 0.85rem; border: 1px solid #e2e8f0; }
.s-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
.c-green { color: var(--success); } .c-blue { color: var(--primary); }
.ocr-alert { margin-top: 15px; padding: 10px; background: #fff7ed; border: 1px solid #ffedd5; border-radius: 8px; font-size: 0.8rem; color: #c2410c; font-weight: 600; }

.sidebar-footer { padding: 1.5rem; border-top: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 10px; }
/* App-style primary action button (Save) */
.btn-gradient-full {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #f9fafb;
  border: none;
  width: 100%;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(37,99,235,0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-gradient-full:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(37,99,235,0.4);
  filter: brightness(1.05);
}
.btn-gradient-full:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(37,99,235,0.3);
  filter: brightness(0.98);
}

/* Canvas Area */
.canvas-area { flex: 1; background: #e2e8f0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.canvas-toolbar { padding: 10px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid #e2e8f0; background: white; flex-shrink: 0; }
.canvas-toolbar #downloadBtn { margin-left: auto; }
.nav-btn { background: white; border: 1px solid #cbd5e1; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; font-size: 1rem; color: var(--text-main); }
.nav-btn:hover { background: #f1f5f9; border-color: var(--primary); color: var(--primary); }

.page-badge { background: #f1f5f9; padding: 5px 12px; border-radius: 20px; font-weight: 700; font-size: 0.85rem; border: 1px solid #e2e8f0; }
.canvas-scroll {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  padding: 50px;
  width: 100%;
  min-height: 600px;
  background: #e2e8f0;
  overscroll-behavior: contain;
}

.canvas-wrapper {
  position: relative;
  background: white;
  align-self: flex-start;
  box-shadow: var(--shadow-depth);
  min-height: 800px;
  min-width: 600px;
  background: white;
}
canvas { display: block; }
#overlayLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  z-index: 10;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.is-drawing {
  touch-action: none;
}
.redact-box { position: absolute; background: rgba(0,0,0,0.7); z-index: 15; border: 1px solid rgba(255,0,0,0.3); }
.redact-box.auto { border: 2px dashed #fbbf24; background: rgba(0,0,0,0.5); }
.redact-box:hover { background: rgba(220, 38, 38, 0.8); cursor: pointer; }

.redact-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid #ef4444;
  pointer-events: none;
}
.redact-handle.tl { top: -9px; left: -9px; }
.redact-handle.tr { top: -9px; right: -9px; }
.redact-handle.bl { bottom: -9px; left: -9px; }
.redact-handle.br { bottom: -9px; right: -9px; }

@media (max-width: 768px) {
  .redact-handle {
    width: 22px;
    height: 22px;
  }
  .redact-handle.tl { top: -11px; left: -11px; }
  .redact-handle.tr { top: -11px; right: -11px; }
  .redact-handle.bl { bottom: -11px; left: -11px; }
  .redact-handle.br { bottom: -11px; right: -11px; }
}

/* Magnifier */
.magnifier {
    position: absolute; border: 3px solid #fff; border-radius: 50%; cursor: none;
    width: 150px; height: 150px; box-shadow: 0 0 10px rgba(0,0,0,0.25); display: none; z-index: 50; pointer-events: none;
    background-repeat: no-repeat; background-color: white;
}

/* Loader */
.loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tech-spinner { width: 50px; height: 50px; border: 3px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: var(--primary); animation: spin 1s ease-in-out infinite; margin-bottom: 20px; }
.loading-bar { width: 200px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.bar-fill { height: 100%; width: 50%; background: var(--primary); animation: load 2s infinite ease-in-out; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.fade-view { display: none; opacity: 0; transition: opacity 0.5s; height: 100%; }
.fade-view.active { display: block; opacity: 1; }

/* =========================================
   MOBILE LAYOUT FIX (Single Top Bar)
   ========================================= */
@media (max-width: 900px) {

    /* 1. Reset Grid & Layout */
    .grid-3 { grid-template-columns: 1fr; }
    
    .editor-layout {
      flex-direction: column;
      height: 100vh;
      overflow: hidden;
      width: 100%;
      max-width: 100%;
      margin: 0;
    }
  
    /* 2. Top Bar Header */
    .sidebar {
      order: -1;
      width: 100%;
      height: 60px; /* גובה קבוע וצר */
      
      /* Single Row Layout */
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap; /* קריטי: מונע שבירת שורות */
      align-items: center;
      justify-content: space-between;
      
      padding: 0 8px;
      background: #fff;
      border-bottom: 1px solid #e2e8f0;
      box-shadow: 0 2px 10px rgba(0,0,0,0.05);
      z-index: 100;
      
      /* איפוס הגדרות ישנות */
      position: relative !important;
      bottom: auto !important;
      left: auto !important;
      top: auto !important;
      border-radius: 0 !important;
      max-height: none !important;
      border-inline-end: none;
    }
  
    /* 3. Hide Unnecessary Elements */
    .file-meta, 
    .section-label, 
    .stats-panel, 
    .ocr-alert,
    .toggle-row, 
    .sidebar-header .logo-text, 
    #backBtn span, 
    .tool-btn span, 
    .btn-gradient-full span,
    .tool-desc
    {
      display: none !important;
    }
  
    /* 4. Left Side: Back Button */
    .sidebar-header {
      padding: 0;
      border: none;
      flex: 0 0 auto;
      margin: 0;
    }
    #backBtn {
      border: none;
      background: transparent;
      padding: 8px;
      font-size: 1.2rem;
    }
  
    /* 5. Center: Tools */
    .tools-container {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 5px;
      gap: 10px;
      overflow: visible;
      background: transparent;
      box-shadow: none;
    }
  
    .tool-grid {
      display: flex !important;
      gap: 8px !important;
      margin: 0 !important;
    }
  
    .tool-btn {
      width: 38px !important;
      height: 38px !important;
      padding: 0 !important;
      border-radius: 8px !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      background: #f1f5f9;
      border: 1px solid #e2e8f0;
    }
    
    /* Compact Search Box */
    .search-box {
      margin: 0;
      display: flex;
      align-items: center;
      background: #f1f5f9;
      padding: 0 5px;
      border-radius: 6px;
      height: 38px;
      width: auto;
    }
    .search-box input {
      width: 60px;
      border: none;
      background: transparent;
      font-size: 12px;
      padding: 0;
    }
    .search-box button {
      background: none;
      border: none;
      padding: 0;
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    /* 6. Right Side: Save Button */
    .sidebar-footer {
      padding: 0;
      border: none;
      flex: 0 0 auto;
      background: transparent;
    }
    
    .btn-gradient-full {
      width: 40px !important;
      height: 40px !important;
      padding: 0 !important;
      border-radius: 8px !important;
      /* Center single icon perfectly */
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      box-shadow: none !important;
      overflow: hidden;
    }

    /* 1. Hide any text spans inside the Save button on mobile */
    .btn-gradient-full span {
      display: none !important;
    }
    
    /* 2. Fallback icon – only when there is no SVG (modern download-style icon) */
    .btn-gradient-full::after {
      content: "⬇️";
      font-size: 1.3rem;
      display: block;
    }
    .btn-gradient-full:has(svg)::after {
      display: none;
    }
  
    /* 7. Canvas Area (Bottom) */
    .canvas-area {
      flex: 1;
      height: calc(100vh - 60px);
      width: 100%;
      max-width: 100%;
      margin: 0;
      padding: 0;
      background: #e2e8f0;
      position: relative;
      top: 0;
    }
    
    .canvas-scroll {
      padding: 0;
      height: 100%;
      width: 100%;
      max-width: 100%;
      display: flex;
      justify-content: center;
      align-items: flex-start;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }
    
    .canvas-wrapper {
      box-shadow: none;
      width: 100%;
      max-width: 100%;
      min-width: auto !important;
      margin: 0;
    }
    
    canvas {
      /* Let JS set exact pixel size so overlay coordinates match */
      width: auto !important;
      max-width: 100% !important;
      height: auto !important;
      display: block;
    }
  }

/* Watermark Overlay */
.watermark-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 6rem;
    font-weight: 900;
    color: rgba(200, 0, 0, 0.15); /* Faint red */
    pointer-events: none; /* Allow clicking through it */
    z-index: 50;
    white-space: nowrap;
    user-select: none;
    border: 5px solid rgba(200, 0, 0, 0.15);
    padding: 20px 40px;
    border-radius: 20px;
}

/* Modal Styles */
.modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

#licenseInput {
    width: 100%;
    padding: 10px;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
}

.modal-actions { display: flex; gap: 10px; justify-content: center; }
.btn-primary, .btn-secondary { width: auto; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(37,99,235,0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37,99,235,0.3);
}
.btn-secondary {
    background: #f8fafc;
    color: var(--text-main);
    border: 1px solid #cbd5e1;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn-secondary:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 768px) {
    .modal-wrapper {
        z-index: 4000;
        padding: 12px;
    }
    .modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    .modal-content iframe,
    iframe[src*="gumroad.com"] {
        width: 100%;
        max-height: 90vh;
    }
}

.activate-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}
.activate-link:hover {
    color: var(--primary);
}

/* FAQ Section */
.faq-section {
    padding: 80px 20px 40px;
}
.faq-container {
    max-width: 900px;
    margin: 0 auto;
}
.faq-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 24px;
    color: var(--accent);
}
.faq-category {
    margin-bottom: 32px;
}
.faq-category-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--text-main);
}
.faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-soft);
}
.faq-item summary {
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.faq-item summary::before {
    content: "▸";
    font-size: 0.9rem;
    color: var(--primary);
    transition: transform 0.2s ease;
}
.faq-item[open] summary::before {
    transform: rotate(90deg);
}
.faq-item summary::-webkit-details-marker {
    display: none;
}
.faq-item p {
    margin: 12px 0 4px;
    color: var(--text-muted);
    line-height: 1.8;
}

.faq-section-en {
    display: none;
}
[dir="ltr"] .faq-section-he {
    display: none;
}
[dir="ltr"] .faq-section-en {
    display: block;
}
