.add-flow {
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.add-flow:has(.seller-greeting) {
  padding-top: 13vh;
}

.brand-payoff {
  display: none;
}

body.add-flow-no-images .add-flow {
  min-height: 100svh;
}

.seller-greeting {
  margin: 0 auto 5vh;
  color: #0b0620;
  font-size: 1.3rem;
  font-weight: 820;
  line-height: 1.2;
  text-align: center;
}

.seller-debug-panel {
  width: min(100%, 1100px);
  margin: 0 auto 1.5rem;
  padding: 1rem;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff8e7;
  color: #281304;
}

.seller-debug-panel summary {
  cursor: pointer;
  font-weight: 850;
}

.seller-debug-panel h3 {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
}

.seller-debug-panel p {
  margin: 0.6rem 0 0;
}

.seller-debug-panel pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 0.8rem;
  border-radius: 7px;
  background: #fff;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.add-flow-fold {
  display: contents;
}

.add-flow-intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: end;
  padding: clamp(1.8rem, 4vw, 3.2rem) 0 clamp(1.2rem, 3vw, 2rem);
}

.add-flow-intro h1,
.add-flow-intro h2 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(2rem, 4.2vw, 4.8rem);
  line-height: 0.95;
}

.add-flow-intro h1 {
  margin-top: 6vh;
}

.add-flow-intro h2 {
  margin-top: 30px;
}

.add-flow-intro > p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.upload-dropzone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 164px;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 2px dashed rgba(56, 29, 146, 0.32);
  border-radius: 8px;
  background: var(--accent-soft);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.upload-dropzone.is-drag-over {
  border-color: var(--accent);
  background: #f4f0ff;
  box-shadow: 0 0 0 4px rgba(56, 29, 146, 0.12);
}

.upload-dropzone h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.upload-dropzone p {
  margin: 0;
  color: var(--muted);
}

.upload-pick {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 820;
  cursor: pointer;
}

