/* ============================================================
   Retail product detail — body container + one action system
   ------------------------------------------------------------
   Two jobs, both narrow on purpose:

   1. The details container. Description, attributes and bulk terms
      used to live inside the sell column, which squeezed the hero and
      pushed long copy beside the price. They now sit in their own
      section under the hero (markup lives in productDetail.html,
      ".dt-body"), filled by the same JS through the same ids.

   2. The action row. details.css accumulated one treatment per button
      (cyan→navy gradient for contact, orange gradient for buy, orange
      outline for delivery, plus a pulse animation), so five buttons in
      one row read as five different brands. Everything below is one
      system with three levels of importance:

        primary    solid accent   — the main action (contact the seller)
        secondary  white + border — the money path (secure buy)
        ghost      text only      — supporting actions (offer, delivery,
                                    compare)

      Colour is spent only on the primary; the rest are neutral. No
      gradients, no coloured shadows, no looping animation.

   Everything reads from tokens.css / theme.css, so dark mode and the
   theme editor keep working without a second set of rules.
   ============================================================ */

/* ---------- details container ---------- */

.dt-body {
  margin-top: 16px;
  background: var(--color-surface, var(--white));
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-lg, 14px);
  padding: clamp(14px, 2vw, 22px);
}

.dt-body-head { margin-bottom: 14px; }

.dt-body-title {
  margin: 0 0 2px;
  font-size: clamp(1.7rem, 1.5rem + 0.4vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-on-surface, #24344a);
}

.dt-body-sub {
  margin: 0;
  font-size: 1.2rem;
  color: var(--color-on-muted, #5b6b80);
}

/* The description is the reason the container exists, so it gets the whole
   remainder of the row and the attribute column takes a fixed, narrower
   measure (300px) instead of an equal share. Widened from 1.55fr/1fr. */
.dt-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 22px;
  align-items: start;
}

.dt-sub-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-on-muted, #5b6b80);
}

