/* Oddsprig Free AI Image Upscaler — theme and layout.
   Mobile-first, dark-first (matches image-to-barcode / scan tools).
   Self-hosted SIL OFL fonts only. Do not load a font CDN.
   Scope lives under body.iu-tool so the shared header and footer keep
   their own styles. Builder JS should hook the IDs in layout.html —
   do not edit builder JS from this file, and do not edit this file
   from the upscaler engine. */

/* -------------------------------------------------------------------------- */
/* Fonts — Source Serif 4 + Source Sans 3, SIL OFL 1.1, latin variable        */
/* -------------------------------------------------------------------------- */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("./fonts/source-serif-4-latin-wght-normal.woff2") format("woff2-variations"),
       url("./fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("./fonts/source-sans-3-latin-wght-normal.woff2") format("woff2-variations"),
       url("./fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("./fonts/source-sans-3-latin-wght-italic.woff2") format("woff2-variations"),
       url("./fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* -------------------------------------------------------------------------- */
/* Tokens — dark first (image tools), light via Oddsprig theme toggle         */
/* -------------------------------------------------------------------------- */

:root,
html[data-oddsprig-theme="dark"] {
  color-scheme: dark;
  --iu-bg: #152227;
  --iu-panel: #1c2d31;
  --iu-soft: #24363b;
  --iu-ink: #edf2e9;
  --iu-muted: #b9c9c8;
  --iu-line: #38494b;
  --iu-lime: #c8e6a0;
  --iu-lime-hover: #ddf1bf;
  --iu-gold: #e5ce8e;
  --iu-focus: #e5ce8e;
  --iu-accent: #c8e6a0;
  --iu-danger: #f0b4a8;
  --iu-danger-ink: #7a1d18;
  --iu-drop: #82998d;
  --iu-drop-hover: #31483d;
  --iu-check-a: #1a2a2e;
  --iu-check-b: #24363b;
  --iu-handle: #152227;
  --iu-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --iu-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --iu-radius: 15px;
  --iu-radius-sm: 9px;
  --iu-gutter: 32px;
  --iu-content: 1240px;
  --iu-split: 50%;
  --iu-zoom: 1;
}

html[data-oddsprig-theme="light"] {
  color-scheme: light;
  --iu-bg: #eeece4;
  --iu-panel: #f5f1e8;
  --iu-soft: #e2ebed;
  --iu-ink: #20383e;
  --iu-muted: #50686c;
  --iu-line: #a1b3af;
  --iu-lime: #256358;
  --iu-lime-hover: #1c5349;
  --iu-gold: #9a5018;
  --iu-focus: #426a33;
  --iu-accent: #256358;
  --iu-danger: #8a3410;
  --iu-danger-ink: #8a3410;
  --iu-drop: #6d8979;
  --iu-drop-hover: #d3e5da;
  --iu-check-a: #e8eee8;
  --iu-check-b: #d4ddd6;
  --iu-handle: #20383e;
}

/* -------------------------------------------------------------------------- */
/* Page shell — scoped so nav/footer stay on site chrome                      */
/* -------------------------------------------------------------------------- */

body.iu-tool {
  margin: 0;
  background: var(--iu-bg);
  color: var(--iu-ink);
  font: 16px/1.55 var(--iu-sans);
  overflow-wrap: break-word;
}

body.iu-tool *,
body.iu-tool *::before,
body.iu-tool *::after { box-sizing: border-box; }

body.iu-tool [hidden] { display: none !important; }

body.iu-tool button,
body.iu-tool .iu-button,
body.iu-tool select,
body.iu-tool input,
body.iu-tool textarea { font: inherit; }

body.iu-tool button,
body.iu-tool .iu-button,
body.iu-tool select,
body.iu-tool summary { cursor: pointer; touch-action: manipulation; }

body.iu-tool img,
body.iu-tool svg { display: block; max-width: 100%; }
body.iu-tool img { height: auto; }

body.iu-tool a { color: var(--iu-accent); text-underline-offset: 4px; }
body.iu-tool a:hover { text-decoration-thickness: 2px; }

body.iu-tool :focus-visible {
  outline: 3px solid var(--iu-focus);
  outline-offset: 3px;
}

body.iu-tool .skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 20;
  background: var(--iu-lime);
  color: var(--iu-bg);
  padding: 12px 18px;
  font-weight: 650;
  text-decoration: none;
}
body.iu-tool .skip-link:focus,
body.iu-tool .skip-link:focus-visible {
  top: 12px;
  color: var(--iu-bg);
  outline-color: var(--iu-gold);
}

body.iu-tool .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body.iu-tool main#main { max-width: none; margin: 0; padding: 0; }

body.iu-tool main#main > .wrap,
body.iu-tool .iu-intro.wrap,
body.iu-tool .iu-guide.wrap {
  width: calc(100% - var(--iu-gutter));
  max-width: var(--iu-content);
  margin-inline: auto;
  padding-inline: 0;
}

@media (max-width: 650px) {
  body.iu-tool { --iu-gutter: 32px; }
}

/* -------------------------------------------------------------------------- */
/* Intro                                                                      */
/* -------------------------------------------------------------------------- */

body.iu-tool .iu-intro {
  padding-block: 28px 20px;
}

body.iu-tool .iu-intro .directory-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 8px;
  color: var(--iu-muted);
  font-weight: 600;
  text-decoration: none;
}
body.iu-tool .iu-intro .directory-back:hover { color: var(--iu-ink); }

body.iu-tool .iu-intro .eyebrow {
  margin: 0 0 8px;
  color: var(--iu-gold);
  font-size: .69rem;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
}

body.iu-tool .iu-intro h1 {
  margin: 0;
  color: var(--iu-ink);
  font: 600 clamp(1.65rem, 3vw, 2.15rem)/1.2 var(--iu-serif);
  letter-spacing: -.025em;
}

body.iu-tool .iu-lede {
  max-width: 70ch;
  margin: 12px 0 0;
  color: var(--iu-muted);
  font-size: 1rem;
  line-height: 1.55;
}

body.iu-tool .iu-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

body.iu-tool .iu-chips li {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--iu-line);
  border-radius: 999px;
  background: var(--iu-panel);
  color: var(--iu-ink);
  font-size: 13px;
  font-weight: 650;
}

