/* Empty roster: titlebar stays put; center empty copy + create below. */
.entity-list.is-empty {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.entity-list.is-empty .entity-list__body-wrap {
  display: none;
}

.entity-list.is-empty .entity-list__empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding: var(--space-6);
  box-sizing: border-box;
}

.entity-list.is-empty .entity-list__empty-copy {
  text-align: center;
}

.entity-list.is-empty .entity-list__empty-copy p {
  margin: 0;
  color: var(--text-muted);
}

.entity-list.is-empty .entity-list__create--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  border: none;
  background: transparent;
  gap: 0;
}

.entity-list.is-empty .entity-list__create--empty .entity-list__create-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 auto;
  width: 100%;
}

.entity-list-create {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
}

.entity-list-create__field {
  flex: 1;
  min-width: 0;
  margin: 0;
  /* Roster create line spans the column — don't inherit form `.field` measure. */
  max-width: none;
}

.entity-list-create__field input {
  height: var(--control-h);
  width: 100%;
  max-width: none;
}

.entity-list-create__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.entity-list__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.entity-list__body-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

.entity-list__jump {
  position: absolute;
  left: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transform: translateX(-50%);
  margin: 0;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  background: var(--bg-elevated, var(--bg));
  color: var(--text);
  font: inherit;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

html[data-theme="light"] .entity-list__jump,
html[data-theme="sepia"] .entity-list__jump {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.entity-list__jump:hover {
  border-color: var(--accent);
  color: var(--text);
}

.entity-list__jump--top {
  top: var(--space-2);
}

.entity-list__jump--bottom {
  bottom: var(--space-2);
}

/* Match EntityList header inset for static rows (base `.entity-row--static`
   already uses `--list-pad-x`; shell rows still drop the right pad so the
   trailing ⋯ owns the edge). */
.entity-list__body > .entity-row--static,
.entity-list__body > .entity-row__block > .entity-row--static {
  padding-left: var(--list-pad-x);
  padding-right: var(--list-pad-x);
}

.entity-list__body > .entity-row__shell > .entity-row--static,
.entity-list__body > .entity-row__block > .entity-row__shell > .entity-row--static {
  padding-left: var(--list-pad-x);
  padding-right: 0;
}

.entity-list__body.brand-list,
.brand-list.entity-list__body {
  gap: 0;
}

/* EntityCard — card layout; actions are always-visible buttons */

.entity-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  height: calc(4 * var(--row-h));
  min-height: calc(4 * var(--row-h));
  padding: var(--space-3);
  border: 1px solid var(--border-inner);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-sizing: border-box;
  overflow: visible;
}

/* Compose / note slot — grow past the 4-row lock so the field is not clipped. */
.entity-card:has(.entity-card__details > *) {
  height: auto;
}

/* Nested wrappers: each inner box steps up border luminance. */
.panel .panel,
.panel .entity-card,
.entity-card .entity-card {
  border-color: var(--border-inner);
}

.panel .panel .entity-card,
.panel .panel .panel {
  border-color: var(--border);
}

.entity-card.is-selected {
  border-color: var(--accent);
  background: var(--selection);
}

.entity-card.is-selectable {
  position: relative;
  cursor: pointer;
}

.entity-card.is-selectable > .entity-card__hit {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: auto;
  height: auto;
  flex: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.entity-card.is-selectable > .entity-card__chrome,
.entity-card.is-selectable > .entity-card__actions {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.entity-card.is-selectable .entity-row__menu-btn,
.entity-card.is-selectable .entity-card__actions .btn,
.entity-card.is-selectable .entity-card__details {
  pointer-events: auto;
}

.entity-card__details {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
}

.entity-card__details:not(:has(*)) {
  display: none;
}

.entity-card__details .entity-row-message {
  white-space: normal;
  width: 100%;
}

.entity-card__hit {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.entity-card__chrome {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.entity-card__end {
  flex-shrink: 0;
}

.entity-card__title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
  height: var(--row-h);
  min-height: var(--row-h);
  max-height: var(--row-h);
}

.entity-card__badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.entity-card__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.entity-card__label {
  font-weight: 500;
  overflow-wrap: anywhere;
  white-space: normal;
}

.entity-card__secondary {
  overflow-wrap: anywhere;
  white-space: normal;
}

.entity-card__meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.entity-card__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  height: var(--row-h);
  min-height: var(--row-h);
}

.entity-card__when {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card__actions > .btn:last-child {
  margin-left: auto;
}

/* EntityTiles — grid of EntityCards */

.entity-tiles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.entity-tiles__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  align-items: stretch;
  gap: var(--space-3);
  padding: var(--space-3);
  box-sizing: border-box;
}

.entity-tiles--stack {
  min-height: 0;
  overflow: hidden;
}

.entity-tiles--stack .entity-tiles__grid {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}

/* Belt track owns padding / scroll — don't double-wrap. */
.entity-tiles--belt {
  min-width: 0;
}

.entity-tiles--belt > .ui-belt {
  flex: 1 1 auto;
}

.entity-tiles__slot {
  height: calc(4 * var(--row-h));
  min-height: calc(4 * var(--row-h));
}

.entity-tiles__column-title {
  min-width: 0;
}

.entity-tiles__column-title > .ui-caps {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 0;
  row-gap: 0;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  height: auto;
  min-height: 100%;
  padding: 0;
  box-sizing: border-box;
  align-items: start;
  overflow: visible;
}

.entity-board--1 {
  grid-template-columns: minmax(0, 1fr);
}

.entity-board--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entity-board--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.entity-board > .entity-tiles {
  min-width: 0;
  min-height: 0;
  height: auto;
  min-height: 100%;
}

.entity-board > .entity-tiles + .entity-tiles {
  border-left: 1px solid var(--border-subtle);
}

.entity-board .entity-tiles--stack {
  overflow: visible;
}

.entity-board .entity-tiles--stack .entity-tiles__grid {
  overflow: visible;
  flex: none;
  gap: 0;
  padding: 0;
}

.entity-board .entity-tiles__cell {
  display: grid;
  grid-template-columns: var(--control-h) minmax(0, 1fr);
  align-items: start;
  column-gap: var(--space-2);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.entity-board .entity-tiles__grid > .entity-tiles__cell:last-child {
  border-bottom: none;
}

.entity-board__toggle,
.entity-board__toggle-spacer {
  width: var(--control-h);
  height: var(--control-h);
  min-width: var(--control-h);
  min-height: var(--control-h);
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.entity-board__toggle {
  cursor: pointer;
}

.entity-tiles__cell.is-collapsed {
  min-height: calc(var(--row-h) + 2 * var(--space-3));
}

.entity-tiles__cell.is-collapsed .entity-card--prior,
.entity-tiles__cell.is-collapsed .entity-tiles__slot {
  display: none;
}

.entity-tiles__cell.is-collapsed .entity-card:not(.entity-card--prior) {
  height: var(--row-h);
  min-height: var(--row-h);
  padding: 0 var(--space-3);
  gap: 0;
}

.entity-tiles__cell.is-collapsed .entity-card:not(.entity-card--prior) .entity-card__actions,
.entity-tiles__cell.is-collapsed .entity-card:not(.entity-card--prior) .entity-card__secondary,
.entity-tiles__cell.is-collapsed .entity-card:not(.entity-card--prior) .entity-card__details {
  display: none;
}

.entity-board .entity-tiles__column-title {
  position: sticky;
  top: 0;
  z-index: 1;
}

.entity-card--prior {
  opacity: 0.55;
}

.entity-card--prior.is-selected {
  opacity: 1;
}

.brand-home-body:has(> .entity-board) {
  overflow: auto;
}

.entity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  width: 1.1em;
  height: 1.1em;
  color: var(--entity-user);
  opacity: 0.95;
  /* Inline SVG baseline strut otherwise lifts the glyph above the row mid-line. */
  line-height: 0;
}

.entity-icon svg {
  display: block;
}

.entity-icon.has-src {
  opacity: 1;
}

.entity-icon__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.entity-icon--brand {
  color: color-mix(in srgb, var(--entity-brand) 40%, var(--text-muted));
}

.entity-icon--admin {
  color: color-mix(in srgb, var(--entity-admin) 40%, var(--text-muted));
}

.entity-icon--brand-admin {
  color: color-mix(in srgb, var(--entity-brand-admin) 40%, var(--text-muted));
}

.entity-icon--member {
  color: color-mix(in srgb, var(--entity-member) 40%, var(--text-muted));
}

.entity-icon--user {
  color: var(--entity-user);
}

.entity-icon--assessment {
  color: color-mix(in srgb, var(--entity-assessment) 40%, var(--text-muted));
}

.entity-icon--submitted-product {
  color: color-mix(in srgb, var(--entity-submitted-product) 40%, var(--text-muted));
}

.entity-icon--product {
  color: color-mix(in srgb, var(--entity-product) 40%, var(--text-muted));
}

.entity-icon--ingredient {
  color: color-mix(in srgb, var(--entity-ingredient) 40%, var(--text-muted));
}

.entity-icon--result {
  color: color-mix(in srgb, var(--entity-result) 40%, var(--text-muted));
}

.entity-icon--ok {
  color: var(--accent);
}

.entity-icon--request {
  color: color-mix(in srgb, var(--accent) 35%, var(--text-muted));
}

.entity-icon--certificate {
  color: color-mix(in srgb, var(--entity-certificate) 40%, var(--text-muted));
}

.entity-icon--agent {
  color: color-mix(in srgb, var(--accent) 55%, var(--text-muted));
}

.user-inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.users-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.brand-search-status {
  white-space: nowrap;
}

.hover-rename {
  min-width: 0;
  flex: 1;
}

.entity-row--header .hover-rename {
  min-width: 0;
  max-width: 100%;
}

.hover-rename-display {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.hover-rename-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hover-rename-hint {
  color: var(--text-muted);
  flex-shrink: 0;
}

.hover-rename-input {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  color: var(--text);
  font: inherit;
}

.brand-inspector .inspector-pane-body,
.brand-inspector-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  /* Bounded by the pane so long content (Info form) scrolls instead of clipping. */
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

/* Section tabs stay put while a long section scrolls under them. */
.brand-inspector-body > .nav-rail--horizontal {
  position: sticky;
  top: 0;
  z-index: 3;
  margin-bottom: 0;
}

.brand-inspector-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.brand-inspector-actions {
  display: flex;
  justify-content: flex-end;
}

.brand-inspector-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--list-pad-x);
}

/* EntityList already applies list gutters — don't double-pad. */
.brand-inspector-section:has(.entity-list) {
  padding: 0;
  /* Lists fill the pane and scroll themselves. */
  flex: 1 1 auto;
  min-height: 0;
}

/* Admin brand pane is narrow: one column. Order becomes logo, Business (fields,
   then address under Website), Marketing column 1, Marketing column 2. */
.brand-inspector .brand-business,
.brand-inspector .brand-info-columns {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: none;
  row-gap: var(--space-4);
}

.brand-inspector .brand-business__col {
  display: flex;
  flex-direction: column;
  grid-row: auto;
  gap: var(--space-4);
}

.brand-inspector-section h3 {
  margin: 0;
}

.brand-invite-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

.brand-invite-field {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.brand-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Legacy member chrome — layout lives on .entity-row--static */
.brand-member-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.brand-member-email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a.app-title {
  text-decoration: none;
  color: inherit;
}

a.btn.active {
  font-weight: 600;
}

/* StepCards — numbered process strip (static «how it works»). One ruled
   track; cells separated by the track colour showing through a 1px gap. */
.step-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  gap: 1px;
  background: var(--border-outer);
  border: 1px solid var(--border-outer);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Cards share the strip's four row tracks (head, fact, body, detail), so a
   two-line title or a missing fact line never knocks the rows out of line. */
.step-card {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: var(--space-2);
  align-content: start;
  padding: var(--space-4);
  background: var(--bg-elevated);
  min-width: 0;
}

.step-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.step-card__num {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: calc(6 * var(--u));
  height: calc(6 * var(--u));
  border-radius: 9999px;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-outer));
  color: var(--accent);
}

.step-card__num > * {
  color: inherit;
}

/* Price / duration — same body size, weight and accent carry it. */
.step-card__meta {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.step-card > p {
  text-wrap: pretty;
}

@media (max-width: 960px) {
  .step-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .step-card {
    display: flex;
    flex-direction: column;
    grid-row: auto;
    gap: var(--space-2);
  }

  .step-card__meta.is-empty {
    display: none;
  }
}

@media (max-width: 560px) {
  .step-cards {
    grid-template-columns: 1fr;
  }
}


/* Product card description grows to its text. The shared textarea stays a
   short scrolling box with a drag handle; this one does not. */
.confirm-field.is-multiline textarea#content-offering-description.confirm-field__control,
.confirm-field.is-multiline textarea#content-questionnaire-intro.confirm-field__control,
.confirm-field.is-multiline textarea[id^="content-questionnaire-field-"].confirm-field__control {
  field-sizing: content;
  max-height: none;
  resize: none;
  overflow-y: hidden;
}

/* Price row fills the inspector. The dropdown takes the spare width; the
   refresh control stays a square the same height, pinned to the right. */
.price-pick {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-width: 0;
}

.price-pick > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.price-pick > .btn-host {
  flex: 0 0 var(--row-h);
  width: var(--row-h);
  height: var(--row-h);
}

.price-pick .btn.icon {
  width: 100%;
  height: 100%;
  padding: 0;
}

/* Brand store. The cart lives on this pane only. */
.store-page {
  background: var(--bg);
}

/* Cards on the left, the order panel on the right (stacked when narrow). */
.store-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
}

.store-scroll {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

/* Never more than four cards across; a fifth starts the next row. */
.store-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(max(14rem, calc((100% - 3 * var(--space-4)) / 4)), 1fr)
  );
  gap: var(--space-4);
  padding: var(--space-4);
  align-items: stretch;
}

/* A titled section of the store: the intro sits on the left, wider than a
   form paragraph, short of the frame's right edge. Loose cards follow
   unframed, in the four-across grid. */
.store-line {
  margin: var(--space-4) var(--space-4) 0;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-inset);
}

