.models-page { min-width:0; padding-bottom:28px; }
.models-header,.models-tools { display:flex; align-items:center; gap:12px; min-width:0; }
.models-header { min-height:28px; }
.models-header h1 { margin:0; font-size:16px; font-weight:500; }
.models-header>span,.models-header>a,.models-count { color:var(--fg2); font-size:12px; }
.models-header>a { margin-left:auto; }
.models-tools { margin:24px 0 16px; justify-content:space-between; flex-wrap:wrap; }
.model-tabs { display:inline-flex; align-items:center; max-width:100%; padding:3px; border-radius:999px; background:var(--chip); }
.model-tabs a { display:flex; align-items:center; justify-content:center; padding:0 15px; height:var(--control-height); border-radius:999px; color:var(--fg2); white-space:nowrap; }
@media(pointer:coarse){
 .model-tabs a { position:relative; }
 .model-tabs a::after { content:""; position:absolute; inset:-8px 0; }
}
.model-tabs a[aria-current] { background:var(--fg); color:var(--bg); }
.models-tools .ai-search { width:min(245px,100%); }
.models-page .ai-ranking-head h2 { margin:0; font-size:14px; font-weight:500; }
.models-empty { padding:0!important; }
.model-missing { color:var(--fg2); }
@media(max-width:900px){
 .models-header { gap:8px; flex-wrap:wrap; }
 .models-tools { margin:14px 0 12px; gap:12px; }
 .models-tools .ai-search { flex:1 1 200px; }
}
.ai-ranking { min-width:0; border:1px solid var(--line); border-radius:10px; margin:0 0 10px; overflow:hidden; }
.ai-ranking-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 14px; padding:14px 16px; }
.ai-ranking-head h3 { font-size:14px; font-weight:600; }
.ai-ranking time,.ai-ranking-source { color:var(--fg2); font-size:12px; }
.ai-ranking-source { margin-left:auto; }
.ai-ranking a:hover { text-decoration:underline; }
.ai-ranking-scroll { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
.ai-ranking table { width:100%; min-width:890px; border-collapse:separate; border-spacing:0; text-align:left; font-variant-numeric:tabular-nums; }
.ai-ranking th,.ai-ranking td { padding:8px 10px; border-bottom:1px solid var(--line); }
.ai-ranking thead th { background:var(--bg2); font-size:12px; font-weight:500; }
.ai-ranking th[scope="colgroup"] { border-left:1px solid var(--line); }
.ai-ranking th[data-column] { padding:0; }
.ai-ranking th button{ display:flex; width:100%; align-items:center; justify-content:space-between; gap:6px; padding:0 10px; min-height:var(--control-height); text-align:left;height:var(--control-height)}
.ai-ranking th button>span { white-space:nowrap; line-height:14px; }
.ai-ranking th[data-column="rank"] button { padding-inline:5px; gap:2px; }
.ai-ranking th[data-column="rank"] button .ui-icon { width:12px; height:12px; }
.ai-ranking th[data-column="score"] { width:1%; }
.ai-ranking th small{ display:block; color:var(--fg2); font-size:11px;line-height:14px;margin:0}
.ai-ranking th button:hover { background:var(--chip); }
.ai-ranking tbody th { font-weight:500; min-width:166px; }
.rank-identity { display:inline-flex; align-items:center; gap:8px; vertical-align:middle; }
.rank-identity img { width:18px; height:18px; flex:none; object-fit:contain; }
.ai-ranking td { white-space:nowrap; }
.ai-ranking tbody td:nth-child(n+5) { text-align:right; }
.ai-ranking tbody tr:last-child>* { border-bottom:0; }
@media(max-width:600px){
  .ai-ranking-head{padding:12px;gap:4px 10px}
  .ai-ranking-head h3{flex:1}
  .ai-ranking-source{flex-basis:100%;margin:3px 0 0}
}

/* Keep the page shell outside iOS rubber-band scrolling. Only ranking rows scroll. */
html:has(#app[data-view="tool:ai-models"]),
body:has(#app[data-view="tool:ai-models"]){overflow:hidden;overscroll-behavior:none}
#app[data-view="tool:ai-models"]{
  position:fixed;inset:0 0 0 var(--side);margin-left:0;
  display:flex;flex-direction:column;min-height:0;overflow:hidden;
  padding-bottom:max(16px,env(safe-area-inset-bottom));
}
.models-page{--rank-number-width:48px;--rank-model-width:260px;display:flex;flex:1;flex-direction:column;min-height:0;padding-bottom:0}
.models-header,.models-tools,.ai-ranking-head{flex:none}
.models-page .ai-ranking{display:flex;flex-direction:column;flex:1;min-height:0;margin:0}
.models-page .ai-ranking-columns{flex:none;overflow:hidden;scrollbar-gutter:stable;background:var(--bg2)}
.models-page .ai-ranking-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:none;scrollbar-gutter:stable;touch-action:pan-x pan-y}
.models-page table{table-layout:fixed;width:100%;min-width:calc(var(--rank-other-width) + var(--rank-model-width))}
.models-page .ai-ranking-columns th[scope=colgroup]{height:34px;padding-block:0}
.models-page .rank-accessible-head{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.models-page tbody th[scope=row]{min-width:0}
.models-page tbody th .rank-identity{display:flex;align-items:flex-start;gap:6px}
.models-page tbody th .rank-identity>span{min-width:0;overflow-wrap:anywhere}
.models-page tbody th .rank-identity img{margin-top:1px}
.models-page [hidden]{display:none!important}
@media(max-width:900px){
  #app[data-view="tool:ai-models"]{top:calc(var(--mobile-head) + env(safe-area-inset-top))}
  .models-page{--rank-model-width:180px}
  .models-page tbody td[data-key="rank"],.models-page tbody th[scope="row"]{position:sticky;z-index:1;background:var(--bg)}
  .models-page .ai-ranking-columns th[data-column="rank"],.models-page .ai-ranking-columns th[data-column="model"]{position:sticky;z-index:2}
  .models-page tbody td[data-key="rank"],.models-page .ai-ranking-columns th[data-column="rank"]{left:0}
  .models-page tbody th[scope="row"],.models-page .ai-ranking-columns th[data-column="model"]{left:var(--rank-number-width);border-right:1px solid var(--line)}
}
@media(max-width:420px){.models-page{--rank-model-width:144px}}
@media(max-height:540px){.models-tools{margin-block:6px}.ai-ranking-head{padding-block:6px}}