/* -------------------------------------------------------------------------- */
/* Workspace grid (mobile-first: one column)                                  */
/* -------------------------------------------------------------------------- */

body.iu-tool .iu-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding-bottom: 32px;
}

body.iu-tool .iu-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--iu-line);
  border-radius: var(--iu-radius);
  background: var(--iu-panel);
}

body.iu-tool .iu-panel h2 {
  margin: 0 0 12px;
  color: var(--iu-gold);
  font: 600 1.25rem/1.3 var(--iu-serif);
  letter-spacing: -.02em;
}

body.iu-tool .iu-help,
body.iu-tool .iu-panel .iu-help {
  margin: 10px 0 0;
  color: var(--iu-muted);
  font-size: 14px;
}

body.iu-tool #status {
  margin: 10px 0 0;
  color: var(--iu-accent);
  overflow-wrap: anywhere;
}

body.iu-tool #status[data-tone="error"] { color: var(--iu-danger); }

/* -------------------------------------------------------------------------- */
/* Buttons and fields                                                         */
/* -------------------------------------------------------------------------- */

body.iu-tool .iu-actions,
body.iu-tool .iu-input-actions,
body.iu-tool .iu-output-actions,
body.iu-tool .iu-batch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body.iu-tool .iu-input-actions { margin-top: 12px; }

body.iu-tool button,
body.iu-tool .iu-button,
body.iu-tool select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--iu-line);
  border-radius: var(--iu-radius-sm);
  background: var(--iu-soft);
  color: var(--iu-ink);
  font-size: 14px;
  font-weight: 600;
}

body.iu-tool button:hover:not(:disabled),
body.iu-tool .iu-button:hover {
  border-color: var(--iu-lime);
}

