/* Deals page-specific styles — not in shell.
   Built on QDS: every color, space, radius, type and motion value below
   references a --qds-* token (qds/foundation/). Raw values appear only
   where no token exists, each marked. Buttons, surfaces, fields, inputs,
   radio tiles, badges and the empty state come straight from
   qds/components/ — nothing here restyles them. The two patterns QDS does
   not have yet (step indicator, upload area) live here under the .deal-
   prefix so they can be promoted into qds/components/ later unchanged. */

/* ── Preview-only banner ─────────────────────────────────────── */
.deal-preview-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--qds-space-3);
  padding: var(--qds-space-3) var(--qds-space-4);
  margin-bottom: var(--qds-space-6);
  border: 1px solid rgba(245, 158, 11, 0.25); /* no --qds-* token for this alpha — warning tint, matches qds-badge--warning */
  border-radius: var(--qds-radius-lg);
  background: rgba(245, 158, 11, 0.08); /* no --qds-* token for this alpha */
  color: var(--qds-color-text-secondary);
  font-family: var(--qds-font-family-primary);
  font-size: var(--qds-text-body-sm-size);
  line-height: var(--qds-text-body-sm-line-height);
}
.deal-preview-banner__tag {
  flex-shrink: 0;
  font-family: var(--qds-font-family-mono);
  font-size: var(--qds-text-label-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qds-color-warning);
  padding-top: 2px; /* optical alignment with the body-sm line box */
}
/* display:flex above would otherwise override the hidden attribute (#deal-access with no notice) */
.deal-preview-banner[hidden] { display: none; }

/* ── List view ───────────────────────────────────────────────── */
.deal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* 280px: no token — smallest readable card width */
  gap: var(--qds-space-4);
}
/* display:grid above would otherwise override the hidden attribute. */
.deal-list[hidden] { display: none; }
.deal-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.deal-card__media {
  aspect-ratio: 4 / 3;
  background: var(--qds-color-surface-2);
  background-size: cover;
  background-position: center;
}
.deal-card__body { display: flex; flex-direction: column; gap: var(--qds-space-2); padding: var(--qds-space-4); flex: 1; }
.deal-card__badges { display: flex; flex-wrap: wrap; gap: var(--qds-space-2); }
.deal-card__title {
  font-family: var(--qds-text-card-title-family);
  font-size: var(--qds-text-card-title-size);
  line-height: var(--qds-text-card-title-line-height);
  font-weight: var(--qds-text-card-title-weight);
  color: var(--qds-color-text-primary);
  overflow-wrap: anywhere;
}
.deal-card__offer { font-size: var(--qds-text-body-sm-size); color: var(--qds-color-brand-hover); overflow-wrap: anywhere; }
.deal-card__meta {
  font-family: var(--qds-font-family-mono);
  font-size: var(--qds-text-caption-size);
  color: var(--qds-color-text-muted);
}
.deal-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--qds-space-2);
  padding: var(--qds-space-3) var(--qds-space-4);
  border-top: 1px solid var(--qds-color-border-subtle);
}

/* ── Builder header ──────────────────────────────────────────── */
.deal-back { margin-bottom: var(--qds-space-4); }
.deal-builder-head { display: flex; align-items: center; gap: var(--qds-space-3); flex-wrap: wrap; }

/* ── Step indicator (no QDS component yet) ───────────────────── */
.deal-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--qds-space-2);
  margin: 0 0 var(--qds-space-6);
  padding: 0;
  list-style: none;
}
.deal-step {
  display: flex;
  align-items: center;
  gap: var(--qds-space-2);
  width: 100%;
  min-height: var(--qds-touch-target-min);
  padding: var(--qds-space-2) var(--qds-space-3);
  border: 1px solid var(--qds-color-border-subtle);
  border-radius: var(--qds-radius-lg);
  background: var(--qds-color-surface-1);
  color: var(--qds-color-text-muted);
  font-family: var(--qds-font-family-primary);
  font-size: var(--qds-text-body-sm-size);
  font-weight: var(--qds-font-weight-semibold);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--qds-duration-standard) var(--qds-easing-standard),
              background var(--qds-duration-standard) var(--qds-easing-standard),
              color var(--qds-duration-standard) var(--qds-easing-standard);
}
.deal-step:focus-visible { outline: none; box-shadow: var(--qds-elevation-focus); }
.deal-step:disabled { cursor: not-allowed; color: var(--qds-color-disabled); }
.deal-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--qds-space-6);
  height: var(--qds-space-6);
  border-radius: var(--qds-radius-full);
  background: var(--qds-color-surface-3);
  font-family: var(--qds-font-family-mono);
  font-size: var(--qds-text-label-size);
}
.deal-step__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-step[aria-current="step"] {
  border-color: var(--qds-color-brand-primary);
  background: var(--qds-color-selected-surface);
  color: var(--qds-color-text-primary);
}
.deal-step[aria-current="step"] .deal-step__num { background: var(--qds-color-brand-primary); color: var(--qds-color-text-inverse); }
.deal-step--done { color: var(--qds-color-text-secondary); }
.deal-step--done .deal-step__num { background: rgba(34, 197, 94, 0.16); color: var(--qds-color-success); } /* alpha: no token, matches qds-badge--success family */

