@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,800;1,400&display=swap');

/* ===== VARIABLES ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --navy: #0a0f1d;
  --navy2: #111827;
  --text: #1e293b;
  --text-muted: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --accent: #a855f7;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --border: #e2e8f0;
  --border-focus: #6366f1;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.07);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --nav-h: 68px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #fdfdff;
  color: var(--text);
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.6;
}
img, canvas, svg { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
button { touch-action: manipulation; }
a { touch-action: manipulation; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  overflow: visible;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
  cursor: pointer;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.logo:hover { opacity: 0.85; }
.logo .accent { color: var(--primary); }

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  z-index: 1100;
  flex-shrink: 0;
}
.hamburger:hover { background: rgba(255,255,255,0.1); }
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== DESKTOP NAV ===== */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: visible;
}

/* Mobile-only parts hidden on desktop */
.nav-menu-header,
.nav-item.plain,
.nav-group,
.nav-divider { display: none; }

/* Desktop dropdown links */
.desktop-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: visible;
  position: relative;
}

.desktop-dropdown {
  position: relative;
}

.dd-trigger {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  min-height: 40px;
}
.dd-trigger:hover,
.desktop-dropdown.open .dd-trigger {
  background: rgba(255,255,255,0.12);
  color: white;
}

.dd-content {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.175,0.885,0.32,1.275);
  z-index: 1002;
  border: 1px solid var(--border);
}
.desktop-dropdown.open .dd-content {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.dd-content a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  min-height: 40px;
}
.dd-content a:hover {
  background: #f1f5f9;
  color: var(--primary);
  transform: translateX(4px);
}

/* ===== OVERLAY ===== */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 998;
}
.nav-overlay.show { display: block; }

/* ===== MOBILE NAV ===== */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .desktop-nav-links { display: none; }

  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--navy2);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    z-index: 1050;
    padding-top: var(--nav-h);
  }
  .nav-menu.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.4);
  }

  /* Mobile-only blocks now visible */
  .nav-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(99,102,241,0.18);
  }
  .nav-menu-title {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }
  .nav-badge {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
  }

  .nav-item.plain {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.2s, color 0.2s;
    min-height: 52px;
  }
  .nav-item.plain:hover {
    background: rgba(255,255,255,0.05);
    color: white;
  }

  .nav-group {
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .nav-group-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    min-height: 52px;
    user-select: none;
  }
  .nav-group-trigger > span:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .nav-group.open .nav-group-trigger {
    background: rgba(99,102,241,0.15);
    color: white;
  }

  .nav-group-meta {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .nav-count {
    background: rgba(99,102,241,0.5);
    color: rgba(255,255,255,0.9);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
  }
  .nav-arrow {
    color: rgba(255,255,255,0.4);
    font-size: 1.2rem;
    transition: transform 0.25s;
    line-height: 1;
  }
  .nav-group.open .nav-arrow { transform: rotate(90deg); color: white; }

  .nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.2);
  }
  .nav-group.open .nav-group-items { max-height: 500px; }
  .nav-group-items a {
    display: flex;
    align-items: center;
    padding: 13px 20px 13px 44px;
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    min-height: 48px;
  }
  .nav-group-items a:last-child { border-bottom: none; }
  .nav-group-items a:hover {
    background: rgba(99,102,241,0.2);
    color: white;
  }

  .nav-divider {
    display: block;
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 6px 0;
  }

  .nav-icon { font-size: 16px; }
}

/* ===== LAYOUT ===== */
.layout {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  min-height: calc(100vh - var(--nav-h));
}
.ad-col {
  background: #f1f5f9;
  text-align: center;
  padding-top: 80px;
  font-size: 0.75rem;
  color: #cbd5e1;
  font-weight: 700;
}
.content {
  padding: 40px 5%;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ===== PAGES ===== */
.page { display: none; }
.page.active {
  display: block;
  animation: fadeIn 0.3s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none; }
}

