/* D7 site styles — layout for the maker's control rack and preview.
   Design tokens come from kit/base.css and are law; the gradients on the
   canvas are user content, not UI color, so nothing here invents colors
   beyond the kit palette. */

.gen-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.7rem 1rem;
  margin: 0.25rem 0 0.75rem;
}

.gen-controls label,
.gen-controls .gen-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.gen-controls .gen-field label,
.gen-controls .field-label { font-size: 0.82rem; color: var(--ink-soft); }

/* The custom-size row hides with its field wrapper. */
.gen-field[hidden] { display: none; }

.gen-controls input[type="number"] {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  max-width: 100%;
}

.seed-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.seed-row input { flex: 1 1 auto; min-width: 0; }

/* Custom-size inputs live behind the "Custom size" device choice. */
.custom-size {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.custom-size input { width: 6.5rem; }

/* Palette swatch strip — painted by page.js (CSSOM, not markup), one
   button per palette so the choice is visible, not just named. */
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.25rem;
}

.swatch {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.3rem;
  display: flex;
  gap: 0;
  cursor: pointer;
}

.swatch span {
  width: 1.1rem;
  height: 1.6rem;
  display: inline-block;
}

.swatch[aria-pressed="true"] {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Preview: the phone-shaped canvas. A plain rounded rectangle of our own
   styling — deliberately NOT a hardware mockup, bezel, or notch (spec §3). */
.preview-wrap {
  display: flex;
  justify-content: center;
  padding: 0.75rem 0 0.25rem;
}

#preview {
  width: min(46vw, 15rem);
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
}

/* ---- Pair mode (matching-wallpapers) ----
   Two phone-shaped canvases side by side. Their pixel sizes come from
   page.js at ONE uniform scale (split-field honesty — see page.js), so
   the CSS only spaces them; width/height attributes carry the ratio. */
.pair-preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.75rem 0 0.25rem;
}

.pair-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.pair-preview canvas {
  max-width: 42vw;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
}

.pair-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

/* A/B palette chips: the derived complement made visible. Painted by
   page.js via CSSOM, decorative (aria-hidden) — the palette name lives
   in the select. */
.pair-chips {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 0.5rem;
}

.chip-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chip-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.chips {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.chips span {
  width: 1.1rem;
  height: 1.3rem;
  display: inline-block;
}

/* ---- Gallery (gradient-wallpaper) ----
   Cards are built by page.js from entries.js; each thumb is a live
   canvas render of its entry's seed. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.9rem;
  margin: 0.75rem 0 0.25rem;
  padding: 0;
  list-style: none;
}

.gallery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gallery-thumb {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
}

.gallery-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0.15rem 0 0;
}

.gallery-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin: 0;
}

.gallery-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.2rem 0 0;
}

.gallery-actions .btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
}

.gallery-open {
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ==== STAGE 3 (spec §7.1/§7.2): the two photo-input checkers ==== */

/* File input, styled to sit with the control rack. */
.gen-controls input[type="file"] {
  font: inherit;
  font-size: 0.82rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 0.35rem;
  max-width: 100%;
}

/* Depth-checker stage: the preview canvas with the band overlay on top.
   A plain rounded rectangle in kit styling — deliberately NOT a device
   mockup, bezel, or notch (spec §3); the bands are labeled wireframe
   boxes, positioned by percentage from checker.js geometry. */
.check-stage-wrap {
  display: flex;
  justify-content: center;
  padding: 0.75rem 0 0.25rem;
}

.check-stage {
  position: relative;
  width: min(60vw, 15rem);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  overflow: hidden;
}

.check-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bands { position: absolute; inset: 0; }

.band {
  position: absolute;
  left: 4%;
  right: 4%;
  border: 1.5px dashed var(--accent);
  border-radius: 2px;
}

.band-label {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--panel);
  color: var(--ink-soft);
  padding: 0 0.3rem;
  border-radius: 2px;
  white-space: nowrap;
}

/* The subject zone reads as guidance, not furniture: solid neutral line,
   label on the right so it can't collide with the widget label. */
.band.band-subject { border-style: solid; border-color: var(--ink-soft); }
.band.band-subject .band-label { left: auto; right: 0; }

/* Tint-matcher color output rows. */
.color-list {
  list-style: none;
  margin: 0.25rem 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.color-chip {
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.color-values {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.copy-btn {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
}