/* Intro on the left; the optional picture sits in the top-right corner. */
.store-line__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-5) 0;
  text-align: left;
}

.store-line__intro {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

/* Pixel art: scale by whole pixels, never smooth. */
.store-line__picture {
  flex: none;
  width: 8.5rem;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  image-rendering: pixelated;
}

@media (max-width: 40rem) {
  .store-line__picture {
    display: none;
  }
}

.store-line__title,
.store-line__body,
.store-line__note {
  /* Paragraphs are capped at the form measure (400px). The intro needs a
     wider line, still short of the frame. */
  max-width: min(100%, 64rem);
}

.store-line__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: pretty;
}

.store-line__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  margin: 0;
}

.store-line__body p {
  max-width: none;
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  text-wrap: pretty;
}

.store-line__note {
  margin: 0;
  font-weight: 600;
  color: var(--accent-strong);
}

/* `--line-cols` is how many cards sit in one row. A short last row starts
   at the left, the same width as the row above. */
.store-line__cards {
  --line-cols: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.store-line__cards > .store-card {
  flex: 0 1 calc((100% - (var(--line-cols) - 1) * var(--space-4)) / var(--line-cols));
  max-width: calc((100% - (var(--line-cols) - 1) * var(--space-4)) / var(--line-cols));
  min-width: min(100%, 16rem);
}

.store-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

/* Full-bleed strip across the top of the card, inside its rounded corners. */
.store-card__media {
  margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-inset);
}