/* ── Builder layout: form + live preview ─────────────────────── */
.deal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px; /* 300px: no token — phone-width preview column */
  gap: var(--qds-space-6);
  align-items: start;
}
.deal-form { display: flex; flex-direction: column; gap: var(--qds-space-5); min-width: 0; }
.deal-panel[hidden] { display: none; }
.deal-panel { display: flex; flex-direction: column; gap: var(--qds-space-5); }
.deal-panel__title {
  font-family: 'Space Grotesk', sans-serif; /* same heading family as .qds-page-title — QDS has no heading-family token */
  font-size: var(--qds-text-card-title-size);
  font-weight: var(--qds-font-weight-bold);
  color: var(--qds-color-text-primary);
}
.deal-panel__lead { margin-top: var(--qds-space-1); font-size: var(--qds-text-body-sm-size); color: var(--qds-color-text-muted); }
.deal-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--qds-space-4); }
.deal-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--qds-space-3); }
.deal-type-grid .qds-radio--tile { width: 100%; min-width: 0; }
.deal-type-example { display: block; margin-top: var(--qds-space-1); font-size: var(--qds-text-caption-size); color: var(--qds-color-text-muted); font-weight: var(--qds-font-weight-regular); }
.deal-nav { display: flex; justify-content: space-between; gap: var(--qds-space-3); flex-wrap: wrap; padding-top: var(--qds-space-2); }
.deal-nav__end { display: flex; gap: var(--qds-space-3); flex-wrap: wrap; margin-left: auto; }

