/* ============================================================
   Kiacos.fotos — components.css
   Buttons, menus, sliders, tiles, toasts, ICO presets, editor 2-col.
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 12px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 80ms linear, color 80ms linear, transform 80ms linear, box-shadow 80ms linear, border-color 80ms linear;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }

/* Primary · sombra dura desplazada que se hunde */
.btn--primary {
  background: rgb(var(--cta-action));
  color: rgb(var(--cta-action-fg));
  border-color: rgb(var(--cta-action-press));
  box-shadow: 4px 4px 0 0 rgb(var(--cta-action-press));
}
.btn--primary:hover:not(:disabled) {
  background: rgb(var(--cta-action-hover));
  box-shadow: 2px 2px 0 0 rgb(var(--lf-ink));
  transform: translate(2px, 2px);
}
.btn--primary:active:not(:disabled) {
  background: rgb(var(--cta-action-press));
  box-shadow: 0 0 0 0 rgb(var(--lf-ink));
  transform: translate(4px, 4px);
}

/* Ghost · borde duro rectangular */
.btn--ghost {
  background: rgb(var(--lf-surface-card));
  color: rgb(var(--lf-ink));
  border-color: rgb(var(--lf-ink));
  box-shadow: 4px 4px 0 0 rgb(var(--lf-ink));
}
.btn--ghost:hover:not(:disabled) {
  background: rgb(var(--cta-action) / 0.08);
  color: rgb(var(--cta-action));
  border-color: rgb(var(--cta-action));
  box-shadow: 2px 2px 0 0 rgb(var(--lf-ink));
  transform: translate(2px, 2px);
}
.btn--ghost:active:not(:disabled) {
  box-shadow: 0 0 0 0 rgb(var(--lf-ink));
  transform: translate(4px, 4px);
}

.btn--small {
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.12em;
}

/* Icon button · cuadrado rígido (header) */
.btn--icon {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(var(--lf-surface-card));
  color: rgb(var(--lf-ink));
  border: 1px solid rgb(var(--lf-ink));
  cursor: pointer;
  transition: background 80ms linear, color 80ms linear, border-width 80ms linear;
}
.btn--icon:hover {
  background: rgb(var(--cta-action) / 0.08);
  border-color: rgb(var(--cta-action));
  border-width: 2px;
  color: rgb(var(--cta-action));
}
.btn--icon svg { display: block; }

/* CTA full-width inside cards */
.btn--block { width: 100%; }

/* ---------- Menu dropdown (theme/lang) ---------- */
.menu { position: relative; }
.menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
  padding: 6px;
  box-shadow: 4px 4px 0 0 rgb(var(--lf-ink));
  display: none;
  z-index: 30;
}
.menu.is-open .menu__panel { display: block; }
.menu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  color: rgb(var(--lf-ink));
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 80ms linear, color 80ms linear;
}
.menu__item:hover { background: rgb(var(--cta-action) / 0.08); color: rgb(var(--cta-action)); }
.menu__item.is-current {
  background: rgb(var(--cta-action) / 0.12);
  color: rgb(var(--cta-action));
  font-weight: 600;
}
.menu__item svg { flex-shrink: 0; color: currentColor; }
.menu__code {
  display: inline-flex;
  width: 30px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgb(var(--lf-body-muted));
}
.menu__item.is-current .menu__code { color: rgb(var(--cta-action)); }

/* ---------- Switch (option rows) ---------- */
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgb(var(--lf-divider));
}
.switch:first-child { border-top: none; }
.switch__label {
  font-size: 14px;
  color: rgb(var(--lf-ink));
}
.switch__hint {
  display: block;
  font-size: 12px;
  color: rgb(var(--lf-body-muted));
  margin-top: 2px;
}
.switch input[type="checkbox"] {
  appearance: none;
  width: 38px; height: 22px;
  background: rgb(var(--lf-surface-card-tinted));
  position: relative;
  cursor: pointer;
  border: 1px solid rgb(var(--lf-ink));
  transition: background 80ms linear, border-color 80ms linear;
  flex-shrink: 0;
}
.switch input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: rgb(var(--lf-ink));
  transition: transform 80ms linear, background 80ms linear;
}
.switch input[type="checkbox"]:checked {
  background: rgb(var(--cta-action));
  border-color: rgb(var(--cta-action-press));
}
.switch input[type="checkbox"]:checked::after { transform: translateX(16px); background: rgb(var(--cta-action-fg)); }