body.iu-tool button:disabled,
body.iu-tool .iu-button:disabled {
  opacity: .4;
  cursor: default;
}

body.iu-tool .iu-primary,
body.iu-tool button.primary,
body.iu-tool .button.primary {
  background: var(--iu-lime);
  border-color: var(--iu-lime);
  color: var(--iu-bg);
  font-weight: 750;
}
body.iu-tool .iu-primary:hover:not(:disabled),
body.iu-tool button.primary:hover:not(:disabled) {
  background: var(--iu-lime-hover);
  border-color: var(--iu-lime-hover);
}

html[data-oddsprig-theme="light"] body.iu-tool .iu-primary,
html[data-oddsprig-theme="light"] body.iu-tool button.primary {
  color: #f4f8f2;
}

body.iu-tool .iu-button { position: relative; }
body.iu-tool .iu-button input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
body.iu-tool .iu-button:focus-within {
  outline: 3px solid var(--iu-focus);
  outline-offset: 3px;
}

/* -------------------------------------------------------------------------- */
/* Drop zone                                                                  */
/* -------------------------------------------------------------------------- */

body.iu-tool .iu-drop {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 160px;
  padding: 24px 16px;
  border: 2px dashed var(--iu-drop);
  border-radius: 12px;
  text-align: center;
}

body.iu-tool .iu-drop strong {
  font-size: 1.05rem;
  font-weight: 700;
}

body.iu-tool .iu-drop span {
  color: var(--iu-muted);
  font-size: 14px;
}

body.iu-tool .iu-drop.drag,
body.iu-tool .iu-drop[data-dragging="true"] {
  border-color: var(--iu-lime);
  background: var(--iu-drop-hover);
}

body.iu-tool .iu-drop:focus-visible {
  outline: 3px solid var(--iu-focus);
  outline-offset: 3px;
}

/* -------------------------------------------------------------------------- */
/* Scale / model picker                                                       */
/* -------------------------------------------------------------------------- */

body.iu-tool .iu-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

body.iu-tool .iu-picker legend {
  margin: 0 0 10px;
  color: var(--iu-ink);
  font-size: 14px;
  font-weight: 700;
}

body.iu-tool .iu-choice {
  position: relative;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 14px 14px 14px 44px;
  border: 1px solid var(--iu-line);
  border-radius: 12px;
  background: var(--iu-bg);
  cursor: pointer;
  min-height: 44px;
}

body.iu-tool .iu-choice:hover { border-color: var(--iu-lime); }

body.iu-tool .iu-choice:has(input:focus-visible) {
  outline: 3px solid var(--iu-focus);
  outline-offset: 3px;
}

body.iu-tool .iu-choice:has(input:checked) {
  border-color: var(--iu-lime);
  background: var(--iu-drop-hover);
}

body.iu-tool .iu-choice input {
  position: absolute;
  left: 14px;
  top: 16px;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--iu-lime);
}

body.iu-tool .iu-choice strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

body.iu-tool .iu-choice em {
  display: block;
  color: var(--iu-muted);
  font-style: normal;
  font-size: 13px;
  line-height: 1.45;
}

body.iu-tool .iu-choice .iu-choice-meta {
  display: block;
  margin-top: 2px;
  color: var(--iu-gold);
  font-size: 12px;
  font-weight: 650;
}

/* -------------------------------------------------------------------------- */
/* Model-download and tiling progress                                         */
/* -------------------------------------------------------------------------- */

body.iu-tool .iu-progress-block {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
}

body.iu-tool .iu-progress-block:last-of-type { margin-bottom: 0; }

body.iu-tool .iu-progress-block label {
  font-size: 14px;
  font-weight: 700;
}

body.iu-tool progress {
  width: 100%;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--iu-soft);
  accent-color: var(--iu-lime);
}

