/* Repository index — styles for index.html and repo.html.
   Monochrome: black, white and a neutral gray ramp; the brand green is the one accent and goes
   only on the primary action, links, focus and the "Runs in browser" badge. Status colours
   (live, cached, warning) appear only with words. Hairlines and space instead of cards.
   Light and dark follow the reader's system setting. Spacing sits on a 4px grid. */

:root {
  color-scheme: light dark;
  --paper: #fff;
  --card: #fff;
  --raised: #f5f5f5;
  --ink: #0a0a0a;
  --ink-2: #404040;
  --muted: #525252;
  --faint: #6b6b6b;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;
  --line-soft: #efefef;
  --accent: #294d3b;
  --accent-fill: #294d3b;
  --accent-fill-hover: #1d3a2b;
  --on-accent: #fff;
  --focus: #294d3b;
  --warn: #8a5a00;
  --warn-surface: #fdf6e7;
  --warn-line: #ecd9ad;
  --live: #2f7a4a;
  --cached: #a86b00;
  --stale: #8f8f8f;
  --scrim: rgb(255 255 255 / .92);
  --r: 6px;
  --ease: cubic-bezier(.22, .68, .26, 1);
  --fast: 160ms;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a0a0a;
    --card: #0a0a0a;
    --raised: #171717;
    --ink: #ededed;
    --ink-2: #d4d4d4;
    --muted: #a3a3a3;
    --faint: #8f8f8f;
    --line: #262626;
    --line-strong: #3a3a3a;
    --line-soft: #1c1c1c;
    --accent: #8cc9a3;
    --accent-fill: #2f5c46;
    --accent-fill-hover: #3a6d54;
    --focus: #8cc9a3;
    --warn: #e0b45c;
    --warn-surface: #2a2111;
    --warn-line: #4d3c17;
    --live: #5fb47f;
    --cached: #d9a440;
    --stale: #8f8f8f;
    --scrim: rgb(10 10 10 / .88);
  }
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
@media (pointer: fine) { html { overscroll-behavior: none } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 var(--sans); }
h1, h2, h3, h4, h5, h6 { text-wrap: balance }
p { text-wrap: pretty }
button, input, select { font: inherit; color: inherit }
select { background-color: var(--card); color: var(--ink) }
a { color: var(--accent) }
button { cursor: pointer }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px }
time, .count, .carousel-position, .tile-bottom, .repo-stats, .file-size, .language-share, .sha, .sync-status, .catalog-status, .hero-meta { font-variant-numeric: tabular-nums }
.icon { display: block; flex: none; width: 16px; height: 16px }
/* "User-Avatar-BackEnd /" above names of repositories outside antomys's own account. */
.owner-prefix { display: block; margin-bottom: 2px; color: var(--muted); font: 400 12px/16px var(--mono); letter-spacing: 0; overflow-wrap: anywhere }
.repo-hero h1 .owner-prefix { margin-bottom: 6px; font-size: 13px }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
[hidden] { display: none !important }

.wrap { width: min(1184px, calc(100% - 96px)); margin-inline: auto }
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 10; padding: 8px 12px; border-radius: var(--r); background: var(--accent-fill); color: var(--on-accent); font-size: 13px; font-weight: 600; text-decoration: none }
.skip-link:focus-visible { top: 12px }

/* ---- Header and footer ---- */
.header { border-bottom: 1px solid var(--line) }
.header .wrap { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px }
.brand, .profile { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; text-decoration: none; border-radius: var(--r) }
.brand { font: 600 13px var(--mono); color: var(--ink) }
/* The [ ] mark is the site's signature; it reappears only around "Runs in browser". */
.logo { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r); background: var(--accent-fill); color: var(--on-accent); font-size: 12px }
.profile { font-size: 13px; font-weight: 600; color: var(--ink) }
.profile .icon, .panel-link .icon { width: 14px; height: 14px }
.profile:hover, .panel-link:hover, .panel-more:hover, .back-link:hover { text-decoration: underline; text-underline-offset: 3px }
footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: 12px }
footer .wrap { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap }

/* ---- Buttons ---- */
.button, .action {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r);
  font-size: 13px; font-weight: 600; line-height: 1.2; text-decoration: none;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.button .icon, .action .icon { width: 14px; height: 14px }
