/* Market body from the approved 390-point artboards. The shell owns outer rails
   and the page gutter; only the body uses these styles. */
.buyer-market { padding-block-start: 16px; }
[data-sticky-navigation] > .buyer-market { padding-block-start: 0; }
.buyer-market-switch {
  display: inline-flex;
  flex-wrap: wrap;
  max-inline-size: 100%;
  padding: 4px;
  gap: 2px;
  border-radius: 15px;
  background: var(--buyer-inset, #e7ddcb);
}
.buyer-market-switch .buyer-market-mode {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 3px 9px;
  min-block-size: 36px;
  min-inline-size: 100px;
  border-radius: 12px;
  background: none;
  color: var(--buyer-muted, #53564b);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 400;
  white-space: nowrap;
}
.buyer-market-mode::after { content: ""; position: absolute; inset: -4px 0; }
.buyer-market-switch .buyer-market-mode[aria-checked="true"] {
  background: var(--buyer-tool, #f3ecdf);
  color: var(--buyer-blue);
  font-weight: 600;
}
.buyer-market-switch .buyer-market-mode:disabled { color: var(--buyer-muted, #53564b); background: none; opacity: .7; }
.buyer-market-mode svg { inline-size: 16px; block-size: 16px; flex: none; }
.buyer-market-count {
  display: inline-grid;
  place-items: center;
  min-inline-size: 21px;
  min-block-size: 20px;
  border-radius: 999px;
  padding-inline: 4px;
  background: var(--buyer-tool, #f3ecdf);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.buyer-market-mode[aria-checked="true"] .buyer-market-count { background: var(--buyer-paper, #f0e9dd); }
.buyer-market-group { margin-block-start: 19px; }
.buyer-market-group + .buyer-market-group { margin-block-start: 16px; }
.buyer-market-group-title {
  margin: 0 3px 9px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--buyer-ink, #242821);
  overflow-wrap: anywhere;
}
.buyer-market-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  min-block-size: 66px;
  border-radius: 15px;
  padding: 10px 16px;
  background: var(--buyer-option, #f9f4e9);
  color: var(--buyer-ink, #242821);
  text-align: start;
  text-decoration: none;
}
.buyer-market-card + .buyer-market-card { margin-block-start: 8px; }
.buyer-market-card-copy { display: grid; gap: 2px; min-inline-size: 0; overflow-wrap: anywhere; }
.buyer-market-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.buyer-market-card-meta { font-size: 12px; line-height: 1.45; color: var(--buyer-muted, #53564b); }
.buyer-market-open {
  inline-size: 14px;
  block-size: 14px;
  color: var(--buyer-muted, #53564b);
}
.buyer-market-open:dir(ltr) { scale: -1 1; }
.buyer-market-card:focus-visible, .buyer-market-quick:focus-visible {
  outline: 2px solid var(--buyer-blue);
  outline-offset: 2px;
}
.buyer-market-status {
  display: grid;
  justify-items: center;
  gap: 7px;
  margin-block-start: 40px;
  text-align: center;
  color: var(--buyer-ink, #242821);
}
.buyer-market-status-copy { display: grid; justify-items: center; gap: 6px; }
.buyer-market-status-copy svg { inline-size: 21px; block-size: 21px; color: var(--buyer-muted, #53564b); }
.buyer-market-status p { margin: 0; font-size: 16px; font-weight: 600; }
/* The new-price reference sits above the list; an unpriced ad names why in the price's place.
   Our stone badge (owner 2026-11-29: «بدجنا المعروف اللي خلفية حجرية فقط بدون حدود… ولا تكون لاصقة بالتابات
   اللي اعلى منها»): the request text's stone, no border, clear of the tabs above. */
.buyer-market-reference {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 14px 0 12px; padding: 11px 14px; border: 0; border-radius: 12px;
  background: var(--buyer-inset, #e7ddcb); color: var(--buyer-ink, #242821);
}
.buyer-market-reference-label { font-size: 13px; font-weight: 600; color: var(--buyer-muted, #53564b); }
.buyer-market-reference-value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Results enter one by one; the next ones keep a place below them: the line, then Abeely's
   moving lines centred beneath it, as in every wait. */
.buyer-market-incoming {
  display: grid;
  justify-items: center;
  margin-block-start: 8px;
  padding: 16px 14px 12px;
  border-radius: 15px;
  background: var(--buyer-tool, #f3ecdf);
  text-align: center;
}
.buyer-market-incoming-line { display: grid; justify-items: center; gap: 8px; }
.buyer-market-incoming-line p { margin: 0; font-size: 15px; font-weight: 600; color: var(--buyer-muted, #53564b); }
.buyer-market-incoming-line > .buyer-wait-mark[data-brand-wait] { position: relative; display: block; flex: none; inline-size: 48px; block-size: 44px; }
.buyer-market-incoming-line > .buyer-wait-mark > [data-brand-live] { inline-size: 100%; block-size: 100%; background: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .buyer-market [data-arrive] { --buyer-pop-lift: 12px; animation: buyer-pop-in 300ms var(--buyer-ease, ease-out) both; }
}
.buyer-market .buyer-market-quick {
  border: 0;
  min-block-size: 44px;
  margin-block-start: 8px;
  border-radius: 13px;
  padding: 0 12px;
  background: var(--buyer-option, #f9f4e9);
  color: var(--buyer-blue);
  font-size: 13px;
  font-weight: 600;
}
@media (max-width: 330px) {
  .buyer-market-switch .buyer-market-mode { min-inline-size: 91px; gap: 5px; padding-inline: 6px; }
}

/* The product, not the external link, is the primary object. Sparse listings take no image space. */
.buyer-product {
  min-inline-size: 0; padding: 12px 14px 3px; border-radius: 15px;
  background: var(--buyer-tool,#f3ecdf); color: var(--buyer-ink,#242821); text-align: start;
}
.buyer-product + .buyer-product { margin-block-start: 8px; }
.buyer-product-top { display: flex; align-items: flex-start; gap: 12px; }
.buyer-product-top .buyer-market-card-copy { flex: 1 1 0; }
.buyer-product .buyer-market-card-title { line-height: 1.55; unicode-bidi: plaintext; }
.buyer-product-thumb { flex: none; inline-size: 60px; block-size: 68px; border-radius: 10px; object-fit: contain; background: #fff; }
.buyer-product-byline,.buyer-product-footer { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 9px; }
.buyer-product-byline,.buyer-product-observed,.buyer-product-fields dt { color: var(--buyer-muted,#53564b); font-size: 12px; line-height: 1.65; }
.buyer-product-price { color: var(--buyer-ink,#242821); font-size: 15px; font-weight: 600; }
.buyer-product-fields { display: grid; gap: 2px; margin: 4px 0 0; }
.buyer-product-fields>div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.buyer-product-fields dd { margin: 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.buyer-product-footer { align-items: center; margin-block-start: 3px; gap: 0 10px; }
.buyer-product-source,.buyer-market .buyer-product-toggle {
  display: inline-flex; align-items: center; gap: .35em; min-block-size: 44px; padding: .25em .65em;
  border: 0; border-radius: 10px; background: transparent; color: var(--buyer-action-ink,#4c3a2a);
  text-decoration: none; font: inherit; font-size: .875rem; font-weight: 600;
}
.buyer-product-source { margin-inline-start: auto; color: var(--buyer-blue); background: var(--buyer-inset,#e7ddcb); }
@media (hover:hover) and (pointer:fine) {
  .buyer-product-source:hover,.buyer-market .buyer-product-toggle:hover { background: var(--buyer-inset,#e7ddcb); }
}
.buyer-product-source:active,.buyer-market .buyer-product-toggle:is(:active,[aria-expanded=true]) { background: var(--buyer-line,#d6ccbc); }
.buyer-product-source svg,.buyer-product-toggle svg { inline-size: 13px; block-size: 13px; flex: none; }
.buyer-product-source svg:dir(ltr) { scale: -1 1; }
.buyer-product-source:focus-visible,.buyer-market .buyer-product-toggle:focus-visible,.buyer-product-scroll:focus-visible {
  outline: 2px solid var(--buyer-blue); outline-offset: 2px;
}
.buyer-product-reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 180ms cubic-bezier(.2,.8,.2,1); }
.buyer-product-reveal[data-open="true"] { grid-template-rows: 1fr; }
.buyer-product-clip { overflow: hidden; min-block-size: 0; }
.buyer-product-scroll { margin-block-start: 5px; padding: 4px 2px; max-block-size: min(34vh,15rem); overflow-y: auto; overscroll-behavior-y: contain; }
.buyer-product-description { margin: 4px 0 0; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.buyer-product-toggle svg { transition: transform 180ms ease; }
.buyer-product-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.buyer-market-assessment { margin-block-start: 8px; padding-block-start: 8px; border-block-start: 1px solid var(--buyer-line, #d9d3c9); }
.buyer-market-condition-state { margin: 0; font-size: 13px; font-weight: 650; }
.buyer-market-condition-muted { color: var(--buyer-muted, #53564b); font-weight: 400; line-height: 1.55; }
.buyer-market-condition-known { margin: 2px 0; font-size: 12px; line-height: 1.65; }
.buyer-market-gaps { margin-block: 3px 7px; padding-inline-start: 1.15em; font-size: 13px; line-height: 1.55; }
.buyer-market-scope { display: grid; gap: 3px; font-size: 12px; line-height: 1.55; }
.buyer-market-scope-price { display: block; font-weight: 650; }
.buyer-market-evidence>summary, .buyer-market-compare>summary {
  min-block-size: 44px; align-content: center; padding-inline: .65em; border-radius: 10px; color: var(--buyer-action-ink,#4c3a2a);
  cursor: pointer; font-size: .875rem;
}
.buyer-market-evidence[open]>summary,.buyer-market-compare[open]>summary { background: var(--buyer-inset,#e7ddcb); }
.buyer-market-evidence>summary:focus-visible, .buyer-market-compare :is(summary,select):focus-visible {
  outline: 2px solid var(--buyer-blue); outline-offset: 2px;
}
.buyer-market-condition-list { margin-block: 3px 8px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 5px 8px; font-size: 12px; }
.buyer-market-condition-list dd { margin: 0; }
.buyer-market-condition-list :is(dt,dd) { overflow-wrap: anywhere; }
.buyer-market-condition-list small { display: block; }
.buyer-market-unmatched-original {
  margin: 10px 0 14px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 14px;
}
.buyer-market-unmatched .buyer-market-condition-list { font-size: 13px; }
.buyer-market-compare { border-block-end: 1px solid var(--buyer-line, #d9d3c9); margin-block: 6px 10px; }
.buyer-market-compare-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-block-end: 8px; }
.buyer-market-compare-fields label { min-inline-size: 0; display: grid; gap: 3px; font-size: 12px; }
.buyer-market-compare-fields select {
  inline-size: 100%; min-block-size: 44px; background: var(--buyer-tool, #f3ecdf);
  border: 1px solid var(--buyer-line, #d9d3c9); color: var(--buyer-ink, #242821); border-radius: 5px; font: inherit;
}
.buyer-market-comparison table { table-layout: fixed; border-collapse: collapse; inline-size: 100%; margin-block-end: 10px; font-size: 12px; }
.buyer-market-comparison caption { text-align: start; background: var(--buyer-tool, #f3ecdf); padding: 6px; font-weight: 650; }
.buyer-market-comparison :is(th, td) {
  text-align: start; vertical-align: top; padding: 5px 4px; overflow-wrap: anywhere; border-block-end: 1px solid var(--buyer-line, #d9d3c9);
}
@media (prefers-reduced-motion:reduce) {
  .buyer-product-reveal,.buyer-product-toggle svg { transition: none; }
}

/* A grounded card reads short: title, price, one gap, its sources. The
   provider's lines stay whole, as authored, behind the product rows' «التفاصيل». */
.buyer-grounded { margin-block-start: 8px; min-inline-size: 0; }
.buyer-grounded-results { display: grid; gap: 10px; min-inline-size: 0; }
.buyer-grounded-card {
  min-inline-size: 0; padding: 12px 14px 3px; border-radius: 15px;
  background: var(--buyer-option,#f9f4e9); color: var(--buyer-ink,#242821);
}
.buyer-grounded-title { margin: 0 0 7px; font-size: 16px; line-height: 1.6; font-weight: 600; overflow-wrap: anywhere; }
.buyer-grounded-card > .buyer-grounded-title {
  margin-block-end: 3px; font-size: 15px; line-height: 1.55;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.buyer-grounded-gap {
  margin: 2px 0 0; color: var(--buyer-muted,#53564b); font-size: 13px; line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.buyer-grounded-card .buyer-grounded-sources { margin: 0; margin-inline-start: auto; }
.buyer-grounded-card .buyer-product-scroll .buyer-grounded-line { font-size: 13.5px; line-height: 1.7; }
.buyer-grounded-line { margin: 3px 0; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.buyer-grounded-copy { color: var(--buyer-muted,#53564b); }
.buyer-grounded-sources { display: flex; flex-wrap: wrap; gap: 0 12px; margin-block-start: 5px; }
.buyer-grounded-source {
  display: inline-flex; align-items: center; min-block-size: 44px; max-inline-size: 100%;
  color: var(--buyer-blue); font-size: 13px; line-height: 1.6;
  text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere;
}
.buyer-grounded-source:focus-visible { outline: 2px solid var(--buyer-blue); outline-offset: 2px; border-radius: 4px; }
.buyer-grounded-attribution { margin: 0; color: var(--buyer-muted,#53564b); font-size: 12px; text-align: end; }
.buyer-grounded-suggestions { min-inline-size: 0; max-inline-size: 100%; overflow-x: auto; }