/* ===== BACK BUTTON (injected by JS) ===== */
.back-btn-injected {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: white;
  border: 2px solid var(--border);
  color: var(--primary);
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 22px;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.25s;
  min-height: 42px;
}
.back-btn-injected:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== HERO ===== */
.hero-title {
  font-size: clamp(1.8rem,5vw,3rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  margin: 20px 0 16px;
  letter-spacing: -1px;
}
.gradient-text {
  background: linear-gradient(90deg,#6366f1,#a855f7,#ec4899,#6366f1);
  background-size: 300%;
  animation: gradFlow 5s linear infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@keyframes gradFlow { to { background-position: 300% center; } }

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 1.05rem;
}
.home-all-tools {
  text-align: center;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  margin-top: 30px;
  padding: 12px;
}
.home-all-tools:hover { text-decoration: underline; }

/* ===== HOME GRID ===== */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(260px,1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.home-card {
  background: white;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.23,1,0.32,1);
}
.home-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(99,102,241,0.18);
  transform: translateY(-5px);
}
.hc-icon { font-size: 2rem; margin-bottom: 10px; }
.home-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.home-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ===== TOOL TITLE ===== */
.tool-title {
  font-size: clamp(1.5rem,4vw,2rem);
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

/* ===== TOOL CARD ===== */
.tool-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
  max-width: 820px;
}

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: #eef2ff;
}
.drop-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 20px;
  cursor: pointer;
  text-align: center;
}
.drop-icon { font-size: 2rem; }
.drop-text { font-weight: 600; font-size: 1rem; color: var(--text); }
.drop-text u { color: var(--primary); }
.drop-sub { font-size: 0.82rem; color: var(--text-muted); }

/* ===== PREVIEW ===== */
.preview-box {
  width: 100%;
  min-height: 160px;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-box img,
.preview-box canvas {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 8px;
}
.preview-box:empty { display: none; }

/* ===== INFO BOX ===== */
.info-box {
  padding: 14px 16px;
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  line-height: 1.6;
  display: none;
}
.info-box.show { display: block; }

/* ===== FORM ELEMENTS ===== */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label,
.field-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}
input[type="text"],
input[type="number"],
input[type="color"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text);
  background: white;
  transition: border-color 0.2s;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
input[type="color"] {
  padding: 4px;
  height: 50px;
  cursor: pointer;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.four-col { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }

/* ===== SLIDER ===== */
.field-row { display: flex; flex-direction: column; gap: 6px; }
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  margin: 6px 0;
  touch-action: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  transition: transform 0.15s;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}
.slider-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===== CHECKBOXES / RADIOS ===== */
.check-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 36px;
}
.check-label input[type="checkbox"],
.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--primary);
  padding: 0;
  border: none;
  border-radius: 4px;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s;
  min-height: 40px;
}
.radio-label:hover { background: rgba(99,102,241,0.07); }
.radio-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn-primary {
  width: 100%;
  padding: 14px 20px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99,102,241,0.28);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  padding: 10px 18px;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
  padding: 10px 18px;
  background: #fee2e2;
  color: var(--danger);
  border: 1.5px solid var(--danger);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-danger-sm {
  padding: 9px 16px;
  background: #fee2e2;
  color: var(--danger);
  border: 1.5px solid var(--danger);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.2s;
  min-height: 40px;
}
.btn-danger-sm:hover { background: var(--danger); color: white; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== DOWNLOAD ZONE ===== */
.dl-zone {
  padding: 18px;
  background: #ecfdf5;
  border-radius: var(--radius);
  text-align: center;
  display: none;
  border: 1px solid #a7f3d0;
}
.dl-zone.show { display: block; animation: fadeSlide 0.3s ease both; }
.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--success);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: all 0.2s;
  min-height: 46px;
}
.btn-download:hover { background: #059669; transform: translateY(-2px); }

/* ===== FORMAT BUTTONS ===== */
.fmt-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.fmt-btn {
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  min-height: 40px;
}
.fmt-btn.active, .fmt-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== PRESET PILLS ===== */
.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preset-pills button {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  min-height: 36px;
  color: var(--text);
}
.preset-pills button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== TEXTAREA ===== */
.big-textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  resize: vertical;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
  background: white;
  transition: border-color 0.2s;
}
.big-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.mono { font-family: 'Courier New', Courier, monospace; font-size: 0.85rem; }

/* ===== FILE LIST ===== */
.file-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.file-list:empty { display: none; }
.file-item {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  min-height: 48px;
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: #e0e7ff; }
.file-item.selected { background: #e0e7ff; border-left: 3px solid var(--primary); }
.file-item-size { color: var(--text-muted); font-weight: 400; font-size: 0.8rem; }

.merge-controls { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== ROTATE BUTTONS ===== */
.rotate-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.rotate-btn {
  padding: 10px 18px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  min-height: 42px;
}
.rotate-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== WATERMARK GRID ===== */
.wm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ===== FILTER GRID ===== */
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
}
.stat-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
}
.stat-lbl {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
}

/* ===== COMPARE ===== */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.diff-result {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--bg);
  display: none;
}
.diff-result.show { display: block; }

/* ===== CROP ===== */
.crop-wrap {
  width: 100%;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}