/* ---------- Segmented radio (download mode) ---------- */
.segmented {
  display: inline-flex;
  padding: 0;
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
}
.segmented label {
  position: relative;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--lf-body-muted));
  cursor: pointer;
  user-select: none;
  border-right: 1px solid rgb(var(--lf-ink));
  transition: background 80ms linear, color 80ms linear;
}
.segmented label:last-child { border-right: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + span { color: rgb(var(--cta-action-fg)); }
.segmented label:has(input:checked) {
  background: rgb(var(--cta-action));
  color: rgb(var(--cta-action-fg));
}

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.field__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgb(var(--lf-body-muted));
  text-transform: uppercase;
}
.input, .select {
  width: 100%;
  padding: 11px 14px;
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
  color: rgb(var(--lf-ink));
  font: inherit;
  font-size: 14px;
  transition: border-width 80ms linear, padding 80ms linear;
}
.input:hover, .select:hover {
  border-width: 2px;
  padding: 10px 13px;
}
.input:focus, .select:focus {
  border-color: rgb(var(--cta-action));
  border-width: 3px;
  padding: 9px 12px;
  outline: none;
}

/* ---------- Sliders (pro look) ---------- */
.slider-row {
  display: grid;
  grid-template-columns: 80px 1fr 36px;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}
.slider-row__label {
  font-size: 13px;
  color: rgb(var(--lf-ink));
  font-weight: 500;
}
.slider-row__value {
  font-size: 12px;
  color: rgb(var(--lf-body-muted));
  font-variant-numeric: tabular-nums;
  text-align: right;
}
input[type="range"] {
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgb(var(--lf-ink));
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px; height: 14px;
  background: rgb(var(--cta-action));
  border: 2px solid rgb(var(--lf-ink));
  cursor: pointer;
  transition: transform 80ms linear;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  background: rgb(var(--cta-action));
  border: 2px solid rgb(var(--lf-ink));
  cursor: pointer;
}

