/* Image to Base64: styles for this tool only. Shared components live in /tools/shared/tools.css. */

.itb-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.itb-pane .panel-body {
  gap: 0.75rem;
}

/* Output blocks: label, size and copy button above a read-only text area */
.itb-out {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.itb-out-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.itb-out-head .field-label {
  padding: 0;
}
.itb-out .textarea {
  height: 5.5rem;
}
.itb-out-note {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

/* Facts about the image */
.itb-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
  font-size: var(--text-sm);
}
.itb-info dt {
  color: var(--color-muted);
}
.itb-info dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-ink);
}

.itb-error {
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Decode preview */
.itb-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: var(--stage-pad, 1rem);
}
.itb-preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
}
.itb-preview-frame img {
  max-width: 100%;
  max-height: calc(100dvh - 14rem);
  object-fit: contain;
}

@media (max-width: 860px) {
  body[data-tool="image-to-base64"] #stage {
    min-height: 18rem;
  }
  /* Stack the panel under the page instead of pinning it over the content */
  body[data-tool="image-to-base64"].panel-open .panel {
    position: static;
    box-shadow: none;
  }
  .itb-pane .panel-body {
    flex-direction: column;
    flex-wrap: nowrap;
    max-height: none;
    padding: 0.25rem 1rem;
  }
  .itb-pane .panel-body > * {
    flex: 0 0 auto;
  }
  .itb-pane .panel-head p {
    display: block;
  }
  .itb-preview-frame img {
    max-height: 50dvh;
  }
}