/* ── Image step ──────────────────────────────────────────────── */
.deal-tabs { display: flex; gap: var(--qds-space-2); flex-wrap: wrap; }
.deal-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--qds-space-3); }
.deal-swatch {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 2px solid transparent;
  border-radius: var(--qds-radius-lg);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: transform var(--qds-duration-fast) var(--qds-easing-standard), border-color var(--qds-duration-standard) var(--qds-easing-standard);
}
.deal-swatch:hover { transform: translateY(var(--qds-hover-lift)); }
.deal-swatch:focus-visible { outline: none; box-shadow: var(--qds-elevation-focus); }
.deal-swatch[aria-pressed="true"] { border-color: var(--qds-color-brand-primary); }
.deal-swatch__name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--qds-space-1) var(--qds-space-2);
  background: var(--qds-color-overlay);
  color: var(--qds-color-text-primary);
  font-family: var(--qds-font-family-primary);
  font-size: var(--qds-text-caption-size);
  text-align: left;
}
.deal-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--qds-space-2);
  padding: var(--qds-space-8) var(--qds-space-4);
  border: 1px dashed var(--qds-color-border-default);
  border-radius: var(--qds-radius-lg);
  background: var(--qds-color-surface-1);
  color: var(--qds-color-text-secondary);
  font-size: var(--qds-text-body-sm-size);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--qds-duration-standard) var(--qds-easing-standard), background var(--qds-duration-standard) var(--qds-easing-standard);
}
.deal-upload:hover, .deal-upload--over { border-color: var(--qds-color-brand-primary); background: var(--qds-color-selected-surface); }
.deal-upload:focus-within { box-shadow: var(--qds-elevation-focus); }
.deal-upload__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.deal-upload__hint { font-size: var(--qds-text-caption-size); color: var(--qds-color-text-muted); }
.deal-image-current { display: flex; align-items: center; gap: var(--qds-space-4); flex-wrap: wrap; }
.deal-image-current__thumb {
  width: 160px; /* no token — thumbnail width */
  aspect-ratio: 4 / 3;
  border-radius: var(--qds-radius-md);
  border: 1px solid var(--qds-color-border-subtle);
  background: var(--qds-color-surface-2);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.deal-image-current__info { display: flex; flex-direction: column; gap: var(--qds-space-2); min-width: 0; font-size: var(--qds-text-body-sm-size); color: var(--qds-color-text-secondary); overflow-wrap: anywhere; }

/* ── Schedule + review ───────────────────────────────────────── */
.deal-summary-line {
  padding: var(--qds-space-3) var(--qds-space-4);
  border-radius: var(--qds-radius-md);
  background: var(--qds-color-surface-2);
  color: var(--qds-color-text-secondary);
  font-size: var(--qds-text-body-sm-size);
}
.deal-review { display: flex; flex-direction: column; }
.deal-review__row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto; /* 140px: no token — label column */
  gap: var(--qds-space-3);
  align-items: start;
  padding: var(--qds-space-3) 0;
  border-bottom: 1px solid var(--qds-color-border-subtle);
}
.deal-review__row:last-child { border-bottom: 0; }
.deal-review__label {
  font-family: var(--qds-font-family-mono);
  font-size: var(--qds-text-label-size);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--qds-color-text-muted);
  padding-top: 2px; /* optical alignment */
}
.deal-review__value { color: var(--qds-color-text-primary); font-size: var(--qds-text-body-sm-size); overflow-wrap: anywhere; }
.deal-review__value--empty { color: var(--qds-color-text-muted); }
.deal-issues { margin: 0; padding-left: var(--qds-space-5); color: var(--qds-color-danger); font-size: var(--qds-text-body-sm-size); }
.deal-note {
  padding: var(--qds-space-3) var(--qds-space-4);
  border: 1px solid var(--qds-color-border-subtle);
  border-radius: var(--qds-radius-md);
  color: var(--qds-color-text-muted);
  font-size: var(--qds-text-caption-size);
  line-height: var(--qds-text-body-sm-line-height);
}

