.repo-page { padding-top: 1.6rem; }

.repo-page code,
.repo-page pre { font-family: inherit; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.5rem;
  margin: 0 0 1rem;
  color: var(--faint);
  font-size: 0.85rem;
}

.crumbs a { color: var(--muted); text-decoration: none; }

.crumbs a:hover { color: var(--accent); }

.crumbs [aria-current="page"] { color: var(--text); }

.repo-head {
  display: grid;
  justify-items: start;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
}

.repo-head h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.repo-head h1:focus-visible { outline: none; }

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-raise);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.gh-link:hover { border-color: var(--accent); color: var(--accent); }

.gh-link svg { flex: none; }

.repo-about {
  margin: 0;
  max-width: 46rem;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.8rem;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
  border-bottom: 1px solid var(--line);
}

.tabs a {
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-bottom: 0;
  color: var(--muted);
  text-decoration: none;
}

.tabs a:hover { color: var(--accent); }

.tabs a[aria-current="page"] {
  margin-bottom: -1px;
  border-color: var(--line);
  background: var(--bg-raise);
  color: var(--text);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0 0 1.2rem;
}

.panel {
  margin: 0 0 1.2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.panel > h2 {
  margin: 0 0 0.8rem;
  font-size: 1.3rem;
}

.panel .bars { margin: 0; }

.md { max-width: 52rem; overflow-wrap: anywhere; }

.md > :first-child { margin-top: 0; }

.md > :last-child { margin-bottom: 0; }

.md h3, .md h4, .md h5, .md h6 { margin: 1.4rem 0 0.5rem; line-height: 1.25; }

.md h3 { font-size: 1.45rem; }

.md h4 { font-size: 1.2rem; }

.md h5, .md h6 { font-size: 1rem; }

.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0 0 0.9rem; }

.md ul, .md ol { padding-left: 1.4rem; }

.md li + li { margin-top: 0.2rem; }

.md blockquote {
  padding: 0.1rem 0 0.1rem 0.9rem;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}

.md a { color: var(--accent); }

.md code {
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--line);
  background: var(--bg-sink);
  font-size: 0.9em;
}

.md pre {
  padding: 0.8rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--bg-sink);
  font-size: 0.85rem;
  line-height: 1.5;
}

.md pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}

.md img { max-width: 100%; height: auto; }

.md hr {
  margin: 1.2rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.commits {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.commit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 1rem;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.commits li:last-child .commit { border-bottom: 0; }

.commit:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: inherit;
}

.commit strong { font-weight: 500; overflow-wrap: anywhere; }

.commit small { grid-column: 1 / -1; color: var(--faint); }

.sha {
  color: var(--phosphor);
  font-size: 0.85rem;
}

.more { margin-top: 1rem; }

.more[hidden] { display: none; }

.commit-head h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.msg {
  margin: 0.6rem 0 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.meta-list {
  display: grid;
  gap: 0.25rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}

.meta-list code { color: var(--phosphor); overflow-wrap: anywhere; }

.files {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.files-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  padding: 0.75rem 0.95rem;
}

.files-head span + span { margin-left: 0.7rem; }

.file { border-top: 1px solid var(--line); }

.file summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
  padding: 0.65rem 0.95rem;
  cursor: pointer;
}

.file summary:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

.file .name { flex: 1; min-width: 12rem; overflow-wrap: anywhere; }

.status {
  padding: 0 0.4rem;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.74rem;
}

.plus { color: var(--phosphor); }

.minus { color: var(--danger); }

.diff {
  margin: 0;
  padding: 0.5rem 0;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-sink);
  font-size: 0.82rem;
  line-height: 1.5;
}

.diff-lines {
  display: inline-block;
  min-width: 100%;
}

.diff-lines span {
  display: block;
  padding: 0 0.95rem;
  white-space: pre;
}

.d-add { background: color-mix(in srgb, var(--phosphor) 18%, transparent); }

.d-del { background: color-mix(in srgb, var(--danger) 18%, transparent); }

.d-hunk {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--faint);
}

.diff-note {
  margin: 0;
  padding: 0.75rem 0.95rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

html.theme-anim .gh-link,
html.theme-anim .chips li,
html.theme-anim .tabs a,
html.theme-anim .panel,
html.theme-anim .commits,
html.theme-anim .commit,
html.theme-anim .files,
html.theme-anim .status,
html.theme-anim .diff,
html.theme-anim .diff-lines span,
html.theme-anim .md code,
html.theme-anim .md pre {
  transition: background-color 0.48s ease, color 0.48s ease, border-color 0.48s ease, box-shadow 0.48s ease;
}

@media (max-width: 800px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .commit { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html.theme-anim .gh-link,
  html.theme-anim .chips li,
  html.theme-anim .tabs a,
  html.theme-anim .panel,
  html.theme-anim .commits,
  html.theme-anim .commit,
  html.theme-anim .files,
  html.theme-anim .status,
  html.theme-anim .diff,
  html.theme-anim .diff-lines span,
  html.theme-anim .md code,
  html.theme-anim .md pre {
    transition: none;
  }
}