/* ---------- Tiles (image queue) ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.tile {
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-width 80ms linear, box-shadow 80ms linear, transform 80ms linear;
}
.tile:hover {
  border-width: 2px;
  box-shadow: 4px 4px 0 0 rgb(var(--cta-action));
  transform: translate(-2px, -2px);
}
.tile__thumb {
  aspect-ratio: 1;
  background: rgb(var(--lf-surface-card-tinted));
  overflow: hidden;
}
.tile__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile__body { padding: 10px 12px; }
.tile__name {
  font-size: 12px;
  font-weight: 500;
  color: rgb(var(--lf-ink));
  margin: 0 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile__status {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  border: 1px solid currentColor;
}
.status--pending { background: rgb(var(--lf-surface-card-tinted)); color: rgb(var(--lf-body-muted)); }
.status--processing { background: rgb(var(--state-warn-bg)); color: rgb(var(--state-warn-fg)); }
.status--done { background: rgb(var(--state-success-bg)); color: rgb(var(--state-success-fg)); }
.status--error { background: rgb(var(--state-error-bg)); color: rgb(var(--state-error-fg)); }
.tile__bar {
  height: 3px;
  background: rgb(var(--lf-ink));
  overflow: hidden;
  margin-bottom: 8px;
}
.tile__bar-fill {
  height: 100%;
  background: rgb(var(--cta-action));
  width: 0%;
  transition: width 200ms ease;
}
.tile__dl {
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgb(var(--lf-ink));
  color: rgb(var(--lf-ink));
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: none;
  transition: background 80ms linear, color 80ms linear, border-color 80ms linear;
}
.tile.is-done .tile__dl { display: block; }
.tile__dl:hover {
  background: rgb(var(--cta-action));
  border-color: rgb(var(--cta-action));
  color: rgb(var(--cta-action-fg));
}

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  padding: 10px 14px;
  background: rgb(var(--lf-surface-card));
  border: 2px solid rgb(var(--lf-ink));
  color: rgb(var(--lf-ink));
  font-size: 13px;
  box-shadow: 4px 4px 0 0 rgb(var(--lf-ink));
  max-width: 320px;
  animation: toast-in 200ms linear;
  pointer-events: auto;
}
.toast--success { border-color: rgb(var(--state-success-fg)); box-shadow: 4px 4px 0 0 rgb(var(--state-success-fg)); }
.toast--error { border-color: rgb(var(--state-error-fg)); box-shadow: 4px 4px 0 0 rgb(var(--state-error-fg)); }
.toast--warn { border-color: rgb(var(--state-warn-fg)); box-shadow: 4px 4px 0 0 rgb(var(--state-warn-fg)); }
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- ICO presets (chip selector) ---------- */
.ico-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}
.chip {
  padding: 7px 13px;
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
  color: rgb(var(--lf-ink));
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-width 80ms linear, padding 80ms linear, background 80ms linear, color 80ms linear;
}
.chip:hover { border-width: 2px; padding: 6px 12px; color: rgb(var(--cta-action)); border-color: rgb(var(--cta-action)); }
.chip.is-active {
  background: rgb(var(--cta-action));
  border-color: rgb(var(--cta-action-press));
  color: rgb(var(--cta-action-fg));
}
.ico-custom {
  margin-top: 8px;
  padding: 12px;
  background: rgb(var(--lf-surface-card-soft));
  border: 1px solid rgb(var(--lf-ink));
}
.ico-custom__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.ico-custom__opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgb(var(--lf-ink));
}
.ico-help {
  font-size: 13px;
  color: rgb(var(--lf-body-muted));
  margin: 8px 0 0;
  line-height: 1.5;
}