/* ── Live preview ────────────────────────────────────────────── */
.deal-preview { position: sticky; top: var(--qds-space-6); display: flex; flex-direction: column; gap: var(--qds-space-3); min-width: 0; }
.deal-preview__label {
  font-family: var(--qds-font-family-mono);
  font-size: var(--qds-text-label-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qds-color-text-muted);
}
.deal-phone {
  padding: var(--qds-space-3);
  border: 1px solid var(--qds-color-border-default);
  border-radius: 28px; /* no token — device corner, larger than --qds-radius-xl */
  background: var(--qds-color-background);
  box-shadow: var(--qds-elevation-lg);
}
.deal-phone__page { font-size: var(--qds-text-caption-size); color: var(--qds-color-text-muted); text-align: center; padding: var(--qds-space-2) 0 var(--qds-space-3); }
.deal-pv {
  overflow: hidden;
  border: 1px solid var(--qds-color-border-subtle);
  border-radius: var(--qds-radius-xl);
  background: var(--qds-color-surface-1);
}
.deal-pv__media { position: relative; aspect-ratio: 4 / 3; background: var(--qds-color-surface-2); background-size: cover; background-position: center; }
.deal-pv__media--empty { display: flex; align-items: center; justify-content: center; color: var(--qds-color-text-muted); font-size: var(--qds-text-caption-size); }
.deal-pv__chip {
  position: absolute; top: var(--qds-space-3); left: var(--qds-space-3);
  max-width: calc(100% - var(--qds-space-6));
  padding: var(--qds-space-1) var(--qds-space-3);
  border-radius: var(--qds-radius-full);
  background: var(--qds-color-brand-primary);
  color: var(--qds-color-text-inverse);
  font-family: var(--qds-font-family-primary);
  font-size: var(--qds-text-label-size);
  font-weight: var(--qds-font-weight-bold);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.deal-pv__body { display: flex; flex-direction: column; gap: var(--qds-space-2); padding: var(--qds-space-4); }
.deal-pv__title { font-family: 'Space Grotesk', sans-serif; font-size: var(--qds-text-card-title-size); font-weight: var(--qds-font-weight-bold); color: var(--qds-color-text-primary); overflow-wrap: anywhere; }
.deal-pv__offer { font-size: var(--qds-text-body-size); font-weight: var(--qds-font-weight-semibold); color: var(--qds-color-brand-hover); overflow-wrap: anywhere; }
.deal-pv__desc { font-size: var(--qds-text-body-sm-size); line-height: var(--qds-text-body-sm-line-height); color: var(--qds-color-text-secondary); overflow-wrap: anywhere; white-space: pre-line; }
.deal-pv__valid { font-family: var(--qds-font-family-mono); font-size: var(--qds-text-caption-size); color: var(--qds-color-text-muted); }
.deal-pv--placeholder .deal-pv__title, .deal-pv--placeholder .deal-pv__offer { color: var(--qds-color-text-muted); }
.deal-preview__note { font-size: var(--qds-text-caption-size); color: var(--qds-color-text-muted); line-height: var(--qds-text-body-sm-line-height); }

/* ── Review: where the deal appears (js/deal-page-picker.js) ────── */
.deal-pages { display: flex; flex-direction: column; gap: var(--qds-space-3); padding-top: var(--qds-space-4); border-top: 1px solid var(--qds-color-border-subtle); }
.deal-pages__head { display: flex; flex-direction: column; gap: var(--qds-space-1); }
.deal-pages__title { margin: 0; font-size: var(--qds-text-body-size); font-weight: var(--qds-font-weight-semibold); }
.deal-pages__lead, .deal-pages__status { margin: 0; font-size: var(--qds-text-caption-size); color: var(--qds-color-text-muted); }
.deal-pages__status:empty { display: none; }
.deal-pages__tools { display: flex; flex-wrap: wrap; gap: var(--qds-space-2); }
.deal-pages__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--qds-space-2); }
.deal-page__row {
  display: flex; align-items: center; gap: var(--qds-space-3);
  padding: var(--qds-space-3); border: 1px solid var(--qds-color-border-subtle); border-radius: var(--qds-radius-md);
  background: var(--qds-color-surface-1); cursor: pointer;
}
.deal-page__check { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--qds-color-brand-primary); } /* 18px: no token — checkbox size */
.deal-page__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.deal-page__name { font-weight: var(--qds-font-weight-semibold); overflow-wrap: anywhere; }
.deal-page__slug { font-family: var(--qds-font-family-mono); font-size: var(--qds-text-caption-size); color: var(--qds-color-text-muted); overflow-wrap: anywhere; }
.deal-page--off .deal-page__row { cursor: default; opacity: 0.6; }
.deal-page__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--qds-space-2); padding: var(--qds-space-2) var(--qds-space-3) 0; }
.deal-page__hint { font-size: var(--qds-text-caption-size); color: var(--qds-color-text-muted); overflow-wrap: anywhere; flex: 1 1 200px; }
/* Deal links: copy the public offers / deal link, view the owner preview (deals.html dealLinkHtml) */
.deal-link { display: flex; flex-direction: column; gap: var(--qds-space-1); padding: var(--qds-space-2) var(--qds-space-3) 0; }
.deal-card__body .deal-link { padding: var(--qds-space-2) 0 0; }
.deal-link__page { font-size: var(--qds-text-caption-size); font-weight: var(--qds-font-weight-semibold); color: var(--qds-color-text-secondary); overflow-wrap: anywhere; }
.deal-link__actions { display: flex; flex-wrap: wrap; gap: var(--qds-space-2); }
.deal-link__hint { font-size: var(--qds-text-caption-size); color: var(--qds-color-text-muted); overflow-wrap: anywhere; }
@media (max-width: 480px) { .deal-link__actions .qds-btn { flex: 1 1 100%; justify-content: center; } }

/* ── Step 2: formats preview (js/deal-image-formats.js). Tile shapes come from
   the format itself (inline aspect-ratio); the deal's own image boxes above
   are not changed. ─────────────────────────────────────────────── */
