/* webshed poster/app.css — the app's OWN stylesheet.

   It sits BENEATH the shell's shell.css and adds layout rules for the
   Poster's own screens only. It NEVER overrides a shell token and defines
   none: every value below is a shell token (var(--…)) or plain layout.
   A second token set is a second design system, and two of those in one
   suite is how "the same app in two colours" starts.

   Do not put shell chrome rules here. If a shell-rendered element needs a
   rule, that rule belongs in shell.css at HQ's word. */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.poster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.job-list,
.photo-list,
.settings-list {
  list-style: none;
  margin: var(--sp-4) 0;
  padding: 0;
  display: grid;
  gap: var(--sp-3);
}

.job-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
}

.job-row .pill,
.job-row .btn {
  justify-self: start;
}

.job-text {
  display: grid;
  gap: var(--sp-1);
  min-width: 0;
}

.thumb {
  display: block;
  width: 96px;
  height: auto;
  max-height: 96px;
  object-fit: cover;
  background: var(--surface-2);
}

span.thumb {
  height: 72px;
}

.post-form {
  display: grid;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.post-form .group {
  border: 1px solid var(--border);
  padding: var(--sp-3);
  margin: 0;
  display: grid;
  gap: var(--sp-3);
}

.post-form legend {
  font-weight: 600;
  padding: 0 var(--sp-1);
}

.post-form label {
  display: grid;
  gap: var(--sp-1);
}

.size-line {
  display: flex;
  gap: var(--sp-2);
  align-items: end;
  flex-wrap: wrap;
}

.size-line .field {
  flex: 1 1 4.5em;
  min-width: 4.5em;
}

.size-line .input {
  min-width: 0;
}

.door-line {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-2);
}

.photo-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--sp-2) var(--sp-3);
  align-items: start;
}

.photo-row .caption {
  grid-column: 2;
}

/* the post form's photo (669): the design gallery's x at the thumbnail's
   top-right corner, and the same tap-to-view thumbnail */
.photo-frame {
  position: relative;
  display: block;
}

.photo-row.is-dragging {
  opacity: 0.5;
}

/* the count beside a gallery's heading: digits (669) */
.gallery-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}

.photo-count {
  font-variant-numeric: tabular-nums;
}

.photo-count[hidden],
[data-no-photos][hidden] {
  display: none;
}

.photo-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.add-in-place summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
}

.add-in-place summary::-webkit-details-marker {
  display: none;
}

.add-fields {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-3);
  margin-top: var(--sp-2);
  border: 1px dashed var(--border-strong);
}

.crew-list {
  display: grid;
  gap: var(--sp-2);
}

.check {
  display: flex !important;
  grid-template-columns: none;
  gap: var(--sp-2);
  align-items: center;
  min-height: var(--touch-min);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.preview {
  margin-top: var(--sp-4);
}

.preview dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--sp-1) var(--sp-3);
}

.preview dt {
  font-weight: 600;
}

.preview dd {
  margin: 0;
  white-space: pre-line;
}

.preview-photos {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.add-row {
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.swatch {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: var(--sp-2);
  vertical-align: middle;
  border: 1px solid var(--border-strong);
}

#posted-toast {
  position: static;
  margin: var(--sp-3) 0;
}

/* A DESIGN'S PICTURES (the design screen round): the Upload button with
   the gallery right beside it; the x sits at each thumbnail's top-right
   corner; the full-screen view is a <dialog>. Shell tokens only. */
.gallery-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
}

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-3);
}

.gallery-item {
  position: relative;
  display: grid;
  gap: var(--sp-1);
  align-content: start;
}

.gallery-item.is-dragging {
  opacity: 0.5;
}

.gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: zoom-in;
}

/* SQUARE THUMBNAILS in both galleries (PHOTOS-STANDARD line 8; WS-G G4):
   the design gallery and the post form's rows; the picture is cropped to
   fill the square, and the viewer keeps the whole picture */
.gallery-open .thumb,
.photo-row .thumb {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.gallery-cover {
  position: absolute;
  top: var(--sp-1);
  left: var(--sp-1);
}

.gallery-x {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.gallery-x svg {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 2px;
}

.gallery-form {
  display: grid;
  gap: var(--sp-1);
}

.gallery-moves {
  display: flex;
  gap: var(--sp-1);
}

.photo-view {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: var(--sp-3);
  border: 0;
  background: var(--text);
  box-sizing: border-box;
}

.photo-view[open] {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--sp-3);
}

.photo-view [data-close-view] {
  justify-self: start;
}

/* PHOTOS-STANDARD 658: the round + is plain (not the primary colour) and
   44 px or larger; "Photo removed." sits with its Undo on one line; the
   viewer's day and its two steps sit under the picture */
.gallery-add {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border-radius: var(--r-pill);
  font-size: 1.5rem;
  line-height: 1;
}

.gallery-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
}

.gallery-notice[hidden] {
  display: none;
}

.photo-view[open] {
  grid-template-rows: auto 1fr auto;
}

.photo-view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  color: var(--surface);
}

.photo-view-bar .btn[hidden] {
  display: none;
}

.photo-view-canvas {
  max-width: 100%;
  max-height: 100%;
  justify-self: center;
  align-self: center;
  object-fit: contain;
}

.price-check {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--sp-1) var(--sp-3);
}

.price-check dd {
  margin: 0;
}

.line-list {
  list-style: none;
  margin: var(--sp-3) 0;
  padding: 0;
  display: grid;
  gap: var(--sp-2);
}

.line-form,
.line-add {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}

.line-form .input,
.line-add .input {
  flex: 1 1 14em;
}

/* THE PICK-LIST ROWS (part 4a fix round, shell tokens only): each row sits
   inside the card's standard inner padding, a hairline between rows, and a
   town's Merge form stands apart from its Edit. The colour control is a
   44 px target like every other control (the add form's twin too). */
.settings-list.card {
  gap: 0;
}

.settings-list.card > li {
  padding: var(--sp-4);
}

.settings-list.card > li + li {
  border-top: 1px solid var(--border);
}

.settings-list .merge-row {
  margin-top: var(--sp-4);
}

.edit-row input[type="color"] {
  margin-right: var(--sp-2);
}

input[type="color"] {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  vertical-align: middle;
}

/* W3 (first-timer walk): a design row's name and type stand apart, with
   its pills and Edit, wrapping on a phone */
.design-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
}

.design-row .muted-line {
  margin: 0;
}