body.iu-tool progress::-webkit-progress-bar {
  background: var(--iu-soft);
  border-radius: 999px;
}
body.iu-tool progress::-webkit-progress-value {
  background: var(--iu-lime);
  border-radius: 999px;
}
body.iu-tool progress::-moz-progress-bar {
  background: var(--iu-lime);
  border-radius: 999px;
}

body.iu-tool .iu-progress-block p {
  margin: 0;
  color: var(--iu-muted);
  font-size: 14px;
}

body.iu-tool .iu-progress-block[data-state="busy"] p { color: var(--iu-accent); }
body.iu-tool .iu-progress-block[data-state="error"] p { color: var(--iu-danger); }
body.iu-tool .iu-progress-block[data-state="done"] p { color: var(--iu-accent); }

body.iu-tool #progress-panel .iu-actions { margin-top: 14px; }

/* -------------------------------------------------------------------------- */
/* Before / after zoom slider                                                 */
/* -------------------------------------------------------------------------- */

body.iu-tool .iu-compare-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}

body.iu-tool .iu-compare-head h2 { margin: 0; }

body.iu-tool .iu-zoom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

body.iu-tool .iu-zoom button {
  min-width: 44px;
  padding-inline: 10px;
}

body.iu-tool .iu-zoom input[type="range"] {
  width: min(160px, 36vw);
  min-height: 44px;
  margin: 0;
  accent-color: var(--iu-lime);
  background: transparent;
  cursor: pointer;
}

body.iu-tool .iu-stage {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  border: 1px solid var(--iu-line);
  border-radius: 10px;
  touch-action: none;
  background-color: var(--iu-check-a);
  background-image:
    linear-gradient(45deg, var(--iu-check-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--iu-check-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--iu-check-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--iu-check-b) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

body.iu-tool .iu-stage[data-empty="true"] {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--iu-muted);
  text-align: center;
  background-image: none;
  background-color: var(--iu-bg);
}

body.iu-tool .iu-stage[data-empty="true"] .iu-compare,
body.iu-tool .iu-stage[data-empty="true"] .iu-compare-labels { display: none; }

body.iu-tool .iu-world {
  transform-origin: 0 0;
  /* Builder sets: transform: translate(var(--iu-pan-x, 0px), var(--iu-pan-y, 0px)) scale(var(--iu-zoom)); */
}

body.iu-tool .iu-compare {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
}

body.iu-tool .iu-compare img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

body.iu-tool .iu-compare-after-wrap {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--iu-split, 50%);
  overflow: hidden;
}

body.iu-tool .iu-compare-after-wrap img {
  width: var(--iu-frame-width, 100%);
  max-width: none;
}

body.iu-tool .iu-compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--iu-split, 50%);
  z-index: 2;
  width: 44px;
  margin-left: -22px;
  pointer-events: none;
}

body.iu-tool .iu-compare-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--iu-lime);
  box-shadow: 0 0 0 1px var(--iu-handle);
}

body.iu-tool .iu-compare-handle::after {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--iu-lime);
  border-radius: 50%;
  background: var(--iu-handle);
  color: var(--iu-lime);
  font-size: 14px;
  font-weight: 700;
  transform: translate(-50%, -50%);
}

body.iu-tool .iu-compare-labels {
  position: absolute;
  inset: 10px 10px auto;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

body.iu-tool .iu-compare-labels span {
  padding: 4px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--iu-handle) 78%, transparent);
  color: var(--iu-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body.iu-tool .iu-compare-control {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

body.iu-tool .iu-compare-control label {
  font-size: 14px;
  font-weight: 650;
  color: var(--iu-muted);
}

body.iu-tool .iu-compare-control input[type="range"] {
  width: 100%;
  min-height: 44px;
  margin: 0;
  accent-color: var(--iu-lime);
  cursor: pointer;
}

body.iu-tool .iu-output-actions { margin-top: 14px; }
body.iu-tool #dims { margin-top: 10px; }

/* -------------------------------------------------------------------------- */
/* Batch grid                                                                 */
/* -------------------------------------------------------------------------- */

body.iu-tool .iu-batch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}

body.iu-tool .iu-batch-head h2 { margin: 0; }

body.iu-tool .iu-batch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.iu-tool .iu-batch-grid:empty,
body.iu-tool .iu-batch-panel:has(.iu-batch-grid:empty) #batch-empty { display: block; }

body.iu-tool .iu-batch-panel:has(.iu-batch-item) #batch-empty { display: none; }

body.iu-tool .iu-batch-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--iu-line);
  border-radius: 12px;
  background: var(--iu-bg);
}