.dt-sub-title svg { flex: 0 0 auto; color: var(--color-on-muted, #5b6b80); }

/* description body */

.dt-body .productDescription {
  font-size: 1.35rem;
  line-height: 1.68;
  color: var(--color-on-surface, #24344a);
  overflow-wrap: anywhere;
}

.dt-body .productDescription > :first-child { margin-top: 0; }
.dt-body .productDescription > :last-child { margin-bottom: 0; }
.dt-body .productDescription p { margin: 0 0 10px; }
.dt-body .productDescription ul,
.dt-body .productDescription ol { margin: 0 0 10px; padding-left: 18px; }
.dt-body .productDescription li { margin-bottom: 4px; }
.dt-body .productDescription strong { font-weight: 600; }
.dt-body .productDescription a { color: var(--color-primary, #06426e); text-underline-offset: 2px; }
.dt-body .productDescription img { max-width: 100%; height: auto; border-radius: var(--radius-md, 10px); }
.dt-body .productDescription:empty::before {
  content: "No description provided.";
  color: var(--color-on-muted, #5b6b80);
}

/* attribute column */

.dt-body-side {
  border-left: 1px solid var(--color-border, var(--line));
  padding-left: 20px;
  min-width: 0;
}

.attr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* One family: neutral pill, hairline border, 1.5px stroke glyph.
   The old chip was blue-on-blue and turned orange on hover; now the
   only colour change is the border/hover tint, and the glyph carries
   the meaning. */
a.attr-chip,
.attr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-sm, 6px);
  background: var(--neutral-50, var(--neutral-50));
  color: var(--color-on-surface, #24344a);
  font-size: 1.2rem;
  line-height: 1.3;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

a.attr-chip:hover,
a.attr-chip:focus-visible {
  border-color: var(--brand-orange-600, var(--brand-orange-600));
  background: rgba(255, 127, 17, 0.08);
  outline: none;
}

a.attr-chip:focus-visible {
  outline: 2px solid var(--color-ring, var(--brand-orange-700));
  outline-offset: 2px;
}

.attr-chip svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: var(--color-on-muted, #5b6b80);
}

.attr-chip b {
  font-weight: 600;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-on-muted, #5b6b80);
}

.attr-chip i {
  font-style: normal;
  font-weight: 500;
  color: var(--color-on-surface, #24344a);
}

.dt-body-side .ws-terms { margin: 14px 0 0; }

/* ---------- hero labels: condition / location / delivery ----------
   These were three inline pills mixing label and value in one run of text,
   with the value hard-coded orange. They are now small spec cards: icon,
   muted label, ink value, equal heights across a two-column grid, so the
   block fills the width of the panel instead of shrinking to its content. */

main .layer1 .productInformation {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

main .layer1 .productInfo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 0;
}

main .layer1 .productInfo .info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface, var(--white));
  box-shadow: none;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-on-muted, #5b6b80);
}

main .layer1 .productInfo .info .ic {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--color-on-muted, #5b6b80);
}

/* The value inside each card is ink and semibold — the old rule coloured it
   orange, which competed with the primary button. */
main .layer1 .productInfo .info span,
main .layer1 .productInfo .info #condition-js,
main .layer1 .productInfo .info #location-js,
main .layer1 .productInfo .info #delivery-js {
  color: var(--color-on-surface, #24344a);
  font-weight: 600;
}

/* Extra facts that keep the tall right-hand panel populated: category,
   listed date, stock, mode. Rendered by productDetail.js into #productFacts-js. */
main .layer1 .productFacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

/* `hidden` has to beat the display above (same trap as the skeleton on the
   wholesale page): the block stays out of the layout until JS fills it. */
main .layer1 .productFacts[hidden] { display: none; }

/* The legacy location row carried a stray "Region" word after the value, so
   drop any bare span that is neither the (new) label nor the value. */
main .layer1 .productInfo .info > span:not([id]):not(.info-label):not(.info-value) { display: none; }

main .layer1 .productFacts .fact {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface, var(--white));
}

main .layer1 .productFacts .fact-label {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-on-muted, #5b6b80);
}

main .layer1 .productFacts .fact-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-on-surface, #24344a);
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  main .layer1 .productInfo { grid-template-columns: 1fr; }
  main .layer1 .productFacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

[data-theme="dark"] main .layer1 .productInfo .info,
[data-theme="dark"] main .layer1 .productFacts .fact {
  background: #0f1729;
  border-color: #24314b;
}

/* ---------- one action system ---------- */

.ctaSection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.ctaSection > div { display: flex; min-width: 0; }

/* Base: every action shares geometry, weight and behaviour. */
.ctaSection .buyProduct,
.ctaSection .offerProduct,
.ctaSection .escrowProduct,
.ctaSection .compareProduct,
.ctaSection .deliveryProduct {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--color-on-surface, #24344a);
  box-shadow: none;
  /* Kills the looping pulse details.css put on the contact button. */
  animation: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ctaSection button svg,
.ctaSection .buyProduct svg,
.ctaSection .escrowProduct svg,
.ctaSection .compareProduct svg,
.ctaSection .deliveryProduct svg,
.ctaSection .offerProduct svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

/* Primary — solid accent, dark ink on it (7.5:1, from tokens). */
.ctaSection .buyProduct {
  background: var(--brand-orange-500, var(--brand-orange-500));
  border-color: var(--brand-orange-500, var(--brand-orange-500));
  color: var(--color-on-accent, #1a0d00);
}

.ctaSection .buyProduct:hover {
  background: var(--brand-orange-600, var(--brand-orange-600));
  border-color: var(--brand-orange-600, var(--brand-orange-600));
}

/* Secondary — the money path. Neutral surface, firm border, no fill. */
.ctaSection .escrowProduct {
  background: var(--color-surface, var(--white));
  border-color: var(--brand-navy-800, #06426e);
  color: var(--brand-navy-800, #06426e);
}

.ctaSection .escrowProduct:hover {
  background: var(--brand-navy-800, #06426e);
  color: var(--color-on-primary, var(--white));
}

/* Ghost — supporting actions. Text weight only, hairline border. */
.ctaSection .offerProduct,
.ctaSection .compareProduct,
.ctaSection .deliveryProduct {
  background: transparent;
  border-color: var(--color-border, var(--line));
  color: var(--color-on-surface, #24344a);
  font-weight: 500;
}

.ctaSection .offerProduct:hover,
.ctaSection .compareProduct:hover,
.ctaSection .deliveryProduct:hover {
  background: var(--neutral-100, var(--neutral-100));
  border-color: var(--neutral-300, var(--neutral-300));
}

/* Pressed + focus states, shared. */
.ctaSection .buyProduct:active,
.ctaSection .escrowProduct:active,
.ctaSection .offerProduct:active,
.ctaSection .compareProduct:active,
.ctaSection .deliveryProduct:active {
  transform: none;
  box-shadow: none;
}

.ctaSection .buyProduct:focus-visible,
.ctaSection .escrowProduct:focus-visible,
.ctaSection .offerProduct:focus-visible,
.ctaSection .compareProduct:focus-visible,
.ctaSection .deliveryProduct:focus-visible {
  outline: 2px solid var(--color-ring, var(--brand-orange-700));
  outline-offset: 2px;
}

.ctaSection button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Response-time note in the seller card. It carried a hardcoded green in an
   inline style attribute (also a strict-CSP violation); colour now comes from
   the success token and visibility from the `hidden` attribute. */
.owner-response-time {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-success, var(--color-success));
}

.owner-response-time[hidden] { display: none; }
.owner-response-time svg { width: 12px; height: 12px; }

/* ---------- hero: the sell column fills its half ----------
   details.css stretches both columns, but the summary only grew to the
   height of its own content, so once the description moved out to
   .dt-body the right half ended in dead space below "Posted".

   Three changes, each doing one job:
     1. a tinted panel, so the column reads as a container that fills its
        side of the hero instead of bare white space next to the photo;
     2. the hero's 720px floor relaxed to a viewport-based clamp, which is
        where most of the emptiness came from;
     3. the action row anchored to the bottom behind a hairline, so the
        remaining space sits between the price and the buttons and reads
        as deliberate spacing.

   The panel applies at every width; only the fill behaviour is desktop. */

main .layer1 .productSummary {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  background: var(--neutral-50, var(--neutral-50));
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-lg, 14px);
  /* No fixed height: .layer1 already stretches its children. */
  height: auto;
  gap: 16px;
  padding: clamp(10px, 1.3vw, 18px);
}

main .layer1 .productSummary > * { width: 100%; }

[data-theme="dark"] main .layer1 .productSummary {
  background: #121a2b;
  border-color: #24314b;
}

@media (min-width: 1021px) {
  main .layer1 {
    align-items: stretch;
    min-height: clamp(520px, 64vh, 700px);
  }

  /* Hairline under the price separates the top group (name, price) from
     the actions group. */
  main .layer1 .productSummary .productPrice {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border, var(--line));
  }

  /* Actions anchor to the bottom of the column. */
  main .layer1 .productSummary .ctaSection {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--color-border, var(--line));
  }

  main .layer1 .productSummary .productInformation { margin-top: 0; }
  main .layer1 .productSummary .posted { margin-top: 0; }
}

/* Once the hero stacks there is nothing to fill: drop the 720px floor so
   the single column does not leave space under the buttons. */
@media (max-width: 1020px) {
  main .layer1 { min-height: 0; }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .dt-body-grid { grid-template-columns: 1fr; gap: 16px; }
  .dt-body-side {
    border-left: 0;
    border-top: 1px solid var(--color-border, var(--line));
    padding-left: 0;
    padding-top: 14px;
  }
}

@media (max-width: 560px) {
  .ctaSection { grid-template-columns: 1fr 1fr; }
  .ctaSection .buyProduct,
  .ctaSection .escrowProduct { grid-column: 1 / -1; }
  .ctaSection .offerProduct,
  .ctaSection .compareProduct,
  .ctaSection .deliveryProduct { font-size: 1.25rem; padding: 9px 10px; }
}

/* ---------- dark mode ---------- */

[data-theme="dark"] .dt-body {
  background: var(--color-surface, #121a2b);
  border-color: var(--color-border, #24314b);
}

[data-theme="dark"] a.attr-chip,
[data-theme="dark"] .attr-chip {
  background: #17223a;
  border-color: #24314b;
  color: #dbe6f3;
}

[data-theme="dark"] a.attr-chip:hover,
[data-theme="dark"] a.attr-chip:focus-visible {
  border-color: var(--brand-orange-500, var(--brand-orange-500));
  background: rgba(255, 127, 17, 0.14);
}

[data-theme="dark"] .ctaSection .escrowProduct {
  background: #121a2b;
  border-color: #7fb0e0;
  color: #dbe6f3;
}

[data-theme="dark"] .ctaSection .escrowProduct:hover {
  background: #7fb0e0;
  color: #06121f;
}

[data-theme="dark"] .ctaSection .offerProduct,
[data-theme="dark"] .ctaSection .compareProduct,
[data-theme="dark"] .ctaSection .deliveryProduct {
  background: transparent;
  border-color: #24314b;
  color: #dbe6f3;
}

[data-theme="dark"] .ctaSection .offerProduct:hover,
[data-theme="dark"] .ctaSection .compareProduct:hover,
[data-theme="dark"] .ctaSection .deliveryProduct:hover {
  background: #1b2540;
  border-color: #33415c;
}

/* ---------- motion / contrast ---------- */

@media (prefers-reduced-motion: reduce) {
  a.attr-chip,
  .ctaSection .buyProduct,
  .ctaSection .escrowProduct,
  .ctaSection .offerProduct,
  .ctaSection .compareProduct,
  .ctaSection .deliveryProduct { transition: none; }
}

@media (forced-colors: active) {
  .dt-body,
  a.attr-chip,
  .attr-chip { border: 1px solid CanvasText; }
  .ctaSection .buyProduct { border: 2px solid Highlight; }
  .ctaSection .escrowProduct,
  .ctaSection .offerProduct,
  .ctaSection .compareProduct,
  .ctaSection .deliveryProduct { border: 1px solid CanvasText; }
}

/* ============================================================
   RETAIL DETAIL — strips removed, description widened, group deals
   ============================================================ */

/* ---------- 1. The multicoloured strips are gone ----------------
   Three separate rainbow rules painted a 3-5px bar across the page:
   the hero's orange→blue top edge, the reviews heading's orange→cyan
   underline and the seller card's blue→cyan→orange top bar. They carried
   no meaning, so they are removed rather than recoloured. */
main .layer1::before,
.productComments .comments h1::after,
.productComments .userContainer::before {
  content: none;
  display: none;
}

/* That description panel still carried a 4px orange left strip. */
.productSummary .productDescription {
  border-left: 0;
  background: transparent;
  border-color: var(--color-border, var(--line));
}

/* The horizontal scrollers' scrollbar also used an orange→blue gradient. */
.detail-sec .sProducts::-webkit-scrollbar-thumb,
.layer4 .oAds::-webkit-scrollbar-thumb {
  background: var(--neutral-300, #cbd5e1);
}

/* ---------- 2. Description takes the full container width -------
   The details card is page-wide, but its inner grid reserved 300px for the
   attributes, so the description stopped short of every other container.
   One column now: description first, attributes beneath it. */
.dt-body-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.dt-body-main { min-width: 0; }

.dt-body-side {
  border-left: 0;
  border-top: 1px solid var(--color-border, var(--line));
  padding-left: 0;
  padding-top: 14px;
}

/* ---------- 3. Group deals layer -------------------------------
   Was a white card with a green-tinted header, a green gradient button and
   green header glyph — a fourth accent on a page that already has one. It is
   the same neutral card language as the rest of the page now, with the single
   accent only on the progress fill and the one primary action. */
.layer-group-deals {
  margin-top: 16px;
  background: var(--color-surface, var(--white));
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-lg, 14px);
  box-shadow: none;
}

.group-deals-header {
  padding: 14px clamp(14px, 2vw, 22px);
  background: transparent;
  border-bottom: 1px solid var(--color-border, var(--line));
}

.group-deals-header svg { color: var(--color-on-muted, #5b6b80); }

.group-deals-header span {
  font-size: clamp(1.5rem, 1.2rem + 0.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--color-on-surface, #24344a);
}

.group-deals-body { padding: clamp(14px, 2vw, 22px); }

.layer-group-deals .gb-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.layer-group-deals .gb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.layer-group-deals .gb-head h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-on-surface, #24344a);
}

.layer-group-deals .gb-progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 39, 66, 0.1);
}

.layer-group-deals .gb-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-orange-500, #ff7f11);
  transition: width 0.3s ease;
}

.layer-group-deals .gb-counts {
  margin: 10px 0 4px;
  font-size: 1.15rem;
  color: var(--color-on-muted, #5b6b80);
}

.layer-group-deals .gb-counts strong {
  font-size: 1.5rem;
  color: var(--color-on-surface, #24344a);
}

.layer-group-deals .gb-meta,
.layer-group-deals .gb-mine {
  margin: 0 0 12px;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--color-on-muted, #5b6b80);
}

.layer-group-deals .gb-timer-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--color-on-muted, #5b6b80);
}

.layer-group-deals .gb-timer {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-on-surface, #24344a);
  font-variant-numeric: tabular-nums;
}

.layer-group-deals .gb-form { display: grid; gap: 12px; }

.layer-group-deals .gb-form label {
  display: grid;
  gap: 6px;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-on-muted, #5b6b80);
}

.layer-group-deals .gb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.layer-group-deals .gb-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 1.3rem;
  color: var(--color-on-surface, #24344a);
  background: var(--white, #fff);
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-sm, 6px);
}

.layer-group-deals .gb-form input:focus-visible {
  outline: 2px solid var(--color-ring, #a8410a);
  outline-offset: 1px;
}

.layer-group-deals .btn,
.layer-group-deals .btn-primary {
  justify-self: start;
  min-height: 44px;
  padding: 0 20px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-on-accent, #1a0d00);
  background: var(--brand-orange-500, #ff7f11);
  border: 1px solid var(--brand-orange-500, #ff7f11);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
}

.layer-group-deals .btn:disabled { opacity: 0.55; cursor: not-allowed; }

.layer-group-deals .gb-win {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-success, #12805a);
}

.layer-group-deals .gb-error {
  margin: 8px 0 0;
  font-size: 1.15rem;
  color: var(--color-destructive, #c92a2f);
}

[data-theme="dark"] .layer-group-deals { background: #121a2b; border-color: #24314b; }
[data-theme="dark"] .group-deals-header { background: transparent; border-bottom-color: #24314b; }
[data-theme="dark"] .layer-group-deals .gb-progress { background: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .layer-group-deals .gb-form input { background: #0f1729; border-color: #24314b; color: #e8eef7; }

/* ---------- 4. Market analytics -------------------------------
   Same neutral card language as the group-deals layer: one surface, one
   hairline divider, no blue/violet tint. The panel now leads with the price
   change (value + plain text) over a line graph. */
.layer-market {
  margin-top: 16px;
  background: var(--color-surface, var(--white));
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-lg, 14px);
  box-shadow: none;
}

.market-analytics-header {
  padding: 14px clamp(14px, 2vw, 22px);
  background: transparent;
  border-bottom: 1px solid var(--color-border, var(--line));
}

.market-analytics-header svg { color: var(--color-on-muted, #5b6b80); }

.market-analytics-header span {
  font-size: clamp(1.5rem, 1.2rem + 0.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--color-on-surface, #24344a);
}

.market-analytics-body { padding: clamp(14px, 2vw, 22px); }

.market-ph-wrap,
.market-mi-wrap { min-width: 0; }

/* --- trend card --- */
.ph-card { display: grid; gap: 12px; }
.ph-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ph-top-main { display: grid; gap: 2px; min-width: 0; }

.ph-label {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-on-muted, #5b6b80);
}

.ph-now {
  font-size: clamp(2.2rem, 1.8rem + 1vw, 2.9rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-on-surface, #24344a);
}

.ph-caption { font-size: 1.1rem; color: var(--color-on-muted, #5b6b80); }

.ph-delta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  text-align: left;
  background: var(--white, #fff);
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-md, 10px);
}

.ph-delta-icon { display: inline-flex; width: 18px; height: 18px; color: var(--color-on-muted, #5b6b80); }
.ph-delta-icon svg { width: 18px; height: 18px; }
.ph-delta-text { display: grid; gap: 1px; font-size: 1.05rem; color: var(--color-on-muted, #5b6b80); }
.ph-delta-text strong { font-size: 1.35rem; font-weight: 700; color: var(--color-on-surface, #24344a); }
.ph-delta-down .ph-delta-icon { color: var(--color-success, #12805a); }
.ph-delta-up .ph-delta-icon { color: var(--color-destructive, #c92a2f); }

/* --- line graph --- */
.ph-line {
  display: block;
  width: 100%;
  height: clamp(140px, 18vw, 190px);
  overflow: visible;
}

.ph-grid line { stroke: var(--color-border, var(--line)); stroke-width: 1; stroke-dasharray: 3 4; }
.ph-area { fill: rgba(255, 127, 17, 0.12); stroke: none; }
.ph-path {
  fill: none;
  stroke: var(--brand-orange-500, #ff7f11);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.ph-dots circle { fill: var(--white, #fff); stroke: var(--brand-orange-500, #ff7f11); stroke-width: 2; }
.ph-dot-last { fill: var(--brand-orange-500, #ff7f11); stroke: var(--white, #fff); stroke-width: 2; }

.ph-axis { display: flex; justify-content: space-between; font-size: 1.05rem; color: var(--color-on-muted, #5b6b80); }
.ph-change { margin: 0; font-size: 1.2rem; line-height: 1.55; color: var(--color-on-surface, #24344a); }
.ph-change-sub { font-size: 1.1rem; color: var(--color-on-muted, #5b6b80); }

.ph-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ph-fact {
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  background: var(--white, #fff);
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-md, 10px);
}
.ph-fact-key { font-size: 1rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-on-muted, #5b6b80); }
.ph-fact-val { font-size: 1.35rem; font-weight: 600; color: var(--color-on-surface, #24344a); }
.ph-empty { margin: 0; font-size: 1.2rem; color: var(--color-on-muted, #5b6b80); }

/* --- price timeline ---
   Every recorded change, newest first: a vertical rail with a dot per change,
   the date, the old → new move and the size of the move. The graph answers
   "what shape"; the timeline answers "when, and from what to what". */
.ph-timeline-wrap {
  margin-top: 2px;
  border-top: 1px dashed var(--color-border, var(--line));
  padding-top: 10px;
}
.ph-timeline-title {
  margin: 0 0 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-on-muted, #5b6b80);
}
.ph-timeline-title span {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.ph-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  display: grid;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.ph-tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  padding: 5px 0;
}
/* The rail: one continuous line behind every dot. */
.ph-tl-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border, var(--line));
}
.ph-tl-item:first-child::before { top: 9px; }
.ph-tl-item:last-child::before { bottom: calc(100% - 12px); }
.ph-tl-dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  margin-left: 3px;
  border-radius: 50%;
  background: var(--white, #fff);
  border: 2px solid var(--color-on-muted, #5b6b80);
}
.ph-tl-item.is-latest .ph-tl-dot {
  background: var(--brand-orange-500, #ff7f11);
  border-color: var(--brand-orange-500, #ff7f11);
  box-shadow: 0 0 0 3px rgba(255, 127, 17, 0.18);
}
.ph-tl-down .ph-tl-dot { border-color: var(--color-success, #12805a); }
.ph-tl-up .ph-tl-dot { border-color: var(--color-destructive, #c92a2f); }
.ph-tl-body { min-width: 0; }
.ph-tl-when {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 1.05rem;
  color: var(--color-on-muted, #5b6b80);
}
.ph-tl-when time { font-weight: 600; color: var(--color-on-surface, #24344a); }
.ph-tl-reason {
  font-size: 0.95rem;
  padding: 0 6px;
  border: 1px solid var(--color-border, var(--line));
  border-radius: 999px;
  background: var(--neutral-50, #f7f9fc);
}
.ph-tl-move {
  margin: 1px 0 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.ph-tl-old { color: var(--color-on-muted, #5b6b80); text-decoration: line-through; text-decoration-thickness: 1px; }
.ph-tl-arrow { display: inline-flex; width: 12px; height: 12px; color: var(--color-on-muted, #5b6b80); }
.ph-tl-arrow svg { width: 12px; height: 12px; }
.ph-tl-new { font-weight: 700; color: var(--color-on-surface, #24344a); }
.ph-tl-delta { margin-left: auto; font-size: 1.05rem; font-weight: 600; color: var(--color-on-muted, #5b6b80); white-space: nowrap; }
.ph-tl-down .ph-tl-delta { color: var(--color-success, #12805a); }
.ph-tl-up .ph-tl-delta { color: var(--color-destructive, #c92a2f); }
.ph-timeline-more { margin: 6px 0 0 24px; font-size: 1rem; color: var(--color-on-muted, #5b6b80); }
.ph-card-empty .ph-empty { padding: 4px 0 0; }

/* --- market position --- */
.mi-card { display: grid; gap: 12px; }
.mi-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mi-label {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-on-muted, #5b6b80);
}
.mi-count { font-size: 1.05rem; color: var(--color-on-muted, #5b6b80); }
.mi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mi-stat {
  display: grid;
  gap: 2px;
  padding: 10px;
  background: var(--white, #fff);
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-md, 10px);
}
.mi-val { font-size: 1.45rem; font-weight: 700; color: var(--color-on-surface, #24344a); }
.mi-key { font-size: 1.02rem; color: var(--color-on-muted, #5b6b80); }
.mi-deal {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-md, 10px);
}
.mi-deal-amount { font-size: 1.5rem; font-weight: 700; color: var(--color-on-surface, #24344a); }
.mi-deal-copy { font-size: 1.1rem; line-height: 1.5; color: var(--color-on-muted, #5b6b80); }
.mi-deal-good { background: var(--success-tint, rgba(18, 128, 90, 0.08)); border-color: rgba(18, 128, 90, 0.28); }
.mi-deal-high { background: var(--warning-tint, rgba(255, 127, 17, 0.1)); border-color: rgba(255, 127, 17, 0.3); }

/* Two columns only where there is room; details.css already stacks these. */
@media (min-width: 769px) {
  .market-analytics-body { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 480px) {
  .ph-facts,
  .mi-row { grid-template-columns: 1fr; }
  .ph-top { flex-direction: column; align-items: stretch; }
  .layer-group-deals .gb-row { grid-template-columns: 1fr; }
}

[data-theme="dark"] .layer-market { background: #121a2b; border-color: #24314b; }
[data-theme="dark"] .market-analytics-header { background: transparent; border-bottom-color: #24314b; }
[data-theme="dark"] .ph-delta,
[data-theme="dark"] .ph-fact,
[data-theme="dark"] .mi-stat { background: #0f1729; border-color: #24314b; }
[data-theme="dark"] .ph-dots circle { fill: #0f1729; }
[data-theme="dark"] .ph-area { fill: rgba(255, 180, 99, 0.16); }

/* details.css still targets these two wrappers with its old bar-chart rules,
   so the new copy needs the same selector depth to actually apply. */
.market-ph-wrap .ph-label,
.market-mi-wrap .mi-label {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-on-muted, #5b6b80);
}

.market-mi-wrap .mi-stat {
  background: var(--white, #fff);
  border: 1px solid var(--color-border, var(--line));
  border-radius: var(--radius-md, 10px);
  padding: 10px;
}

.market-mi-wrap .mi-val { color: var(--color-on-surface, #24344a); }
.market-mi-wrap .mi-key { color: var(--color-on-muted, #5b6b80); }
.market-ph-wrap .ph-axis { color: var(--color-on-muted, #5b6b80); }
.market-ph-wrap .ph-change { color: var(--color-on-surface, #24344a); }
.market-ph-wrap .ph-change-sub { color: var(--color-on-muted, #5b6b80); }

[data-theme="dark"] .market-ph-wrap .ph-label,
[data-theme="dark"] .market-mi-wrap .mi-label,
[data-theme="dark"] .market-mi-wrap .mi-key,
[data-theme="dark"] .market-ph-wrap .ph-axis,
[data-theme="dark"] .market-ph-wrap .ph-change-sub { color: #93a4bb; }

[data-theme="dark"] .market-mi-wrap .mi-stat { background: #0f1729; border-color: #24314b; }
[data-theme="dark"] .market-mi-wrap .mi-val,
[data-theme="dark"] .market-ph-wrap .ph-change { color: #e8eef7; }

/* ============================================================
   LAYOUT PARITY + HERO ACTION CLEANUP (appended)
   ============================================================ */

/* `main` is a flex column with `align-items: center`, so any direct child
   without an explicit width shrinks to its content. .layer1 carries
   `width: 100%` and the details card did not, which is why it looked
   inset and compacted beside the hero. Both now share one column edge. */
.dt-body {
  width: 100%;
  align-self: stretch;
  min-width: 0;
}

/* Description | attributes stays a row on desktop, copy taking the
   remainder and the attribute rail a narrow fixed measure. */
.dt-body-grid {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: clamp(16px, 2vw, 26px);
}

@media (max-width: 760px) {
  .dt-body-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- wishlist pill ---------- */

/* Was a navy pill that turned orange on hover and a pink gradient once
   saved — three colours for one toggle. It is a secondary button now and
   the heart alone carries the saved state. */
.productPrice .watchlist {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, var(--line));
  color: var(--color-on-surface, #24344a);
  box-shadow: none;
  font-weight: 500;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.productPrice .watchlist .text {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
}

.productPrice .watchlist .wishlist-heart {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
  flex-shrink: 0;
  transition: transform .15s ease;
}

.productPrice .watchlist:hover .wishlist-heart { transform: scale(1.12); }

.productPrice .watchlist:hover,
.productPrice .watchlist:focus-visible {
  width: auto;
  background: rgba(255, 127, 17, .10);
  border-color: var(--brand-orange-600, #e56f0a);
  color: var(--brand-orange-700, #b34700);
  transform: none;
  box-shadow: none;
}

.productPrice .watchlist.wishlisted {
  background: rgba(255, 127, 17, .12);
  border-color: var(--brand-orange-600, #e56f0a);
  color: var(--brand-orange-700, #b34700);
}

.productPrice .watchlist:focus-visible {
  outline: 2px solid var(--brand-orange-700, #b34700);
  outline-offset: 2px;
}

/* ---------- posted row + share ---------- */

.posted {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--color-border, var(--line));
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-on-muted, #5b6b80);
}

.posted > div:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.posted button,
.share-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, var(--line));
  color: var(--color-on-surface, #24344a);
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease;
}

.posted button:hover,
.posted button:focus-visible,
.share-detail-btn:hover,
.share-detail-btn:focus-visible {
  background: var(--neutral-50, #f6f7f8);
  border-color: var(--color-on-muted, #5b6b80);
  color: var(--color-on-surface, #24344a);
  transform: none;
  box-shadow: none;
}

.posted button:focus-visible,
.share-detail-btn:focus-visible {
  outline: 2px solid var(--brand-orange-700, #b34700);
  outline-offset: 2px;
}

.posted button svg,
.share-detail-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

[data-theme="dark"] .productPrice .watchlist,
[data-theme="dark"] .posted button,
[data-theme="dark"] .share-detail-btn {
  background: #17223a;
  border-color: #24314b;
  color: #dbe6f3;
}

[data-theme="dark"] .productPrice .watchlist:hover,
[data-theme="dark"] .productPrice .watchlist:focus-visible,
[data-theme="dark"] .productPrice .watchlist.wishlisted {
  background: rgba(255, 127, 17, .14);
  border-color: var(--brand-orange-500, #ff7f11);
  color: #ffb877;
}

[data-theme="dark"] .posted {
  border-top-color: #24314b;
  color: #93a4bb;
}

/* Phones: details.css pins the wishlist to a 34px square so a tap-hover can
   never expand it. Keep that square — only the new pill metrics are reset. */
@media (max-width: 640px) {
  .productPrice .watchlist,
  .productPrice .watchlist:hover,
  .productPrice .watchlist:focus-visible {
    height: 34px;
    padding: 0;
    border-radius: 10px;
  }

  .productPrice .watchlist .wishlist-heart { width: 20px; height: 20px; }
}

/* ------------------------------------------------------------------
   Name + price on narrow screens: one line each, never wrapped.
   ------------------------------------------------------------------
   The hero title used to wrap to three or four lines on a phone and
   pushed the price under the fold. The name now truncates with an
   ellipsis and a "See more" control opens the full text in a modal;
   the price stays on its own nowrap line so the number is always
   readable in full.
   ------------------------------------------------------------------ */
.pName-more {
  display: none;
  flex: 0 0 auto;
  align-self: center;
  padding: 2px 8px;
  border: 1px solid var(--color-border, #e3eaf2);
  border-radius: 999px;
  background: var(--color-surface, #fff);
  color: var(--color-accent, #ff7f11);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}

.pName-more:hover {
  background: rgba(255, 127, 17, 0.1);
  border-color: var(--color-accent, #ff7f11);
}

@media (max-width: 768px) {
  .productSummary .productName {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .productSummary .productName span.pName,
  .productSummary .productName span#pName-js {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
    /* px: these pages run a 10px root font, so rem here would render ~11px. */
    font-size: 17px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pName-more { display: inline-block; }

  /* Price line: no wrapping anywhere — the amount is the point. */
  .productSummary .productPrice,
  .productSummary .productPrice .Pprice,
  .productSummary .productPrice .Pprice span {
    white-space: nowrap;
  }

  .productSummary .productPrice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .productSummary .productPrice .Pprice {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 20px;
  }

  .productSummary .productPrice .Pprice span.price {
    font-size: 20px;
  }

  .productSummary .productPrice .pSave { flex: 0 0 auto; }
}

/* ---- Full-name modal ---- */
.pname-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 21, 38, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pname-modal-overlay.active { opacity: 1; }

.pname-modal {
  width: min(480px, 100%);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 20px;
  border-radius: 18px;
  background: var(--color-surface, #fff);
  color: var(--color-on-surface, #24344a);
  box-shadow: 0 24px 64px rgba(2, 20, 38, 0.35);
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.pname-modal-overlay.active .pname-modal { transform: none; }

.pname-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pname-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pname-modal-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--color-muted, #eef2f7);
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.pname-modal-price {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 800;
}

.pname-modal-facts {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.pname-modal-facts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--color-muted, #eef2f7);
}

.pname-modal-facts b { font-weight: 600; }

[data-theme="dark"] .pname-modal { background: #121a2b; color: #dbe6f3; }
[data-theme="dark"] .pname-modal-close,
[data-theme="dark"] .pname-modal-facts li { background: rgba(255, 255, 255, 0.07); }

/* ------------------------------------------------------------------
   Summary facts, share button and the seller action row
   ------------------------------------------------------------------
   Each fact is a card: the label sits right beside its icon and the
   value is pushed to the opposite edge, so Condition / Location /
   Delivery scan as label → value instead of one run-on sentence.
   The share control shares the row with the LISTED card (the old
   "Posted · 5 days ago" line and its dot are gone), and the last
   seller button closes the row at full width.
   ------------------------------------------------------------------ */
main .layer1 .productInfo .info {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

main .layer1 .productInfo .info .info-label {
  margin-inline-end: auto;
  color: var(--color-on-muted, #5b6b80);
  font-weight: 400;
}

main .layer1 .productInfo .info .info-value {
  margin-inline-start: auto;
  text-align: right;
  overflow-wrap: anywhere;
}

.productSummary .factsRow {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.productSummary .factsRow .productFacts {
  flex: 1 1 auto;
  min-width: 0;
}

.productSummary .factsRow .posted {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.posted .share-trigger,
.posted button.share-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--color-border, #e3eaf2);
  border-radius: 12px;
  background: var(--color-surface, #fff);
  color: var(--color-on-surface, #24344a);
  box-shadow: none;
}

.posted button.share-trigger:hover {
  background: var(--color-muted, #eef2f7);
  border-color: var(--color-accent, #ff7f11);
  transform: none;
  box-shadow: none;
}

[data-theme="dark"] .posted button.share-trigger {
  background: #0f1729;
  border-color: #24314b;
  color: #dbe6f3;
}

/* The seller's action row: Message spans the width, the last button does too. */
.owner-actions .owner-action:last-child {
  grid-column: 1 / -1;
}

/* Buttons size to their label; a form submit should not become a full-bleed
   bar just because its parent is a column. */
.reportContent form button,
.productReport .reportContent form button {
  width: auto;
  min-width: 152px;
  padding-inline: 22px;
  align-self: flex-end;
}

/* ---- hero buy box: stock state, meter, quantity, live total ----
   Sits directly under the name / price / wishlist row inside layer1, so the
   summary column is filled instead of leaving a gap above the action row.
   Everything here is stock or buying information — none of it belongs in the
   attributes panel. */
.buyBox {
  margin: 12px 0 6px;
  padding: 14px 16px 16px;
  border: 1px solid rgba(10, 127, 181, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, #f7fcff, #eef7fd);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 8px 22px rgba(9, 60, 93, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.buyBox[hidden] { display: none; }
.buybox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.buybox-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.7800rem;
  font-weight: 700;
  line-height: 1.5;
  border: 1px solid transparent;
}
.buybox-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.buybox-pill--high { color: #15803d; background: #e9f8ef; border-color: #bfe8cd; }
.buybox-pill--mid { color: #b45309; background: #fff5e6; border-color: #fbe0b8; }
.buybox-pill--low,
.buybox-pill--empty { color: #b42318; background: #fdeeee; border-color: #f6caca; }
.buybox-pill--untracked { color: #4b5f74; background: #f1f5f9; border-color: #dbe3ec; }
.buybox-left {
  font-size: 0.8000rem;
  font-weight: 600;
  color: #48627a;
}
.stock-battery-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 2px rgba(15, 39, 66, 0.12);
  overflow: hidden;
}
.stock-battery-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  background: linear-gradient(90deg, #15803d, #22c55e);
}
.stock-battery--mid .stock-battery-fill { background: linear-gradient(90deg, #b45309, #f59e0b); }
.stock-battery--low .stock-battery-fill { background: linear-gradient(90deg, #b42318, #ef4444); }
.stock-battery--empty .stock-battery-fill { background: #94a3b8; }
.buybox-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 39, 66, 0.14);
}
.buybox-qty {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.buybox-label {
  font-size: 0.7200rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5b7288;
}
.buy-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}
.buy-qty .ws-qty-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #cfe2f0;
  background: #ffffff;
  color: #0b3c5d;
  font-size: 1.1500rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.buy-qty .ws-qty-btn:hover:not(:disabled) { background: #eaf5fd; border-color: #8fc4e3; }
.buy-qty .ws-qty-btn:focus-visible {
  outline: 2px solid #0a7fb5;
  outline-offset: 2px;
}
.buy-qty .ws-qty-input {
  width: 64px;
  height: 38px;
  text-align: center;
  border: 1px solid #cfe2f0;
  border-radius: 10px;
  background: #ffffff;
  color: #0b3c5d;
  font-size: 1.0000rem;
  font-weight: 700;
}
.buy-qty .ws-qty-input:focus-visible {
  outline: 2px solid #0a7fb5;
  outline-offset: 1px;
  border-color: #8fc4e3;
}
.buybox-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.buybox-total span {
  font-size: 0.7200rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5b7288;
}
.buybox-total b {
  font-size: 1.4000rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0b3c5d;
}
.stock-untracked {
  margin: 0;
  font-size: 0.8000rem;
  font-weight: 600;
  color: #475569;
}

[data-theme="dark"] .buyBox {
  background: linear-gradient(180deg, #10283a, #0c2132);
  border-color: rgba(90, 180, 230, 0.25);
  box-shadow: none;
}
[data-theme="dark"] .buybox-left { color: #9fb6c9; }
[data-theme="dark"] .buybox-label,
[data-theme="dark"] .buybox-total span { color: #8fa8bf; }
[data-theme="dark"] .buybox-total b { color: #ffc07a; }
[data-theme="dark"] .buybox-row { border-top-color: rgba(148, 180, 209, 0.2); }
[data-theme="dark"] .buy-qty .ws-qty-btn,
[data-theme="dark"] .buy-qty .ws-qty-input {
  background: #132036;
  border-color: #2c4560;
  color: #e8eef7;
}
[data-theme="dark"] .buy-qty .ws-qty-btn:hover:not(:disabled) { background: #1a2c45; border-color: #3f6285; }
[data-theme="dark"] .buybox-pill--high { color: #4ade80; background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.35); }
[data-theme="dark"] .buybox-pill--mid { color: #fbbf24; background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.35); }
[data-theme="dark"] .buybox-pill--low,
[data-theme="dark"] .buybox-pill--empty { color: #fca5a5; background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.35); }
[data-theme="dark"] .buybox-pill--untracked { color: #b6c7d8; background: rgba(148, 163, 184, 0.14); border-color: rgba(148, 163, 184, 0.3); }
[data-theme="dark"] .stock-untracked { color: #9fb6c9; }

@media (max-width: 520px) {
  .buybox-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .buybox-total {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }
}

@media (forced-colors: active) {
  .buyBox { border: 1px solid CanvasText; }
  .stock-battery-track { border: 1px solid CanvasText; }
  .buybox-pill { border: 1px solid CanvasText; }
}