.button:active, .action:active, .carousel-step:active, .controls button:active { transform: scale(.98) }
.primary { background: var(--accent-fill); color: var(--on-accent) }
.primary:hover { background: var(--accent-fill-hover) }
.secondary { border-color: var(--line-strong); background: var(--card); color: var(--ink) }
.secondary:hover { background: var(--raised) }
.button[aria-disabled="true"] { opacity: .5; pointer-events: none }
.action.small { min-height: 32px; padding: 0 10px; font-size: 12px }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px }

/* ---- Index intro ---- */
main { padding: 40px 0 64px }
.intro h1 { margin: 0 0 8px; font-size: clamp(32px, 4vw, 40px); line-height: 1.1; letter-spacing: -.02em; font-weight: 600 }
.intro p { margin: 0; color: var(--muted); font-size: 14px }

/* ---- Carousel ---- */
.carousel-viewport {
  position: relative; block-size: 248px; margin-top: 28px; border-radius: var(--r);
  overflow: hidden; overflow: clip; overflow-anchor: none; touch-action: pan-y pinch-zoom;
}
.carousel-viewport .hero {
  position: absolute; inset: 0; display: grid; isolation: isolate; overflow: hidden;
  grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); grid-template-rows: minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: var(--r); background: var(--paper);
}
@media (min-width: 721px) { .carousel-viewport .hero:has(.hero-art:not(.has-ui)) { grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr) } }
.carousel-viewport .slide-outgoing { pointer-events: none }
.hero-copy {
  --hero-title-size: clamp(26px, 3vw, 36px);
  position: relative; z-index: 1; min-width: 0; padding: 20px 28px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
}
.hero-copy > * { flex: none }
.tag { display: inline-flex; align-items: center; gap: 12px; font: 400 12px/16px var(--mono); color: var(--muted) }
.feature-heading { display: flex; align-items: flex-start; gap: 12px; width: 100%; margin: 8px 0 }
/* The title box is always two base lines tall so the slide never changes height. app.js
   (fitTitle) steps the font size down until the whole name fits, breaking only at the
   <wbr> points after separators and between camelCase words. */
.hero h2 {
  flex: 1 1 auto; min-width: 0; margin: 0; block-size: calc(var(--hero-title-size) * 2.08); overflow: hidden;
  font-size: var(--hero-title-size); line-height: 1.04; letter-spacing: -.02em; font-weight: 600; overflow-wrap: normal;
}
.hero h2.is-squeezed { overflow-wrap: anywhere }
.hero p { max-width: 42ch; block-size: 2lh; margin: 0 0 12px; color: var(--ink-2); font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden }
.feature-icon { display: grid; place-items: center; flex: none; width: clamp(32px, 3vw, 40px); height: clamp(32px, 3vw, 40px); color: var(--ink-2) }
.feature-icon:empty { display: none }
.feature-icon .repo-art { width: 100%; height: 100% }
.hero-art { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; overflow: hidden }
.hero-art.has-ui { position: absolute; inset: 0; display: block }
.art-panel { width: 100%; height: 100%; min-height: 0; display: grid; place-items: center; padding: 20px 28px 24px; color: var(--faint) }
.hero-art.has-ui .art-panel { display: block; padding: 0 }
.hero-art .hero-meta {
  position: absolute; right: 12px; bottom: 12px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--scrim); color: var(--muted); font: 11px/16px var(--mono);
}
.hero-meta:empty { display: none }
.product-preview { position: relative; width: 100%; height: 100% }
/* Screenshots are light captures; dim them a little so they do not glare on the dark page. */
@media (prefers-color-scheme: dark) { .product-preview > img, .tile-screenshot, .repo-hero-art img { filter: brightness(.8) } }
.product-preview > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 34%; mask-image: linear-gradient(90deg, transparent 31%, rgba(0,0,0,.12) 44%, rgba(0,0,0,.86) 74%, black 100%) }

.carousel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 12px }
.carousel-nav, .carousel-extras { display: flex; align-items: center; gap: 8px; min-width: 0 }
.carousel-extras { max-width: 100% }
.carousel-step {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--card); color: var(--ink);
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.carousel-step:hover, .carousel-jump:hover { background: var(--raised) }
.carousel-step:disabled { opacity: .45; cursor: default }
.carousel-toggle .icon-play { display: none }
.carousel-toggle[data-playing="false"] .icon-play { display: block }
.carousel-toggle[data-playing="false"] .icon-pause { display: none }
.carousel-position { min-width: 64px; text-align: center; font: 12px var(--mono); color: var(--muted) }
/* With the picker as the only control on the right, give it room for long names. */
.carousel-jump {
  width: min(288px, 40vw); min-width: 0; min-height: 36px; padding: 0 8px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--card); font-size: 13px; cursor: pointer;
  transition: background-color var(--fast) var(--ease);
}