.store-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.store-card__title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-wrap: balance;
}

.store-card__price {
  margin: 0;
  margin-right: auto;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent-strong);
}

.store-card__subtitle {
  margin: 0;
  line-height: 1.5;
  text-wrap: pretty;
}

.store-card__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  color: var(--text);
}

.store-card__copy p {
  max-width: none;
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  text-wrap: pretty;
}

.store-card__subtitle,
.store-card__notes {
  color: var(--text-muted);
}

.store-card__includes {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.store-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.store-card__includes ul {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.store-card__includes li {
  line-height: 1.4;
}

.store-card__notes {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.store-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-2);
}

.store-qty {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.store-qty > span {
  min-width: 1.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.store-panel {
  --panel-tint: color-mix(in srgb, var(--accent) 12%, transparent);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
  overflow: auto;
  padding: var(--space-4);
}

.store-panel__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.store-panel__head-icon,
.store-panel__empty-icon {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--panel-tint);
  color: var(--accent-strong);
}

.store-panel__heading {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
}

.store-panel__count {
  margin-left: auto;
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: var(--panel-tint);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.store-panel__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.store-panel__empty-icon {
  width: 3rem;
  height: 3rem;
}

.store-panel__empty-title {
  margin: 0;
  font-weight: 600;
}

.store-panel__lines {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.store-panel__line {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.store-panel__line:first-child {
  padding-top: 0;
}

.store-panel__thumb {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--panel-tint);
  color: var(--accent-strong);
}

.store-panel__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.store-panel__line-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.store-panel__line-text p {
  max-width: none;
  margin: 0;
}

.store-panel__line-title {
  font-weight: 600;
  line-height: 1.3;
  text-wrap: pretty;
}

.store-panel__line-price {
  font-weight: 600;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.store-panel__line-problem {
  font-size: 0.85rem;
  color: var(--warning);
}

.store-panel__line-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.store-panel__qty {
  min-width: 1.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.store-panel__summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--panel-tint);
}

.store-panel__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.store-panel__row--total {
  padding-top: var(--space-2);
  border-top: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--text);
  font-weight: 600;
}

.store-panel__row--total strong {
  font-size: 1.35rem;
  color: var(--accent-strong);
}

.store-panel__terms {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.store-panel__terms-text {
  max-height: 14rem;
  overflow: auto;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.store-panel__terms-text p {
  max-width: none;
  margin: 0 0 var(--space-2);
  white-space: pre-wrap;
}

.store-panel__terms-title {
  font-weight: 600;
}

.store-panel__cta .btn-host,
.store-panel__cta .btn {
  width: 100%;
  justify-content: center;
}

.store-panel__assure,
.store-panel__next ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.store-panel__assure li,
.store-panel__next li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  line-height: 1.4;
}

.store-panel__assure-icon,
.store-panel__next-icon {
  flex: none;
  display: inline-grid;
  place-items: center;
  margin-top: 1px;
  color: var(--accent-strong);
}

.store-panel__next {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.store-panel__next-title {
  margin: 0 0 var(--space-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.store-panel__next-icon {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: -2px;
  border-radius: 999px;
  background: var(--panel-tint);
}

/* Store columns scroll on their own. */
.store-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.store-column--panel {
  border-left: 1px solid var(--border);
  background: var(--bg-elevated);
}

.store-column--panel > .store-panel {
  flex: 1 1 auto;
}

/* Purchase and questionnaire pages: one readable column that scrolls. */
.purchase-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: var(--space-4) var(--space-5, 1.5rem) var(--space-6, 2rem);
}

.purchase-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 46rem;
}

.purchase-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.purchase-head__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.purchase-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.purchase-section__label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.purchase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.purchase-row:last-child {
  border-bottom: 0;
}

.purchase-row__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.purchase-row__end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
}

.purchase-intro {
  margin: 0;
  white-space: pre-line;
  line-height: 1.55;
}

.purchase-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

/* Brand purchases: a row per purchase, then (behind the drag handle) the
   open purchase — overview on top, its questionnaire below. */
.purchases-page > .split-shell {
  flex: 1 1 auto;
  height: auto;
}

.purchase-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.purchase-overview {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

/* Each piece is as wide as its name and badge; the pieces wrap as a group. */
.purchase-pieces {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5, 1.5rem);
}

.purchase-piece {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
}

.response-answers {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) 0;
}

.response-answers__q {
  margin: var(--space-2) 0 0;
  font-weight: 600;
  color: var(--text);
}

.response-answers__a {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
}

.purchase-unit {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.purchase-unit.is-open {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.purchase-unit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The questionnaire fills its column (up to a comfortable line length);
   text and boxes follow the column, not the global 400px measure. */
.purchase-body.purchase-form {
  max-width: 64rem;
}

.purchase-form p,
.purchase-form .ui-paragraph,
.purchase-form .field-group,
.purchase-form .field,
.purchase-form .field > :not(.field-label) {
  max-width: none;
}

.purchase-form .field input,
.purchase-form .field textarea,
.purchase-form .confirm-field,
.purchase-form .multi-select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.purchase-form__title {
  margin: var(--space-2) 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.purchase-form .field-group {
  gap: var(--space-5, 1.5rem);
}

/* A question, then its clarifying line, then the box. */
.purchase-form .field-label {
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
}

.purchase-form .field-help {
  margin-top: calc(-1 * var(--space-1));
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.purchase-form .field-counter {
  align-self: flex-end;
  margin-top: calc(-1 * var(--space-1));
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

@media (max-width: 64rem) {
  .store-column--panel {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .store-layout {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .store-scroll {
    overflow: visible;
  }

  .store-panel {
    overflow: visible;
  }
}

/* Admin "view as" preview strip (read-only; nothing saved or sent). */
.view-as-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: var(--warn-bg, #fff3cd);
  color: var(--warn-text, #5c4400);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm, 0.85rem);
}

/* Questionnaire builder: each question is its own block. */
.q-block {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-inner);
}

.response-answers__status {
  margin-left: var(--space-2);
  padding: 0 var(--space-2);
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted, var(--text));
}

.response-answers__status--ok {
  color: var(--success, #1a7f5a);
}

.response-answers__status--wait {
  color: var(--caution, #a15c00);
}

.response-answers__files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