.deal-formats { display: flex; flex-direction: column; gap: var(--qds-space-2); }
.deal-formats__head { display: flex; flex-direction: column; gap: var(--qds-space-1); }
.deal-formats__title { font-weight: var(--qds-font-weight-semibold); }
.deal-formats__lead, .deal-formats__note { margin: 0; font-size: var(--qds-text-caption-size); color: var(--qds-color-text-muted); }
.deal-formats__grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--qds-space-3); }
/* As wide as its picture: captions wrap underneath instead of stretching the tile. */
.deal-format { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--qds-space-1); width: min-content; }
.deal-format__frame {
  position: relative;
  height: 124px; /* 124px: no token — four tiles fit one row beside the phone preview */
  overflow: hidden;
  border-radius: var(--qds-radius-md);
  border: 1px solid var(--qds-color-border-subtle);
  background: var(--qds-color-surface-2);
}
.deal-format__img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; }
.deal-format__img--contain { object-fit: contain; }
.deal-format__blur { position: absolute; inset: -12px; background-size: cover; background-position: center; filter: blur(12px) brightness(0.65); }
.deal-format__frame.is-broken .deal-format__img, .deal-format__frame.is-broken .deal-format__blur { visibility: hidden; }
/* The AI label stays complete on narrow tiles: it may wrap, it is never cut off. */
.deal-format__frame .deal-ai-label { left: var(--qds-space-1); bottom: var(--qds-space-1); max-width: calc(100% - var(--qds-space-2)); padding: 1px var(--qds-space-1); border-radius: var(--qds-radius-md); font-size: 0.5625rem; white-space: normal; } /* 9px: no token — fits the 59 px Story tile on a phone */
.deal-format__caption { display: flex; flex-direction: column; gap: 2px; font-size: var(--qds-text-caption-size); line-height: 1.3; }
.deal-format__name { font-weight: var(--qds-font-weight-semibold); color: var(--qds-color-text-secondary); }
.deal-format__size { font-family: var(--qds-font-family-mono); color: var(--qds-color-text-muted); white-space: nowrap; }
.deal-format__status { color: var(--qds-color-text-secondary); }
.deal-format__status--optimal::before { content: '\2713\00a0'; }
.deal-format__status--warn { color: var(--qds-color-warning); font-weight: var(--qds-font-weight-semibold); }
@media (max-width: 768px) { /* --qds-breakpoint-tablet */
  .deal-formats__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: start; }
  .deal-format__frame { height: 104px; } /* 104px: no token — two tiles side by side on a phone */
}

/* ── Responsive (see qds/foundation/breakpoints.css; values hard-coded
   because custom properties are not valid inside @media) ─────── */
@media (max-width: 1024px) { /* --qds-breakpoint-desktop */
  .deal-layout { grid-template-columns: 1fr; }
  .deal-preview { position: static; max-width: 360px; width: 100%; margin: 0 auto; } /* 360px = --qds-breakpoint-small-mobile */
}
@media (max-width: 768px) { /* --qds-breakpoint-tablet */
  .deal-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deal-step__label { display: none; }
  .deal-step { justify-content: center; padding: var(--qds-space-2); }
  .deal-step[aria-current="step"] .deal-step__label { display: inline; }
  .deal-steps { grid-template-columns: repeat(4, auto); justify-content: start; }
  .deal-step[aria-current="step"] { padding: var(--qds-space-2) var(--qds-space-3); }
}
@media (max-width: 480px) { /* --qds-breakpoint-mobile */
  .deal-row { grid-template-columns: 1fr; }
  .deal-swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deal-review__row { grid-template-columns: 1fr auto; }
  .deal-review__label { grid-column: 1 / -1; }
  .deal-nav .qds-btn, .deal-nav__end { flex: 1 1 auto; }
  .deal-nav__end .qds-btn { flex: 1 1 auto; }
}

/* Step headings receive focus from script when a step opens (so screen
   readers announce it); they are not tab stops, so no visible ring. */
.deal-panel__title:focus { outline: none; }

/* ── Starter-image gallery ───────────────────────────────────── */
.deal-starter-gallery { display: flex; flex-direction: column; gap: var(--qds-space-5); margin-bottom: var(--qds-space-4); }
.deal-starter-cat__title {
  margin: 0 0 var(--qds-space-2);
  font-family: var(--qds-font-family-mono);
  font-size: var(--qds-text-label-size);
  font-weight: var(--qds-font-weight-regular);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qds-color-text-muted);
}
.deal-starters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--qds-space-3); }
.deal-starter {
  display: flex;
  flex-direction: column;
  gap: var(--qds-space-2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--qds-color-text-secondary);
  font-family: var(--qds-font-family-primary);
  font-size: var(--qds-text-caption-size);
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.deal-starter__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: var(--qds-radius-lg);
  background: var(--qds-color-surface-2);
  transition: transform var(--qds-duration-fast) var(--qds-easing-standard), border-color var(--qds-duration-standard) var(--qds-easing-standard);
}
.deal-starter__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.deal-starter:hover .deal-starter__media { transform: translateY(var(--qds-hover-lift)); }
.deal-starter:focus-visible { outline: none; }
.deal-starter:focus-visible .deal-starter__media { box-shadow: var(--qds-elevation-focus); }
.deal-starter[aria-pressed="true"] .deal-starter__media { border-color: var(--qds-color-brand-primary); }
.deal-starter[aria-pressed="true"] { color: var(--qds-color-text-primary); }
.deal-starter__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── "AI · KI-generiert" label (EU AI Act Art. 50) ──────────────
   Shown on every AI-generated image, wherever it appears: gallery
   thumbnail, selected image, live preview, deal card. An overlay only --
   the image file itself is never altered. Same wording and shape as the
   approved homepage label; bottom-left so it never collides with the
   offer chip (top-left). */