body.iu-tool .iu-batch-item[aria-current="true"],
body.iu-tool .iu-batch-item.is-active {
  border-color: var(--iu-lime);
}

body.iu-tool .iu-batch-thumb,
body.iu-tool .iu-batch-select {
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--iu-soft);
  border: 1px solid var(--iu-line);
}

body.iu-tool .iu-batch-select { min-height: 72px; }

body.iu-tool .iu-batch-thumb img,
body.iu-tool .iu-batch-select img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.iu-tool .iu-batch-meta { min-width: 0; }
body.iu-tool .iu-batch-name {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  overflow-wrap: anywhere;
}
body.iu-tool .iu-batch-info {
  margin: 2px 0 0;
  color: var(--iu-muted);
  font-size: 13px;
}
body.iu-tool .iu-batch-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 6px 0 0;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--iu-line);
  font-size: 12px;
  font-weight: 700;
}

body.iu-tool .iu-batch-status[data-status="queued"] { color: var(--iu-muted); }
body.iu-tool .iu-batch-status[data-status="model"],
body.iu-tool .iu-batch-status[data-status="tiling"] {
  color: var(--iu-handle);
  background: var(--iu-gold);
  border-color: var(--iu-gold);
}
body.iu-tool .iu-batch-status[data-status="done"] {
  color: var(--iu-handle);
  background: var(--iu-lime);
  border-color: var(--iu-lime);
}
body.iu-tool .iu-batch-status[data-status="error"] {
  color: #fff;
  background: var(--iu-danger-ink);
  border-color: var(--iu-danger-ink);
}
body.iu-tool .iu-batch-status[data-status="canceled"] { color: var(--iu-muted); }

body.iu-tool .iu-batch-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.iu-tool .iu-batch-item-actions button {
  min-height: 44px;
  width: 100%;
  font-size: 13px;
}

/* -------------------------------------------------------------------------- */
/* Guide / FAQ (mirrors generator-guide on barcode tools)                     */
/* -------------------------------------------------------------------------- */

body.iu-tool .iu-guide {
  margin: 8px auto 48px;
}

body.iu-tool .iu-guide h2 {
  margin: 28px 0 12px;
  color: var(--iu-gold);
  font: 600 1.5rem/1.3 var(--iu-serif);
  letter-spacing: -.02em;
}
body.iu-tool .iu-guide h2:first-child { margin-top: 0; }

body.iu-tool .iu-guide p,
body.iu-tool .iu-guide li {
  max-width: 78ch;
  color: var(--iu-ink);
}

body.iu-tool .iu-guide p { margin: 0 0 12px; }
body.iu-tool .iu-guide ol { padding-left: 24px; margin: 0 0 12px; }
body.iu-tool .iu-guide li { margin: .4rem 0; }

body.iu-tool .iu-guide details {
  border-bottom: 1px solid var(--iu-line);
  padding: .8rem 0;
}

body.iu-tool .iu-guide summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  list-style: none;
  min-height: 44px;
  padding: 10px 0;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
body.iu-tool .iu-guide summary::-webkit-details-marker { display: none; }
body.iu-tool .iu-guide summary::after {
  content: "+";
  flex: none;
  color: var(--iu-lime);
  font-size: 1.4rem;
}
body.iu-tool .iu-guide details[open] > summary::after { content: "\2212"; }
body.iu-tool .iu-guide details p { margin: 8px 0; color: var(--iu-muted); }