/* ---- Catalog ---- */
.catalog { margin-top: 40px }
.catalog-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px }
.catalog-title { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0 }
.catalog h2 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.01em; font-weight: 600 }
.count { font: 12px var(--mono); color: var(--muted) }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.search { position: relative; display: block }
.search .icon { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none }
.controls input, .controls select, .controls button {
  height: 36px; border: 1px solid var(--line-strong); border-radius: var(--r); background-color: var(--card); font-size: 13px;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.controls input { width: 224px; padding: 0 12px 0 36px }
.controls input::placeholder { color: var(--faint); opacity: 1 }
.controls select { padding: 0 8px }
.controls button { display: grid; place-items: center; width: 36px; padding: 0 }
.controls button:hover, .controls select:hover { background-color: var(--raised) }
.controls button:disabled { opacity: .55; cursor: wait }

/* The grid is one sheet of cells split by hairlines: each cell draws its own top and left line
   inside and its right and bottom line outside, so shared edges stay 1px and a short last row
   still closes. */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 1px }
.tile {
  position: relative; isolation: isolate; overflow: hidden; min-width: 0; min-height: 156px;
  display: flex; flex-direction: column; align-items: stretch; padding: 16px;
  background: var(--paper); color: inherit; text-align: left; text-decoration: none;
  box-shadow: inset 1px 0 0 var(--line), inset 0 1px 0 var(--line), 1px 0 0 var(--line), 0 1px 0 var(--line), 1px 1px 0 var(--line);
  transition: background-color var(--fast) var(--ease);
}
.tile:hover { background: var(--raised) }
.tile:focus-visible { outline-offset: -2px }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px }
.tile-name { min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: break-word }
.tile-arrow { display: block; flex: none; margin-top: 1px; color: var(--faint); transition: color var(--fast) var(--ease), transform var(--fast) var(--ease) }
.tile:hover .tile-arrow { color: var(--ink); transform: translateX(2px) }
.tile-icon-row { display: flex; align-items: center; gap: 8px; min-width: 0 }
.repo-icon { display: grid; place-items: center; flex: none; width: 24px; height: 24px; color: var(--ink-2) }
.repo-icon:has(picture) { overflow: hidden; border-radius: 4px }
.repo-icon .repo-art { width: 18px; height: 18px }
.repo-icon .repo-art:has(picture) { width: 24px; height: 24px }
.preview-badge { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px/16px var(--mono); color: var(--muted) }
.preview-badge.muted { color: var(--faint) }
/* The bright spot: projects you can run here. */
.preview-badge.runs { color: var(--accent); font-weight: 600 }
.preview-badge.runs::before { content: "[ " }
.preview-badge.runs::after { content: " ]" }
.tile-desc { margin: 8px 0 12px; color: var(--ink-2); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.tile:has(.tile-screenshot) .tile-desc { max-width: 64% }
.tile-bottom { display: flex; align-items: center; justify-content: space-between; gap: 4px 8px; margin-top: auto; color: var(--muted); font-size: 12px }
.tile-bottom time, .tile-bottom .unknown { white-space: nowrap }
.tile-language { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.tile-screenshot { position: absolute; inset: 40px 1px 36px auto; width: 46%; height: calc(100% - 76px); object-fit: cover; object-position: center; z-index: -2; pointer-events: none; mask-image: linear-gradient(90deg, transparent, black 55%), linear-gradient(180deg, transparent, black 13%, black 86%, transparent); mask-composite: intersect }
.repo-art { display: grid; place-items: center; color: inherit; line-height: 0 }
.repo-art picture { display: block; width: 100%; height: 100% }
.repo-art svg, .repo-art img { display: block; width: 100%; height: 100%; object-fit: contain }

.empty { grid-column: 1 / -1; padding: 32px 16px; color: var(--muted); box-shadow: inset 0 1px 0 var(--line), 0 1px 0 var(--line) }
.empty p { margin: 0 }
.empty .empty-title { margin-bottom: 4px; color: var(--ink); font-size: 15px; font-weight: 600 }
.empty .button { margin-top: 16px }
.catalog-status { display: flex; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: 12px }

/* Sync dot: where the data on screen came from (live, cached copy or build snapshot). It is a
   real status and always sits beside its word ("Live", "Cached", "Snapshot"). */
.sync-status[data-source]::before, #catalog-status[data-source]::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; vertical-align: 0; background: var(--live) }
.sync-status[data-source="cached"]::before, #catalog-status[data-source="cached"]::before { background: var(--cached) }
.sync-status[data-source="snapshot"]::before, #catalog-status[data-source="snapshot"]::before, .sync-status[data-source="none"]::before { background: var(--stale) }
.catalog-status .is-warning, .sync-status.is-warning { color: var(--warn) }

/* ---- Repository page ---- */
.repo-main { padding: 20px 0 64px; outline: none }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 32px; font-size: 13px }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; white-space: nowrap; border-radius: var(--r) }
.back-link .icon, .action .icon-arrow-left { width: 14px; height: 14px }
.crumb-sep { color: var(--faint) }
.crumb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px var(--mono); color: var(--muted) }

