.models-page { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.models-sidebar { align-self: start; background: var(--surface); border-right: 1px solid var(--line); height: calc(100vh - 56px); overflow-y: auto; padding: 22px 16px; position: sticky; top: 56px; }
.models-filter-group + .models-filter-group { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.models-filter-group h2 { color: var(--muted); font-size: 11px; letter-spacing: .07em; margin: 0 10px 8px; text-transform: uppercase; }
.models-filter { align-items: center; background: transparent; border: 0; border-radius: 7px; color: var(--ink-soft); display: flex; justify-content: space-between; min-height: 38px; padding: 7px 10px; text-align: left; width: 100%; }
.models-filter:hover, .models-filter.active { background: var(--accent-soft); color: var(--accent-strong); }
.models-filter b { color: var(--muted); font-size: 11px; font-weight: 600; }
.models-main { min-width: 0; padding: 26px 34px 80px; }
.models-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 22px; }
.models-heading p { color: var(--accent-strong); font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.models-heading h1 { font-size: 34px; margin-top: 4px; }
.models-heading span { color: var(--muted); display: block; margin-top: 4px; }
.models-toolbar { display: grid; gap: 10px; grid-template-columns: minmax(260px, 1fr) 210px auto; }
.models-search { margin: 0; position: relative; }
.models-search svg { fill: none; height: 18px; left: 13px; position: absolute; stroke: var(--muted); stroke-width: 1.8; top: 12px; width: 18px; }
.models-search input { padding-left: 40px; }
.models-sort > span:first-child { margin: 0; }
.models-view-switch { align-items: center; background: #eeebe4; border-radius: 8px; display: flex; padding: 3px; }
.models-view-switch button { background: transparent; border: 0; border-radius: 6px; min-height: 36px; padding: 6px 12px; }
.models-view-switch button.active { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .09); font-weight: 700; }
.models-category-tabs { border-bottom: 1px solid var(--line); display: flex; gap: 22px; margin: 24px 0 16px; overflow-x: auto; }
.models-category-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); min-height: 44px; padding: 0 2px; white-space: nowrap; }
.models-category-tabs button:hover, .models-category-tabs button.active { border-bottom-color: var(--accent); color: var(--accent-strong); }
.models-list { display: grid; gap: 24px; }
.model-provider-section { display: grid; gap: 12px; }
.model-provider-section > header { align-items: center; display: flex; gap: 10px; padding: 2px 2px 0; }
.model-provider-section > header h2 { font-size: 20px; }
.model-provider-section > header p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.model-provider-logo { align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 9px; display: flex; height: 38px; justify-content: center; width: 38px; }
.model-provider-logo img { max-height: 23px; max-width: 23px; }
.model-provider-cards { display: grid; gap: 10px; }
/* One model per row. The reference catalogue fits name, badges, description
   and every rate into ~170px by putting the rates on a single metadata line
   instead of a grid of tiles; the tile grid left a two-price model looking
   mostly empty. */
.model-row { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 9px; padding: 17px 20px; transition: border-color .15s ease, box-shadow .15s ease; }
.model-row:hover { border-color: var(--line-strong); box-shadow: 0 8px 24px rgba(35, 28, 65, .05); }
.model-row-head { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; }
.model-row-logo { align-items: center; background: #f2f0ea; border-radius: 8px; display: flex; flex: 0 0 30px; height: 30px; justify-content: center; width: 30px; }
.model-row-logo img { max-height: 19px; max-width: 19px; }
.model-row-head h2 { font-size: 17px; font-weight: 650; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.model-row-head h2 a { color: inherit; text-decoration: none; }
.model-row-head h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.model-row-badges { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; }
.model-row-id { align-items: center; display: flex; gap: 2px; margin: -4px 0 0; }
.model-row-id code { color: var(--muted); font: 12px var(--mono); }
.model-row-description { color: var(--ink-soft); line-height: 1.55; margin: 0; max-width: 960px; }
.model-row-note { color: var(--muted); }
.model-row-note::before { content: " — "; }
.model-row-meta { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 12.5px; gap: 0 10px; list-style: none; margin: 2px 0 0; padding: 0; }
.model-row-meta li { align-items: center; display: flex; font-variant-numeric: tabular-nums; gap: 10px; }
.model-row-meta li + li::before { color: var(--line-strong); content: "|"; }
.model-name { color: inherit; text-decoration: none; }
.model-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.model-directory-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.model-directory-tag { background: #f1eee7; border-radius: 999px; color: var(--ink-soft); font-size: 10px; padding: 4px 7px; }
.model-discount-badge { background: linear-gradient(135deg, #eee9ff, #e6f4ff); border: 1px solid rgba(91, 68, 213, .16); border-radius: 999px; box-shadow: 0 2px 8px rgba(91, 68, 213, .08); color: var(--accent-strong); display: inline-flex; font-size: 10px; font-weight: 750; letter-spacing: .01em; line-height: 1; padding: 5px 8px; white-space: nowrap; }
.copy-model { background: transparent; border: 0; color: var(--muted); padding: 5px; }
.copy-model svg { height: 16px; width: 16px; }
.copy-model.copied { color: var(--ok); }
.models-table-view .table-wrap { margin-top: 12px; }
.models-table-view .model-cell { align-items: center; display: flex; gap: 8px; min-width: 250px; }
.models-table-view .model-cell-copy { align-items: flex-start; display: flex; flex-direction: column; gap: 5px; }
.models-table-view .model-cell-copy > span:first-child { align-items: center; display: flex; }
.models-table-view .logo { align-items: center; background: #f2f0ea; border-radius: 7px; display: flex; height: 30px; justify-content: center; width: 30px; }
.models-table-view .logo img { max-height: 19px; max-width: 19px; }
.price-num, .free { font-variant-numeric: tabular-nums; white-space: nowrap; }
.models-table-view .price-num { white-space: normal; }
.free { color: var(--ok); font-weight: 650; }
.models-empty { background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); padding: 50px 20px; text-align: center; }

@media (max-width: 920px) {
  .models-page { grid-template-columns: 1fr; }
  .models-sidebar { border-bottom: 1px solid var(--line); border-right: 0; display: flex; gap: 20px; height: auto; overflow-x: auto; padding: 12px 16px; position: static; }
  .models-filter-group { display: flex; flex: 0 0 auto; gap: 4px; }
  .models-filter-group + .models-filter-group { border: 0; margin: 0; padding: 0; }
  .models-filter-group h2 { display: none; }
  .models-filter { min-width: max-content; width: auto; }
  .models-main { padding: 24px 18px 70px; }
}
@media (max-width: 700px) {
  .models-toolbar { grid-template-columns: 1fr; }
  .models-view-switch { width: max-content; }
  .model-row { padding: 15px 14px; }
  .model-row-head { align-items: flex-start; }
}