.crop-wrap canvas { max-width: 100%; }

/* ===== COLOR PICKER ===== */
.color-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: start;
}
.color-left { display: flex; flex-direction: column; gap: 12px; }
.color-left input[type="color"] {
  width: 100px;
  height: 100px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 4px;
  background: var(--bg);
  touch-action: manipulation;
}
.color-swatch {
  width: 130px;
  height: 60px;
  border-radius: var(--radius);
  background: #6366f1;
  border: 1.5px solid var(--border);
  transition: background 0.2s;
}
.color-right { display: flex; flex-direction: column; gap: 12px; }
.palette-title { font-weight: 700; font-size: 1rem; }
.palette-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.palette-swatch {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s;
}
.palette-swatch:hover { transform: scale(1.12); box-shadow: 0 4px 12px rgba(0,0,0,0.18); }

/* ===== PASSWORD ===== */
.pwd-display {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pwd-input {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 2px;
  background: var(--bg);
  min-height: 50px;
}
.pwd-strength {
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
  font-size: 0.9rem;
  display: none;
}
.pwd-strength.show { display: block; }
.strength-weak   { background: #fee2e2; color: #dc2626; border: 1.5px solid #fca5a5; }
.strength-medium { background: #fef3c7; color: #d97706; border: 1.5px solid #fcd34d; }
.strength-strong { background: #d1fae5; color: #059669; border: 1.5px solid #6ee7b7; }
.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ===== QR ===== */
.qr-result {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: var(--radius);
  padding: 20px;
}

/* ===== PDF COMPRESS ===== */
.gs-note {
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: #92400e;
  font-weight: 500;
}
.progress-wrap {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1.5px solid var(--border);
  text-align: center;
}
.progress-bar {
  height: 8px;
  background: var(--primary);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
  margin-bottom: 10px;
}
#compress-status-text { font-size: 0.88rem; color: var(--text-muted); font-weight: 600; }
.compress-stats {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== BLOG ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(300px,1fr));
  gap: 24px;
  margin-top: 20px;
}
.blog-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.blog-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,var(--primary),var(--accent));
  transform: scaleX(0);
  transition: transform 0.3s;
}
.blog-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(99,102,241,0.15);
  transform: translateY(-4px);
}
.blog-card:hover::before { transform: scaleX(1); }
.blog-cat {
  display: inline-block;
  background: linear-gradient(135deg,var(--primary),var(--accent));
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.blog-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.35;
  color: var(--navy);
}
.blog-card:hover .blog-card-title { color: var(--primary); }
.blog-excerpt { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 16px; }
.blog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}
.blog-date { color: var(--text-muted); }
.blog-read { color: var(--primary); font-weight: 700; }