.repo-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; margin-top: 12px; border-bottom: 1px solid var(--line) }
.repo-hero-copy { position: relative; max-width: 780px; padding: 20px 0 24px }
.repo-hero.has-ui .repo-hero-copy { max-width: min(780px, 58%) }
.repo-hero-art { position: absolute; top: 0; right: 0; bottom: 0; width: 54%; z-index: -2; pointer-events: none }
.repo-hero-art:empty { display: none }
.repo-hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; mask-image: linear-gradient(90deg, transparent 12%, rgba(0,0,0,.16) 36%, rgba(0,0,0,.88) 70%, black 100%) }
.repo-heading { display: flex; align-items: center; gap: 16px; margin: 12px 0 }
.repo-hero h1 { min-width: 0; margin: 0; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.06; letter-spacing: -.02em; font-weight: 600; overflow-wrap: break-word }
.feature-icon.repo-hero-icon { width: 48px; height: 48px }
.repo-description { max-width: 64ch; margin: 0 0 16px; color: var(--ink-2); font-size: 15px; line-height: 1.5 }
.repo-flags { display: flex; flex-wrap: wrap; gap: 8px }
.repo-flags:empty { display: none }
.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r); color: var(--ink-2); font: 12px/1.5 var(--mono); overflow-wrap: anywhere }
.chip.warn { border-color: var(--warn-line); background: var(--warn-surface); color: var(--warn) }
.chip a { margin-left: 4px; color: inherit }
.repo-hero .actions { margin: 16px 0 0 }
.repo-stats { position: relative; display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; padding: 12px 0; list-style: none; border-top: 1px solid var(--line-soft) }
.repo-stats:empty { display: none }
.repo-stats li { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap }
.repo-stats strong { color: var(--ink); font: 600 14px var(--mono) }
.repo-stats li span:empty { display: none }

.sync-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 12px }
.sync-status { min-width: 0; color: var(--muted); font: 12px/1.5 var(--mono) }
#repo-refresh { flex: none }
#repo-refresh:disabled { opacity: .6; cursor: wait }
.page-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; padding-bottom: 4px }
.page-nav a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; border-radius: var(--r) }
.page-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px }

.repo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; margin-top: 16px }
.repo-primary, .repo-secondary { min-width: 0 }
.panel { min-width: 0; margin: 0 0 24px; border-top: 1px solid var(--line); scroll-margin-top: 16px }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 12px 0 }
.panel-head h2 { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 600 }
.panel-kicker { color: var(--muted); font: 12px/1.5 var(--mono) }
.panel-link { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; font-size: 13px; font-weight: 600; text-decoration: none; border-radius: var(--r) }
.panel-body { min-width: 0; padding: 0 0 8px }
.panel-empty, .run-note { margin: 0; color: var(--muted); font-size: 13px }
.run-note { margin: 0 0 12px }
.panel-label { margin: 12px 0 8px; color: var(--muted); font: 12px var(--mono) }
.panel-subhead { margin: 4px 0 8px; font-size: 14px; font-weight: 600 }
.panel-more { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; text-decoration: none; border-radius: var(--r) }