body.iu-tool .iu-related {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

body.iu-tool .iu-related a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 44px;
  padding: 18px;
  border: 1px solid var(--iu-line);
  border-radius: 8px;
  background: var(--iu-panel);
  color: var(--iu-ink);
  text-decoration: none;
}
body.iu-tool .iu-related a:hover { border-color: var(--iu-lime); }
body.iu-tool .iu-related a strong { color: var(--iu-lime); font-size: 1.1rem; }
body.iu-tool .iu-related a span { color: var(--iu-muted); font-size: 14px; }

/* -------------------------------------------------------------------------- */
/* Footer polish inside the shared shell                                      */
/* -------------------------------------------------------------------------- */

body.iu-tool .iu-tool-footnote {
  margin: 0 auto 36px;
  width: calc(100% - var(--iu-gutter));
  max-width: var(--iu-content);
  color: var(--iu-muted);
  font-size: 14px;
}
body.iu-tool .iu-tool-footnote p { margin: 0 0 8px; }

/* -------------------------------------------------------------------------- */
/* Breakpoints                                                                */
/* -------------------------------------------------------------------------- */

@media (min-width: 640px) {
  body.iu-tool .iu-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.iu-tool .iu-batch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.iu-tool .iu-related {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 851px) {
  body.iu-tool .iu-intro { padding-block: 36px 24px; }
  body.iu-tool .iu-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 16px;
  }
  body.iu-tool .iu-input { grid-column: 1 / -1; }
  body.iu-tool .iu-options,
  body.iu-tool .iu-progress,
  body.iu-tool .iu-batch-panel { grid-column: 1; }
  body.iu-tool .iu-compare-panel {
    grid-column: 2;
    grid-row: 2 / span 4;
    position: sticky;
    top: 15px;
    align-self: start;
  }
  body.iu-tool .iu-drop { min-height: 120px; }
  body.iu-tool .iu-stage { min-height: 320px; }
  body.iu-tool .iu-panel { padding: 20px 22px; }
}

@media (min-width: 1100px) {
  body.iu-tool .iu-batch-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  body.iu-tool .iu-related {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  body.iu-tool .iu-intro { padding-block: 24px 16px; }
  body.iu-tool .iu-panel { padding: 16px; }
  body.iu-tool .iu-batch-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  body.iu-tool .iu-batch-item-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }
  body.iu-tool .iu-batch-item-actions button { flex: 1; }
  body.iu-tool .iu-batch-thumb,
  body.iu-tool .iu-batch-select {
    width: 64px;
    height: 64px;
    min-height: 64px;
  }
  body.iu-tool .iu-zoom input[type="range"] { width: 100%; flex: 1 1 100%; }
}

/* -------------------------------------------------------------------------- */
/* Motion, contrast, print                                                    */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  body.iu-tool,
  body.iu-tool * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (forced-colors: active) {
  body.iu-tool .iu-drop,
  body.iu-tool .iu-panel,
  body.iu-tool .iu-choice,
  body.iu-tool .iu-batch-item,
  body.iu-tool .iu-stage {
    border: 2px solid CanvasText;
  }
  body.iu-tool .iu-primary { border: 2px solid Mark; }
}

@media print {
  .oddsprig-nav-header,
  .oddsprig-subnav,
  .oddsprig-theme-actions,
  .oddsprig-theme-dock,
  body.iu-tool .iu-input,
  body.iu-tool .iu-options,
  body.iu-tool .iu-progress,
  body.iu-tool .iu-zoom,
  body.iu-tool .iu-compare-control,
  body.iu-tool .iu-output-actions,
  body.iu-tool .iu-batch-actions,
  body.iu-tool .skip-link {
    display: none !important;
  }
  body.iu-tool,
  body.iu-tool .iu-panel,
  body.iu-tool .iu-stage {
    background: #fff;
    color: #111;
  }
  body.iu-tool .iu-compare-after-wrap { position: static; width: auto; overflow: visible; }
  body.iu-tool .iu-compare-handle { display: none; }
  body.iu-tool .iu-compare img { page-break-inside: avoid; }
}