/* ---------- Editor — 2-column pro layout ---------- */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 980px) {
  .editor-grid { grid-template-columns: 1fr 340px; }
}
.editor-stage {
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 400px;
}
.editor-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image:
    linear-gradient(45deg, rgb(var(--lf-surface-card-tinted)) 25%, transparent 25%),
    linear-gradient(-45deg, rgb(var(--lf-surface-card-tinted)) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgb(var(--lf-surface-card-tinted)) 75%),
    linear-gradient(-45deg, transparent 75%, rgb(var(--lf-surface-card-tinted)) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: rgb(var(--lf-surface-card-soft));
  border: 1px solid rgb(var(--lf-ink));
  min-height: 360px;
  position: relative;
  overflow: hidden;
}
.editor-canvas-wrap canvas { max-width: 100%; max-height: 70vh; display: block; }
.editor-empty {
  color: rgb(var(--lf-body-muted));
  font-size: 14px;
  text-align: center;
  padding: 32px;
}
.editor-spinner {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgb(var(--lf-canvas) / 0.5);
  backdrop-filter: blur(2px);
  z-index: 2;
}
.editor-spinner.is-active { display: flex; }
.editor-spinner::after {
  content: '';
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 3px solid rgb(var(--lf-surface-card-tinted));
  border-top-color: rgb(var(--cta-action));
  animation: kf-spin 700ms linear infinite;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.editor-panel__group {
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
  padding: 14px 16px;
  box-shadow: 2px 2px 0 0 rgb(var(--lf-ink));
}
.editor-panel__group > summary {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(var(--lf-body-muted));
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.editor-panel__group > summary::-webkit-details-marker { display: none; }
.editor-panel__group > summary::after {
  content: '⌃';
  font-size: 14px;
  color: rgb(var(--lf-body-muted));
  transition: transform 160ms ease;
}
.editor-panel__group[open] > summary::after { transform: rotate(180deg); }
.editor-panel__body { padding-top: 12px; }

.editor-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.editor-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 9px;
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
  color: rgb(var(--lf-ink));
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 80ms linear, border-width 80ms linear, padding 80ms linear, color 80ms linear;
}
.editor-tool-btn:hover {
  border-color: rgb(var(--cta-action));
  border-width: 2px;
  padding: 7px 8px;
  color: rgb(var(--cta-action));
  background: rgb(var(--cta-action) / 0.08);
}
.editor-tool-btn svg { color: currentColor; }

.editor-history {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.editor-history button { flex: 1; }
.editor-hint {
  font-size: 11px;
  color: rgb(var(--lf-body-muted));
  margin: 6px 0 0;
}

/* ---------- Brand logo (dark/light swap via data-theme) ---------- */
.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}
.brand-logo__img {
  height: 56px;
  width: auto;
  max-width: 60vw;
  object-fit: contain;
  display: none;
}
[data-theme="light"] .brand-logo__img--light,
[data-theme="dark"]  .brand-logo__img--dark {
  display: block;
}
@media (min-width: 768px) {
  .brand-logo__img { height: 80px; }
}
@media (min-width: 1200px) {
  .brand-logo__img { height: 96px; }
}

/* ---------- Crop visual overlay ---------- */
.crop-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}
.crop-overlay__rect {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
  border: 1px solid #fff;
  pointer-events: auto;
  cursor: move;
  box-sizing: border-box;
  touch-action: none;
}
.crop-overlay__handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.6);
  border-radius: 2px;
  pointer-events: auto;
  box-sizing: border-box;
  touch-action: none;
}
.crop-overlay__handle[data-h="nw"] { top: -7px;    left: -7px;   cursor: nwse-resize; }
.crop-overlay__handle[data-h="n"]  { top: -7px;    left: 50%;    margin-left: -7px; cursor: ns-resize; }
.crop-overlay__handle[data-h="ne"] { top: -7px;    right: -7px;  cursor: nesw-resize; }
.crop-overlay__handle[data-h="e"]  { top: 50%;     right: -7px;  margin-top: -7px;  cursor: ew-resize; }
.crop-overlay__handle[data-h="se"] { bottom: -7px; right: -7px;  cursor: nwse-resize; }
.crop-overlay__handle[data-h="s"]  { bottom: -7px; left: 50%;    margin-left: -7px; cursor: ns-resize; }
.crop-overlay__handle[data-h="sw"] { bottom: -7px; left: -7px;   cursor: nesw-resize; }
.crop-overlay__handle[data-h="w"]  { top: 50%;     left: -7px;   margin-top: -7px;  cursor: ew-resize; }

/* Allow pointer drag of text overlays on the editor canvas */
#edCanvas { touch-action: none; }

