.pricing-marketplace {
  min-width: 0;
  padding: 22px;
  border: 1px solid #dce8e3;
  border-radius: 20px;
  background:
    radial-gradient(circle at 38% 0%, rgba(20, 184, 166, .09), transparent 31%),
    linear-gradient(180deg, #f5fbf9 0, #f8fbfa 220px, #fff 520px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .045);
}

.pricing-marketplace [hidden] { display: none !important; }

.pricing-market-public-shell { padding: 30px var(--pad) 72px; }
.pricing-market-public-wrap { width: 100%; max-width: 1280px; margin: 0 auto; }

.market-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.market-page-head h1 {
  margin-top: 3px;
  color: #17231f;
  font-size: clamp(28px, 2.6vw, 38px);
  letter-spacing: -.035em;
}

.market-page-head p:not(.eyebrow) {
  max-width: 720px;
  margin-top: 7px;
  color: #60706a;
  font-size: 15px;
  line-height: 1.65;
}

.market-total {
  flex: none;
  padding: 8px 12px;
  border: 1px solid #d5e2dd;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: #75817d;
  font-size: 13px;
  white-space: nowrap;
}

.market-total strong { color: #18382e; font-size: 15px; }

.market-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px 16px;
  border: 1px solid #d9e5e0;
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .035);
}

.market-notice-icon {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #e3f7ef;
  color: #087653;
  font-size: 17px;
  font-weight: 800;
}

