/* Image to SVG converter. Builds on ../styles.css tokens (light and dark). */
.tool-wrap {
  max-width: 48rem;
  overflow-wrap: anywhere;
}

.tool-title {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.privacy-hook {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--glow);
  border-radius: 0.5rem;
  background: var(--panel);
}

.privacy-hook p {
  margin: 0;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2rem 1.25rem;
  border: 2px dashed var(--rule);
  border-radius: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.dropzone:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.dropzone-main {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
}

.dropzone-sub,
.help {
  color: var(--muted);
  font-size: 0.9rem;
}

.ghost-button {
  font: inherit;
  font-size: 0.95rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.ghost-button:hover {
  border-color: var(--accent);
}

.tool-status {
  min-height: 1.6em;
  font-size: 0.95rem;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem 1.5rem;
  align-items: start;
}

.control-group,
.control {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.control-group legend,
.control > label {
  font-weight: 600;
  padding: 0;
}

.control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 0.75rem;
}

.control > label,
.control > .help,
.control > .color-row,
.control > select {
  grid-column: 1 / -1;
}

.control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  min-height: 2rem;
}

.control output {
  font-variant-numeric: tabular-nums;
  min-width: 3.5rem;
  text-align: right;
}

.control select {
  font: inherit;
  min-height: 2.5rem;
  margin-top: 0.25rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--fg);
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 1.25rem;
  min-height: 2.5rem;
}

.check-row label,
.color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.check-row input,
.choice input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
}

.color-row input[type="color"] {
  width: 3rem;
  height: 2.25rem;
  padding: 0.1rem;
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
  background: var(--bg);
}

.controls input:focus-visible,
.controls select:focus-visible,
.ghost-button:focus-visible,
.button-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.previews figure {
  margin: 0;
  min-width: 0;
}

.previews img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 28rem;
  object-fit: contain;
  border: 1px solid var(--rule);
  border-radius: 0.75rem;
  background: var(--panel);
}

.previews img.paper {
  background: #ffffff;
}

.previews figcaption {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.workspace[aria-busy="true"] .previews img.paper {
  opacity: 0.6;
}

.button-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.app-block {
  margin-top: 3rem;
  padding: 1.25rem 1.5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 1.25rem;
  background: var(--panel);
}

.app-block h2 {
  margin-top: 0;
}

.app-block ul {
  padding-left: 1.2rem;
}

.app-block li + li {
  margin-top: 0.35rem;
}

@media (max-width: 34rem) {
  .previews {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dropzone {
    transition: none;
  }
}

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