dl.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13px }
dl.facts dt { color: var(--muted) }
dl.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums }
/* Language colours are chart series, the one place several hues are content. */
.language-bar { display: flex; gap: 2px; height: 8px; border-radius: 2px; overflow: hidden; background: var(--raised) }
.language-segment { display: block; height: 100%; min-width: 4px }
.language-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 12px }
.language-legend li { display: flex; align-items: center; gap: 8px; min-width: 0 }
.swatch { flex: none; width: 10px; height: 10px; border-radius: 2px }
@media (prefers-color-scheme: dark) { .language-segment, .swatch { filter: brightness(1.6) saturate(.85) } }
.language-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.language-share { margin-left: auto; color: var(--muted); font: 12px var(--mono) }
.commit-list { margin: 0; padding: 0; list-style: none }
.commit-list li { padding: 8px 0; border-bottom: 1px solid var(--line-soft) }
.commit-list li:first-child { padding-top: 0 }
.commit-message { display: block; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere }
a.commit-message:hover { color: var(--accent); text-decoration: underline }
.commit-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 12px }
.commit-meta a { color: var(--ink-2) }
.sha { padding: 0 4px; border-radius: 4px; background: var(--raised); font: 12px var(--mono) }
.release-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--r) }
.release-name { font-size: 14px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere }
.release-meta { margin: 4px 0 0; color: var(--muted); font-size: 12px }
.release-meta code { font: 12px var(--mono) }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none }
.tag-list a { display: inline-block; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: var(--r); font: 12px var(--mono); text-decoration: none }
.file-list { margin: 0; padding: 0; list-style: none; font-size: 13px }
.file-list li { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 32px; border-bottom: 1px solid var(--line-soft) }
.file-icon { flex: none; width: 16px; height: 16px; color: var(--faint) }
.file-dir .file-icon { color: var(--ink-2) }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none }
a.file-name:hover { text-decoration: underline }
.file-dir .file-name { font-weight: 600 }
.file-size { flex: none; margin-left: auto; color: var(--muted); font: 12px var(--mono) }

.run-instructions { margin: 0 0 12px; font-size: 14px }
.run-shell { margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden }
.run-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line); background: var(--raised) }
.run-label { color: var(--ink-2); font: 600 12px var(--mono) }
.run-frame { display: block; width: 100%; height: 540px; border: 0; background: var(--paper) }
.notebook-list { margin: 0 0 16px; padding: 0; list-style: none }
.notebook-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line-soft) }
.notebook-path { min-width: 0; font: 12px var(--mono); overflow-wrap: anywhere }
.notebook-links { display: flex; flex-wrap: wrap; gap: 8px }
.run-shell + .actions, .panel-body > .actions { margin: 12px 0 }
.clone-box { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised) }
.clone-label { color: var(--muted); font: 600 12px var(--mono) }
.clone-command { flex: 1 1 220px; min-width: 0; padding: 4px 0; overflow-x: auto; white-space: nowrap; font: 12px/1.6 var(--mono); overscroll-behavior-x: contain }
.copy-button { min-width: 72px }

.repo-missing { margin: 24px 0; padding: 24px 0 32px; border-top: 1px solid var(--line) }
.repo-missing h1 { margin: 0 0 12px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.08; letter-spacing: -.02em; font-weight: 600; outline: none }
.repo-missing p { max-width: 62ch; color: var(--ink-2) }
.missing-suggestions { margin: 0 0 8px; padding-left: 20px }
.missing-suggestions li { margin: 4px 0 }