.upload-pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.upload-feedback {
  width: min(100%, 840px);
  margin: 1rem auto 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.upload-feedback p,
.upload-feedback ul {
  margin: 0;
}

.upload-feedback ul {
  padding-left: 1.2rem;
}

.upload-feedback strong {
  color: var(--accent-dark);
}

.upload-process {
  display: grid;
  gap: 0.55rem;
  width: min(100%, 840px);
  margin: 1rem auto 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #14082f;
  background: #fff;
}

.upload-process[hidden] {
  display: none;
}

.upload-process-count,
.upload-process-summary {
  margin: 0;
  line-height: 1.55;
}

.upload-process-count {
  font-weight: 850;
}

.upload-process-summary {
  color: var(--muted);
}

.upload-process-details {
  margin-top: 0.15rem;
}

.upload-process-details summary {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  color: #381d92;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.upload-process-details summary::-webkit-details-marker {
  display: none;
}

.upload-process-details summary::after {
  content: "⌄";
  font-size: 1rem;
  line-height: 1;
}

.upload-process-details[open] summary::after {
  transform: rotate(180deg);
}

.upload-process-log {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.upload-process-log p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.add-flow-text-process .grouping-shell {
  display: none;
}

.duplicate-warning-panel {
  display: grid;
  gap: 0.45rem;
  width: min(100%, 840px);
  margin: 0.8rem auto 0;
  padding: 0.9rem 1rem;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  color: #5b2609;
  background: #fff8e7;
}

.duplicate-warning-panel[hidden] {
  display: none;
}

.duplicate-warning-panel h3,
.duplicate-warning-panel p {
  margin: 0;
}

.duplicate-warning-panel h3 {
  color: #7a2e0e;
  font-size: 1rem;
}

.duplicate-warning-panel ul {
  margin: 0;
  padding-left: 1.2rem;
}

.duplicate-warning-panel a {
  color: #381d92;
  font-weight: 820;
}

@media (min-width: 1100px) {
  .add-flow-intro,
  .upload-dropzone {
    max-width: 840px;
    margin-right: auto;
    margin-left: auto;
  }
}

.grouping-shell {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.grouping-summary {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

.manual-grouping-link {
  width: min(100%, 840px);
  margin: 0.85rem auto 0;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.manual-grouping-link a {
  color: var(--accent-dark);
  font-weight: 820;
}

.grouping-toolbar,
.panel-heading,
.thing-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.grouping-toolbar {
  display: grid;
  justify-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.8rem 0 0;
  margin-top: 5vh;
}

.ai-grouping-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
}

.ai-grouping-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #381d92;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.ai-grouping-tools button.secondary {
  color: #381d92;
  background: #f1eef8;
}

.ai-grouping-tools button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ai-grouping-tools p {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.ai-grouping-tools p.is-error {
  color: #9b1c1c;
}

.ai-grouping-login-note a,
.ai-grouping-tools p a {
  color: #381d92;
  font-weight: 800;
}

.grouping-toolbar h2 {
  margin-bottom: 0.25rem;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.grouping-toolbar p,
.thing-group p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.grouping-workspace {
  display: grid;
  grid-template-columns: minmax(0, 840px);
  gap: 1rem;
  align-items: start;
  justify-content: center;
}

.image-bank,
.thing-groups {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.image-bank[hidden] {
  display: none;
}

.thing-groups {
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 220ms ease 120ms, transform 220ms ease 120ms;
  visibility: hidden;
}

.grouping-shell.has-thing-groups .thing-groups {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.thing-groups-title {
  margin: 0;
  color: #0b0620;
  font-size: 1.15rem;
  line-height: 1.1;
}

.panel-heading h3,
.thing-group h4 {
  margin: 0;
}

.panel-heading h3 {
  font-size: 1rem;
}

.panel-heading button {
  min-height: 38px;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font: inherit;
  font-weight: 780;
}

.panel-heading button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.panel-heading-bottom {
  justify-content: flex-end;
}

.grouping-next-step {
  margin: 0;
  padding: 0.78rem 0.85rem;
  border: 1px solid rgba(56, 29, 146, 0.2);
  border-radius: 7px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 740;
  line-height: 1.45;
  white-space: pre-line;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.image-tile {
  position: relative;
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.45rem;
  border: 1px solid #dfdfdf;
  border-radius: 8px;
  cursor: pointer;
}

.image-tile input {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 1;
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}

.image-tile:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 29, 146, 0.12);
}

.image-tile.is-possible-duplicate {
  border-color: #f0c36d;
  background: #fff8e7;
}

.image-tile.is-dragging {
  opacity: 0.45;
}

.image-preview {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  cursor: grab;
  touch-action: none;
}

.image-preview.is-adjusting {
  cursor: grabbing;
}

.image-tile:has(input:checked) .image-preview {
  cursor: move;
  touch-action: auto;
}

.image-zoom-controls {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  z-index: 2;
  display: inline-flex;
  gap: 0.25rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.25rem);
  transition: opacity 140ms ease, transform 140ms ease;
}

.image-preview.has-zoom-controls .image-zoom-controls,
.image-preview:focus-within .image-zoom-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.image-tile:has(input:checked) .image-zoom-controls {
  display: none;
}

.image-zoom-button {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgba(56, 29, 146, 0.26);
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 3px 10px rgba(12, 7, 32, 0.14);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.image-zoom-button:hover {
  background: #fff;
}

.image-preview img {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  max-width: none;
  object-fit: cover;
  transform: translate(calc(-50% + var(--image-offset-x, 0px)), calc(-50% + var(--image-offset-y, 0px)));
  user-select: none;
  -webkit-user-drag: none;
}

.image-name {
  display: none;
}

.thing-groups {
  position: static;
}

.thing-group-list {
  display: grid;
  gap: 0.85rem;
}

.thing-group {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid #dfdfdf;
  border-radius: 8px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.thing-group-new-drop {
  display: grid;
  gap: 0.25rem;
  min-height: 5.25rem;
  padding: 1rem;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: #fbfafc;
  color: #381d92;
  place-content: center;
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.thing-group-new-drop[hidden] {
  display: none;
}

.thing-group-new-drop h4,
.thing-group-new-drop p {
  margin: 0;
}

.thing-group-new-drop h4 {
  color: #16064b;
  font-size: 1rem;
}

.thing-group-new-drop p {
  color: var(--muted);
}

.thing-group-new-drop.is-drop-target {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(56, 29, 146, 0.12);
}

.thing-group.is-review-ready {
  padding: 1rem;
}

.thing-group.is-drop-target {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(56, 29, 146, 0.12);
}

.thing-group.has-possible-duplicate {
  border-color: #f0c36d;
  background: #fffdf6;
}

.thing-group-images {
  display: grid;
  grid-template-columns: repeat(4, 56px);
  gap: 0.4rem;
}

.group-thumb-frame {
  position: relative;
  display: block;
  width: 56px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  cursor: grab;
}

.group-thumb-frame.is-dragging {
  opacity: 0.45;
}

.group-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  max-width: none;
  object-fit: cover;
  transform: translate(calc(-50% + var(--image-offset-x, 0px)), calc(-50% + var(--image-offset-y, 0px)));
}

.thing-group-status {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #17084f;
  font-weight: 400;
  background: var(--accent-soft);
}

.thing-group-status.is-error {
  border-color: #f0c36d;
  color: #7a2e0e;
  background: #fff8e7;
}

.thing-duplicate-warning {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid #f0c36d;
  border-radius: 7px;
  color: #7a2e0e;
  background: #fff8e7;
}

.seller-review-thing-embedded {
  border: 0;
  padding: 0;
}

.thing-group-empty {
  border-style: dashed;
  background: var(--accent-soft);
}

.contact-panel {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.contact-panel h3,
.contact-panel p {
  margin: 0;
}

.contact-panel h3 {
  font-size: 1.05rem;
}

.contact-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.contact-panel label {
  display: grid;
  gap: 0.35rem;
  color: var(--accent-dark);
  font-weight: 780;
}

.contact-panel input[type="text"],
.contact-panel input[type="email"],
.contact-panel input[type="tel"] {
  width: 100%;
  min-height: 42px;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.contact-consent {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.45;
}

.contact-consent input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.2rem 0 0;
  accent-color: var(--accent);
}

.contact-consent a {
  color: var(--accent-dark);
  font-weight: 820;
}

.contact-panel button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 820;
  cursor: pointer;
}

.contact-panel button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.contact-panel.is-complete > h3,
.contact-panel.is-complete > p:not(.contact-status),
.contact-panel.is-complete > label,
.contact-panel.is-complete > button {
  display: none;
}

.contact-status {
  padding: 0.75rem;
  border: 1px solid rgba(56, 29, 146, 0.2);
  border-radius: 7px;
  background: #fff;
  font-weight: 700;
  white-space: pre-line;
}

.contact-status.is-error {
  border-color: #f0c36d;
  color: #7a2e0e;
  background: #fff8e7;
}

.seller-existing-things {
  display: grid;
  gap: 1rem;
  width: min(100%, 1120px);
  margin: calc(3rem + 9vh) auto 0;
}

.seller-pending-things {
  margin-top: calc(2rem + 4vh);
}

.seller-review-things {
  display: grid;
  gap: 1rem;
  width: min(100%, 1120px);
  margin: calc(3rem + 3vh) auto 0;
}

.seller-existing-things-header h2 {
  margin: 0 0 0.25rem;
  color: #999;
  font-size: clamp(0.85rem, 1.7vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0.02rem;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.seller-existing-things-header p {
  margin: 0;
  color: #555;
}

.seller-existing-things-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin-top: 1.75rem;
}

.seller-existing-things-links a {
  color: #381d92;
  font-weight: 820;
}

.seller-review-list {
  display: grid;
  gap: 1rem;
}

.seller-review-approve-all {
  display: flex;
  justify-content: flex-end;
}

.seller-review-approve-all button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.seller-review-approve-all button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.seller-review-thing {
  display: grid;
  grid-template-columns: minmax(11rem, 17rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid #dad0ec;
  border-radius: 8px;
  background: #fff;
}

.seller-review-images {
  display: grid;
  gap: 0.75rem;
}

.seller-review-main-image {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.seller-review-main-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(58vh, 520px);
  border-radius: 7px;
  object-fit: contain;
  background: #f7f5fb;
}

.seller-review-main-image figcaption {
  color: #5a5a5a;
  font-size: 0.95rem;
  font-weight: 820;
}

.seller-review-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.6rem, 1fr));
  gap: 0.45rem;
}

.seller-review-thumbnail-item {
  display: grid;
  gap: 0.28rem;
}

.seller-review-thumbnail-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.seller-review-thumbnail-image-button.is-selected {
  border-color: #43209b;
  box-shadow: 0 0 0 3px rgba(67, 32, 155, 0.13);
}

.seller-review-thumbnail-image-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.seller-review-thumbnail-move-button {
  min-height: 1.8rem;
  padding: 0 0.35rem;
  border: 1px solid #d8ccee;
  border-radius: 999px;
  color: #381d92;
  background: #fff;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 850;
  cursor: pointer;
}

.seller-review-thumbnail-move-button:hover,
.seller-review-thumbnail-move-button:focus-visible {
  background: #f1eef8;
}

.seller-review-thumbnail-move-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.seller-review-thumbnails img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  object-fit: cover;
  background: #f7f5fb;
}

.seller-review-label-images {
  display: grid;
  gap: 0.45rem;
}

.seller-review-label-images summary {
  width: max-content;
  padding: 0.35rem 0.6rem;
  border: 1px solid #dad0ec;
  border-radius: 999px;
  color: #381d92;
  background: #fff;
  font-size: 0.92rem;
  font-weight: 850;
  cursor: pointer;
}

.seller-review-main-image img {
  background: #fff;
}

.seller-review-form {
  display: grid;
  gap: 0.9rem;
}

.seller-review-form label {
  display: grid;
  gap: 0.3rem;
  color: #17084f;
  font-weight: 850;
}

.seller-review-form label small {
  color: #7a1f21;
  font-size: 0.9rem;
  font-weight: 850;
}

.seller-review-form .seller-review-missing-size input {
  border-color: #c83f43;
  background: #fff7f7;
}

.seller-review-form input,
.seller-review-form select,
.seller-review-form textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d8ccee;
  border-radius: 7px;
  color: #0b0620;
  font: inherit;
  font-weight: 750;
  background: #fff;
}

.seller-review-form textarea {
  min-height: 8rem;
  resize: vertical;
  line-height: 1.4;
}

.seller-review-price-input {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  width: fit-content;
}

.seller-review-price-input > span {
  color: #555;
  font-weight: 750;
}

.seller-review-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.seller-review-category-stack {
  display: grid;
  gap: 0.9rem;
}

.seller-review-category-stack.has-category-suggestion {
  grid-column: 1 / -1;
}

.seller-review-category-uncertainty {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid #d8ccee;
  border-radius: 7px;
  background: #f7f5fb;
}

.seller-review-category-uncertainty[hidden] {
  display: none;
}

.seller-review-category-uncertainty p {
  margin: 0;
  color: #17084f;
  font-weight: 750;
  line-height: 1.35;
}

.seller-review-form .seller-review-category-uncertainty button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: fit-content;
  min-height: 3rem;
  padding: 0.5rem 0.9rem 0.5rem 0.5rem;
  border: 1px solid #c9badf;
  border-radius: 7px;
  color: #17084f;
  background: #fff;
}

.seller-review-category-uncertainty button img {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
}

.seller-review-category-uncertainty button span {
  font-weight: 900;
}

.seller-review-form button {
  justify-self: start;
  min-height: 3rem;
  padding: 0.8rem 1.4rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-weight: 900;
  background: #43209b;
  cursor: pointer;
}

.seller-review-inline-status {
  padding: 0.85rem 1rem;
  border: 1px solid #dad0ec;
  border-radius: 7px;
  color: #17084f;
  font-weight: 400;
  background: #f7f5fb;
}

.seller-review-inline-status-error {
  border-color: #f1aaaa;
  color: #6b1111;
  background: #fff2f2;
}

.seller-review-thing-published {
  display: block;
}

.seller-review-published-message {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid #d7eadb;
  border-radius: 8px;
  color: #174321;
  background: #f1fbf4;
}

.seller-review-deleted-message {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid #e8cfd1;
  border-radius: 8px;
  color: #541517;
  background: #fff4f4;
}

.seller-review-published-message strong {
  font-size: 1.08rem;
}

.seller-review-deleted-message strong {
  font-size: 1.08rem;
}

.seller-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.seller-review-form .seller-delete-button {
  color: #0b0620;
  background: #d8d8de;
}

.seller-existing-things-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.seller-existing-thing {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  min-height: 5.8rem;
  padding: 0.85rem;
  border: 1px solid #dad0ec;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  background: #fff;
}

.seller-existing-thing[href]:hover {
  border-color: #43209b;
}

.seller-existing-thing-with-action {
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  align-items: start;
}

.seller-existing-thing-media {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
}

.seller-existing-thing-media a:first-child,
.seller-existing-thing-summary {
  color: inherit;
  text-decoration: none;
}

.seller-existing-thing-with-action:hover {
  border-color: #43209b;
}

.seller-existing-thing-missing-size {
  border-color: #c83f43;
  box-shadow: 0 0 0 3px rgba(200, 63, 67, 0.1);
}

.seller-existing-edit-images-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 0.6rem;
  border-radius: 999px;
  color: #381d92;
  background: #f1eef8;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.seller-existing-edit-images-link:hover,
.seller-existing-edit-images-link:focus-visible {
  background: #e6ddf7;
}

.seller-existing-delete-form {
  justify-self: end;
}

.seller-existing-delete-form button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 999px;
  color: #0b0620;
  background: #d8d8de;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.1;
  cursor: pointer;
}

.seller-existing-delete-form button:hover,
.seller-existing-delete-form button:focus-visible {
  background: #cfcfd8;
}

.seller-existing-delete-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.seller-existing-thing-deleted {
  display: block;
}

.seller-existing-deleted-message {
  color: #541517;
  font-weight: 850;
}

.seller-existing-thing img {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  max-width: 4.5rem;
  aspect-ratio: 1;
  border-radius: 7px;
  object-fit: cover;
  background: #f7f5fb;
}

.seller-existing-thing h3 {
  margin: 0 0 0.25rem;
  color: #0b0620;
  font-size: 1rem;
  line-height: 1.15;
}

.seller-existing-thing p {
  margin: 0;
  color: #555;
  line-height: 1.35;
}

.seller-existing-thing .preview-status-waiting,
.seller-existing-thing .preview-status-published {
  display: inline-flex;
  margin-top: 0.5rem;
  color: #381d92;
  font-weight: 820;
  line-height: 1.2;
}

.seller-existing-thing .preview-size-missing {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.45rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  color: #7a1f21;
  background: #fff0f0;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.15;
}

@media (max-width: 1040px) {
  .image-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .seller-existing-things-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seller-review-thing {
    grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .seller-review-label-images {
    justify-items: end;
  }

  .seller-review-label-images summary {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: right;
  }

  .site-footer-add-flow {
    margin-top: 2rem;
  }

  .site-header {
    position: fixed;
    right: 0.85rem;
    bottom: calc(1.6rem + env(safe-area-inset-bottom));
    z-index: 5;
    padding-top: 0;
    pointer-events: none;
  }

  .add-flow-nav {
    display: grid;
    width: auto;
    min-height: 0;
    justify-content: end;
    justify-items: end;
    gap: 0.25rem;
  }

  .brand-payoff {
    display: block;
    margin: 0;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.25;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .add-flow-nav .brand {
    justify-content: end;
    padding-top: 0;
    pointer-events: auto;
  }

  .add-flow-nav .brand-logo {
    display: none;
  }

  .add-flow-nav .brand span:first-of-type {
    text-align: right;
  }

  .add-flow {
    padding-bottom: 2.5rem;
  }

  .add-flow:has(.seller-greeting) {
    padding-top: 2rem;
  }

  .add-flow-intro,
  .upload-dropzone,
  .grouping-workspace {
    grid-template-columns: 1fr;
  }

  .add-flow-intro {
    align-items: start;
    gap: 0;
    padding: 1rem 0 0.9rem;
  }

  .add-flow-intro h1,
  .add-flow-intro h2 {
    font-size: clamp(2.25rem, 8vw, 3.4rem);
    line-height: 0.96;
  }

  .add-flow-intro h1 {
    margin-top: 1.1rem;
  }

  .add-flow-intro h2 {
    margin-top: 1.5rem;
  }

  .upload-dropzone {
    gap: 1.15rem;
    min-height: 0;
    padding: 1rem;
    border-style: dashed;
    background: #f5f3fb;
  }

  .upload-dropzone h2 {
    margin: 0 0 0.3rem;
    font-size: 1.45rem;
    line-height: 1.05;
  }

  .upload-dropzone p {
    max-width: 28rem;
    line-height: 1.45;
  }

  .upload-pick {
    min-height: 52px;
    padding: 0 1rem;
  }

  .grouping-shell {
    gap: 0.85rem;
    margin-top: 1.35rem;
  }

  .grouping-summary {
    text-align: left;
  }

  .grouping-toolbar {
    display: grid;
    margin-top: 1rem;
    padding-top: 0.2rem;
  }

  .grouping-toolbar h2 {
    margin: 0 0 0.25rem;
    font-size: 1.55rem;
  }

  .grouping-workspace {
    gap: 0.85rem;
  }

  .image-bank,
  .thing-groups {
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .panel-heading {
    display: grid;
    justify-items: stretch;
  }

  .panel-heading button {
    min-height: 46px;
  }

  .image-grid {
    gap: 0.55rem;
  }

  .image-tile {
    padding: 0.38rem;
  }

  .image-tile input {
    top: 0.65rem;
    left: 0.65rem;
    width: 1.15rem;
    height: 1.15rem;
  }

  .image-name {
    font-size: 0.72rem;
  }

  .thing-group {
    padding: 0.75rem;
  }

  .thing-group-header {
    align-items: start;
  }

  .thing-group-images {
    flex-wrap: wrap;
  }

  .thing-groups {
    position: static;
  }
}

@media (max-width: 760px) and (hover: none) and (pointer: coarse) {
  .nav {
    justify-content: center;
  }

  .add-flow-nav {
    justify-content: end;
    justify-items: end;
  }

  .add-flow-fold {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
    min-height: 100svh;
    padding-bottom: 8.5rem;
  }

  .add-flow-intro {
    align-self: end;
  }

  .add-flow-intro > div {
    text-align: center;
  }

  .add-flow-intro h1 {
    line-height: 1.3;
  }

  .upload-dropzone {
    align-self: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px dashed rgba(56, 29, 146, 0.32);
    background: #f5f3fb;
  }

  .upload-pick {
    width: 100%;
    max-width: none;
    margin: 0 auto;
  }

  .grouping-summary {
    align-self: end;
    margin-top: 0;
    padding-bottom: 1rem;
    display: none;
  }
}

@media (max-width: 520px) {
  main {
    width: min(100% - 1rem, 1240px);
  }

  .nav {
    width: min(100% - 1rem, 1240px);
  }

  .add-flow-nav {
    width: auto;
  }

  .brand {
    gap: 0.55rem;
  }

  .brand-logo {
    width: 2.1rem;
    height: 2.1rem;
  }

  .add-flow-intro h1,
  .add-flow-intro h2 {
    font-size: clamp(2rem, 8.7vw, 2.35rem);
  }

  .upload-dropzone {
    border-radius: 7px;
  }

  .image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seller-existing-things {
    margin-top: calc(2rem + 9vh);
  }

  .seller-review-things {
    margin-top: 2rem;
  }

  .seller-review-thing,
  .seller-review-field-grid {
    grid-template-columns: 1fr;
  }

  .seller-review-images {
    max-width: 16rem;
  }

  .seller-review-form button {
    width: 100%;
  }

  .seller-existing-things-grid {
    grid-template-columns: 1fr;
  }

  .seller-existing-thing-with-action {
    grid-template-columns: 4.5rem minmax(0, 1fr);
  }

  .seller-existing-delete-form {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 520px) and (hover: none) and (pointer: coarse) {
  .add-flow-fold {
    min-height: 100svh;
  }
}

@media (max-width: 370px) {
  .brand span:first-of-type {
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .add-flow-intro h1,
  .add-flow-intro h2 {
    font-size: clamp(1.85rem, 8.4vw, 2.1rem);
  }

}
