/* VidLab API platform: the model market (models.js). Also the shared catalogue pieces (.vlmk-logo, .vlmk-price,
   .vlmk-save, .vlmk-task) the model page and the pricing page reuse; both load this file too. */

/* ---------- shared: maker logo tile, price, save badge, task chips ---------- */
.vlmk-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--vla-panel-2);
  border: 1px solid var(--vla-line);
  color: var(--vla-ink-2);
}
/* Every maker's mark sits in the same tile with the same room around it (the files are drawn for this dark tile; see
   site/open/companies/SOURCES.md). The neutral model glyph (a maker we hold no mark for) takes the same box. */
.vlmk-logo img,
.vlmk-logo svg { display: block; width: 18px; height: 18px; object-fit: contain; }
.vlmk-logo--sm { width: 28px; height: 28px; }
.vlmk-logo--lg { width: 44px; height: 44px; border-radius: 12px; }
.vlmk-logo--card { width: 56px; height: 56px; border-radius: 16px; background: #0a0a0a; border-color: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.vlmk-logo--card img,
.vlmk-logo--card svg { width: 34px; height: 34px; }
.vlmk-logo--lg img,
.vlmk-logo--lg svg { width: 28px; height: 28px; }

.vlmk-price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 2px; min-width: 0; }
.vlmk-price strong { font-weight: 500; font-size: 15px; color: var(--vla-ink); }
.vlmk-price__unit { color: var(--vla-ink-2); font-size: 13px; }
.vlmk-price__market { margin-left: 8px; color: var(--vla-ink-3); font-size: 12.5px; }
.vlmk-save {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--vla-r-pill);
  border: 1px solid rgba(52, 211, 153, .3);
  color: var(--vla-ok);
  font: 500 11.5px/1 var(--vla-mono);
  white-space: nowrap;
  flex: none;
}
.vlmk-tasks { display: flex; flex-wrap: wrap; gap: 6px; }
.vlmk-task {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--vla-line-2);
  font: 500 10.5px/1 var(--vla-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--vla-ink-2);
  white-space: nowrap;
}

/* ---------- the market (the toolbar, two filter boxes, a card grid) ---------- */
.vlmk { min-width: 0; container: vlmk / inline-size; }
.vlmk-head { padding: 4px 0 26px; }
.vlmk-title { margin: 0; font: 500 clamp(40px, 5.6vw, 64px)/1.02 var(--vla-font-display); letter-spacing: -0.035em; }
.vlmk-lede { margin: 16px 0 0; max-width: 620px; color: var(--vla-ink-2); font-size: 15.5px; line-height: 1.55; }
.vlmk-lede__n { color: var(--vla-ink); }

/* the toolbar: type tabs, search, sort, layout */
.vlmk-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--vla-line);
  border-radius: var(--vla-r);
  background: var(--vla-panel);
}
.vlmk-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; min-width: 300px; padding: 3px; border-radius: var(--vla-r-sm); background: var(--vla-field); border: 1px solid var(--vla-line); }
.vlmk-tab { height: 34px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--vla-ink-2); font-weight: 500; transition: background-color 150ms ease, color 150ms ease; }
.vlmk-tab:hover { background: var(--vla-hover); color: var(--vla-ink); }
.vlmk-tab[aria-selected="true"],
.vlmk-tab[aria-selected="true"]:hover { background: #fff; color: #050505; }
.vlmk-search { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.vlmk-search svg { position: absolute; left: 14px; width: 16px; height: 16px; color: var(--vla-ink-3); pointer-events: none; }
.vlmk-search__input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border-radius: var(--vla-r-pill);
  border: 1px solid var(--vla-line-2);
  background: var(--vla-field);
  color: var(--vla-ink);
  outline: none;
}
.vlmk-search__input:focus { border-color: rgba(255, 255, 255, .35); }
.vlmk-search__input::-webkit-search-cancel-button { cursor: pointer; }
.vlmk-bar .vlmk-search__input { height: 42px; border-radius: var(--vla-r-sm); }
.vlmk-sort { width: 200px; height: 42px; min-height: 42px; padding: 0 12px; border-radius: var(--vla-r-sm); }
.vlmk-view { display: inline-flex; gap: 2px; padding: 3px; height: 42px; border-radius: var(--vla-r-sm); border: 1px solid var(--vla-line-2); background: var(--vla-field); }
.vlmk-view__btn { display: inline-grid; place-items: center; width: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--vla-ink-3); transition: background-color 150ms ease, color 150ms ease; }
.vlmk-view__btn svg { width: 17px; height: 17px; }
.vlmk-view__btn:hover { background: var(--vla-hover); color: var(--vla-ink); }
.vlmk-view__btn[aria-pressed="true"] { background: var(--vla-hover-2); color: var(--vla-ink); }

