/* Vision AI lab */
.vi-intro { max-width: 900px; margin: 0 0 14px; line-height: 1.6; }
.vi-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 14px; }
.vi-wide { min-width: min(320px, 70vw); }
.vi-muted { font-weight: 400; color: var(--muted); font-size: 13px; }
.vi-ctl-tight { padding: 8px 10px; margin-bottom: 8px; }
.vi-canvas { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); touch-action: none; display: block; }
.vi-pos { color: #2563eb; font-weight: 600; } .vi-neg { color: #dc2626; font-weight: 600; }
.vi-good { color: #15803d; } .vi-bad { color: #b91c1c; }
.vi-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 6px 0 10px; font-size: 14px; }
.vi-dl dt { color: var(--muted); } .vi-dl dd { margin: 0; font-weight: 600; }
.vi-list { margin: 4px 0 8px; padding-left: 18px; list-style: disc; font-size: 14px; line-height: 1.55; }
.vi-list li { margin-bottom: 4px; }
.vi-h { margin: 26px 0 10px; font-weight: 700; font-size: 18px; }
.vi-flash { animation: vi-flash 1.2s ease; }
@keyframes vi-flash { 0%, 40% { box-shadow: 0 0 0 4px var(--teal-tint), 0 0 0 6px var(--teal); } 100% { box-shadow: none; } }

/* transformer */
.tf-flow { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; counter-reset: none; }
.tf-flow li { flex: 1 1 140px; display: flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; background: linear-gradient(135deg, #ede9fe, #ccfbf1); color: #1e1b4b; cursor: pointer; position: relative; }
.tf-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); font-weight: 700; color: #7c3aed; z-index: 1; }
.tf-flow li span { font-size: 12px; opacity: .8; }
.tf-tokens { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.tf-tok { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); cursor: pointer; }
.tf-tok.is-on { border-color: #f59e0b; box-shadow: 0 0 0 2px #fde68a; }
.tf-tok b { font-size: 14px; } .tf-tok small { font-size: 10px; color: var(--muted); }
.tf-tok em { font-style: normal; font-size: 11px; color: var(--muted); line-height: 1; }
.tf-strip { display: grid; grid-template-columns: repeat(8, 7px); gap: 1px; }
.tf-strip i { height: 12px; border-radius: 2px; }
.tf-attn-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 0.8fr); gap: 12px; align-items: start; }
.tf-attn { width: 100%; height: auto; touch-action: none; }
.tf-math { font-size: 13px; }
.tf-math p { margin: 0 0 6px; }
.tf-math code { font-size: 11px; }
.tf-math table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tf-math th { text-align: left; color: var(--muted); font-weight: 500; }
.tf-math td { padding: 2px 0; }
.tf-math tr.is-on td { color: #0d9488; font-weight: 700; }
.tf-wbar { display: inline-block; width: var(--w); max-width: 40px; height: 8px; margin-right: 4px; border-radius: 4px; background: #7c3aed; vertical-align: middle; }
.tf-arcs { position: relative; margin-top: 10px; }
.tf-arc-svg { display: block; width: 100%; height: 70px; }
.tf-arc-words { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-around; }
.tf-arc-words span { padding: 3px 8px; border-radius: 8px; background: var(--soft); cursor: pointer; font-weight: 600; font-size: 14px; }
.tf-arc-words span.is-on { background: #fde68a; color: #78350f; }
.tf-mlp { width: 100%; height: auto; }
.tf-probs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.tf-prob { display: grid; grid-template-columns: 90px 1fr 50px; gap: 8px; align-items: center; font-size: 14px; }
.tf-prob span { font-weight: 700; }
.tf-prob i { height: 12px; border-radius: 999px; background: rgb(var(--c-ink) / .08); overflow: hidden; }
.tf-prob i b { display: block; height: 100%; background: linear-gradient(90deg, #7c3aed, #0d9488); transition: width .25s; }
.tf-prob em { font-style: normal; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.tf-prob.is-cut { opacity: .45; }

/* yolo */
.yo-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.yo-steps button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-weight: 600; font-size: 14px; }
.yo-steps button.is-on { background: #0d9488; border-color: #0d9488; color: #fff; }
.yo-say { font-size: 15px; line-height: 1.6; min-height: 120px; }
.yo-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.yo-log { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.yo-iou-c { cursor: grab; }
.yo-iou-say { margin: 8px 0 0; font-size: 14px; }

/* architectures */
.ar-versions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ar-versions button { display: flex; flex-direction: column; align-items: center; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-weight: 700; }
.ar-versions button small { font-weight: 500; color: var(--muted); font-size: 11px; }
.ar-versions button.is-on { border-color: #7c3aed; box-shadow: 0 0 0 2px #ddd6fe; }
.ar-diagram { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
.ar-block { flex: 1 1 0; min-width: 130px; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 13px; }
.ar-block b { font-size: 14px; }
.ar-block small { color: var(--muted); font-size: 11px; }
.ar-block.is-new { border-color: #7c3aed; background: linear-gradient(180deg, rgba(124, 58, 237, .08), transparent); }
.ar-new { padding: 1px 6px; border-radius: 999px; background: #7c3aed; color: #fff; font-size: 10px; vertical-align: middle; }
.ar-arrow { align-self: center; font-style: normal; color: var(--muted); font-weight: 700; }
.ar-maps { display: flex; align-items: flex-end; gap: 3px; margin-top: 2px; }
.ar-maps i { width: var(--s); height: var(--s); border-radius: 2px; background: #94a3b8; }
.ar-detail { font-size: 14px; line-height: 1.6; }
.ar-detail ul { padding-left: 18px; list-style: disc; }
.ar-num { padding: 8px 12px; border-radius: 10px; background: var(--teal-tint); }
.ar-neck { width: 100%; height: auto; font: 11px system-ui; fill: var(--ink); }
.ar-neck .ar-h { fill: var(--muted); font-weight: 600; }
.ar-flow { stroke-dasharray: 6 4; animation: ar-dash 1s linear infinite; }
@keyframes ar-dash { to { stroke-dashoffset: -20; } }
.ar-chart { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.ar-row { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 10px; align-items: center; }
.ar-colhead span { color: var(--muted); font-size: 12px; }
.ar-bar { position: relative; height: 18px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.ar-bar i { position: absolute; inset: 0 auto 0 0; background: #7c3aed; opacity: .75; }
.ar-bar.is-ms i { background: #f59e0b; }
.ar-bar em { position: relative; padding-left: 6px; font-style: normal; font-weight: 700; line-height: 18px; }

/* reid */
.re-gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.re-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 2px solid transparent; border-radius: 10px; background: var(--soft); cursor: pointer; color: var(--ink); }
.re-card.is-q { border-color: #f59e0b; background: #fef3c7; }
.re-card small { font-size: 10px; color: var(--muted); }
.re-av { width: 100%; max-width: 46px; height: auto; border-radius: 6px; }
.re-result { margin-top: 10px; font-size: 14px; }
.re-rank { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.re-rank > div { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px; border-radius: 10px; border: 2px solid; font-size: 12px; }
.re-rank .is-hit { border-color: #16a34a; } .re-rank .is-miss { border-color: #dc2626; }
.re-rank em { font-style: normal; font-weight: 700; }
.re-score { margin: 8px 0 0; }
.re-train { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; }
.re-train input { flex: 1; }
.os-cues { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.lk-chip.is-on { border-color: #0d9488; background: var(--teal-tint); }
.os-streams { display: flex; flex-direction: column; gap: 6px; }
.os-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 110px 40px; gap: 8px; align-items: center; font-size: 13px; }
.os-row small { display: block; color: var(--muted); font-size: 11px; }
.os-rf { display: flex; align-items: center; justify-content: center; height: 48px; border-radius: 8px; background: var(--soft); }
.os-rf i { width: var(--rf); height: var(--rf); border: 2px solid #0d9488; border-radius: 3px; }
.os-gate { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.os-gate i { height: 14px; border-radius: 2px; background: #0d9488; }
.tr-wrap { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; align-items: start; }
.tr-canvas { width: 128px; height: 256px; border-radius: 10px; border: 1px solid var(--line); }

/* tracking */
.tk-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.tk-stats span { padding: 4px 10px; border-radius: 999px; background: var(--soft); }
.tk-cost table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tk-cost th, .tk-cost td { padding: 4px 8px; border: 1px solid var(--line); text-align: center; }
.tk-cost td.is-pick { background: #dcfce7; color: #14532d; font-weight: 700; }
.tk-systems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tk-systems h4 { margin: 0 0 8px; font-weight: 700; }
.tk-pipe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.tk-pipe span { padding: 5px 9px; border-radius: 8px; background: var(--soft); }
.tk-pipe i { font-style: normal; color: var(--muted); }
.tk-pipe .is-det { background: #dbeafe; color: #1e3a8a; } .tk-pipe .is-reid { background: #fef3c7; color: #78350f; } .tk-pipe .is-trk { background: #dcfce7; color: #14532d; }
.tk-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.tk-flow > button, .tk-flow > div { flex: 1 1 150px; display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: left; font-size: 13px; }
.tk-flow > button { cursor: pointer; }
.tk-flow > button:hover { border-color: #0d9488; }
.tk-flow b { font-size: 14px; } .tk-flow span { color: var(--muted); }
.tk-flow > i { align-self: center; font-style: normal; color: var(--muted); font-weight: 700; }

@media (max-width: 960px) {
  .vi-grid, .tk-systems, .tf-attn-wrap { grid-template-columns: minmax(0, 1fr); }
  .re-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .re-rank { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tf-flow li:not(:last-child)::after { display: none; }
}
@media (max-width: 480px) { .tr-wrap { grid-template-columns: minmax(0, 1fr); } .os-row { grid-template-columns: 44px minmax(0, 1fr) 70px 34px; } }
