/* ============================================================
   models/style.css — the public Models page. The same cards,
   metrics and version tables as the Train page's "The models"
   (train/style.css); tokens and the top bar from common/.
   ============================================================ */
.muted { color: var(--muted); }
.small { font-size: 11px; }
.my { font-family: var(--myanmar); font-weight: 400; }
.note { font-size: 12px; color: var(--text2); line-height: 1.6; }
.note.error { color: var(--accent2); }

#page { max-width: 1040px; margin: 0 auto; padding: 22px 16px 64px; display: flex; flex-direction: column; gap: 16px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { font-size: 13px; color: var(--text2); margin-top: 4px; max-width: 72ch; line-height: 1.6; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px 20px; }

.model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.model { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.model-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.model-name { font-size: 17px; font-weight: 700; }
.model-name .my { color: var(--text2); font-size: 15px; margin-left: 6px; }
.model-reads { font-size: 11px; color: var(--muted); }
.tag { font-size: 11px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
       border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.tag.none { color: var(--muted); background: var(--surface2); }
.empty-model { font-size: 12px; color: var(--text2); background: var(--surface2); border: 1px dashed var(--border2);
               border-radius: 10px; padding: 12px 14px; }

/* Version switcher: one button per version on the menu */
.ver-switch { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--surface2);
              border: 1px solid var(--border); border-radius: 10px; align-self: flex-start; }
.ver-switch button { font: 600 12px var(--mono); color: var(--text2); background: none; border: 0; border-radius: 7px;
                     padding: 5px 12px; cursor: pointer; }
.ver-switch button:hover { color: var(--text); }
.ver-switch button.on { color: var(--accent); background: var(--surface); box-shadow: 0 0 0 1px var(--border2); }
.ver-switch button:focus-visible, .row-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.metric { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; }
.metric-v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; grid-row: span 2; }
.metric-k { font-size: 12px; font-weight: 600; }
.metric-s { font-size: 11px; color: var(--text2); line-height: 1.5; }
.metric.small .metric-v { font-size: 18px; }
.vs-legacy { font-size: 11px; color: var(--text2); line-height: 1.6; margin-top: -4px; }

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.versions { width: 100%; border-collapse: collapse; font-size: 11px; }
.versions th { text-align: left; font-size: 10px; color: var(--muted); font-weight: 600; padding: 4px 6px 4px 0; }
.versions td { padding: 5px 6px 5px 0; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.versions tr:has(td) { cursor: pointer; }
.versions tr:has(td):hover td { background: var(--surface2); }
.versions .cur td, .versions .cur .row-pick { color: var(--accent); font-weight: 600; }
.row-pick { font: inherit; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; }
.dflt { font-size: 9px; color: var(--muted); border: 1px solid var(--border2); border-radius: 6px; padding: 0 4px; margin-left: 6px; }
.num, .versions th.num { text-align: right; white-space: nowrap; }
.versions .when { padding-right: 0; }

.facts { border-top: 1px solid var(--border); padding-top: 10px; }
.facts summary { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; }
.facts dl { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 4px 12px; margin-top: 8px; font-size: 12px; }
.facts dt { color: var(--text2); }
.facts dd { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .model-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .card { padding: 16px 16px 18px; }
  .actions .btn { flex: 1 1 auto; text-align: center; }
  .versions .when { display: none; }
}