/* ---- README rendering ---- */
.readme { font-size: 15px; line-height: 1.65; overflow-wrap: break-word }
.markdown-body > :first-child { margin-top: 0 }
.markdown-body :is(p, ul, ol, blockquote, pre, .md-table, .md-html) { margin: 0 0 16px }
.markdown-body .md-heading { margin: 24px 0 12px; line-height: 1.25; font-weight: 600; scroll-margin-top: 16px }
.markdown-body h3.md-heading { padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); font-size: 22px; letter-spacing: -.01em }
.markdown-body h4.md-heading { padding-bottom: 4px; border-bottom: 1px solid var(--line-soft); font-size: 18px }
.markdown-body h5.md-heading { font-size: 16px }
.markdown-body h6.md-heading { color: var(--muted); font-size: 14px }
.markdown-body :is(ul, ol) { padding-left: 24px }
.markdown-body li { margin: 4px 0 }
.markdown-body li > :is(ul, ol) { margin: 4px 0 }
.markdown-body a { overflow-wrap: anywhere }
.markdown-body code { padding: 1px 4px; border-radius: 4px; background: var(--raised); font: 13px/1.5 var(--mono) }
.markdown-body pre { max-width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); overflow: auto; white-space: pre; overscroll-behavior-x: contain }
.markdown-body pre code { padding: 0; background: none; font-size: 13px }
.markdown-body kbd { display: inline-block; min-width: 20px; padding: 0 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--card); font: 12px/18px var(--mono); text-align: center }
.markdown-body blockquote { padding: 4px 16px; border-left: 3px solid var(--line-strong); color: var(--ink-2) }
.markdown-body blockquote > :last-child { margin-bottom: 0 }
.markdown-body .md-alert { padding: 8px 16px; border-left-color: var(--live); border-radius: 0 var(--r) var(--r) 0; background: var(--raised) }
.markdown-body :is(.md-alert-warning, .md-alert-caution) { border-left-color: var(--cached); background: var(--warn-surface) }
.md-alert-title { display: inline-block; margin-right: 4px; font-weight: 600 }
.md-table { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); overscroll-behavior-x: contain }
.markdown-body table { min-width: 100%; border-collapse: collapse; font-size: 13px; overflow-wrap: normal; font-variant-numeric: tabular-nums }
.markdown-body :is(th, td) { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); text-align: left; vertical-align: top }
.markdown-body :is(th, td):last-child { border-right: 0 }
.markdown-body tbody tr:last-child td { border-bottom: 0 }
.markdown-body th { background: var(--raised); font-weight: 600; white-space: nowrap }
.markdown-body [data-align="center"] { text-align: center }
.markdown-body [data-align="right"] { text-align: right }
.markdown-body hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line) }
.md-image { max-width: 100%; height: auto; vertical-align: middle; border-radius: 4px }
.md-badge { display: inline-block; margin: 2px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--raised); color: var(--ink-2); font: 12px/1.5 var(--mono); vertical-align: middle }
.md-task { margin-right: 6px; font-family: var(--mono) }
.md-summary { font-weight: 600 }

/* ---- Breakpoints ---- */
@media (max-width: 1000px) {
  .wrap { width: calc(100% - 64px) }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .repo-layout { grid-template-columns: minmax(0, 1fr); gap: 0 }
  .repo-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px }
  .repo-secondary .panel:first-child { grid-column: 1 / -1 }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px) }
  main { padding-top: 32px }
  .carousel-viewport { block-size: 400px }
  .carousel-viewport .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 208px) minmax(0, 1fr) }
  .hero-copy { --hero-title-size: clamp(24px, 6vw, 32px); padding: 20px }
  .art-panel { padding: 12px 16px 16px }
  .product-preview > img { object-position: 58% 55%; mask-image: linear-gradient(180deg, transparent 37%, rgba(0,0,0,.12) 50%, rgba(0,0,0,.86) 80%, black 100%) }
  .catalog-bar { flex-direction: column; align-items: stretch }
  .controls { width: 100%; flex-wrap: nowrap }
  .search { flex: 1; min-width: 0 }
  .controls input { width: 100%; min-width: 0; font-size: 16px }
  .controls input, .controls select, .controls button, .carousel-step, .carousel-jump { height: 44px; min-height: 44px }
  .controls button, .carousel-step { width: 44px }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .repo-hero.has-ui .repo-hero-copy { max-width: none }
  .repo-hero.has-ui .repo-hero-art { position: relative; order: 2; width: auto; height: 192px; margin-top: -8px }
  .repo-hero-art img { mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,.6) 40%, black 100%) }
  .repo-stats { order: 3; gap: 4px 16px }
  .repo-description { font-size: 15px }
  .feature-icon.repo-hero-icon { width: 40px; height: 40px }
  .repo-secondary { display: block }
  .page-nav { flex-wrap: nowrap; margin-inline: -16px; padding: 0 16px 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none }
  .page-nav::-webkit-scrollbar { display: none }
  .page-nav a { min-height: 44px }
  .run-frame { height: 440px }
}
@media (max-width: 520px) {
  .carousel-toolbar { flex-wrap: wrap }
  .carousel-extras { width: 100% }
  .carousel-jump { flex: 1; width: auto }
  .carousel-position { min-width: 56px }
}
@media (max-width: 390px) {
  .wrap { width: calc(100% - 24px) }
  .grid { grid-template-columns: minmax(0, 1fr) }
  .tile { min-height: 0; padding: 14px 12px }
  .tile-bottom { flex-wrap: wrap }
  .hero-copy { padding-inline: 16px }
  .repo-stats { gap: 4px 12px }
  .markdown-body h3.md-heading { font-size: 20px }
  .language-legend { grid-template-columns: minmax(0, 1fr) }
  .page-nav { margin-inline: -12px; padding-inline: 12px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important }
}
