/* White converter shell for the img-edit format pages. Behavior stays in img-edit.js. */

.ieconv-page { --ie-blue: #2563eb; --ie-green: #16a34a; --ie-gold: #f5b400; }
.ieconv-page [hidden] { display: none !important; }

@media (min-width: 1100px) {
  .ieconv-page { --cv-aside: clamp(230px, 18vw, 280px); }
}
.ieconv-page .conv-title {
  font-size: clamp(1.7rem, 2.2vw, 2.2rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
  hyphens: manual;
  overflow-wrap: normal;
}
.article .ieconv-page .conv-lede {
  margin: 0 0 16px;
  color: #3b4d9a;
  font-size: 1.02rem;
  line-height: 1.4;
}
.article .ieconv-page .conv-perks { gap: 14px; }
.article .ieconv-page .conv-perks li { font-size: 0.84rem; }
.ieconv-page .conv-perks strong { color: #1d3fd8; }
.article .ieconv-page img.conv-art {
  max-width: 260px;
  margin-top: 22px;
}

.ieconv-page .ieconv-app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--cv-ink, #172033);
}
.ieconv-page .conv-board { gap: 12px; }
@media (min-width: 1100px) {
  .ieconv-page .conv-board {
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  }
}
.ieconv-page .conv-stack { gap: 12px; }
.ieconv-page .conv-card,
.ieconv-page .conv-steps {
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ieconv-page .conv-steps [data-conv-step="1"] > span:first-child { background: var(--ie-blue); color: #fff; }
.ieconv-page .conv-steps [data-conv-step="1"] strong { color: var(--ie-blue); }
.ieconv-page:is(:has(.ie-has-file), :has(#avif-meta:not(:empty)), :has(#sq-meta:not(:empty)), :has(#fb-meta:not(:empty)), :has(#colagem-thumbs:not(:empty)), :has(#dgrid-meta:not(:empty)), :has(#ocr-meta:not(:empty)), :has(#paleta-meta:not(:empty))) .conv-steps [data-conv-step="1"] > span:first-child { background: var(--ie-green); color: #fff; }
.ieconv-page:is(:has(.ie-has-file), :has(#avif-meta:not(:empty)), :has(#sq-meta:not(:empty)), :has(#fb-meta:not(:empty)), :has(#colagem-thumbs:not(:empty)), :has(#dgrid-meta:not(:empty)), :has(#ocr-meta:not(:empty)), :has(#paleta-meta:not(:empty))) .conv-steps [data-conv-step="1"] strong { color: var(--cv-ink, #172033); }
.ieconv-page:is(:has(.ie-has-file), :has(#avif-meta:not(:empty)), :has(#sq-meta:not(:empty)), :has(#fb-meta:not(:empty)), :has(#colagem-thumbs:not(:empty)), :has(#dgrid-meta:not(:empty)), :has(#ocr-meta:not(:empty)), :has(#paleta-meta:not(:empty))) .conv-steps [data-conv-step="2"] > span:first-child { background: var(--ie-blue); color: #fff; }
.ieconv-page:is(:has(.ie-has-file), :has(#avif-meta:not(:empty)), :has(#sq-meta:not(:empty)), :has(#fb-meta:not(:empty)), :has(#colagem-thumbs:not(:empty)), :has(#dgrid-meta:not(:empty)), :has(#ocr-meta:not(:empty)), :has(#paleta-meta:not(:empty))) .conv-steps [data-conv-step="2"] strong { color: var(--ie-blue); }
.ieconv-page:is(:has(:is(#ie-result, #heic-result, #avif-result).is-visible), :has(:is(#sq-result-wrap, #fb-result-wrap).is-visible), :has(#colagem-result.is-visible:not(.is-preview)), :has(#dgrid-grid-preview:not(:empty)), :has(#ocr-conf:not(:empty)), :has(#paleta-swatches:not(:empty))) .conv-steps [data-conv-step="2"] > span:first-child { background: var(--ie-green); }
.ieconv-page:is(:has(:is(#ie-result, #heic-result, #avif-result).is-visible), :has(:is(#sq-result-wrap, #fb-result-wrap).is-visible), :has(#colagem-result.is-visible:not(.is-preview)), :has(#dgrid-grid-preview:not(:empty)), :has(#ocr-conf:not(:empty)), :has(#paleta-swatches:not(:empty))) .conv-steps [data-conv-step="2"] strong { color: var(--cv-ink, #172033); }
.ieconv-page:is(:has(:is(#ie-result, #heic-result, #avif-result).is-visible), :has(:is(#sq-result-wrap, #fb-result-wrap).is-visible), :has(#colagem-result.is-visible:not(.is-preview)), :has(#dgrid-grid-preview:not(:empty)), :has(#ocr-conf:not(:empty)), :has(#paleta-swatches:not(:empty))) .conv-steps [data-conv-step="3"] > span:first-child { background: var(--ie-blue); color: #fff; }
.ieconv-page:is(:has(:is(#ie-result, #heic-result, #avif-result).is-visible), :has(:is(#sq-result-wrap, #fb-result-wrap).is-visible), :has(#colagem-result.is-visible:not(.is-preview)), :has(#dgrid-grid-preview:not(:empty)), :has(#ocr-conf:not(:empty)), :has(#paleta-swatches:not(:empty))) .conv-steps [data-conv-step="3"] strong { color: var(--ie-blue); }

.article .ieconv-page h2.conv-card-title { color: #1d3fd8; font-size: 1.02rem; }
.ieconv-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--ie-blue);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.ieconv-page .ieconv-app .itool-drop,
.ieconv-page .ieconv-app.ie-has-file .itool-drop.is-compact {
  min-height: 200px;
  margin: 0;
  padding: 22px 16px;
  border: 1.5px dashed #93c5fd;
  border-radius: 14px;
  background: #f5f9ff;
  box-shadow: none;
}
.ieconv-page .ieconv-app.ie-has-file .itool-drop.is-compact::after { content: none; }
.ieconv-page .ieconv-app.ie-has-file .itool-drop.is-compact .conv-cloud,
.ieconv-page .ieconv-app.ie-has-file .itool-drop.is-compact .itool-drop-title,
.ieconv-page .ieconv-app.ie-has-file .itool-drop.is-compact .itool-drop-hint,
.ieconv-page .ieconv-app.ie-has-file .itool-drop.is-compact .itool-drop-cta {
  display: inline-flex;
}
.ieconv-page .ieconv-app.ie-has-file .itool-drop.is-compact .itool-drop-title,
.ieconv-page .ieconv-app.ie-has-file .itool-drop.is-compact .itool-drop-hint { display: block; }
.ieconv-page .ieconv-app .itool-drop.is-dragover { background: #e6efff; }
.ieconv-page .ieconv-app .conv-cloud { width: 64px; height: 64px; background-size: 40px; }
.ieconv-page .ieconv-app .itool-drop-title {
  color: var(--cv-ink, #172033);
  font-size: 1.05rem;
  font-weight: 800;
}
.ieconv-page .ieconv-app .itool-drop-hint { color: #64748b; }
.ieconv-page .ieconv-app .itool-drop-actions { margin-top: 4px; }
.ieconv-page .ieconv-app button.itool-drop-sample {
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: #334155;
}
.ieconv-page .ieconv-app .ie-replace-row { margin: 10px 0 0; }
.ieconv-page .ieconv-app .ie-batch-list { margin-top: 10px; }

.ieconv-page .ieconv-opts:not(:has(.itool-field:not([hidden]))) { display: none; }
.ieconv-page .ieconv-app .itool-fields { margin: 0; gap: 12px; }
.ieconv-page .ieconv-app .itool-label { display: block; margin-bottom: 6px; font-weight: 700; color: var(--cv-ink, #172033); }
.ieconv-page .ieconv-app select,
.ieconv-page .ieconv-app input[type="number"] {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--cv-line, #e3e9f1);
  border-radius: 10px;
  background: #fff;
  color: var(--cv-ink, #172033);
}
.ieconv-page .ieconv-app input[type="range"] { width: 100%; height: 28px; margin: 4px 0 0; padding: 0; border: 0; background: transparent; }
.ieconv-page .ieconv-app input[type="color"] { width: 64px; height: 40px; padding: 4px; }
.article .ieconv-page .ieconv-app .itool-hint { margin-top: 6px; color: #64748b; font-size: 0.8rem; line-height: 1.35; }

.ieconv-fmt { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.ieconv-fmt a,
.ieconv-page .ieconv-app button.ie-fmt-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--cv-line, #e3e9f1);
  border-radius: 10px;
  background: #fff;
  color: var(--cv-ink, #172033);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.ieconv-page .ieconv-app button.ie-fmt-chip.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: var(--ie-blue);
}
.ieconv-fmt .ie-fmt-arrow { color: #94a3b8; font-weight: 500; }
.article .ieconv-page .ie-fmt-special { margin: 8px 0 0; color: #64748b; font-size: 0.82rem; }
.article .ieconv-page .ie-fmt-special a { color: var(--ie-blue); font-weight: 700; }

.ieconv-page .ieconv-app button#ie-btn-run,
.ieconv-page .ieconv-app button#heic-btn-run,
.ieconv-page .ieconv-app button#avif-btn-run,
.ieconv-page .ieconv-app button#sq-btn-run,
.ieconv-page .ieconv-app button#fb-btn-run,
.ieconv-page .ieconv-app button#colagem-btn-run,
.ieconv-page .ieconv-app button#dgrid-btn-run,
.ieconv-page .ieconv-app button#ocr-btn-run,
.ieconv-page .ieconv-app button#paleta-btn-run {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--ie-gold);
  color: #1f2937;
  font-size: 1rem;
  font-weight: 800;
}
.ieconv-page .ieconv-app button#ie-btn-run:hover:not(:disabled),
.ieconv-page .ieconv-app button#heic-btn-run:hover:not(:disabled),
.ieconv-page .ieconv-app button#avif-btn-run:hover:not(:disabled),
.ieconv-page .ieconv-app button#sq-btn-run:hover:not(:disabled),
.ieconv-page .ieconv-app button#fb-btn-run:hover:not(:disabled),
.ieconv-page .ieconv-app button#colagem-btn-run:hover:not(:disabled),
.ieconv-page .ieconv-app button#dgrid-btn-run:hover:not(:disabled),
.ieconv-page .ieconv-app button#ocr-btn-run:hover:not(:disabled),
.ieconv-page .ieconv-app button#paleta-btn-run:hover:not(:disabled) {
  background: #e5a800;
  border-color: #e5a800;
  color: #1f2937;
}
.article .ieconv-page .ieconv-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed #d0d5dd;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
}
.article .ieconv-page #heic-list:empty { display: none; }
.article .ieconv-page #heic-list .ie-batch-ul { margin: 8px 0 0; padding: 0; list-style: none; }
.article .ieconv-page #heic-list .ie-batch-ul li::before { content: none; }
.article .ieconv-page .ieconv-app .itool-status { min-height: 1.2em; color: #64748b; font-size: 0.84rem; }
.article .ieconv-page .ieconv-app .itool-status.is-ok { color: #15803d; }
.article .ieconv-page .ieconv-app .itool-status.is-error { color: #b91c1c; }
.article .ieconv-page .ieconv-app .itool-status.is-loading { color: var(--ie-blue); }

.ieconv-stage {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: 14px;
  background-color: #e8eef6;
  background-image:
    linear-gradient(45deg, #d5deea 25%, transparent 25%),
    linear-gradient(-45deg, #d5deea 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d5deea 75%),
    linear-gradient(-45deg, transparent 75%, #d5deea 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  overflow: hidden;
}
.article .ieconv-page .ieconv-empty { margin: 0; padding: 16px; color: #64748b; font-size: 0.9rem; text-align: center; }
.ieconv-stage:has(.itool-preview-wrap.is-visible) .ieconv-empty,
.ieconv-stage:has(.itool-result.is-visible) .ieconv-empty { display: none; }
.ieconv-stage:has(#sq-result-wrap.is-visible) #sq-preview-wrap,
.ieconv-stage:has(#fb-result-wrap.is-visible) #fb-preview-wrap { display: none !important; }
.ieconv-stage #sq-result-wrap.is-visible,
.ieconv-stage #fb-result-wrap.is-visible { display: block; }
.ieconv-stage .itool-preview-wrap,
.ieconv-stage .itool-preview-wrap.is-visible { display: none; width: 100%; margin: 0; }
.ieconv-stage:not(:has(.itool-result.is-visible)) .itool-preview-wrap.is-visible { display: block; }
.ieconv-stage .itool-preview-wrap img,
.ieconv-stage .itool-preview-wrap canvas,
.ieconv-stage .itool-result img {
  max-height: 320px;
  margin: 12px auto;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.ieconv-stage .itool-result,
.ieconv-stage .itool-result.is-visible {
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 0;
  background: transparent;
}
.ieconv-stage .itool-meta,
.ieconv-stage .itool-result-name,
.ieconv-stage .itool-result-sub { padding: 0 8px; text-align: center; word-break: break-word; }

.ieconv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ieconv-actions .itool-btn { flex: 1 1 120px; }
.ieconv-page .ieconv-app button#ie-btn-dl:not(:disabled),
.ieconv-page .ieconv-app button#ie-btn-dl-zip:not(:disabled),
.ieconv-page .ieconv-app button#heic-btn-dl:not(:disabled),
.ieconv-page .ieconv-app button#heic-btn-zip:not(:disabled),
.ieconv-page .ieconv-app button#avif-btn-dl:not(:disabled),
.ieconv-page .ieconv-app button#sq-btn-dl:not(:disabled),
.ieconv-page .ieconv-app button#fb-btn-dl:not(:disabled),
.ieconv-page .ieconv-app button#colagem-btn-dl:not(:disabled),
.ieconv-page .ieconv-app button#colagem-btn-dl-below:not(:disabled),
.ieconv-page .ieconv-app button#ocr-btn-dl:not(:disabled),
.ieconv-page .ieconv-app button#ocr-btn-pdf:not(:disabled) {
  background: var(--ie-green);
  border-color: var(--ie-green);
  color: #fff;
}
.ieconv-page .ieconv-app button#ie-btn-dl:not(:disabled):hover,
.ieconv-page .ieconv-app button#ie-btn-dl-zip:not(:disabled):hover,
.ieconv-page .ieconv-app button#heic-btn-dl:not(:disabled):hover,
.ieconv-page .ieconv-app button#heic-btn-zip:not(:disabled):hover,
.ieconv-page .ieconv-app button#avif-btn-dl:not(:disabled):hover,
.ieconv-page .ieconv-app button#sq-btn-dl:not(:disabled):hover,
.ieconv-page .ieconv-app button#fb-btn-dl:not(:disabled):hover,
.ieconv-page .ieconv-app button#colagem-btn-dl:not(:disabled):hover,
.ieconv-page .ieconv-app button#colagem-btn-dl-below:not(:disabled):hover,
.ieconv-page .ieconv-app button#ocr-btn-dl:not(:disabled):hover,
.ieconv-page .ieconv-app button#ocr-btn-pdf:not(:disabled):hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}
.article .ieconv-page .ieconv-links { margin: 10px 0 0; }
.article .ieconv-page .ieconv-links a { color: var(--ie-blue); font-weight: 700; }
.ieconv-page .itool-next { margin-top: 10px; }

.ieconv-page #colagem-thumbs:empty,
.ieconv-page #paleta-swatches:empty,
.ieconv-page #dgrid-grid-preview:empty { display: none; }
.ieconv-page .ieconv-result textarea.itool-input { width: 100%; box-sizing: border-box; }
.ieconv-page #colagem-thumbs { margin-top: 12px; }

.ieconv-page .ieconv-app > .itool-side {
  display: none;
  width: auto;
  max-width: none;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.ieconv-page .ieconv-app > .itool-side:has(.itool-hist-host:not([hidden])) { display: block; }
.ieconv-page .ieconv-app > .itool-side .itool-hist-list {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.ieconv-page .ieconv-app > .itool-side .itool-hist-thumb { aspect-ratio: 4 / 3; }
.article .ieconv-page .itool-hist-list > li { margin: 0; }
.article .ieconv-page .itool-hist-list > li::before { content: none; }
.ieconv-page .ieconv-app > .itool-success,
.ieconv-page .ieconv-app.is-busy > .itool-busy-banner { display: none !important; }

html[data-theme="dark"] .ieconv-page .ieconv-app .itool-drop,
html[data-theme="dark"] .ieconv-page .ieconv-app.ie-has-file .itool-drop.is-compact { background: #0f1b33; border-color: #3b5b99; }
html[data-theme="dark"] .ieconv-page .ieconv-app select,
html[data-theme="dark"] .ieconv-page .ieconv-app input[type="number"],
html[data-theme="dark"] .ieconv-page .ieconv-app button.itool-drop-sample,
html[data-theme="dark"] .ieconv-fmt a,
html[data-theme="dark"] .ieconv-page .ieconv-app button.ie-fmt-chip { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .ieconv-page .ieconv-app button#ie-btn-run,
html[data-theme="dark"] .ieconv-page .ieconv-app button#heic-btn-run,
html[data-theme="dark"] .ieconv-page .ieconv-app button#avif-btn-run,
html[data-theme="dark"] .ieconv-page .ieconv-app button#sq-btn-run,
html[data-theme="dark"] .ieconv-page .ieconv-app button#fb-btn-run,
html[data-theme="dark"] .ieconv-page .ieconv-app button#colagem-btn-run,
html[data-theme="dark"] .ieconv-page .ieconv-app button#dgrid-btn-run,
html[data-theme="dark"] .ieconv-page .ieconv-app button#ocr-btn-run,
html[data-theme="dark"] .ieconv-page .ieconv-app button#paleta-btn-run { color: #1f2937; }
html[data-theme="dark"] .article .ieconv-page .ieconv-note { background: #0f1b33; border-color: #3b5b99; color: #cbd5e1; }
html[data-theme="dark"] .ieconv-page .ieconv-app button#ie-btn-dl:disabled { background: #1e293b; color: #64748b; }
