/* Figure Extractor (Chunk 6) -- page styles. Shared chrome, the
 * drop zone, progress bar and chips come from ui.css and
 * ui/paper-tools-ui.css. */

.fx-status {
  margin: 0.5rem 0 0;
  min-height: 1.4em;
}

/* Round 3: the dropzone is oversized with empty space inside, so make
   it a little shorter (the shared .pt-dropzone is 132px + wide padding).
   Scoped to this page only; other tools keep the shared size. */
#fxDrop.pt-dropzone {
  min-height: 96px;
  padding: var(--s4) var(--s4);
}

.fx-load-controls {
  margin-top: 0.75rem;
}

.fx-select {
  display: block;
  margin-top: 0.25rem;
}

.fx-summary {
  margin: 0.25rem 0 0.75rem;
  line-height: 1.5;
}

.fx-figure {
  border: 1px solid var(--border, #d7dee6);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  margin: 0.6rem 0;
}

.fx-figure.is-selected {
  border-color: var(--accent, #2a5a8a);
  box-shadow: 0 0 0 1px var(--accent, #2a5a8a);
}

.fx-figure__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fx-figure__caption {
  margin: 0.4rem 0 0.25rem;
  line-height: 1.5;
}

.fx-figure__meta {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted, #5a6b7c);
}

.fx-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.fx-page-label {
  margin: 0;
}

.fx-thumbs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  max-width: 100%;
  contain: paint;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.fx-thumb {
  flex: 0 0 auto;
  border: 1px solid var(--border, #d7dee6);
  border-radius: 4px;
  background: #fff;
  padding: 2px;
  cursor: pointer;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted, #5a6b7c);
}

.fx-thumb canvas {
  display: block;
  width: 56px;
  height: auto;
}

.fx-thumb.is-current {
  border-color: var(--accent, #2a5a8a);
  box-shadow: 0 0 0 1px var(--accent, #2a5a8a);
}

.fx-page-wrap {
  position: relative;
  max-width: 900px;
  border: 1px solid var(--border, #d7dee6);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.fx-page-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}

.fx-caption-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin-top: 0.75rem;
}

.fx-caption-edit .field-label {
  flex: 1 1 260px;
  margin: 0;
}

.fx-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0.5rem 0;
}

.fx-radio {
  cursor: pointer;
}

.fx-sliders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0.75rem 0;
}

.fx-sliders .field-label {
  margin: 0;
}

.fx-sliders input[type="range"] {
  width: 100%;
}

.fx-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.fx-warn {
  margin: 0.75rem 0;
}

.fx-before-after {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.fx-before-after figure {
  margin: 0;
}

.fx-before-after figcaption {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.fx-before-after canvas {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border, #d7dee6);
  border-radius: 6px;
  background: #fff;
}

.fx-export-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
}

.fx-export-controls .field-label {
  margin: 0;
}

@media (max-width: 600px) {
  .fx-page-nav {
    gap: 0.5rem;
  }
  .fx-caption-edit {
    flex-direction: column;
    align-items: stretch;
  }
  .fx-caption-edit .field-label {
    flex-basis: auto;
  }
}