.deal-ai-label {
  position: absolute;
  left: var(--qds-space-2);
  bottom: var(--qds-space-2);
  z-index: 1;
  max-width: calc(100% - var(--qds-space-4));
  padding: 2px var(--qds-space-2); /* 2px: no token below --qds-space-1 */
  border-radius: var(--qds-radius-full);
  background: var(--qds-color-overlay);
  color: var(--qds-color-text-primary);
  font-family: var(--qds-font-family-primary);
  font-size: 0.6875rem; /* 11px: no token — same size as the approved homepage label */
  font-weight: var(--qds-font-weight-semibold);
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}
.deal-ai-label[hidden] { display: none; }
.deal-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.deal-card__media, .deal-image-current__thumb { position: relative; }

@media (max-width: 480px) { /* --qds-breakpoint-mobile */
  .deal-starters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.deal-summary-line[hidden] { display: none; }

/* ── Saving, loading and error states (Phase C1) ─────────────── */
.deal-alert {
  padding: var(--qds-space-3) var(--qds-space-4);
  border: 1px solid var(--qds-color-danger);
  border-radius: var(--qds-radius-md);
  background: rgba(239, 68, 68, 0.08); /* no --qds-* token for this alpha — danger tint */
  color: var(--qds-color-text-primary);
  font-size: var(--qds-text-body-sm-size);
  line-height: var(--qds-text-body-sm-line-height);
  overflow-wrap: anywhere;
}
.deal-alert[hidden], .deal-note[hidden] { display: none; }
.deal-card-skeleton { aspect-ratio: 4 / 5; min-height: 240px; } /* 240px: no token — roughly one deal card */
.deal-upload__status { margin-top: var(--qds-space-2); font-size: var(--qds-text-caption-size); color: var(--qds-color-text-secondary); }
.deal-upload__status[hidden] { display: none; }
.deal-upload--busy { opacity: 0.6; cursor: progress; }
.deal-busy .deal-step, .deal-busy .deal-starter, .deal-busy .deal-swatch { cursor: progress; }

/* ── Deals access notice and usage (GET /deals/access) ───────── */
.deal-access-usage { margin: 0 0 var(--qds-space-4); }
.deal-access__billing { color: var(--qds-color-brand-primary); font-weight: 600; white-space: nowrap; }

/* ── Archive confirmation (#deal-archive-dialog) ────────────── */
.deal-confirm { margin: auto; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: var(--qds-space-6); border: 1px solid var(--qds-color-border-subtle); border-radius: var(--qds-radius-lg); background: var(--qds-color-surface-1); color: var(--qds-color-text-primary); font-family: var(--qds-font-family-primary); }
.deal-confirm::backdrop { background: rgba(0, 0, 0, .5); }
.deal-confirm__title { margin: 0 0 var(--qds-space-3); font-size: 18px; font-weight: var(--qds-font-weight-semibold); }
.deal-confirm__deal { margin: 0 0 var(--qds-space-3); font-weight: var(--qds-font-weight-semibold); overflow-wrap: anywhere; }
.deal-confirm__msg { margin: 0 0 var(--qds-space-5); color: var(--qds-color-text-secondary); font-size: var(--qds-text-body-sm-size); line-height: var(--qds-text-body-sm-line-height); }
.deal-confirm__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--qds-space-2); }
@media (max-width: 480px) { .deal-confirm__actions { flex-direction: column; } .deal-confirm__actions .qds-btn { width: 100%; } }
