/* /models/ v3 (2026-11-17): card wall with sidebar filters. Self-contained: this page loads only
   tommy-v4/chrome.css and this file. Structure follows the reference model library the owner chose
   (cover + type badge, provider, name, price line; filters on the left, single column on phones). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: rgba(8,127,131,.16); }
body.explore-v3 { --ink:#171717; --muted:#5f6363; --subtle:#8a8f8f; --line:#e5e7eb; --line-strong:#d1d5db; --soft:#fafafa; --teal:#087f83;
  margin: 0; color: var(--ink); background: #fff; font: 15px/1.6 Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; text-rendering: optimizeLegibility; }
.explore-v3 main a { color: inherit; text-decoration: none; }
.explore-v3 h1, .explore-v3 h2, .explore-v3 h3, .explore-v3 p { margin: 0; }
.explore-v3 :focus-visible { outline: 3px solid #35a8aa; outline-offset: 2px; }
.explore-v3 .skip-link { position: absolute; left: 16px; top: 8px; z-index: 200; transform: translateY(-160%); padding: 9px 12px; border-radius: 6px; color: #fff; background: #111; font-size: 13px; }
.explore-v3 .skip-link:focus-visible { transform: none; }
.explore-wrap { width: min(1344px, calc(100% - 96px)); margin: 0 auto; }

/* hero */
.explore-hero { padding: 92px 0 88px; text-align: center; }
.explore-hero h1 { font-size: clamp(38px, 6.2vw, 80px); font-weight: 700; letter-spacing: -.035em; line-height: 1.1; text-wrap: balance; }
.explore-hero p { max-width: 46em; margin: 24px auto 0; font-size: 19px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.explore-search { position: relative; width: min(672px, 100%); margin: 44px auto 0; }
.explore-search svg { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
.explore-search input { width: 100%; height: 60px; padding: 0 20px 0 56px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-size: 17px; box-shadow: 0 1px 2px rgba(17,24,39,.04); caret-color: var(--teal); }
.explore-search input::placeholder { color: #9ca3af; }
.explore-search input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }

/* body */
.explore-body { background: var(--soft); border-top: 1px solid #f0f0f0; padding: 36px 0 24px; }
.explore-layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: 32px; align-items: start; }
.explore-filters { position: sticky; top: 88px; display: grid; gap: 16px; max-height: calc(100vh - 104px); overflow: auto; scrollbar-width: thin; }
.explore-filters > summary { display: none; }
.filter-group { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.filter-group > summary { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 16px; font-size: 14px; font-weight: 650; cursor: pointer; list-style: none; user-select: none; }
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary svg { color: #9ca3af; flex: none; }
.filter-group > summary .filter-chevron { margin-left: auto; transition: transform .15s ease; }
.filter-group[open] > summary .filter-chevron { transform: rotate(180deg); }
.filter-list { display: grid; gap: 2px; padding: 0 12px 12px; }
.filter-option { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 8px; border-radius: 6px; font-size: 14px; color: #3f4444; cursor: pointer; }
.filter-option:hover { background: #f5f5f5; }
.filter-option input { appearance: none; -webkit-appearance: none; flex: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--line-strong); border-radius: 3px; background: #fff; cursor: pointer; }
.filter-option input:checked { background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 8.4 2.6 2.6L12 5.6'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--teal); }
.filter-option span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-option b { flex: none; min-width: 26px; padding: 1px 6px; border: 1px solid #eee; border-radius: 4px; background: #fafafa; color: var(--subtle); font-size: 11px; font-weight: 500; text-align: center; font-variant-numeric: tabular-nums; }
.filter-option:has(input:checked) { background: #f5f5f5; color: var(--ink); font-weight: 600; }
.filter-option:has(input:checked) b { background: var(--teal); border-color: var(--teal); color: #fff; }

.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; margin-bottom: 22px; font-size: 14px; color: var(--muted); }
.results-bar strong { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.explore-v3 .results-hint { display: flex; align-items: flex-start; gap: 8px; margin: -8px 0 20px; padding: 10px 14px; border: 1px solid #d5ebe9; border-radius: 6px; background: #f3fbfa; color: #33595a; font-size: 13px; line-height: 1.6; }
.results-hint svg { flex: none; margin-top: 3px; color: var(--teal); }
.sort-select { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font-size: 14px; }
.sort-select select { height: 38px; padding: 0 8px; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }

/* cards */
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; }
.catalog-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; overflow: hidden; transition: border-color .18s ease, box-shadow .18s ease; }
.catalog-card:hover { border-color: var(--line-strong); box-shadow: 0 10px 28px rgba(17,24,39,.08); }
.catalog-card[hidden] { display: none; }
.model-media { position: relative; aspect-ratio: 3 / 2; background: #f2f3f5; overflow: hidden; isolation: isolate; }
.model-cover, .model-video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.model-cover { z-index: 1; }
.model-video { z-index: 2; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.is-playing .model-video { opacity: 1; }
.media-video-failed .model-video { display: none; }
.media-detail-link { position: absolute; inset: 0; z-index: 3; }
.media-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 22px; color: #303038; background: #f0f1f4; }
.media-fallback span { font-size: 12px; font-weight: 650; }
.media-fallback strong { font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; overflow-wrap: anywhere; }
.media-kind { position: absolute; left: 10px; bottom: 10px; z-index: 4; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 7px; border: 1px solid rgba(17,24,39,.08); border-radius: 4px; background: rgba(255,255,255,.94); font-size: 12px; font-weight: 600; pointer-events: none; }
.media-kind[data-kind="video"] { color: #6d28d9; }
.media-kind[data-kind="image"] { color: #1d4ed8; }
.media-kind[data-kind="audio"] { color: #b45309; }
.media-kind[data-kind="text"], .media-kind[data-kind="embedding"], .media-kind[data-kind="rerank"], .media-kind[data-kind="other"] { color: #047857; }
.media-proof { position: absolute; left: 10px; top: 10px; z-index: 4; padding: 3px 7px; border-radius: 4px; background: rgba(17,17,17,.72); color: #fff; font-size: 11px; pointer-events: none; }
.preview-toggle { position: absolute; z-index: 5; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px 0 7px; border: 1px solid rgba(255,255,255,.24); border-radius: 4px; background: rgba(17,17,17,.82); color: #fff; font: inherit; font-size: 12px; line-height: 1; cursor: pointer; }
.preview-toggle:hover { background: #000; }
.preview-toggle:disabled { cursor: default; background: #4b4b52; }
.catalog-card-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 18px; }
.card-provider { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--subtle); }
.catalog-card h3 { margin-top: 6px; font-size: 17px; font-weight: 650; line-height: 1.35; letter-spacing: -.015em; overflow-wrap: anywhere; }
.catalog-card h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; margin-top: 10px; }
.catalog-card h3.is-long { font-size: 15px; letter-spacing: -.02em; }
.card-chips span { padding: 2px 8px; border-radius: 4px; background: #f3f4f6; color: #4b5563; font-size: 12px; line-height: 1.6; }
.catalog-card .model-availability { align-self: flex-start; margin-top: 10px; padding: 2px 8px; border-radius: 4px; font-size: 12px; line-height: 1.6; color: #80531b; background: #fff5e8; }
.catalog-card .model-availability[data-availability="unavailable"] { color: #8a3d3d; background: #fdeeee; }
.card-foot { margin-top: auto; padding-top: 14px; }
.card-foot::before { content: ""; display: block; margin-bottom: 14px; border-top: 1px solid #f0f0f0; }
.card-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; }
.card-price b { font-size: 25px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card-price span { font-size: 12px; color: var(--muted); }
.card-price-text span { font-size: 14px; color: var(--ink); font-weight: 600; }
.card-price-note { min-height: 18px; margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--subtle); }

/* compatibility aliases */
.alias-section { margin-top: 56px; }
.alias-section[hidden] { display: none; }
.alias-head { margin-bottom: 20px; padding: 18px 20px; border: 1px solid #f3dfc0; border-radius: 8px; background: #fffaf1; }
.alias-head h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 650; }
.alias-head h2 span { padding: 1px 8px; border-radius: 999px; background: #80531b; color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.alias-head p { max-width: 62em; margin-top: 8px; font-size: 14px; line-height: 1.7; color: #6b4a1e; }

.catalog-empty { padding: 64px 24px; border: 1px dashed var(--line-strong); border-radius: 8px; background: #fff; text-align: center; }
.catalog-empty[hidden] { display: none; }
.catalog-empty h2 { font-size: 20px; font-weight: 650; }
.catalog-empty p { margin: 10px auto 22px; max-width: 36em; color: var(--muted); font-size: 14px; }
.catalog-empty button { height: 40px; padding: 0 18px; border: 1px solid #111; border-radius: 8px; background: #111; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.catalog-notes { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.8; color: var(--muted); }
.catalog-notes p + p { margin-top: 6px; }
.catalog-notes a { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 1280px) { .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1040px) { .explore-wrap { width: calc(100% - 64px); } .explore-layout { grid-template-columns: 224px minmax(0, 1fr); gap: 24px; } .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .explore-wrap { width: calc(100% - 32px); }
  .explore-hero { padding: 44px 0 40px; }
  .explore-hero p { margin-top: 16px; font-size: 16px; }
  .explore-search { margin-top: 26px; }
  .explore-search input { height: 54px; font-size: 16px; }
  .explore-body { padding-top: 22px; }
  .explore-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .explore-filters { position: static; max-height: none; overflow: visible; gap: 10px; }
  .explore-filters > summary { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
  .explore-filters > summary::-webkit-details-marker { display: none; }
  .filter-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .catalog-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .results-bar { margin-bottom: 16px; }
  .alias-section { margin-top: 40px; }
}
@media (prefers-reduced-motion: reduce) { .explore-v3 *, .explore-v3 *::before, .explore-v3 *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
