/* ─── Variables ───────────────────────────────────────────────────────────── */
:root {
  --bg:          #f1f5f9;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #0f172a;
  --text-muted:  #64748b;
  --primary:     #2563eb;
  --primary-dk:  #1d4ed8;
  --success:     #059669;
  --success-bg:  #ecfdf5;
  --warn:        #d97706;
  --warn-bg:     #fffbeb;
  --error:       #dc2626;
  --dark:        #0f172a;
  --radius:      10px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
}

/* ─── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}
img { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

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

/* ─── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  background: var(--dark);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  max-width: 960px;
  margin: 0 auto;
  min-height: 52px;
  flex-wrap: wrap;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  letter-spacing: -0.02em;
  padding: 12px 0;
  white-space: nowrap;
}
.nav__brand:hover { text-decoration: none; color: #e2e8f0; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
  padding: 8px 0;
}

.nav__links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: #94a3b8;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background .1s, color .1s;
}
.nav__links a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav__links a.active { color: #fff; background: rgba(255,255,255,.12); }

.nav__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #34d399;
  background: rgba(52,211,153,.1);
  border: 1px solid rgba(52,211,153,.2);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ─── Landing Hero ────────────────────────────────────────────────────────── */
.landing-hero {
  background: var(--dark);
  color: #fff;
  padding: 56px 0 60px;
  text-align: center;
}

.landing-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.landing-hero__headline {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.landing-hero__sub {
  font-size: 1.15rem;
  color: #94a3b8;
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.landing-hero__sub strong { color: #e2e8f0; }

/* ─── Trust Bar ───────────────────────────────────────────────────────────── */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
}

/* ─── Tool Cards (landing page) ───────────────────────────────────────────── */
.tools-section { padding: 56px 0; }

.tools-section .section-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 36px;
}

.tool-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .tool-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 639px) {
  .nav__links { display: none; }
  .nav__badge { margin-left: auto; }
  .landing-hero { padding: 36px 0 40px; }
  .landing-hero__sub { font-size: 1rem; }
  .tools-section { padding: 36px 0; }
  .tool-header { padding: 24px 0 28px; }
  .main { padding: 24px 0 40px; }
  .dropzone { padding: 32px 16px; }
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}

