/* Codila list template ("kit"): one shell page + one JSON per list. Look and spacing measured from a plain catalog
   layout at 390 and 1440 px: white page, Inter, 14 px text, thin grey rules, 728 px column. See scripts/KIT-TEMPLATE.md. */
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono Variable'; font-style: normal; font-display: swap; font-weight: 100 800; src: url('/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2'); }

:root {
  --font: 'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono Variable', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ink: #151515;
  --ink-2: #757575;
  --muted: #a5a5a5;
  --faint: #e5e5e5;
  --line: #ededed;
  --subtle: #f5f5f5;
  --hover: #fafafa;
  --doc: #404040;
  --bg: #fff;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: #000; font: 400 16px/24px var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; z-index: 60; background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.skip:focus { top: 8px; }
.t14 { font-size: 14px; line-height: 21px; }

.c7 { width: 100%; max-width: 1280px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.c3 { width: 100%; max-width: 768px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* ---------- header ---------- */
.hd { position: absolute; inset: 0 0 auto; z-index: 10; padding-top: 8px; }
.hd nav { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 21px; font-weight: 450; color: var(--ink); }
.brand img { width: 18px; height: 18px; border-radius: 50%; }
.hd-r { display: flex; align-items: center; gap: 8px; }
.ibtn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); transition: background-color .15s ease-out; }
.ibtn:hover { background: var(--subtle); }
.ibtn svg { width: 16px; height: 16px; }
.xpill { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; line-height: 21px; border: 1px solid transparent; transition: opacity .15s ease-out; }
.xpill:hover { opacity: .88; }
.xpill svg { width: 14px; height: 14px; }

/* ---------- page column ---------- */
main { padding-top: 80px; min-height: 70vh; }
.stack { display: flex; flex-direction: column; gap: 48px; min-width: 0; }
.stack-40 { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
h1, .h1 { margin: 0; font-size: 36px; line-height: 45px; font-weight: 450; letter-spacing: -0.9px; color: var(--ink); text-wrap: balance; }
.home-h { max-width: 384px; }
.sec { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.blk { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.blk-20 { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stitle { align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; font-size: 14px; line-height: 21px; font-weight: 450; color: var(--ink-2); transition: color .15s ease-out; }
a.stitle:hover { color: var(--ink); }
.stitle svg { width: 16px; height: 16px; color: var(--muted); }

/* ---------- boxed cards ---------- */
.grid2 { display: grid; gap: 12px; min-width: 0; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.card { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; transition: background-color .15s ease-out; }
a.card:hover, .card.is-link:hover { background: var(--hover); }
.card-d { display: flex; flex-direction: column; gap: 2px; padding-right: 32px; min-width: 0; }
.card-t { font-size: 14px; line-height: 21px; font-weight: 450; color: var(--ink); }
.card-s { font-size: 14px; line-height: 21px; color: var(--ink-2); }
.card-go { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; display: grid; place-items: center; color: var(--ink-2); border-radius: 8px; }
.card .stretch::before { content: ''; position: absolute; inset: 0; z-index: 0; border-radius: 8px; }
.card-go svg { width: 10px; height: 16px; }
.code { position: relative; z-index: 2; display: flex; align-items: center; min-width: 0; height: 36px; padding: 0 4px 0 12px; border-radius: 8px; background: var(--subtle); cursor: pointer; }
.code > span:not(.cbtn) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 12px/18px var(--mono); color: var(--ink); }
.cbtn { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--ink-2); }
.code:hover .cbtn, .cbtn:hover { color: var(--ink); }
.cbtn svg { width: 16px; height: 16px; }
.cbtn .ok, .is-done .cbtn .cp { display: none; }
.is-done .cbtn .ok { display: block; color: var(--ink); }
.apps { position: relative; z-index: 2; display: flex; gap: 8px; min-width: 0; }
.app { flex: 1; min-width: 0; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; background: var(--subtle); font-size: 13px; line-height: 18px; color: var(--ink); transition: background-color .15s ease-out; }
.app:hover { background: #eee; }
.app svg { width: 14px; height: 14px; flex: none; }

/* ---------- list rows ---------- */
.rows { display: flex; flex-direction: column; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.av { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; background: var(--subtle); }
.av.ltr { display: grid; place-items: center; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.row-d { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.row-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-n { font-size: 14px; line-height: 21px; font-weight: 450; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.org { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; line-height: 21px; font-weight: 450; color: var(--muted); max-width: 50%; }
.org span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org svg { width: 14px; height: 14px; flex: none; color: var(--faint); }
.row-s { font-size: 14px; line-height: 21px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row:hover .row-n { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.empty { padding: 24px 0; font-size: 14px; line-height: 21px; color: var(--ink-2); }

/* ---------- logo strip ---------- */
.strip { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.strip::-webkit-scrollbar { display: none; }
.tile { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: #fff; transition: border-color .15s ease-out, transform .15s ease-out; }
.tile:hover { border-color: #d4d4d4; transform: translateY(-1px); }
.tile img { width: 20px; height: 20px; }

/* ---------- promo cards ---------- */
.promo { min-height: 180px; }
.promo .card-d { padding-right: 16px; }
.mini { position: relative; z-index: 1; margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 8px; background: var(--subtle); }
.mini-r { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 26px; padding: 0 8px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font-size: 12px; line-height: 18px; color: var(--ink); min-width: 0; }
.mini-r b { font-weight: 450; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mini-r i { flex: none; font-style: normal; color: var(--muted); font-size: 11px; }
.fol { position: relative; z-index: 2; margin-top: auto; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 4px 0 4px; border: 1px solid var(--line); border-radius: 8px; }
.fol img { width: 26px; height: 26px; border-radius: 50%; }
.fol span { flex: 1; font-size: 14px; line-height: 21px; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fol a { height: 26px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 13px; line-height: 18px; }

/* ---------- catalog ---------- */
.crumbs { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; line-height: 21px; font-weight: 450; min-width: 0; }
.crumbs a { color: var(--ink-2); transition: color .15s ease-out; }
.crumbs a:hover { color: var(--ink); }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li:last-child { color: var(--muted); overflow: hidden; }
.crumbs li:last-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs svg { width: 16px; height: 16px; color: var(--muted); }
.lede { margin: 0; font-size: 14px; line-height: 21px; color: var(--ink-2); max-width: 728px; }
.pills { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.pill { height: 28px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; line-height: 21px; color: var(--ink); user-select: none; transition: background-color .15s ease-out, color .15s ease-out, border-color .15s ease-out; }
.pill:hover { background: var(--subtle); }
.pill span { font-size: 12px; line-height: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pill[aria-current='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill[aria-current='true'] span { color: rgba(255, 255, 255, .6); }
.tools { margin-top: 8px; display: flex; gap: 8px; min-width: 0; }
.search { position: relative; flex: 1; min-width: 0; }
.search svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 36px; padding: 0 10px 0 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; line-height: 21px; color: var(--ink); outline: none; transition: border-color .15s ease-out; }
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: #cfcfcf; }
.sort { position: relative; flex: none; }
.sort select { -webkit-appearance: none; appearance: none; height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; line-height: 21px; color: var(--ink); cursor: pointer; }
.sort svg { position: absolute; right: 9px; top: 50%; width: 14px; height: 14px; margin-top: -7px; color: var(--muted); pointer-events: none; }

/* ---------- item page ---------- */
.ihead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.ihead-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ihead-l > div { display: flex; flex-direction: column; min-width: 0; }
.iname { margin: 0; font-size: 20px; line-height: 25px; font-weight: 450; letter-spacing: -0.5px; color: var(--ink); overflow-wrap: anywhere; }
.ihead .org { max-width: none; font-weight: 400; }
.iacts { flex: none; display: flex; align-items: center; gap: 4px; }
.iact { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); transition: background-color .15s ease-out, color .15s ease-out; }
.iact:hover { background: var(--subtle); color: var(--ink); }
.iact svg { width: 16px; height: 16px; }
.idesc { margin: 12px 0 0; font-size: 14px; line-height: 21px; color: var(--ink-2); }
.ilabel { margin: 0 0 12px; font-size: 14px; line-height: 21px; font-weight: 450; color: var(--ink-2); }
.doc { position: relative; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px 12px 40px; min-width: 0; }
.doc-copy { position: absolute; top: 12px; right: 12px; z-index: 2; height: 28px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; line-height: 21px; color: var(--ink); transition: background-color .15s ease-out; }
.doc-copy:hover { background: var(--subtle); }
.doc-copy svg { width: 14px; height: 14px; }
.md { font: 400 12px/18px var(--mono); color: var(--doc); overflow-wrap: anywhere; }
.md .fm { margin: 0 0 4px; padding-right: 72px; line-height: 18px; color: var(--muted); white-space: pre-wrap; }
.md .fm b { font-weight: 400; color: inherit; }
.md h2 { margin: 28px 0 16px; font-size: 20px; line-height: 28px; font-weight: 500; color: var(--ink); }
.md h3 { margin: 28px 0 12px; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--ink); }
.md p { margin: 0 0 12px; line-height: 24px; color: var(--ink); }
.md ol, .md ul { margin: 0 0 12px; padding-left: 20px; line-height: 24px; color: var(--ink); }
.md li { margin: 4px 0; padding-left: 4px; }
.md li::marker { color: var(--muted); }
.md a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.md a:hover { text-decoration-color: var(--ink); }
.md code { padding: 1px 4px; border-radius: 4px; background: var(--subtle); color: var(--ink); }
.md .code { margin: 8px 0; }

/* ---------- footer ---------- */
.ft { margin-top: 128px; border-top: 1px solid var(--line); }
.ft-g { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 24px; padding: 48px 20px; }
.ft-b { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 12px; max-width: 240px; }
.ft-b p { margin: 0; font-size: 14px; line-height: 21px; color: var(--ink-2); }
.ft h3 { margin: 0; font-size: 14px; line-height: 21px; font-weight: 450; color: var(--ink); }
.ft ul { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ft li a { font-size: 14px; line-height: 21px; color: var(--ink-2); transition: color .15s ease-out; }
.ft li a:hover { color: var(--ink); }
.ft-c { margin: 0 20px; padding: 24px 0 48px; border-top: 1px solid var(--line); font-size: 14px; line-height: 21px; color: var(--ink-2); text-align: center; }
.ft-c span { display: block; }
@media (min-width: 768px) {
  .ft-g { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ft-b { grid-column: auto; }
}
@media (min-width: 1280px) { .ft-c { margin: 0 auto; max-width: 1240px; } }

/* ---------- follow card (bottom right) ---------- */
.pop { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; width: 264px; max-width: calc(100vw - 32px); padding: 12px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .05); opacity: 0; transform: translateY(8px); pointer-events: none; visibility: hidden; transition: opacity .2s ease-out, transform .2s ease-out, visibility 0s linear .2s; }
.pop.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .2s ease-out, transform .2s ease-out; }
.pop > a { display: flex; flex-direction: column; gap: 8px; border-radius: 6px; }
.pop-h { display: flex; align-items: center; gap: 10px; padding-right: 24px; }
.pop-h img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.pop-h span { display: flex; flex-direction: column; min-width: 0; }
.pop-t { font-size: 14px; line-height: 21px; font-weight: 450; color: var(--ink); }
.pop-s, .pop-d { font-size: 14px; line-height: 21px; color: var(--ink-2); }
.pop-x { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.pop-x:hover { background: var(--subtle); color: var(--ink); }
.pop-x svg { width: 12px; height: 12px; }
@media (prefers-reduced-motion: reduce) { .pop, .pop.is-open { transition: none; } }

/* ---------- search dialog ---------- */
.sd { width: min(560px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 120px)); margin: 72px auto auto; padding: 0; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 16px 48px -12px rgba(0, 0, 0, .18); overflow: hidden; }
.sd::backdrop { background: rgba(0, 0, 0, .12); }
.sd-in { display: flex; flex-direction: column; max-height: inherit; }
.sd .search svg { left: 14px; }
.sd .search input { height: 48px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding-left: 40px; font-size: 15px; }
.sd-list { overflow-y: auto; padding: 4px 12px 8px; }
.sd-list .row { padding: 8px 0 10px; }
.sd-list .av { width: 32px; height: 32px; border-radius: 10px; }
.sd-list .row.is-sel { background: var(--hover); box-shadow: -12px 0 0 var(--hover), 12px 0 0 var(--hover); }
.sd-foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; line-height: 18px; color: var(--muted); }

/* ---------- model cards: the same cards as /uncensored-ai/ (window band, logo, badges, scores, command), scoped to .mgrid ---------- */
@font-face { font-family: 'Host Grotesk'; font-style: normal; font-display: swap; font-weight: 300 800; src: url('/fonts/host-grotesk-latin-wght-normal.woff2') format('woff2'); }
.mgrid {
  --font: 'Host Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ink: #0e0e12; --ink-2: #44444e; --grey: #6b6b76; --line: rgba(20, 20, 40, 0.09);
  --glass-border: rgba(255, 255, 255, 0.85); --blur: blur(22px) saturate(1.6);
  --shadow: 0 1px 2px rgba(20, 20, 50, 0.05), 0 14px 34px -16px rgba(40, 30, 90, 0.22);
  --shadow-hover: 0 2px 4px rgba(20, 20, 50, 0.06), 0 26px 52px -18px rgba(40, 30, 90, 0.32);
  --card: rgba(255, 255, 255, 0.8); --card-solid: #fff; --chip: rgba(255, 255, 255, 0.78);
  --on: #0e0e12; --on-ink: #fff; --btn-glow: 0 8px 20px -8px rgba(14, 14, 18, 0.45);
  --badge: rgba(20, 20, 40, 0.06); --tint-bg: rgba(124, 92, 255, 0.12); --tint-ink: #5b3fd6;
  --track: rgba(20, 20, 40, 0.08); --fitbox: rgba(20, 20, 40, 0.045); --code: rgba(246, 246, 250, 0.95);
  --win-sheen: radial-gradient(120% 90% at 85% -20%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 55%), linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 40%);
  --notch-piece: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M0 0H24A12 12 0 0 0 12 12A12 12 0 0 1 0 24Z'/%3E%3C/svg%3E");
  --r-pill: 999px; --r-card: 26px; --r-sm: 14px; --r-av: 12px;
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px;
  font-family: var(--font); color: var(--ink); letter-spacing: normal;
}
@media (min-width: 760px) { .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.mgrid .pal-0 { --win-bg: linear-gradient(135deg, #3b2bd6 0%, #7c3aed 55%, #a78bfa 100%); --bar-bg: linear-gradient(90deg, #a78bfa, #5b3fd6); }
.mgrid .pal-1 { --win-bg: linear-gradient(135deg, #f43f3f 0%, #ff7a45 55%, #ffb86b 100%); --bar-bg: linear-gradient(90deg, #ffb86b, #f43f3f); }
.mgrid .mc { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-card); overflow: hidden; background: var(--card); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.mgrid .win { position: relative; height: 92px; padding: 14px 16px; color: var(--win-ink, #fff); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; background: var(--win-bg); --nw: 112px;
  -webkit-mask: linear-gradient(#000 0 0) top left / 100% calc(100% - 23.5px) no-repeat, linear-gradient(#000 0 0) bottom left / calc(100% - var(--nw) - 23.5px) 24px no-repeat, var(--notch-piece) right var(--nw) bottom 0 / 24px 24px no-repeat;
  mask: linear-gradient(#000 0 0) top left / 100% calc(100% - 23.5px) no-repeat, linear-gradient(#000 0 0) bottom left / calc(100% - var(--nw) - 23.5px) 24px no-repeat, var(--notch-piece) right var(--nw) bottom 0 / 24px 24px no-repeat; }
.mgrid .win::after { content: ''; position: absolute; inset: 0; background: var(--win-sheen); pointer-events: none; }
.mgrid .win > * { position: relative; z-index: 1; }
.mgrid .big { font-size: 40px; line-height: .9; font-weight: 700; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.mgrid .big small { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0; opacity: .85; margin-top: 5px; }
.mgrid .win-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; line-height: 1.4; font-weight: 600; text-align: right; }
.mgrid .mpill { padding: 3px 9px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); white-space: nowrap; }
.mgrid .arrow { position: absolute; right: 16px; top: 76px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--card-solid); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); transition: transform .25s var(--ease); }
.mgrid .arrow svg { width: 12px; height: 12px; }
.mgrid .face { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.mgrid .head { display: flex; gap: 11px; align-items: center; min-width: 0; padding-right: 30px; }
.mgrid .mlogo { flex: none; width: 40px; height: 40px; border-radius: var(--r-av); display: grid; place-items: center; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), inset 0 0 0 1px rgba(255, 255, 255, .6); }
.mgrid .mlogo img { width: 22px; height: 22px; display: block; }
.mgrid .mlogo.ltr { font-weight: 700; font-size: 17px; color: #fff; background: var(--win-bg); border: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.mgrid .head-t { min-width: 0; }
.mgrid h2 { margin: 0; font-size: 17px; line-height: 1.25; font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; color: var(--ink); }
.mgrid .by { margin: 2px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--grey); overflow-wrap: anywhere; }
.mgrid .badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mgrid .b { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); background: var(--badge); color: var(--ink-2); line-height: 1.3; }
.mgrid .b.tint { background: var(--tint-bg); color: var(--tint-ink); }
.mgrid .b.dim { background: transparent; color: var(--grey); padding-left: 2px; }
.mgrid .scores { margin: 0; display: grid; gap: 8px; }
.mgrid .sc { display: grid; grid-template-columns: 100px 1fr 46px; align-items: center; gap: 10px; font-size: 13.5px; line-height: 1.4; }
.mgrid .sc dt { color: var(--grey); }
.mgrid .sc dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.mgrid .bar { height: 6px; border-radius: 6px; background: var(--track); overflow: hidden; }
.mgrid .bar i { display: block; height: 100%; border-radius: inherit; background: var(--bar-bg); }
.mgrid .good { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.mgrid .good b { color: var(--ink); font-weight: 650; }
.mgrid .more { display: none; align-self: flex-start; margin-top: -8px; border: 0; background: none; padding: 0; font-size: 13.5px; font-weight: 650; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.mgrid .fit { margin: 0; font-size: 13.5px; color: var(--ink-2); background: var(--fitbox); border-radius: var(--r-sm); padding: 9px 12px; line-height: 1.4; }
.mgrid .untested { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--grey); }
.mgrid .cmd { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--code); padding: 5px 5px 5px 0; min-width: 0; }
.mgrid .cmd code { flex: 1; min-width: 0; padding: 0 0 0 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.45; white-space: nowrap; overflow-x: auto; scrollbar-width: none; color: var(--ink); }
.mgrid .cmd code::-webkit-scrollbar { display: none; }
.mgrid .copy { flex: none; height: 34px; border: 1px solid var(--line); background: var(--card-solid); border-radius: calc(var(--r-sm) - 4px); padding: 0 12px; font-size: 13px; font-weight: 650; min-width: 70px; color: var(--ink); transition: background .2s var(--ease), color .2s var(--ease); }
.mgrid .copy.is-done { background: var(--on); color: var(--on-ink); border-color: var(--on); }
.mgrid .acts { display: flex; gap: 10px; align-items: center; margin-top: auto; }
.mgrid .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 46px; padding: 0 20px; border-radius: var(--r-pill); font-size: 15px; font-weight: 650; white-space: nowrap; border: 1px solid var(--line); background: var(--chip); transition: transform .15s var(--ease), box-shadow .25s var(--ease), opacity .2s; }
.mgrid .btn:active { transform: scale(.97); }
.mgrid .btn.primary { background: var(--on); color: var(--on-ink); border-color: var(--on); box-shadow: var(--btn-glow); flex: 1; }
@media (max-width: 759px) {
  .mgrid .good { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .mgrid .good.is-open { display: block; }
  .mgrid .more { display: inline-block; }
  .mgrid .face > .cmd { display: none; }
}
@media (min-width: 760px) {
  .mgrid .mc { border-radius: 20px; }
  .mgrid .win { height: 62px; padding: 11px 14px; --nw: 92px; }
  .mgrid .big { font-size: 30px; }
  .mgrid .big small { font-size: 11px; margin-top: 3px; }
  .mgrid .mpill { font-size: 11px; padding: 2px 8px; }
  .mgrid .arrow { top: 48px; right: 12px; width: 30px; height: 30px; }
  .mgrid .arrow svg { width: 11px; height: 11px; }
  .mgrid .face { padding: 10px 16px 16px; gap: 10px; }
  .mgrid .head { gap: 10px; padding-right: 26px; }
  .mgrid .mlogo { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
  .mgrid .mlogo img { width: 20px; height: 20px; }
  .mgrid h2 { font-size: 15.5px; }
  .mgrid .by { font-size: 12.5px; }
  .mgrid .b { font-size: 11.5px; padding: 3px 8px; }
  .mgrid .scores { gap: 6px; }
  .mgrid .sc { grid-template-columns: 88px 1fr 42px; gap: 8px; font-size: 12.5px; }
  .mgrid .bar { height: 5px; }
  .mgrid .good { font-size: 13.5px; line-height: 1.45; }
  .mgrid .fit { font-size: 12.5px; padding: 8px 10px; border-radius: 10px; }
  .mgrid .untested { font-size: 12.5px; }
  .mgrid .cmd { padding: 4px 4px 4px 0; border-radius: 12px; }
  .mgrid .cmd code { font-size: 12px; padding-left: 10px; }
  .mgrid .copy { height: 30px; font-size: 12.5px; min-width: 62px; border-radius: 8px; }
  .mgrid .acts { gap: 8px; }
  .mgrid .acts .btn { height: 38px; padding: 0 16px; font-size: 13.5px; }
}
@media (hover: hover) and (pointer: fine) {
  .mgrid .mc { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease), box-shadow .4s var(--ease); will-change: transform; }
  .mgrid .mc:hover { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-5px); box-shadow: var(--shadow-hover); transition: transform .18s ease-out, box-shadow .4s var(--ease); }
  .mgrid .mc::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease); background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .5), transparent 45%); mix-blend-mode: soft-light; z-index: 3; }
  .mgrid .mc:hover::after { opacity: 1; }
  .mgrid .mc:hover .arrow { transform: translate(2px, -2px); }
}
@media (prefers-reduced-motion: reduce) { .mgrid .mc, .mgrid .mc:hover { transform: none !important; } }

/* ---------- rows, a little nicer than a plain list (pointer devices): the row under the pointer settles onto a white
   card tinted very lightly with its avatar's colour (--tint), the other rows fade back, the stars give way to an
   Install button that copies the command. Rows rise in as they scroll into view. ---------- */
.ri { position: relative; }
#view .rows .row { position: relative; transition: opacity .3s ease-out; }
#view .rows .row::before { content: ''; position: absolute; inset: 3px -12px 7px; z-index: 0; border-radius: 14px; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--tint, #8a8a8a) 8%, transparent), transparent 70%), color-mix(in srgb, var(--tint, #ffffff) 4%, #ffffff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tint, #000000) 7%, transparent), 0 10px 26px -16px color-mix(in srgb, var(--tint, #000000) 40%, transparent);
  opacity: 0; transform: scale(.985); transition: opacity .25s ease-out, transform .45s cubic-bezier(.32, 1.4, .5, 1); }
#view .rows .row > * { position: relative; z-index: 1; }
.row .av { transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.row-st { flex: none; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 13px; line-height: 21px; color: var(--muted); font-variant-numeric: tabular-nums; transition: opacity .2s ease-out, transform .3s cubic-bezier(.22, 1, .36, 1); }
.row-st svg { width: 12px; height: 12px; color: #d6d6d6; }
.rinst { display: none; }
@media (hover: hover) and (pointer: fine) {
  .row-st { min-width: 80px; }
  .rinst { position: absolute; right: 0; top: 50%; z-index: 2; display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13px; line-height: 18px; opacity: 0; transform: translate(6px, calc(-50% - 2px)); pointer-events: none; transition: opacity .2s ease-out, transform .35s cubic-bezier(.22, 1, .36, 1); }
  .rinst > span { display: inline-flex; align-items: center; gap: 6px; }
  .rinst svg { width: 13px; height: 13px; flex: none; }
  .rinst .ri-b, .rinst.is-done .ri-a { display: none; }
  .rinst.is-done .ri-b { display: inline-flex; animation: ri-pop .35s cubic-bezier(.34, 1.56, .64, 1); }
  .ri:hover .rinst, .rinst:focus-visible { opacity: 1; transform: translate(0, calc(-50% - 2px)); pointer-events: auto; }
  .ri:hover .row-st, .ri:focus-within .row-st { opacity: 0; transform: translateX(-8px); }
  #view .ri:hover .row::before { opacity: 1; transform: none; }
  .ri:hover .av { transform: scale(1.05); }
  .rows:has(.ri:hover) .ri:not(:hover) .row { opacity: .5; }
}
@keyframes ri-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
#view .rows .row:active::before { opacity: 1; transform: scale(.99); transition-duration: .1s; }
.rv { opacity: 0; transform: translateY(10px); }
.rv.is-in { opacity: 1; transform: none; transition: opacity .5s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms), transform .65s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms); }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; } .row .av, .row-st, .rinst, #view .rows .row, #view .rows .row::before { transition: none; } .rinst.is-done .ri-b { animation: none; } }
.istars { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.istars svg { width: 12px; height: 12px; color: #f5b301; }

/* ---------- a remote markdown document (SKILL.md) ---------- */
.md h4 { margin: 24px 0 10px; font-size: 14px; line-height: 21px; font-weight: 500; color: var(--ink); }
.md h5 { margin: 20px 0 8px; font-size: 12px; line-height: 18px; font-weight: 600; color: var(--ink); }
.md b { font-weight: 600; color: var(--ink); }
.md .mdpre { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--subtle); overflow-x: auto; font: inherit; line-height: 18px; color: var(--ink); white-space: pre; }
.md .mdpre code { padding: 0; background: none; }
.md hr { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }
.md blockquote { margin: 0 0 12px; padding: 2px 0 2px 12px; border-left: 2px solid var(--line); color: var(--ink-2); line-height: 24px; }
.md .mdtable { margin: 0 0 12px; overflow-x: auto; }
.md table { border-collapse: collapse; font: inherit; }
.md th, .md td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 18px; color: var(--ink); }
.md th { background: var(--subtle); font-weight: 500; }
