/* Batch Photo Watermarker (/tools/batch-photo-watermarker/), 2026-11-30.
   Uses tokens from ft-shell-20261106.css and components from ft-tool-20261106.css.
   Reserves fixed 3:2 stage and stat card geometry from first paint so CLS stays 0.000. */

.ft-tool .ft-fields {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), minmax(0, 1fr)));
}

.ft-tool .ft-field,
.ft-tool fieldset,
.ft-tool .ft-panel,
.ft-tool .ft-stack,
.ft-tool .ft-inputgroup {
  min-width: 0;
  max-width: 100%;
}

.ft-tool .ft-select {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-tool input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.ft-tool select,
.ft-tool textarea,
.ft-tool .ft-input,
.ft-tool .ft-select {
  font-size: max(16px, 1rem);
  min-height: 44px;
}

.ft-tool input[type="range"] {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  accent-color: var(--ft-accent);
  cursor: pointer;
}

.ft-tool input[type="color"] {
  width: 3.5rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0.2rem;
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  cursor: pointer;
}

.ft-tool .ft-btn {
  min-width: 44px;
  min-height: 44px;
  height: auto;
  padding-block: 0.48rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.bpw-filebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ft-space-2) var(--ft-space-3);
  margin-top: calc(-1 * var(--ft-space-2));
}

.bpw-fileinfo {
  flex: 1 1 13rem;
  min-width: 0;
  margin: 0;
  color: var(--ft-ink-2);
  font-size: var(--ft-text-sm);
  overflow-wrap: anywhere;
}

.bpw-fileinfo strong {
  color: var(--ft-ink);
  font-weight: 650;
}

.bpw-presets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-2);
}

.bpw-presets__label {
  margin: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-sm);
  font-weight: 600;
}

.bpw-presets__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ft-space-2);
}

.bpw-preset {
  justify-content: flex-start;
  text-align: left;
}

.bpw-preset[aria-pressed="true"] {
  border-color: var(--ft-accent);
  background: var(--ft-accent-soft);
  color: var(--ft-ink);
}

.bpw-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-3);
  min-width: 0;
  margin: 0;
  padding: var(--ft-space-4) 0 0;
  border: 0;
  border-top: 1px solid var(--ft-line);
}

.bpw-group__legend {
  float: left;
  width: 100%;
  margin: 0 0 var(--ft-space-1);
  padding: 0;
  color: var(--ft-ink);
  font-size: var(--ft-text-md);
  font-weight: 650;
}

.bpw-group__legend + * {
  clear: both;
}

.bpw-sr-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.bpw-logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ft-space-2);
  min-width: 0;
}

.bpw-logo-status {
  font-size: var(--ft-text-xs);
  color: var(--ft-ink-2);
  overflow-wrap: anywhere;
}

.bpw-range-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem var(--ft-space-2);
}

.bpw-range-val {
  font-size: var(--ft-text-sm);
  font-weight: 650;
  color: var(--ft-ink);
  font-variant-numeric: tabular-nums;
}

/* 9-Point Anchor Grid */
.bpw-anchor-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-2);
  min-width: 0;
}

.bpw-anchor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem var(--ft-space-2);
}

.bpw-anchor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(44px, 1fr));
  gap: 0.4rem;
  max-width: 13.5rem;
}

.bpw-anchor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.25rem;
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  color: var(--ft-ink-2);
  font: inherit;
  font-size: var(--ft-text-xs);
  font-weight: 650;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.bpw-anchor-btn:hover {
  border-color: var(--ft-ink-2);
  color: var(--ft-ink);
}

.bpw-anchor-btn[aria-pressed="true"] {
  border-color: var(--ft-accent);
  background: var(--ft-accent-soft);
  color: var(--ft-ink);
  box-shadow: inset 0 0 0 1px var(--ft-accent);
}

.bpw-check {
  display: flex;
  align-items: center;
  gap: var(--ft-space-2);
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  color: var(--ft-ink);
  line-height: 1.35;
  box-sizing: border-box;
  cursor: pointer;
}

.bpw-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
}

.bpw-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Batch Selector Pills */
.bpw-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.bpw-pill {
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  color: var(--ft-ink-2);
  font: inherit;
  font-size: var(--ft-text-sm);
  overflow-wrap: anywhere;
  cursor: pointer;
}

.bpw-pill[aria-pressed="true"] {
  border-color: var(--ft-accent);
  background: var(--ft-accent-soft);
  color: var(--ft-ink);
  font-weight: 650;
}

/* Fixed-Aspect Preview Stage (Zero CLS) */
.bpw-stage-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ft-space-3);
  padding: var(--ft-space-3);
  border: 1px solid var(--ft-line);
  border-radius: var(--ft-radius);
  background: var(--ft-surface);
  min-width: 0;
}

.bpw-stage-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  display: grid;
  place-items: center;
  border-radius: var(--ft-radius);
  border: 1px solid var(--ft-line);
  background:
    linear-gradient(180deg, #e7f0f8 0%, #d8e6f3 50%, #1c252b 51%, #13191e 100%);
  overflow: hidden;
  min-width: 0;
}

.bpw-stage-frame canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.bpw-stage-badge {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  max-width: calc(100% - 1rem);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(16, 23, 28, 0.78);
  color: #f8fafc;
  font-size: var(--ft-text-xs);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.bpw-lum-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  min-width: 0;
}

.bpw-lum-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-size: var(--ft-text-xs);
  font-weight: 650;
  background: var(--ft-accent-soft);
  border: 1px solid color-mix(in srgb, var(--ft-accent) 42%, var(--ft-line));
  color: var(--ft-ink);
  font-variant-numeric: tabular-nums;
}

.bpw-lum-detail {
  margin: 0;
  font-size: var(--ft-text-xs);
  color: var(--ft-ink-2);
  overflow-wrap: anywhere;
  flex: 1 1 12rem;
}

.bpw-stats {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), minmax(0, 1fr)));
}

.bpw-after-example {
  margin-top: var(--ft-space-3);
}

@media (max-width: 520px) {
  .bpw-stage-card {
    padding: var(--ft-space-2);
  }
  .bpw-anchor-grid {
    max-width: 100%;
  }
}

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