/* CSMBAC Image Tools — scoped styles (Engine B) */
.image-tools-body {
  background: var(--page-bg, #f6f7f9);
  color: var(--text-main, #1a1a1a);
  min-height: 100vh;
}

.image-tools-nav {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--panel-bg, #fff);
  position: sticky;
  top: 0;
  z-index: 20;
}

.image-tools-nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.image-tools-nav__brand { font-weight: 700; color: var(--text-main); text-decoration: none; }
.image-tools-nav__product { font-weight: 600; color: var(--link-uk, #0b4f8a); text-decoration: none; }
.image-tools-nav__links { margin-left: auto; display: flex; gap: 1rem; }
.image-tools-nav__links a { color: var(--text-muted); text-decoration: none; }

.image-tools-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.image-tools-hero h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin: 0 0 0.5rem; }
.image-tools-lead { font-size: 1.05rem; color: var(--text-muted); max-width: 52ch; }

.image-tools-cta {
  display: inline-block;
  margin: 1rem 0.5rem 0 0;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  background: var(--link-uk, #0b4f8a);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.image-tools-cta--secondary {
  background: transparent;
  color: var(--link-uk, #0b4f8a);
  border: 1px solid currentColor;
}

.image-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.image-tools-card {
  display: block;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--panel-bg, #fff);
  text-decoration: none;
  color: inherit;
}

.image-tools-card h2 { font-size: 1.05rem; margin: 0 0 0.35rem; }
.image-tools-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.image-tools-app {
  margin: 1.5rem 0;
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(0, 0, 0, 0.15);
  background: var(--panel-bg, #fff);
  min-height: 220px;
}

.image-tools-panel label { display: block; margin: 0.5rem 0 0.25rem; font-weight: 600; }
.image-tools-panel input[type="file"],
.image-tools-panel input[type="number"],
.image-tools-panel input[type="text"],
.image-tools-panel select {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.image-tools-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 1.5rem; }
.image-tools-preset {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--panel-bg, #fff);
  cursor: pointer;
}

.image-tools-disclaimer {
  font-size: 0.9rem;
  color: var(--text-muted);
  border-left: 3px solid var(--link-uk, #0b4f8a);
  padding-left: 0.75rem;
}

.image-tools-status {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(11, 79, 138, 0.06);
}

.image-tools-retention-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.image-tools-delete {
  margin-left: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(160, 40, 40, 0.35);
  background: rgba(160, 40, 40, 0.08);
  color: #8b1e1e;
  cursor: pointer;
  font-weight: 600;
}

.image-tools-privacy__lead {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--link-uk, #0b4f8a);
  background: rgba(11, 79, 138, 0.06);
  font-size: 1.05rem;
}

.image-tools-privacy h2 { margin-top: 1.75rem; }
.image-tools-privacy h3 { margin-top: 1rem; font-size: 1rem; }

.image-tools-cross-sell {
  margin-top: 2.5rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
}

.image-tools-cross-sell__link { color: var(--link-uk); font-weight: 600; }

.image-tools-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.image-tools-footer__muted { opacity: 0.8; }

html[data-theme='dark'] .image-tools-body { background: #0f1419; }
html[data-theme='dark'] .image-tools-card,
html[data-theme='dark'] .image-tools-app,
html[data-theme='dark'] .image-tools-nav { background: #1a222c; border-color: rgba(255,255,255,0.08); }

/* Professional tool shell (Engine B amendments) */
.image-tools-app { border-style: solid; padding: 0; overflow: hidden; }
.it-upload-shell { padding: 1.25rem; }
.it-dropzone {
  border: 2px dashed rgba(11, 79, 138, 0.35);
  border-radius: 12px;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  background: rgba(11, 79, 138, 0.04);
  transition: border-color 0.15s, background 0.15s;
}
.it-dropzone.is-dragover, .it-dropzone:focus-visible { border-color: var(--link-uk); background: rgba(11, 79, 138, 0.08); outline: none; }
.it-dropzone-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.35rem; }
.it-dropzone-sub, .it-upload-hint, .it-muted { color: var(--text-muted); font-size: 0.9rem; }
.it-workspace {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr minmax(240px, 300px);
  gap: 0;
  min-height: 420px;
}
.it-panel { padding: 1rem; border-right: 1px solid rgba(0,0,0,0.08); }
.it-panel--controls { border-right: none; border-left: 1px solid rgba(0,0,0,0.08); }
.it-queue-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 360px; overflow: auto; }
.it-queue-item {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 0.5rem; align-items: center;
  width: 100%; text-align: left; padding: 0.35rem; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer;
}
.it-queue-item.is-selected { border-color: var(--link-uk); background: rgba(11,79,138,0.06); }
.it-queue-item img { border-radius: 4px; object-fit: cover; }
.it-queue-name { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-queue-status { font-size: 0.75rem; color: var(--text-muted); }
.it-preview-toolbar { display: flex; gap: 0.35rem; margin-bottom: 0.5rem; }
.it-preview-tab { padding: 0.35rem 0.6rem; border-radius: 6px; border: 1px solid rgba(0,0,0,0.1); background: var(--panel-bg); cursor: pointer; font-size: 0.85rem; }
.it-preview-tab.is-active { border-color: var(--link-uk); color: var(--link-uk); font-weight: 600; }
.it-compare { position: relative; overflow: hidden; border-radius: 8px; background: #e8e8e8; }
.it-compare img { display: block; width: 100%; height: auto; }
.it-compare-after-wrap { position: absolute; top: 0; left: 0; height: 100%; overflow: hidden; border-right: 2px solid var(--link-uk); }
.it-compare-slider { position: absolute; bottom: 8px; left: 10%; width: 80%; }
.it-preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; font-size: 0.82rem; margin-top: 0.75rem; }
.it-quality input[type="range"] { width: 100%; }
.it-quality-meta { display: flex; justify-content: space-between; align-items: baseline; }
.it-quality-warn { color: #8b4513; font-size: 0.85rem; }
.it-swatches { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.35rem 0; }
.it-swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); cursor: pointer; }
.it-swatch--checkerboard { background: repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 50% / 10px 10px; }
.it-preset-grid { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.it-preset-card { text-align: left; padding: 0.6rem; border-radius: 8px; border: 1px solid rgba(0,0,0,0.1); background: var(--panel-bg); cursor: pointer; }
.it-preset-card strong { display: block; }
.it-preset-card span { font-size: 0.82rem; color: var(--text-muted); }
.it-format-grid { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.it-format-card { text-align: left; padding: 0.6rem; border-radius: 8px; border: 1px solid rgba(0,0,0,0.1); cursor: pointer; background: var(--panel-bg); }
.it-format-card.is-active { border-color: var(--link-uk); }
.it-controls-header { display: flex; gap: 0.35rem; margin-bottom: 0.75rem; }
.it-mode-toggle { flex: 1; padding: 0.4rem; border-radius: 6px; border: 1px solid rgba(0,0,0,0.12); background: var(--panel-bg); cursor: pointer; }
.it-mode-toggle[aria-pressed="true"] { background: var(--link-uk); color: #fff; border-color: var(--link-uk); }
.it-process-btn { width: 100%; margin-top: 1rem; border: none; cursor: pointer; }
.it-cancel-btn { width: 100%; margin-top: 0.5rem; padding: 0.45rem; border-radius: 6px; border: 1px solid rgba(0,0,0,0.15); background: transparent; cursor: pointer; }
.it-progress { padding: 1rem; border-top: 1px solid rgba(0,0,0,0.08); }
.it-progress-bar { height: 8px; border-radius: 999px; background: rgba(0,0,0,0.08); overflow: hidden; margin: 0.5rem 0; }
.it-progress-fill { height: 100%; background: var(--link-uk); transition: width 0.3s ease; }
@media (prefers-reduced-motion: reduce) {
  .it-progress-fill { transition: none; }
}
.it-progress-counts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.88rem; }
.it-batch-summary { padding: 1.25rem; }
.it-batch-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.it-batch-metrics dt { font-size: 0.8rem; color: var(--text-muted); }
.it-context-frame { border-radius: 8px; border: 1px solid rgba(0,0,0,0.1); padding: 0.5rem; background: #f4f4f4; }
.it-context-frame img { width: 100%; height: auto; display: block; }
.it-error { color: #8b1e1e; padding: 1rem; }
.it-review-mobile .it-workspace { grid-template-columns: 1fr; }
.it-label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 0.25rem; }
.it-tool-intro { font-size: 0.9rem; color: var(--text-muted); margin-top: 0; }
.it-disclaimer-small { font-size: 0.8rem; color: var(--text-muted); }
.it-operation-summary { font-size: 0.88rem; margin: 0.75rem 0; padding: 0.6rem; border-radius: 8px; background: rgba(0,0,0,0.03); }

@media (max-width: 900px) {
  .it-workspace { grid-template-columns: 1fr; }
  .it-panel { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.08); }
  .it-panel--controls { border-left: none; }
}