.market-notice > div { flex: 1 1 280px; min-width: 0; }
.market-notice > div strong { color: #26342f; font-size: 14.5px; }
.market-notice > div p { margin-top: 2px; color: #77827e; font-size: 13.5px; }
.market-deal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  flex: 0 1 560px;
  max-width: 560px;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 7px 9px;
  border: 1px solid #f6dcc2;
  border-radius: 10px;
  background: #fff7ed;
  color: #934b0b;
  font-size: 12.5px;
}
.market-deal:hover { border-color: #efbd8c; background: #fff3e3; }
.market-deal-badge,
.market-deal-discount { padding: 3px 7px; border-radius: 999px; white-space: nowrap; font-weight: 750; }
.market-deal-badge { background: #f97316; color: #fff; font-size: 10.5px; letter-spacing: .035em; }
.market-deal-copy { display: grid; min-width: 0; gap: 1px; }
.market-deal-copy b,
.market-deal-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-deal-copy b { color: #80400b; font-size: 13px; }
.market-deal-copy small { color: #aa6b35; font-size: 11.5px; }
.market-deal-discount { background: #ffead5; color: #a6530d; font-size: 11.5px; }
.market-deal i { color: #c56516; font-style: normal; font-weight: 800; }

.market-filter-panel {
  margin-bottom: 16px;
  padding: 15px 16px;
  border: 1px solid #d8e5df;
  border-radius: 15px;
  background: rgba(247, 252, 250, .9);
}

.market-filter-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.market-filter-row + .market-filter-row { margin-top: 9px; }
.market-filter-label { padding-top: 6px; color: #8a9691; font-size: 13px; }
.market-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }

.market-chip {
  min-height: 28px;
  padding: 5px 11px;
  border: 1px solid #d8e2de;
  border-radius: 8px;
  background: #fff;
  color: #596762;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.market-chip:hover:not(:disabled):not(.is-on) { border-color: #8ec5b0; color: #087653; }
.market-chip.is-on { border-color: #13a77a; background: #12a77a; color: #fff; box-shadow: 0 3px 9px rgba(18, 167, 122, .2); }
.market-chip:disabled { opacity: .32; cursor: default; }
.market-chip-anthropic:not(.is-on) { border-color: #efcba8; background: #fff8f1; color: #a75b16; }
.market-chip-openai:not(.is-on) { border-color: #bce3cf; background: #effaf4; color: #08764d; }
.market-chip-google:not(.is-on) { border-color: #bcd6f5; background: #f1f7ff; color: #2764ad; }
.market-chip-xai:not(.is-on) { border-color: #d5d9dc; background: #f5f6f7; color: #4e5961; }

.market-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e0e9e5;
}

.market-search {
  position: relative;
  display: flex;
  flex: 0 1 300px;
  align-items: center;
}

.market-search svg { position: absolute; left: 11px; width: 15px; height: 15px; fill: #96a19d; pointer-events: none; }
.market-search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  border: 1px solid #d7e1dd;
  border-radius: 9px;
  background: #fff;
  color: #26332e;
  font: inherit;
  font-size: 13.5px;
}
.market-search input:focus { outline: none; border-color: #18a97d; box-shadow: 0 0 0 3px rgba(18, 169, 125, .1); }
.market-search input::placeholder { color: #a0aaa6; }
.market-shown { margin-left: auto; color: #89938f; font-size: 13px; white-space: nowrap; }
.market-shown strong { color: #40504a; }
.market-reset { padding: 6px 9px; border: 0; background: transparent; color: #0a7b58; font: inherit; font-size: 13.5px; cursor: pointer; }

.market-groups { display: grid; gap: 16px; }
.market-group {
  overflow: hidden;
  border: 1px solid #bfe2d1;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(18, 91, 68, .055);
}

.market-group-head {
  padding: 14px 16px 13px;
  border-bottom: 1px solid #e3ebe8;
  background: linear-gradient(90deg, #f6fcf9, #fff 58%);
}

.market-group-copy { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.market-group-tag { padding: 3px 10px; font-size: 13px; font-weight: 750; }
.market-group-mult,
.market-group-discount { padding: 3px 7px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.market-group-mult { background: #e8f7f0; color: #087653; }
.market-group-discount { background: #fff0e4; color: #ad5c12; }
.market-group-head p { margin-top: 7px; color: #73807b; font-size: 13px; line-height: 1.55; }

.market-table-wrap { width: 100%; overflow: visible; }
.market-table { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.market-table th,
.market-table td { min-width: 0; padding: 9px clamp(7px, .72vw, 12px); border-right: 1px solid #edf1ef; border-bottom: 1px solid #e7ecea; text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.market-table th:last-child,
.market-table td:last-child { border-right: 0; }
.market-table tbody tr:last-child td { border-bottom: 0; }
.market-table thead th { background: #f8faf9; color: #8a9691; font-size: 13px; font-weight: 650; }
.market-table thead tr:first-child th { height: 38px; text-align: center; }
.market-table thead tr:nth-child(2) th { width: auto; height: 32px; text-align: left; }
.market-table thead .market-model-col,
.market-table thead .market-discount-col { text-align: left; }
.market-current-head { background: #edf9f3 !important; color: #27926e !important; }
.market-official-head { background: #fafafa !important; color: #9aa3a0 !important; }
.market-table thead small { margin-left: 5px; color: inherit; font-size: 11.5px; font-weight: 500; opacity: .75; }
.market-model-col { width: 19%; }
.market-discount-col { width: 9.5%; }
.market-model-row { background: #fff; transition: background-color .12s ease; }
.market-model-row:nth-child(even) { background: #fcfdfd; }
.market-model-row:hover { background: #f5fbf8; }
.market-model-row[hidden],
.market-group[hidden] { display: none; }

.market-model-name { background: inherit; box-shadow: 1px 0 0 #edf1ef; }
.market-model-name code { display: block; padding: 0; background: none; color: #26322e; font-family: var(--mono); font-size: 15px; font-weight: 750; overflow-wrap: anywhere; }
.market-price { color: #6e7975; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.market-price strong { display: block; color: #26332e; font-size: 15px; font-weight: 750; }
.market-price small,
.market-cache span { display: block; line-height: 1.6; }
.market-price small { color: #9a6b3e; font-size: 12.5px; }
.market-cache span { color: #27765b; }
/* The long-context line. The supplier states one boundary and reprices the
   whole request above it, so the row carries the standard figure on the first
   line and the above-threshold figure underneath, tagged so the two are never
   read as a range. */
.market-band { display: inline-block; margin-right: 5px; padding: 1px 4px; border-radius: 4px; background: #eef6f2; color: #7c8b85; font-size: 11.5px; font-style: normal; font-weight: 650; }
.market-long { color: #a35f22 !important; }
.market-official .market-long { color: #8d9793 !important; }
.market-official { background: rgba(249, 250, 250, .72); color: #9ba4a0; }
.market-official strong { color: #79837f; font-weight: 600; }
.market-official small { color: #a6aeab; }
.market-discount-cell { text-align: center !important; font-variant-numeric: tabular-nums; }
.market-discount-cell strong { display: inline-block; padding: 4px 7px; border-radius: 6px; background: #e9f8f1; color: #087653; font-size: 13px; white-space: nowrap; }
.market-discount-cell small { display: block; margin-top: 4px; color: #6e7b76; font-size: 12px; font-weight: 700; }
.market-discount-cell > span { color: #b2b9b6; }
.market-image-prices { color: #7b8782; font-size: 13px; }
.market-image-prices > span { margin-right: 8px; color: #8d9793; }
.market-image-prices b { display: inline-block; margin: 2px 7px 2px 0; color: #26332e; font-size: 12.5px; }
.market-image-official { font-size: 11.5px; }
.market-unpriced { color: #9ba4a0; font-size: 12.5px; }

.market-empty { padding: 64px 20px; border: 1px dashed #cad9d3; border-radius: 15px; background: rgba(255, 255, 255, .7); color: #87938e; font-size: 15px; text-align: center; }
.market-footnotes { display: grid; gap: 5px; margin-top: 16px; padding: 0 3px; color: #8a9590; font-size: 12.5px; line-height: 1.65; }
.market-footnotes a { color: #087653; text-decoration: underline; text-underline-offset: 2px; }

/* Below a 1340px viewport the console rail leaves too little room for eight
   readable columns. Turn each model row into a comparison card instead of
   shrinking the type or making customers discover prices by side-scrolling. */
@media (max-width: 1339.98px) {
  .market-table,
  .market-table tbody { display: block; width: 100%; }

  /* Every card cell shows its own label through attr(data-label) below, so the
     header row is decoration here. Hiding it with clip instead would leave it
     in the accessibility tree and make a screen reader read each price twice. */
  .market-table thead { display: none; }

  .market-table tbody { display: grid; gap: 11px; padding: 12px; }
  .market-model-row,
  .market-model-row:nth-child(even) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #dce8e3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(18, 91, 68, .04);
  }
  .market-model-row:hover { background: #fff; border-color: #bcdccc; }
  .market-table td { padding: 11px; border-right: 1px solid #edf1ef; border-bottom: 1px solid #edf1ef; background: #fff; }
  .market-table .market-model-name {
    grid-column: 1 / -1;
    border-right: 0;
    background: linear-gradient(90deg, #f3fbf7, #fff);
    box-shadow: none;
  }
  .market-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: #779087;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .01em;
  }
  .market-table .market-official { border-top: 6px solid #eef4f1; background: #fafcfb; }
  .market-table .market-official::before { color: #949f9b; }
  .market-table .market-discount-cell {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 0;
    border-bottom: 0;
    background: #f3fbf7;
    text-align: left !important;
  }
  .market-table .market-discount-cell::before { margin: 0 auto 0 0; }
  .market-discount-cell small { margin-top: 0; }
  .market-table .market-image-prices,
  .market-table .market-image-official,
  .market-table .market-unpriced { grid-column: 1 / -1; border-right: 0; }
  .market-table .market-image-official,
  .market-table .market-official.market-unpriced { border-top: 6px solid #eef4f1; }
}

@media (max-width: 899.98px) {
  .pricing-marketplace { padding: 18px; border-radius: 16px; }
  .market-page-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .market-total { align-self: flex-start; }
  .market-notice { align-items: flex-start; }
  .market-deal { flex-basis: 100%; max-width: none; margin: 4px 0 0 44px; }
}

@media (max-width: 640px) {
  .pricing-marketplace { margin: 0 calc(var(--pad) * -1); padding: 15px var(--pad) 20px; border-right: 0; border-left: 0; border-radius: 0; }
  .market-page-head h1 { font-size: 28px; }
  .market-notice { padding: 13px; }
  .market-notice > div { flex-basis: calc(100% - 44px); }
  .market-deal { margin-left: 0; }
  .market-deal-copy small { white-space: normal; }
  .market-filter-panel { padding: 13px 12px; }
  .market-filter-row { display: block; }
  .market-filter-label { display: block; margin-bottom: 6px; padding: 0; }
  .market-chips { flex-wrap: nowrap; overflow-x: auto; padding: 0 22px 3px 0; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
  .market-chips::-webkit-scrollbar { display: none; }
  .market-chip { flex: 0 0 auto; }
  .market-search-row { align-items: stretch; flex-wrap: wrap; }
  .market-search { flex: 1 1 100%; }
  .market-shown { margin-left: 0; }
  .market-reset { margin-left: auto; }
  .market-group-head { padding: 13px 12px; }
  .market-table tbody { gap: 10px; padding: 10px; }
  .market-model-row,
  .market-model-row:nth-child(even) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-table td { padding: 10px; }
  .market-table .market-cache,
  .market-table .market-model-name,
  .market-table .market-discount-cell,
  .market-table .market-image-prices,
  .market-table .market-image-official,
  .market-table .market-unpriced { grid-column: 1 / -1; }
  .market-table .market-official { border-top: 1px solid #edf1ef; }
  .market-table .market-model-row > td:nth-child(5),
  .market-table .market-model-row > td:nth-child(6),
  .market-table .market-image-official,
  .market-table .market-official.market-unpriced { border-top: 6px solid #eef4f1; }
  .market-price strong { font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .market-chip,
  .market-model-row { transition: none; }
}
