/* ============================================
   IWantFreeImageTools.com - Design System
   ============================================ */

:root {
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --secondary: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --dropzone-bg: #f5f3ff;
  --dropzone-border: #7c3aed;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 12px rgba(124,58,237,.18), 0 8px 28px rgba(0,0,0,.1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-free { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.logo-name { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.logo-tld  { font-size: 1rem;   font-weight: 400; color: var(--text-muted); }

.logo-tagline {
  font-size: .78rem;
  color: var(--text-muted);
  margin-left: 4px;
  display: none;
}

.main-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.main-nav a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color .2s;
}
.main-nav a:hover { color: var(--primary); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .2s;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 72px 20px 56px;
  background: linear-gradient(160deg, #faf5ff 0%, #f0f9ff 100%);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 20px;
}
.hero h1 span { color: var(--primary); }
.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
}

/* Trust pills */
.trust-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ---- Section titles ---- */
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}
.section-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: .95rem;
}

/* ---- Tools Grid ---- */
.tools-section { padding: 64px 0; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.tool-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  position: relative;
}
.tool-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: #ddd6fe;
}
.tool-card.coming-soon { opacity: .7; }

.tool-card .icon {
  font-size: 2.4rem;
  margin-bottom: 14px;
  display: block;
}
.tool-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.tool-card p {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}
.tool-card .btn-use {
  display: inline-block;
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.tool-card .btn-use:hover { background: var(--primary-hover); text-decoration: none; }

.badge-coming {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #fef3c7;
  color: #92400e;
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .03em;
}

/* ---- How It Works ---- */
.how-section {
  background: var(--bg-secondary);
  padding: 64px 0;
}
.steps-row {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}
.step {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  text-align: center;
}
.step .step-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  display: block;
}
.step h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.step p  { font-size: .88rem; color: var(--text-muted); }

/* ---- Privacy Section ---- */
.privacy-section { padding: 64px 0; }
.privacy-box {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: var(--radius);
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}
.privacy-box h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}
.privacy-box p { color: var(--text-muted); font-size: .95rem; line-height: 1.7; }

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}
.footer-family {
  text-align: center;
  margin-bottom: 28px;
}
.footer-family h4 {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
}
.footer-links a {
  font-size: .85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}
.footer-links a:hover { color: var(--primary); }

.footer-bottom {
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 24px;
  font-size: .82rem;
  color: var(--text-muted);
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--primary); }

/* ============================================
   TOOL PAGES
   ============================================ */

/* ---- Breadcrumb ---- */
.breadcrumb {
  padding: 12px 0;
  font-size: .84rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

/* ---- Tool Header ---- */
.tool-hero {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
}
.tool-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 8px;
}
.tool-hero p {
  color: var(--text-muted);
  font-size: .95rem;
}

/* ---- Privacy Badge ---- */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 500;
  margin: 20px 0;
}

/* ---- Drop Zone ---- */
.dropzone-wrapper { margin: 16px 0 24px; }

.dropzone {
  background: var(--dropzone-bg);
  border: 2px dashed var(--dropzone-border);
  border-radius: var(--radius);
  padding: 52px 32px;
  text-align: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  background: #ede9fe;
  border-color: var(--primary-hover);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.dropzone-icon { font-size: 2.8rem; margin-bottom: 12px; display: block; }
.dropzone h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.dropzone p  { font-size: .85rem; color: var(--text-muted); }

.file-info-bar {
  display: none;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 12px;
  font-size: .88rem;
}
.file-info-bar.visible { display: flex; }
.file-info-bar .fi-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #e5e7eb;
}
.file-info-bar .fi-details { flex: 1; }
.file-info-bar .fi-name { font-weight: 600; margin-bottom: 2px; word-break: break-all; }
.file-info-bar .fi-meta { color: var(--text-muted); font-size: .82rem; }

/* ---- Settings Panel ---- */
.settings-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}
.settings-panel h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-btn:hover { color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Form elements */
.form-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: .84rem;
  font-weight: 500;
  color: var(--text);
}
.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  color: var(--text);
  background: var(--bg);
  width: 120px;
  transition: border-color .2s;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}
.form-group select { width: auto; }

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: .88rem;
  color: var(--text);
}
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Presets */
.preset-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.preset-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f5f3ff;
}

/* Range slider */
.range-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.range-label-row {
  display: flex;
  justify-content: space-between;
  font-size: .84rem;
}
.range-label-row span:first-child { font-weight: 500; }
.range-label-row span:last-child { color: var(--primary); font-weight: 600; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(124,58,237,.3);
  transition: box-shadow .2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 8px rgba(124,58,237,.4);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(124,58,237,.3);
}

/* Live hint text */
.live-hint {
  font-size: .84rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.live-hint strong { color: var(--primary); }

/* Format selector */
.format-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.format-opt {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .84rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all .2s;
  background: var(--bg);
}
.format-opt.selected {
  border-color: var(--primary);
  background: #f5f3ff;
  color: var(--primary);
}

/* Note box */
.note-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .84rem;
  color: #78350f;
  margin-bottom: 16px;
}

/* ---- Action Button ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  font-family: inherit;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--bg);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.btn-secondary:hover { background: #f5f3ff; }

.action-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0;
}

/* ---- Before / After Preview ---- */
.preview-section {
  display: none;
  margin: 32px 0;
}
.preview-section.visible { display: block; }