/* Capability and Provider */
.vlmk-boxes { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 9fr); gap: 14px; margin-top: 14px; }
.vlmk-box { min-width: 0; padding: 16px; border: 1px solid var(--vla-line); border-radius: var(--vla-r); background: var(--vla-panel); }
.vlmk-box__head { display: flex; align-items: baseline; gap: 10px; min-height: 28px; margin-bottom: 12px; }
.vlmk-box__title { margin: 0; font: 500 17px/1.2 var(--vla-font-display); letter-spacing: -0.01em; }
.vlmk-box__sub { font-size: 13px; color: var(--vla-ink-3); }
.vlmk-clear { align-self: center; height: 28px; margin-left: auto; padding: 0 10px; border: 0; border-radius: var(--vla-r-pill); background: transparent; color: var(--vla-ink-2); font-size: 13px; }
.vlmk-clear:hover { background: var(--vla-hover); color: var(--vla-ink); }
.vlmk-opts { display: grid; gap: 8px; }
.vlmk-opts--cap { grid-template-columns: minmax(0, 1fr); }
.vlmk-opts--maker { grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); }
.vlmk-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--vla-line);
  border-radius: var(--vla-r-sm);
  background: var(--vla-field);
  color: var(--vla-ink-2);
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.vlmk-opt:hover { background: var(--vla-hover); border-color: var(--vla-line-2); color: var(--vla-ink); }
.vlmk-opt[aria-checked="true"] { background: var(--vla-hover); border-color: rgba(255, 255, 255, .42); color: var(--vla-ink); }
.vlmk-opt.is-empty,
.vlmk-opt.is-empty:hover { background: var(--vla-field); border-color: var(--vla-line); color: var(--vla-ink-3); cursor: default; }
.vlmk-opt.is-empty .vlmk-logo { opacity: .45; }
.vlmk-opt__box { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--vla-line-2); background: var(--vla-field); }
.vlmk-opt[aria-checked="true"] .vlmk-opt__box { background: #fff; border-color: #fff; color: #050505; }
.vlmk-opt__box svg { width: 11px; height: 11px; }
.vlmk-opt__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.vlmk-opt__n { flex: none; font-size: 12px; color: var(--vla-ink-3); }
.vlmk-morebtn { display: none; width: 100%; height: 40px; margin-top: 8px; border: 1px solid var(--vla-line); border-radius: var(--vla-r-sm); background: transparent; color: var(--vla-ink-2); font-weight: 500; }
.vlmk-morebtn:hover { background: var(--vla-hover); color: var(--vla-ink); }

/* the cards */
.vlmk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.vlmk-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 46%), var(--vla-panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.vlmk-card:hover { border-color: rgba(255, 255, 255, .22); transform: translateY(-2px); }
.vlmk-card__media { position: relative; display: block; flex: none; aspect-ratio: 16 / 10; overflow: hidden; background: var(--vla-panel-2); border-bottom: 1px solid var(--vla-line); }
.vlmk-card__ph { position: absolute; inset: 0; display: grid; place-items: center; }
.vlmk-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: 0; transition: opacity 240ms ease; }
.vlmk-card__media.is-loaded img { opacity: 1; }
.vlmk-card__media.is-broken img { display: none; }
.vlmk-card__body { display: flex; flex: 1; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 20px 14px; }
.vlmk-card__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vlmk-type { flex: none; height: 22px; font-size: 10.5px; }
.vlmk-card__name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vlmk-card__title { min-width: 0; font: 500 17px/1.25 var(--vla-font-display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.vlmk-card__price { margin-top: auto; padding-top: 4px; font-size: 14px; }
.vlmk-card__price strong { font-size: 21px; font-weight: 500; letter-spacing: -.01em; }
.vlmk-card__go { display: flex; flex: none; align-items: center; justify-content: center; height: 46px; margin: 0 14px 14px; border-radius: 13px; background: #fff; color: #050505; font-weight: 500; transition: background-color 150ms ease; }
.vlmk-card:hover .vlmk-card__go { background: #ececec; }
.vlmk-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.vlmk-card__title { font-size: 21px; line-height: 1.2; font-weight: 500; letter-spacing: -.015em; }
.vlmk-card__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.vlmk-sentinel { height: 1px; }
.vlmk-sentinel[hidden] { display: none; }
.vlmk-none { grid-column: 1 / -1; padding: 56px 16px; border: 1px solid var(--vla-line); border-radius: var(--vla-r); background: var(--vla-panel); text-align: center; color: var(--vla-ink-2); }
.vlmk-none p { margin: 0 0 14px; }

/* the list layout: one row a model */
.vlmk-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.is-list .vlmk-card { display: grid; grid-template-columns: 152px minmax(0, 1fr) 136px; }
.is-list .vlmk-card__media { aspect-ratio: auto; min-height: 92px; border-bottom: 0; border-right: 1px solid var(--vla-line); }
.is-list .vlmk-card__body { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0 24px; padding: 12px 18px; }
.is-list .vlmk-card__name { order: -1; }
.is-list .vlmk-card__price { margin-top: 0; padding-top: 0; text-align: right; }
.is-list .vlmk-card__go { height: auto; margin: 10px; }
.is-list .vlmk-card { min-height: 0; }
.is-list .vlmk-card:hover { transform: none; }
.is-list .vlmk-logo--card { width: 40px; height: 40px; border-radius: 12px; }
.is-list .vlmk-logo--card img,
.is-list .vlmk-logo--card svg { width: 24px; height: 24px; }

/* width of the page column (not the window: the side menu takes some) */
/* the market while its catalogue is on its way: the same boxes in grey (models.js render) */
.vlmk--skel .vlmk-tab { display: inline-flex; align-items: center; justify-content: center; }
.vlmk--skel .vlmk-search__input,
.vlmk--skel .vlmk-sort { display: block; }
.vlmk--skel .vlmk-view { width: 76px; }
.vlmk-sk { display: block; border-radius: 7px; background: rgba(255, 255, 255, .055); animation: vlmk-pulse 1.4s ease-in-out infinite; }
.vlmk-lede__n .vlmk-sk--n { display: inline-block; width: 2.2em; height: .9em; vertical-align: -1px; }
.vlmk-opt--skel,
.vlmk-opt--skel:hover { background: var(--vla-field); border-color: var(--vla-line); cursor: default; }
.vlmk-sk--opt { width: 62%; height: 10px; }
.vlmk-card--skel,
.vlmk-card--skel:hover { min-height: 268px; transform: none; border-color: rgba(255, 255, 255, .08); }
.vlmk-card--skel .vlmk-card__body { gap: 16px; }
.vlmk-sk--chip { width: 54px; height: 22px; }
.vlmk-sk--name { width: 70%; height: 22px; margin-top: 30px; }
.vlmk-sk--price { width: 52%; height: 18px; margin-top: auto; }
.vlmk-card__go.vlmk-sk-go { background: rgba(255, 255, 255, .06); }
@keyframes vlmk-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .vlmk-sk { animation: none; } }
@container vlmk (max-width: 559px) {
  .vlmk-opts--cap .vlmk-opt--skel { width: 146px; }
  .vlmk-opts--maker .vlmk-opt--skel { width: 150px; }
  .vlmk-morebtn--skel { display: inline-flex; align-items: center; color: var(--vla-ink-3); }
  .vlmk-opts--maker .vlmk-opt--skel:nth-child(n + 7) { display: none; }
  .vlmk-card--skel { min-height: 250px; }
}

@container vlmk (max-width: 1039px) {
  .vlmk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container vlmk (max-width: 760px) {
  .vlmk-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .vlmk-tabs,
  .vlmk-search { grid-column: 1 / -1; }
  .vlmk-tabs { min-width: 0; }
  .vlmk-sort { width: 100%; }
}
@container vlmk (max-width: 799px) {
  .vlmk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container vlmk (max-width: 559px) {
  .vlmk-head { padding-bottom: 20px; }
  .vlmk-boxes { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .vlmk-box { padding: 14px; }
  .vlmk-box__head { min-height: 24px; margin-bottom: 10px; }
  /* the choices wrap like chips, so the boxes stay short */
  .vlmk-opts { display: flex; flex-wrap: wrap; gap: 6px; }
  .vlmk-opt { flex: 0 1 auto; max-width: 100%; min-height: 38px; padding: 0 10px; gap: 8px; }
  .vlmk-opt__label { flex: 0 1 auto; }
  .vlmk-opts--maker:not(.is-open) .vlmk-opt:nth-child(n + 7):not([aria-checked="true"]) { display: none; }
  .vlmk-morebtn { display: block; width: auto; height: 34px; margin-top: 10px; padding: 0 14px; }
  .is-list .vlmk-card { grid-template-columns: 104px minmax(0, 1fr); }
  .is-list .vlmk-card__body { grid-template-columns: minmax(0, 1fr); row-gap: 8px; padding: 12px 14px; }
  .is-list .vlmk-card__price { text-align: left; }
  .is-list .vlmk-card__go { grid-column: 1 / -1; height: 40px; }
}
@container vlmk (max-width: 479px) {
  .vlmk-grid:not(.is-list) { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .vlmk-card__media img { transition: none; }
}

