/* Options and page grid for the conversion tools (JPG to PDF, PDF to JPG). Colours come from style.css variables only. */

.opts { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.opt { border: 0; margin: 0; padding: 0; min-width: 0; }
.opt legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.opt[disabled] { opacity: .45; }
.opt-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.opt-range legend { width: 100%; float: left; }

/* Segmented switch built from real radio buttons, so arrows and Tab work as usual. */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.seg label { position: relative; display: flex; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg input:disabled { cursor: default; }

.range-in { min-height: 44px; width: 10em; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; }
.range-in:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.range-in[aria-invalid="true"] { border-color: var(--danger); }

/* PDF to JPG: page cards are not draggable; they sit under the options. */
.pages { margin-top: 18px; }
.pdf2jpg-opts { margin-top: 0; padding-top: 0; border-top: 0; }
.pages .thumb { cursor: default; touch-action: auto; }
.pages .file { transition: opacity .15s; }
.pages .file.off { opacity: .4; }
.pages .factions { justify-content: flex-end; min-height: 36px; }
.go-row .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.result-txt { display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 720px) {
  .opts { flex-direction: column; }
  .seg { display: flex; }
  .seg label { flex: 1; }
  .seg span { justify-content: center; width: 100%; }
  .range-in { flex: 1; }
  .go-row .btns { width: 100%; }
  .go-row .btns .btn { flex: 1; }
}