.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.tool-card__icon--metadata { background: #eff6ff; color: #2563eb; }
.tool-card__icon--convert  { background: #f5f3ff; color: #7c3aed; }
.tool-card__icon--pdf      { background: #fff7ed; color: #ea580c; }
.tool-card__icon--images   { background: #f0fdf4; color: #059669; }

.tool-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.tool-card__desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 20px;
}

.tool-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
}

.tool-card__link:hover { text-decoration: underline; }

/* ─── Why Privacy Section ─────────────────────────────────────────────────── */
.why-section {
  background: var(--dark);
  color: #fff;
  padding: 56px 0;
}

.why-section .section-title { color: #fff; margin-bottom: 12px; }
.why-sub { color: #64748b; font-size: 1rem; margin-bottom: 40px; }

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

@media (min-width: 640px) {
  .why-grid { grid-template-columns: repeat(3, 1fr); }
}

.why-item {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 24px;
  background: rgba(255,255,255,.03);
}

.why-item__icon { font-size: 1.5rem; margin-bottom: 12px; }
.why-item__title { font-size: 0.95rem; font-weight: 700; color: #e2e8f0; margin-bottom: 8px; }
.why-item__body  { font-size: 0.84rem; color: #64748b; line-height: 1.65; }

/* ─── Tool Page Header ────────────────────────────────────────────────────── */
.tool-header {
  background: var(--dark);
  color: #fff;
  padding: 36px 0 40px;
}

.tool-header__headline {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.tool-header__sub {
  font-size: 1rem;
  color: #94a3b8;
  margin-bottom: 20px;
  line-height: 1.6;
}

.tool-header__sub strong { color: #e2e8f0; }

/* ─── Main ────────────────────────────────────────────────────────────────── */
.main { padding: 40px 0 60px; }

/* ─── Drop Zone ───────────────────────────────────────────────────────────── */
.dropzone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
  margin-bottom: 36px;
}

.dropzone:hover, .dropzone--over {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(37,99,235,.08);
}

.dropzone__inner { pointer-events: none; }
.dropzone__inner .btn { pointer-events: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; opacity: 0; }
.dropzone__icon { color: var(--text-muted); margin: 0 auto 16px; }
.dropzone--over .dropzone__icon { color: var(--primary); }
.dropzone__primary { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.dropzone__secondary { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; }
.dropzone__hint { color: var(--text-muted); font-size: 0.82rem; margin-top: 14px; }

.dropzone__privacy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
  margin-top: 10px;
  background: var(--success-bg);
  padding: 4px 12px;
  border-radius: 999px;
}

/* ─── Compress Controls ───────────────────────────────────────────────────── */
.controls-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
}

.control-group { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }

.control-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.control-group label span { color: var(--primary); }

.slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  width: 100%;
  display: block;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.select {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
  width: 100%;
  display: block;
}
.select:focus { border-color: var(--primary); }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
label.btn, button.btn, .btn {
  display: inline-block;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  padding: 11px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
  pointer-events: auto;
}

.btn--primary   { background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,.3); }
.btn--primary:hover { background: var(--primary-dk); color: #fff; text-decoration: none; }
.btn--secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn--secondary:hover { background: var(--bg); text-decoration: none; }
.btn--ghost     { background: transparent; color: var(--text-muted); border: 1px solid transparent; }
.btn--ghost:hover { background: var(--bg); text-decoration: none; }
.btn--download  { background: var(--success); color: #fff; font-size: 0.85rem; padding: 9px 18px; }
.btn--download:hover { background: #047857; color: #fff; text-decoration: none; }

/* ─── Results ─────────────────────────────────────────────────────────────── */
.results-section { margin-bottom: 48px; }

.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.results-header h2 { font-size: 1.1rem; font-weight: 700; flex: 1; }
.results-actions { display: flex; gap: 8px; }

/* ─── File Cards ──────────────────────────────────────────────────────────── */
.file-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .file-list { grid-template-columns: 1fr 1fr; }
}

.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.file-card--processing { opacity: .65; }

.file-card__thumb {
  width: 68px; height: 68px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.file-card__thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.file-card__body { flex: 1; min-width: 0; }

.file-card__name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.file-card__sizes { font-size: 0.77rem; color: var(--text-muted); margin-bottom: 8px; }

.meta-list { display: flex; flex-direction: column; gap: 3px; }

.meta-item {
  font-size: 0.77rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.4;
}

.meta-item::before { content: '–'; flex-shrink: 0; color: var(--border); }
.meta-item--gps { color: var(--warn); font-weight: 600; }
.meta-item--gps::before { content: '⚑'; color: var(--warn); }

.no-meta { font-size: 0.77rem; color: var(--text-muted); margin-top: 6px; }

.file-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge--gps     { background: var(--warn-bg);    color: var(--warn); }
.badge--clean   { background: var(--success-bg); color: var(--success); }
.badge--savings { background: #eff6ff;            color: var(--primary); }
.badge--none    { background: var(--bg);          color: var(--text-muted); }

/* ─── Steps ───────────────────────────────────────────────────────────────── */
.steps-section { margin-bottom: 48px; }
.section-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 24px; }

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.step__num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.step__title { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.step__body  { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.step__body strong { color: var(--text); }

/* ─── Info Section ────────────────────────────────────────────────────────── */
.info-section { margin-bottom: 16px; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 720px) { .info-grid { grid-template-columns: 1fr 280px; } }

.info-main h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }
.info-main h3 { font-size: 0.95rem; font-weight: 700; margin: 22px 0 12px; }
.info-main p  { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 10px; }
.info-main p strong { color: var(--text); }

.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }

.tag {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 999px;
}

/* Privacy card */
.privacy-card {
  background: var(--dark);
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 26px 22px;
  align-self: start;
}

.privacy-card svg { color: #60a5fa; margin-bottom: 14px; }
.privacy-card h3  { font-size: 0.95rem; font-weight: 700; color: #fff; margin-bottom: 14px; }
.privacy-card ul  { display: flex; flex-direction: column; gap: 9px; }

.privacy-card li {
  font-size: 0.82rem;
  color: #94a3b8;
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.privacy-card li::before { content: '✓'; position: absolute; left: 0; color: #34d399; font-weight: 700; }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  background: var(--dark);
  color: #475569;
  padding: 32px 0;
  font-size: 0.84rem;
}

.footer__inner { display: flex; flex-direction: column; gap: 10px; }

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.footer__statement { color: #64748b; line-height: 1.6; }
.footer__statement strong { color: #e2e8f0; }
.footer__nav a { color: #60a5fa; }
.footer__nav a:hover { color: #93c5fd; }
.footer__tech { font-size: 0.76rem; color: #334155; line-height: 1.6; }

/* ─── FAQ ─────────────────────────────────────────────────────────────────── */
.faq-section { margin-bottom: 48px; }

.faq-section details {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.faq-section details:first-of-type { border-top: 1px solid var(--border); }

.faq-section summary {
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-section summary::-webkit-details-marker { display: none; }

.faq-section summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1;
}

.faq-section details[open] summary::after { content: '−'; }

.faq-section details p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-top: 12px;
}

.faq-section details p strong { color: var(--text); }

/* ─── Merge Tool ──────────────────────────────────────────────────────────── */
.merge-list { display: flex; flex-direction: column; gap: 10px; }

.merge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.merge-item__num {
  width: 26px; height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.merge-item__name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.merge-item__size { font-size: 0.77rem; color: var(--text-muted); flex-shrink: 0; }
.merge-item__actions { display: flex; gap: 4px; flex-shrink: 0; }

.merge-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
  font-family: inherit;
}

.merge-btn:hover:not(:disabled) { background: var(--border); }
.merge-btn:disabled { opacity: 0.3; cursor: default; }
.merge-btn--remove { color: var(--error); }

/* ─── Tool Header Breadcrumb ──────────────────────────────────────────────── */
.tool-header__breadcrumb {
  font-size: 0.82rem;
  margin-bottom: 10px;
}
.tool-header__breadcrumb a { color: #94a3b8; }
.tool-header__breadcrumb a:hover { color: #fff; text-decoration: none; }

/* ─── Generic Inputs ──────────────────────────────────────────────────────── */
.input {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.input:focus { border-color: var(--primary); }
.input--num  { width: 100px; }
.input--text { width: 180px; }

/* ─── Aspect Ratio / Checkbox Label ──────────────────────────────────────── */
.ar-lock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  user-select: none;
}
.ar-lock input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; }

.control-group--check { justify-content: flex-end; }

.controls-row--sub {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ─── Transform Buttons (rotate tool) ────────────────────────────────────── */
.transform-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.transform-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
  line-height: 1;
}
.transform-btn:hover  { background: var(--bg); border-color: var(--primary); }
.transform-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Crop Tool ───────────────────────────────────────────────────────────── */
.crop-stage-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  overflow: auto;
  margin-bottom: 16px;
}

.crop-stage {
  position: relative;
  display: inline-block;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#cropImg {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  border-radius: 4px;
}

.crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
  cursor: move;
  touch-action: none;
}

.crop-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.25);
  border-radius: 2px;
}
.crop-handle[data-handle="nw"] { top: -5px;  left: -5px;            cursor: nw-resize; }
.crop-handle[data-handle="n"]  { top: -5px;  left: calc(50% - 5px); cursor: n-resize;  }
.crop-handle[data-handle="ne"] { top: -5px;  right: -5px;           cursor: ne-resize; }
.crop-handle[data-handle="e"]  { top: calc(50% - 5px); right: -5px; cursor: e-resize;  }
.crop-handle[data-handle="se"] { bottom: -5px; right: -5px;         cursor: se-resize; }
.crop-handle[data-handle="s"]  { bottom: -5px; left: calc(50% - 5px); cursor: s-resize; }
.crop-handle[data-handle="sw"] { bottom: -5px; left: -5px;          cursor: sw-resize; }
.crop-handle[data-handle="w"]  { top: calc(50% - 5px); left: -5px;  cursor: w-resize;  }

.crop-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.crop-dims {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.crop-controls__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── Rename Tool ─────────────────────────────────────────────────────────── */
.rename-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rename-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 10px 14px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  min-width: 0;
}

.rename-item__orig {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  min-width: 0;
}

.rename-item__arrow {
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}

.rename-item__new {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  min-width: 0;
}

.rename-item__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

@media (max-width: 600px) {
  .rename-item {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .rename-item__orig { grid-column: 1; color: var(--text-muted); font-size: 0.8rem; }
  .rename-item__arrow { display: none; }
  .rename-item__new  { grid-column: 1; }
  .rename-item__actions { grid-column: 2; grid-row: 1 / 3; }
}

/* ─── Photo Studio Editor ─────────────────────────────────────────────────── */

#studioSection:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 52px);
  overflow: hidden;
}

.editor-wrap {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Sidebar */
.editor-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-tab-bar {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.editor-tab-bar::-webkit-scrollbar { display: none; }

.editor-tab-btn {
  padding: 11px 14px;
  font-size: 0.79rem;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  flex-shrink: 0;
  font-family: inherit;
  transition: color .15s;
}
.editor-tab-btn--active { color: var(--primary); border-bottom-color: var(--primary); }
.editor-tab-btn:hover:not(.editor-tab-btn--active) { color: var(--text); }

.editor-panels { flex: 1; overflow-y: auto; }

.editor-panel { padding: 16px; }
.editor-panel:not([hidden]) { display: block; }

.editor-panel__hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.editor-panel h3 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 10px;
}
.editor-panel h3:first-child { margin-top: 0; }

/* Canvas area */
.editor-canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #1e293b;
  min-width: 0;
  overflow: hidden;
}

.editor-canvas-inner {
  flex: 1;
  overflow: hidden;
  display: flex;
  min-height: 0;
}

/* CropperJS zone — :not([hidden]) prevents display:flex from beating [hidden]{display:none} */
.cropper-zone:not([hidden]) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Preview canvas zone */
.preview-wrap:not([hidden]) {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
#previewCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 3px;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
  transform-origin: 50% 50%;
  cursor: default;
}
.preview-wrap--zoomed #previewCanvas { cursor: grab; }
.preview-wrap--zoomed #previewCanvas:active { cursor: grabbing; }

/* Bottom actions bar */
.editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--dark);
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  gap: 10px;
}
.editor-actions__filename {
  font-size: 0.78rem;
  color: rgba(255,255,255,.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.editor-actions__right { display: flex; gap: 8px; flex-shrink: 0; }

/* Edit panel compact controls */
.edit-btn-group { margin-bottom: 10px; }
.edit-btn-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.edit-btn-row { display: flex; gap: 6px; }
.edit-btn {
  flex: 1;
  font-size: 0.78rem;
  padding: 7px 4px;
  justify-content: center;
  min-width: 0;
}

/* Resize inputs */
.resize-row {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  align-items: end;
  gap: 6px;
  margin-bottom: 12px;
}
.resize-row .control-group { min-width: 0; }
.resize-lock-btn {
  width: 28px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
  padding: 0;
}
.resize-lock-btn--active { border-color: var(--primary); color: var(--primary); }

/* Adjustment sliders */
.adj-row { margin-bottom: 14px; }
.adj-row:last-of-type { margin-bottom: 0; }
.adj-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.adj-row__label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.adj-row__val   { font-size: 0.78rem; color: var(--text-muted); min-width: 30px; text-align: right; }

/* Filter presets */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 16px;
}
.filter-btn {
  padding: 8px 4px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.77rem;
  font-weight: 600;
  text-align: center;
  font-family: inherit;
  transition: border-color .15s, background .15s;
  line-height: 1.3;
}
.filter-btn:hover { border-color: #94a3b8; }
.filter-btn--active { border-color: var(--primary); background: #eff6ff; color: var(--primary); }

/* Export options row (above actions bar) */
.export-options {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 7px 14px;
  background: var(--dark);
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.export-options__field:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 8px;
}
.export-options__label {
  font-size: 0.78rem;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
}
.export-options__val {
  font-size: 0.78rem;
  color: rgba(255,255,255,.85);
  min-width: 32px;
}
.export-options__size {
  margin-left: auto;
  font-size: 0.78rem;
  color: rgba(255,255,255,.85);
}
.select--sm { padding: 3px 6px; font-size: 0.8rem; width: auto; }
.slider--sm  { width: 90px; }

/* Editor drop section */
.editor-drop-wrap {
  padding: 40px 0 60px;
}

/* Mobile */
@media (max-width: 767px) {
  #studioSection { height: calc(100vh - 52px); overflow: hidden; }

  .editor-wrap { flex-direction: column-reverse; }

  .editor-sidebar {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-top: 1px solid var(--border);
    height: 280px;
    min-height: 0;
    flex-shrink: 0;
    max-height: none;
  }

  .editor-canvas-area { flex: 1; min-height: 0; height: auto; max-height: none; }

  /* On Edit tab mobile: hide the preview panel (CropperJS takes full width) */
  .mode-edit .preview-wrap { display: none; }
  .mode-edit .cropper-zone { border-right: none; }

  .editor-actions__filename { display: none; }

  .cropper-zone, .preview-wrap { padding: 12px; }
}

/* ── Single-panel sidebar controls ────────────────────────────────────────── */

.editor-controls {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 20px;
}

.ctrl-section {
  padding: 14px 16px 6px;
}

.ctrl-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ctrl-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ctrl-section-header .ctrl-section-title { margin-bottom: 0; }

.ctrl-section-action {
  font-size: 0.72rem;
  padding: 3px 8px;
  color: var(--text-muted);
  border-color: transparent;
}

.ctrl-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0 0;
}

/* ── Zoom bar + hint overlay ───────────────────────────────────────────────── */

.zoom-bar {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: auto;
  left: auto;
  transform: none;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 5px 12px;
  user-select: none;
}
.zoom-bar__btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
  font-family: inherit;
}
.zoom-bar__btn:hover { color: #fff; }
.zoom-bar__slider { width: 90px; }
.zoom-bar__val {
  font-size: 0.75rem;
  color: #94a3b8;
  min-width: 38px;
  text-align: right;
}
.zoom-hint {
  position: absolute;
  top: 60px;
  right: 14px;
  bottom: auto;
  left: auto;
  transform: none;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 12px;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  white-space: nowrap;
}
.zoom-hint--visible { opacity: 1; }