/* ---------- Opt groups (anti-dup grouped options) ---------- */
.opt-group { padding-top: 2px; }
.opt-group + .opt-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgb(var(--lf-hairline));
}
.opt-group__title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(var(--lf-body-muted));
  margin: 0 0 8px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.5);
  z-index: 60;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: rgb(var(--lf-surface-card));
  border: 2px solid rgb(var(--lf-ink));
  padding: 22px;
  max-width: 440px;
  width: 100%;
  box-shadow: 6px 6px 0 0 rgb(var(--cta-action));
}
.modal h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 14px;
}
.modal__row {
  display: flex;
  gap: 10px;
  margin: 0 0 10px;
}
.modal__row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: rgb(var(--lf-ink-soft));
  flex: 1;
}
.modal__row input[type="number"],
.modal__row input[type="text"] {
  padding: 9px 12px;
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
  color: rgb(var(--lf-ink));
  font: inherit;
  font-size: 14px;
}
.modal__row input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 4px;
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
  cursor: pointer;
}
.modal__row select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 9px 36px 9px 12px;
  background-color: rgb(var(--lf-surface-card));
  background-image: linear-gradient(45deg, transparent 50%, rgb(var(--lf-ink)) 50%),
                    linear-gradient(135deg, rgb(var(--lf-ink)) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid rgb(var(--lf-ink));
  color: rgb(var(--lf-ink));
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  width: 100%;
  transition: border-width 80ms linear, padding 80ms linear;
}
.modal__row select:hover {
  border-width: 2px;
  padding: 8px 35px 8px 11px;
}
.modal__row select:focus {
  outline: none;
  border-color: rgb(var(--cta-action));
  border-width: 3px;
  padding: 7px 34px 7px 10px;
}
.modal__row select option {
  background: rgb(var(--lf-surface-card));
  color: rgb(var(--lf-ink));
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* ---------- Card head (title + action row) ---------- */
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card__head .card__title { margin: 0; }

/* ---------- Option rows (anti-dup options) ---------- */
.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid rgb(var(--lf-divider));
}
.opt:first-child { border-top: none; padding-top: 4px; }
.opt__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.opt__label {
  font-size: 14px;
  color: rgb(var(--lf-ink));
  font-weight: 500;
}
.opt__hint {
  font-size: 12px;
  color: rgb(var(--lf-body-muted));
}

/* ---------- Options body collapse ---------- */
.options-body { transition: opacity 160ms ease; }
.options-body.collapsed { display: none; }

/* ---------- Segmented (download mode) ---------- */
.seg {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgb(var(--lf-divider));
}
.seg__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgb(var(--lf-body-muted));
  text-transform: uppercase;
  margin: 0 0 10px;
}
.seg__group {
  display: inline-flex;
  padding: 0;
  background: rgb(var(--lf-surface-card));
  border: 1px solid rgb(var(--lf-ink));
  flex-wrap: wrap;
}
.seg__opt { position: relative; }
.seg__opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg__opt label {
  display: inline-block;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--lf-body-muted));
  cursor: pointer;
  user-select: none;
  border-right: 1px solid rgb(var(--lf-ink));
  transition: background 80ms linear, color 80ms linear;
}
.seg__opt:last-child label { border-right: 0; }
.seg__opt input:checked + label {
  background: rgb(var(--cta-action));
  color: rgb(var(--cta-action-fg));
}
.seg__opt input:focus-visible + label {
  outline: 2px solid rgb(var(--cta-action));
  outline-offset: 2px;
}

/* ---------- Image grid (queue thumbnails) ---------- */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
@media (min-width: 768px) {
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
.img-grid > * { min-width: 0; }

/* ---------- CTA (process / convert hero button) ---------- */
.cta-row {
  display: flex;
  justify-content: center;
  margin: 24px 0 0;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgb(var(--cta-action));
  color: rgb(var(--cta-action-fg));
  border: 1px solid rgb(var(--cta-action-press));
  cursor: pointer;
  box-shadow: 6px 6px 0 0 rgb(var(--cta-action-press));
  transition: background 80ms linear, transform 80ms linear, box-shadow 80ms linear;
}
.cta:hover:not(:disabled) {
  background: rgb(var(--cta-action-hover));
  box-shadow: 3px 3px 0 0 rgb(var(--lf-ink));
  transform: translate(3px, 3px);
}
.cta:active:not(:disabled) {
  background: rgb(var(--cta-action-press));
  box-shadow: 0 0 0 0 rgb(var(--lf-ink));
  transform: translate(6px, 6px);
}
.cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.cta svg { color: currentColor; flex-shrink: 0; }

/* ---------- Footer links (privacy/terms) ---------- */
.app-footer__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 10px;
  font-size: 12px;
}
.app-footer__links a { font-weight: 500; }
.app-footer__links .sep { color: rgb(var(--lf-hairline-strong)); }