/* Blog full post */
.blog-full { max-width: 740px; margin: 0 auto; }
.blog-full h1 { font-size: clamp(1.5rem,4vw,2.2rem); font-weight: 800; margin-bottom: 16px; }
.blog-meta-full {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 14px 18px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.blog-body { font-size: 1rem; line-height: 1.85; }
.blog-body p { margin-bottom: 20px; }
.blog-body h2 { font-size: 1.4rem; font-weight: 800; margin: 28px 0 14px; }
.blog-body h3 { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin: 22px 0 10px; }

/* ===== ABOUT ===== */
.about-card { font-size: 1rem; line-height: 1.8; }
.about-card h3 { color: var(--primary); margin: 24px 0 10px; font-size: 1.1rem; }
.about-card ul { list-style: none; padding: 0; }
.about-card li { padding: 6px 0 6px 22px; position: relative; color: var(--text-muted); }
.about-card li::before { content: '→'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

/* ===== UTILITIES ===== */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.flex-wrap { flex-wrap: wrap; }

/* ===== STATUS TOAST ===== */
.status-toast {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  right: 16px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease both;
  line-height: 1.5;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast-success { background: #10b981; color: white; }
.toast-error   { background: #ef4444; color: white; }
.toast-warning { background: #f59e0b; color: white; }
.toast-info    { background: #3b82f6; color: white; }

/* ===== RESPONSIVE — TABLET ===== */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .ad-col { display: none; }
  .content { padding: 24px 4%; }
  .filter-grid { grid-template-columns: 1fr; }
  .wm-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .color-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .four-col { grid-template-columns: repeat(2,1fr); }
}

/* ===== RESPONSIVE — MOBILE ===== */
@media (max-width: 600px) {
  .navbar { padding: 0 4%; }
  .tool-card { padding: 20px 16px; }
  .home-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .home-card { padding: 18px 14px; }
  .hc-icon { font-size: 1.5rem; }
  .home-card h3 { font-size: 0.9rem; }
  .home-card p { font-size: 0.78rem; }
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .four-col { grid-template-columns: repeat(2,1fr); }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .check-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .btn-row { flex-direction: column; }
  .btn-row .btn-secondary { width: 100%; }
  .merge-controls { flex-direction: column; }
  .preview-box img, .preview-box canvas { max-height: 220px; }
  .dl-zone { padding: 14px; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== PRINT ===== */
@media print {
  .navbar, .ad-col, .hamburger { display: none !important; }
  .content { padding: 0; }
  .page { display: block !important; }
  .tool-card { box-shadow: none; border: 1px solid #ccc; }
}
/* ===== LUCIDE ICON SIZING ===== */
/* Nav sidebar icons */
.nav-icon-svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-item-icon {
  width: 14px;
  height: 14px;
  stroke: #818cf8;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
/* Desktop dropdown icons */
.dd-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dd-item-icon {
  width: 13px;
  height: 13px;
  stroke: #6366f1;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
/* Tool title icons */
.tool-title-icon {
  width: 26px;
  height: 26px;
  stroke: #6366f1;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  margin-right: 8px;
  display: inline-block;
}
/* Button icons */
.btn-icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
/* Drop zone upload icon */
.drop-icon-svg {
  width: 36px;
  height: 36px;
  stroke: #94a3b8;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 6px;
}
/* Home grid card icons */
.hc-icon i[data-lucide] {
  width: 32px;
  height: 32px;
  stroke: #6366f1;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Make tool title layout clean */
.tool-title {
  display: flex;
  align-items: center;
}

/* ===== HAMBURGER HINT (mobile only) ===== */
@media (max-width: 768px) {
  /* Pulsing dot on burger — permanent until first open */
  .burger-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: #818cf8;
    border-radius: 50%;
    border: 1.5px solid #0a0f1d;
    animation: dotPulse 2.5s ease infinite;
    transition: opacity 0.4s;
    pointer-events: none;
  }
  .hint-seen .burger-dot {
    opacity: 0;
    animation: none;
  }
  @keyframes dotPulse {
    0%,100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(129,140,248,0.5); }
    50%      { transform: scale(1.2); box-shadow: 0 0 0 5px rgba(129,140,248,0); }
  }

  /* Tooltip that floats below the hamburger once, then disappears */
  .burger-whisper {
    position: absolute;
    top: calc(100% + 8px);
    right: 4px;
    background: #1e293b;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    animation: tooltipOnce 4.5s ease forwards;
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.1px;
    z-index: 1200;
  }
  /* Arrow pointing up toward the burger */
  .burger-whisper::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 14px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #1e293b;
  }
  @keyframes tooltipOnce {
    0%   { opacity: 0; transform: translateY(-4px); }
    15%  { opacity: 1; transform: translateY(0); }
    72%  { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-4px); }
  }
  .hint-seen .burger-whisper { display: none; }
}
@media (min-width: 769px) {
  .burger-dot, .burger-whisper { display: none; }
}

/* Icon alignment — these are already set correctly in their respective blocks */
/* dd-content a has display:flex in its main desktop rule */
/* nav-group-items a and nav-item.plain are mobile-only, handled in @media */

/* ===== PDF EDITOR TABS ===== */
.pdf-editor-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
}
.pe-tab {
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  min-height: 40px;
  color: var(--text);
  touch-action: manipulation;
}
.pe-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.pe-tab:hover:not(.active) {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}
.pe-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== PDF CONVERT PROGRESS ===== */
#pdf-convert-progress { margin: 4px 0; }

/* ===== WORD PREVIEW ===== */
.word-preview-box {
  width: 100%;
  max-height: 360px;
  overflow-y: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  background: white;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}
.word-preview-box h1, .word-preview-box h2, .word-preview-box h3 {
  font-weight: 800;
  margin: 16px 0 8px;
  color: var(--navy);
}
.word-preview-box h1 { font-size: 1.4rem; }
.word-preview-box h2 { font-size: 1.2rem; }
.word-preview-box h3 { font-size: 1.05rem; }
.word-preview-box p { margin-bottom: 10px; }
.word-preview-box ul, .word-preview-box ol {
  margin: 8px 0 8px 24px;
}
.word-preview-box table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.88rem;
}
.word-preview-box td, .word-preview-box th {
  border: 1px solid var(--border);
  padding: 6px 10px;
}
.word-preview-box th {
  background: var(--bg);
  font-weight: 700;
}