.preview-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.preview-pane {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.preview-pane-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.preview-pane-label {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.preview-pane-label.before { color: var(--text-muted); }
.preview-pane-label.after  { color: var(--success); }
.preview-pane-meta {
  font-size: .78rem;
  color: var(--text-muted);
}
.preview-pane img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #f3f4f6;
  display: block;
}
.savings-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}
.savings-great  { background: #d1fae5; color: #065f46; }
.savings-ok     { background: #fef3c7; color: #92400e; }
.savings-low    { background: #f3f4f6; color: #6b7280; }

/* ---- Download Button ---- */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
  font-family: inherit;
}
.btn-download:hover { background: #059669; text-decoration: none; }

/* ---- Batch Results Table ---- */
.batch-results { display: none; margin: 28px 0; }
.batch-results.visible { display: block; }
.batch-results h3 { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }

.results-table { width: 100%; border-collapse: collapse; }
.results-table th {
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
}
.results-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  vertical-align: middle;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table .col-thumb img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-secondary);
}
.results-table .col-name { max-width: 180px; word-break: break-all; font-weight: 500; }
.results-table .col-dl a,
.results-table .col-dl button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background .2s;
}
.results-table .col-dl a:hover,
.results-table .col-dl button:hover { background: #059669; }

/* ---- How to Use ---- */
.howto-section { padding: 48px 0; }
.howto-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}
.howto-step {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}
.howto-step .step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.howto-step h4 { font-size: .95rem; font-weight: 600; margin-bottom: 6px; }
.howto-step p  { font-size: .84rem; color: var(--text-muted); }

/* ---- FAQ ---- */
.faq-section { padding: 48px 0; background: var(--bg-secondary); }
.faq-list { max-width: 800px; margin: 24px auto 0; }
.faq-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: none;
  border: none;
  text-align: left;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  gap: 12px;
}
.faq-q .chevron {
  flex-shrink: 0;
  font-size: 1.1rem;
  transition: transform .2s;
}
.faq-item.open .chevron { transform: rotate(180deg); }
.faq-a {
  display: none;
  padding: 0 20px 16px;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.faq-item.open .faq-a { display: block; }

/* ---- Related Tools ---- */
.related-section { padding: 48px 0; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-decoration: none;
  transition: all .2s;
  color: var(--text);
}
.related-card:hover {
  border-color: #ddd6fe;
  box-shadow: var(--shadow-hover);
  text-decoration: none;
  color: var(--text);
}
.related-card .r-icon { font-size: 1.8rem; }
.related-card .r-title { font-size: .9rem; font-weight: 600; }
.related-card .r-sub   { font-size: .78rem; color: var(--text-muted); }

/* ---- Error message ---- */
.error-msg {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-top: 12px;
}

/* ---- Progress ---- */
.progress-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  margin: 12px 0;
  overflow: hidden;
  display: none;
}
.progress-bar-wrap.visible { display: block; }
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .3s;
  width: 0;
}

/* ============================================
   TOOL-SPECIFIC: Crop
   ============================================ */
.crop-workspace {
  position: relative;
  background: #1f2937;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crop-workspace img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
  pointer-events: none;
  user-select: none;
}
.crop-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}
.crop-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  pointer-events: none;
}
.crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.5);
  cursor: move;
}
.crop-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent 0, transparent 33.3%, rgba(255,255,255,.15) 33.3%, rgba(255,255,255,.15) 33.4%
  ),
  repeating-linear-gradient(
    90deg, transparent 0, transparent 33.3%, rgba(255,255,255,.15) 33.3%, rgba(255,255,255,.15) 33.4%
  );
}
.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 2px;
  transform: translate(-50%, -50%);
}
.crop-handle.nw  { top: 0;   left: 0;   cursor: nw-resize; }
.crop-handle.n   { top: 0;   left: 50%; cursor: n-resize;  }
.crop-handle.ne  { top: 0;   left: 100%; cursor: ne-resize; }
.crop-handle.w   { top: 50%; left: 0;   cursor: w-resize;  }
.crop-handle.e   { top: 50%; left: 100%; cursor: e-resize;  }
.crop-handle.sw  { top: 100%; left: 0;  cursor: sw-resize; }
.crop-handle.s   { top: 100%; left: 50%; cursor: s-resize; }
.crop-handle.se  { top: 100%; left: 100%; cursor: se-resize; }

.crop-info-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: .84rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.crop-info-bar strong { color: var(--text); font-weight: 600; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 48px 20px 40px; }
  .before-after { grid-template-columns: 1fr; }
  .howto-steps { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .settings-panel { padding: 20px; }
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 60px 0 0 0;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(12px);
    padding: 24px;
    gap: 16px;
    align-items: flex-start;
    font-size: 1.1rem;
    z-index: 99;
  }
  .nav-toggle { display: flex; }
}

@media (max-width: 640px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tool-card { padding: 20px 14px; }
  .tool-card .icon { font-size: 1.8rem; }
  .steps-row { flex-direction: column; align-items: center; }
  .form-row { flex-direction: column; }
  .form-group input[type="number"] { width: 100%; }
  .batch-results { overflow-x: auto; }
  .privacy-box { padding: 24px; }
  .dropzone { padding: 36px 20px; }
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
