/* v3 switchable test models: model cards, picker, judge line, leaderboard. Same tokens as app.css. */
.mpicker, .mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 10px; }
.mpicker.compact { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 8px 2px 10px; margin: -8px -2px -4px; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.mpicker.compact .mcard { flex: 0 0 186px; scroll-snap-align: start; }
.mpicker.compact .mcard:last-child { margin-right: 24px; }
.mcard { position: relative; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--rule); border-radius: 11px; background: var(--surface); padding: 11px 12px 10px; min-width: 0; text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s; }
.mcard[role="radio"] { cursor: pointer; }
.mcard[role="radio"]:hover { border-color: #cdbdf7; box-shadow: var(--sh-md); }
.mcard[role="radio"]:focus-visible { box-shadow: var(--ring); }
.mcard.on { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet), var(--sh-md); background: linear-gradient(180deg, #fbf9ff, #fff 60%); }
.mcard.off { background: var(--surface-2); opacity: .62; cursor: not-allowed; }
.mcard.off:hover { border-color: var(--rule); box-shadow: none; }
.mpicker.locked .mcard { cursor: default; }
.mc-check { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(124, 58, 237, .35); }
.mc-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc-n { font: 600 14px/1.25 var(--sans); color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mc-h .mbadge { margin-left: auto; }
.mc-l { font-size: 12px; color: var(--muted); margin-top: -4px; line-height: 1.35; }
.mbadge { display: inline-flex; align-items: center; gap: 3px; flex: none; border-radius: 999px; padding: 1px 8px 1px 6px; font-size: 11px; font-weight: 650; letter-spacing: .01em; }
.mbadge.fast { background: #e3f4f1; color: #0b6b62; }
.mbadge.smart { background: var(--violet-t); color: var(--violet-ink); }
.mc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.mtag { display: inline-flex; align-items: center; border-radius: 6px; padding: 0 7px; font-size: 11px; font-weight: 600; line-height: 1.75; white-space: nowrap; }
.mtag.live { background: var(--ok-bg); color: var(--ok); border: 1px solid #c4ebdd; }
.mtag.judge { background: var(--teal-t); color: var(--teal); }
.mspeed { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--teal-d); }
.mspeed .mono { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.meter { position: relative; flex: 1; height: 6px; min-width: 40px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, var(--teal-2), var(--violet-soft)); }
.mspeed.none { color: var(--faint); font-style: italic; }
.mspeed.none .meter { background: repeating-linear-gradient(90deg, var(--rule) 0 4px, transparent 4px 8px); }
.mspeed.none .meter i { display: none; }
.mc-facts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--muted); }
.mc-facts span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mc-facts .ic { color: var(--teal-2); opacity: .8; }
.mc-st { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; line-height: 1.4; color: var(--muted); padding-top: 6px; border-top: 1px dashed var(--rule); margin-top: auto; }
.mc-st .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; background: var(--faint); }
.mc-st.ready { color: var(--ok); } .mc-st.ready .dot { background: #10b981; box-shadow: 0 0 0 3px #d1fae5; }
.mc-st.warm { color: var(--warn); } .mc-st.warm .dot { background: #f59e0b; animation: mwarm 1.1s ease-in-out infinite; }
.mc-st.bad { color: var(--bad); } .mc-st.bad .dot { background: var(--bad); }
.mc-st.cold .dot { background: #b8c4ca; }
.mc-st.off { color: var(--muted); }
.mc-sub, .mc-note { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.mc-act { align-self: flex-start; margin-top: 2px; }
@keyframes mwarm { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, .45); } 50% { transform: scale(1.15); box-shadow: 0 0 0 5px rgba(245, 158, 11, 0); } }
.mcard.st-warm { border-color: #f6d9a8; }
.mcard.st-warm.on { border-color: var(--violet); }
.mc-warm { height: 4px; border-radius: 999px; background: #fdf0d9; overflow: hidden; }
.mc-warm i { display: block; height: 100%; border-radius: 999px; transition: width .9s linear;
  background: repeating-linear-gradient(-45deg, #f59e0b 0 6px, #fbbf24 6px 12px); background-size: 17px 17px; animation: mstripes .8s linear infinite; }
@keyframes mstripes { to { background-position: 17px 0; } }
.mcard.compact { padding: 9px 10px 8px; gap: 5px; }
.mcard.compact .mc-n { font-size: 13px; }

/* Test bench: the picker card, collapsed to one line while a chat runs */
.modelcard { margin-bottom: 18px; }
.modelcard .card-h { margin-bottom: 12px; }
.modelline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.modelline b { color: var(--heading); }
.chatmodel { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--violet-ink); background: var(--violet-t); border-radius: 999px; padding: 2px 9px 2px 7px; white-space: nowrap; }
.warmpanel { margin: auto; text-align: center; max-width: 46ch; padding: 20px; }
.warmpanel b { display: block; font: 500 19px var(--serif); color: var(--heading); margin: 10px 0 4px; }
.warmpanel p { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.warmorb { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; color: #b45309; background: radial-gradient(circle at 50% 55%, #fde7c2, #fff7e8 70%); position: relative; }
.warmorb::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid transparent; border-top-color: #f59e0b; border-right-color: #fcd34d; animation: mspin 1.2s linear infinite; }
@keyframes mspin { to { transform: rotate(360deg); } }
.warmbar { height: 5px; border-radius: 999px; background: #fdf0d9; overflow: hidden; margin: 0 auto 14px; max-width: 240px; }
.warmbar i { display: block; height: 100%; width: 35%; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #fbbf24); animation: indet 1.6s ease-in-out infinite; }
.recent .rc .rcm { color: var(--violet-ink); font-size: 12px; }

/* Compare: per-side model picker, the judge line, run models */
.sc-m { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--rule); }
.sc-m .sect { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.judgeline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; color: var(--teal-d); }
.judgeline .ic { color: var(--teal-2); }
.judgeline .jl-t { font-weight: 550; }
.jl-s { font-size: 12px; border-radius: 999px; padding: 1px 9px; background: var(--surface-2); color: #46525a; }
.jl-s.ok { background: var(--ok-bg); color: var(--ok); }
.jl-s.warm { background: var(--warn-bg); color: var(--warn); }
.jl-s.bad { background: var(--bad-bg); color: var(--bad); border-radius: 8px; line-height: 1.45; padding: 3px 9px; }
.cmp-judge { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); }
.runmodels { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-card); padding: 10px 16px; margin-bottom: 14px; font-size: 13px; color: var(--muted); box-shadow: var(--sh-sm); }
.runmodels .rm { display: inline-flex; align-items: center; gap: 6px; }
.runmodels .rm b { color: var(--heading); font-weight: 600; }
.runmodels .judgeline { margin-left: auto; }
.sidemodel { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 11.5px; font-weight: 600; color: var(--violet-ink); background: var(--violet-t); border-radius: 999px; padding: 1px 8px 1px 6px; }
.repwait { display: inline-flex; align-items: center; gap: 8px; }
.repwait .dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; animation: mwarm 1.1s ease-in-out infinite; }
.progress.warming i { background: repeating-linear-gradient(-45deg, #f59e0b 0 6px, #fbbf24 6px 12px); }
.replist { display: grid; gap: 2px; }
.replist button { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 10px; cursor: pointer; font: inherit; font-size: 13px; color: var(--teal-d); }
.replist button:hover, .replist button.on { background: var(--teal-t); }
.replist .rid { font: 600 12px var(--mono); color: var(--muted); }
.replist .when { margin-left: auto; font-size: 12px; color: var(--faint); }

/* Leaderboard */
.lboard .judgeline { margin-bottom: 12px; }
.lb td { vertical-align: middle; }
.lb tr.lead td { background: #fffbf0; }
.lb tr.unranked td { color: var(--faint); }
.lb-rank { width: 1%; text-align: center; font: 600 13px var(--mono); color: var(--muted); }
.trophy { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d6, #fde68a); color: #a16207; box-shadow: 0 0 0 1px #f5d77a, 0 4px 10px -4px rgba(161, 98, 7, .5); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lb-m { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lb-m b { color: var(--heading); font-weight: 600; }
.lb-pass { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.lb-pass .mono { font-weight: 600; color: var(--heading); min-width: 44px; }
.lb-pass .meter { max-width: 90px; }
.lb-conf { color: var(--bad); font-weight: 600; }
.calmok { color: var(--ok); }
.lb-foot { margin: 10px 0 0; }

@media (max-width: 980px) {
  .mpicker, .mgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .runmodels .judgeline { margin-left: 0; }
}
@media (max-width: 560px) {
  .mpicker, .mgrid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mpicker.compact .mcard { flex-basis: 160px; }
  .mcard { padding: 9px 9px 8px; }
  .mc-l { display: none; }
  .mc-n { font-size: 13px; white-space: normal; }
  .mc-h { flex-wrap: wrap; gap: 4px; }
  .mc-h .mbadge { margin-left: 0; }
  .mc-facts { gap: 2px 8px; }
}
.sides { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sidecard { grid-template-columns: minmax(0, 1fr); }
.sc-m { min-width: 0; }
@media (max-width: 980px) { .sides { grid-template-columns: minmax(0, 1fr); } }
/* refusal reasons wrap in full (ops follow-up: a two-Spark reason was clipped at 3 lines); no toggle, because the
   card is a role="radio" whose children are presentational, so a nested button would be lost to screen readers */
.mc-st span { min-width: 0; overflow-wrap: anywhere; }
.mspeed.none span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mspeed.none .meter { flex: 0 0 36px; min-width: 36px; }
.mtag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mcard[role="radio"].on, .mcard[role="radio"].on:hover { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet), var(--sh-md); }
.mcard[role="radio"].on:focus-visible { box-shadow: 0 0 0 1px var(--violet), var(--ring); }
@media (max-width: 560px) { .mtag { white-space: normal; line-height: 1.4; padding: 2px 7px; } }
@media (max-width: 560px) { .mspeed.none .meter { display: none; } }
