:root {
  --bg: #eee;
  --bg-box: #ffff;
  --text: #2e2e2e;
  --link: #ff6600;
  --link-hover: #ffffff;
  --accent: #011907;
  --font: 'Berkeley Mono Trial', monospace;
}

@font-face {
  font-family: 'Berkeley Mono Trial';
  src: url('/fonts/BerkeleyMonoTrial-Regular.ttf') format('truetype');
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  margin-right: calc(100% - 100vw);
  background: #eee;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5rem;
}

.site-wrapper {
  max-width: 900px;
  margin: 2rem auto;
}

.site-box {
  background: var(--bg-box);
  color: var(--text);
  width: 100%;
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  padding: .5rem 1rem;
  border: 1px solid #888;
  box-shadow: 2px 2px #ccc;
}

.black {
  color: #000;
  fill: #000;
}

header nav {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--accent);
}

header nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
}

header nav li {
  flex: 1;
}

.site-title {
  font-size: 1rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 1rem;
  font-stretch: condensed;
}

header nav a {
  display: block;
  min-width: 6rem;
  font-size: smaller;
  font-weight: bold;
  text-align: center;
  padding: .10rem .2rem;
  border: 1px solid #888;
  box-shadow: 2px 2px #ccc;
  color: var(--accent);
}

header nav a:hover {
  background: black;
  text-decoration: none;
}

header nav a.nav-active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

h1, h2, h3 {
  color: var(--accent);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px dashed var(--accent);
  font-size: 0.85rem;
}

.search-input {
  font-family: var(--font);
  font-size: smaller;
  padding: .1rem .4rem;
  border: 1px solid #888;
  box-shadow: 2px 2px #ccc;
  background: var(--bg-box);
  color: var(--text);
  width: 9rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: none;
}

.breadcrumb {
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
  color: #888;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #bbb;
}

/* ── Dim mode toggle ── */
.dim-toggle {
  position: fixed;
  top: 1rem;
  z-index: 100;
  font-family: var(--font);
  font-size: smaller;
  font-weight: bold;
  padding: .1rem .4rem;
  border: 1px solid #888;
  box-shadow: 2px 2px #ccc;
  background: var(--bg-box);
  color: var(--accent);
  cursor: pointer;
}

@media (min-width: 1100px) {
  .dim-toggle {
    left: calc(50vw + 450px + 1rem);
    top: 2rem;
  }
}

.dim-toggle:hover {
  background: black;
  color: white;
  box-shadow: none;
}

/* ── Profile header (index page) ── */
.profile-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px dashed var(--accent);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border: 1px solid #888;
  box-shadow: 2px 2px #ccc;
  flex-shrink: 0;
  image-rendering: auto;
}

.profile-body {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
}

.profile-name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem;
}

.profile-name strong { font-size: 1rem; color: var(--accent); }
.profile-login { font-size: 0.85rem; color: #888; }
.profile-bio { font-size: 0.875rem; margin: 0; }

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  font-size: 0.8rem;
  color: #888;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.25rem;
  font-size: 0.8rem;
  color: #888;
  margin-top: .1rem;
}

/* ── Topic / tag pills ── */
.repo-topics {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-top: .3rem;
}

.repo-topic {
  font-size: 0.7rem;
  padding: .05rem .4rem;
  border: 1px solid #bbb;
  color: #888;
  white-space: nowrap;
}

/* ── Language filter pills ── */
.lang-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}

.lang-pill {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: bold;
  padding: .05rem .4rem;
  border: 1px solid #888;
  box-shadow: 1px 1px #ccc;
  background: var(--bg-box);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.lang-pill:hover, .lang-pill.active {
  background: black;
  color: white;
  box-shadow: none;
}

.sort-select {
  font-family: var(--font);
  font-size: smaller;
  padding: .1rem .35rem;
  border: 1px solid #888;
  box-shadow: 2px 2px #ccc;
  background: var(--bg-box);
  color: var(--accent);
  cursor: pointer;
}

.sort-select:focus { outline: none; border-color: var(--accent); box-shadow: none; }

/* ── Repo page 2-column layout ── */
.repo-page-layout {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 1.5rem;
  align-items: start;
}

/* ── Repo sidebar ── */
.repo-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-section {
  border: 1px solid #ddd;
}

.sidebar-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: bold;
  color: #888;
  padding: .3rem .6rem;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
}

.sidebar-section-body {
  padding: .6rem .7rem;
  font-size: 0.82rem;
}

.sidebar-desc {
  color: var(--text);
  margin-bottom: .6rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.sidebar-stat {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem 0;
  font-size: 0.82rem;
  color: #666;
}

.sidebar-stat strong { color: var(--text); }

.sidebar-topics {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .6rem;
}

.sidebar-topic {
  font-size: 0.7rem;
  padding: .1rem .4rem;
  border: 1px solid #bbb;
  color: #777;
  cursor: default;
}

.sidebar-license {
  font-size: 0.82rem;
  color: #888;
  margin-top: .4rem;
}

/* Language bar */
.lang-bar {
  display: flex;
  height: 8px;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: .6rem;
  gap: 1px;
}

.lang-bar-seg {
  height: 100%;
  flex-shrink: 0;
}

.lang-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: 0.8rem;
}

.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lang-name { color: var(--text); }
.lang-pct  { color: #888; margin-left: auto; }

/* Latest release in sidebar */
.sidebar-release-tag {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--accent);
  display: block;
  margin-bottom: .2rem;
}

.sidebar-release-date {
  font-size: 0.75rem;
  color: #aaa;
  display: block;
  margin-bottom: .5rem;
}

.sidebar-release-links {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
}

/* Contributors */
.contributor-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}

.contributor-avatar {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  display: block;
  image-rendering: auto;
}

.contributor-more {
  font-size: 0.75rem;
  color: #888;
}

/* File search within tree */
.file-search {
  width: 7rem;
}

/* License tab */
.license-content {
  font-family: var(--font);
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
}

/* dim overrides */
html.dim .profile-avatar {
  border-color: #3a3a3a;
  box-shadow: 2px 2px #111;
}

html.dim .repo-topic,
html.dim .sidebar-topic {
  border-color: #3a3a3a;
  color: #666;
}

html.dim .lang-pill {
  border-color: #3a3a3a;
  box-shadow: 1px 1px #111;
}

html.dim .lang-pill:hover,
html.dim .lang-pill.active {
  background: var(--accent);
  box-shadow: none;
}

html.dim .sort-select {
  border-color: #3a3a3a;
  box-shadow: 2px 2px #111;
}

html.dim .sidebar-section { border-color: #3a3a3a; }
html.dim .sidebar-section-title { background: #1e1e1e; border-bottom-color: #2a2a2a; color: #666; }
html.dim .contributor-avatar { border-color: #3a3a3a; }

/* ── Git: Repo index ── */
.repo-index-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--accent);
}

.repo-index-controls h1 {
  margin-bottom: 0;
}

.repo-list {
  display: flex;
  flex-direction: column;
}

.repo-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: .5rem 1rem;
  padding: .75rem 0;
  border-bottom: 1px dashed #ddd;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}

.repo-row:last-child {
  border-bottom: none;
}

.repo-row:hover {
  color: var(--accent);
  text-decoration: none;
}

.repo-row-main {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.repo-row-name {
  font-weight: bold;
  color: var(--accent);
  font-size: 0.95rem;
}

.repo-row:hover .repo-row-name {
  text-decoration: underline;
}

.repo-row-desc {
  font-size: 0.85rem;
  color: #888;
}

.repo-row-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .2rem;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #888;
  white-space: nowrap;
}

.repo-stat {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.repo-lang-dot {
  display: inline-block;
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.repo-fork-badge {
  font-size: 0.7rem;
  color: #888;
  border: 1px solid #ccc;
  padding: 0 .3rem;
}

.repo-private-badge {
  font-size: 0.7rem;
  color: #888;
  border: 1px solid #ccc;
  padding: 0 .3rem;
}

.git-loading, .git-error, .git-empty {
  color: #888;
  padding: 2rem 0;
  font-size: 0.9rem;
}

.git-error {
  color: #c0392b;
}

/* ── Git: Repo detail header ── */
.git-repo-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--accent);
}

.git-repo-header h1 {
  margin-bottom: .25rem;
}

.git-repo-header h1 a {
  color: var(--accent);
}

.git-repo-desc {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: .75rem;
}

.git-repo-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  font-size: 0.8rem;
  color: #888;
}

.git-repo-stat {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.git-clone-url {
  font-family: var(--font);
  font-size: 0.8rem;
  padding: .1rem .4rem;
  border: 1px solid #ccc;
  background: #f9f9f9;
  color: var(--text);
  cursor: text;
  user-select: all;
}

/* ── Git: Tabs ── */
.git-tabs {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 1px dashed #ddd;
}

.git-tab {
  font-family: var(--font);
  font-size: smaller;
  font-weight: bold;
  padding: .1rem .5rem;
  border: 1px solid #888;
  box-shadow: 2px 2px #ccc;
  background: var(--bg-box);
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.git-tab:hover {
  background: black;
  color: white;
  text-decoration: none;
  box-shadow: none;
}

.git-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

/* ── Git: Files tab ── */
.git-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}

.git-branch-select {
  font-family: var(--font);
  font-size: smaller;
  padding: .1rem .4rem;
  border: 1px solid #888;
  box-shadow: 2px 2px #ccc;
  background: var(--bg-box);
  color: var(--accent);
  cursor: pointer;
}

.git-branch-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: none;
}

.git-path-crumb {
  font-size: 0.8rem;
  color: #888;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem;
}

.git-path-crumb a {
  color: var(--link);
}

.git-path-crumb .crumb-sep {
  color: #bbb;
}

.file-tree {
  border: 1px solid #ddd;
  margin-bottom: 1rem;
}

.file-row {
  display: grid;
  grid-template-columns: 1.2rem minmax(8rem, 28%) 1fr;
  align-items: center;
  gap: .4rem;
  padding: .35rem .5rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}

.file-row:last-child {
  border-bottom: none;
}

.file-row:hover {
  background: #f9f9f9;
  color: var(--accent);
  text-decoration: none;
}

.file-row.up-row {
  color: #888;
  font-size: 0.8rem;
}

.file-icon {
  color: #888;
  font-size: 0.75rem;
  text-align: center;
}

.file-icon.dir {
  color: var(--accent);
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name.dir {
  color: var(--accent);
  font-weight: bold;
}

.file-commit-msg {
  font-size: 0.78rem;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Git: File viewer ── */
.file-viewer {
  border: 1px solid #ddd;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.file-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .4rem .6rem;
  border-bottom: 1px solid #ddd;
  background: #f9f9f9;
}

.file-viewer-name {
  font-weight: bold;
  color: var(--accent);
}

.file-viewer-meta {
  font-size: 0.75rem;
  color: #888;
}

.file-viewer-actions {
  display: flex;
  gap: .4rem;
  align-items: center;
}

.file-action-btn {
  font-family: var(--font);
  font-size: 0.75rem;
  padding: .05rem .4rem;
  border: 1px solid #888;
  box-shadow: 1px 1px #ccc;
  background: var(--bg-box);
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.file-action-btn:hover {
  background: black;
  color: white;
  text-decoration: none;
  box-shadow: none;
}

.file-code-wrap {
  overflow-x: auto;
}

.file-code {
  display: table;
  width: 100%;
  border-collapse: collapse;
}

.code-line {
  display: table-row;
}

.code-line:hover .line-num,
.code-line:hover .line-text {
  background: #f0f4f0;
}

.line-num {
  display: table-cell;
  padding: 0 .75rem 0 .4rem;
  text-align: right;
  color: #bbb;
  font-size: 0.75rem;
  user-select: none;
  vertical-align: top;
  white-space: nowrap;
  border-right: 1px solid #eee;
  width: 1%;
}

.line-text {
  display: table-cell;
  padding: 0 .5rem;
  white-space: pre;
  vertical-align: top;
}

/* ── Git: Commit list ── */
.commit-list {
  display: flex;
  flex-direction: column;
}

.commit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: .4rem 1rem;
  padding: .6rem 0;
  border-bottom: 1px dashed #ddd;
  font-size: 0.875rem;
}

.commit-row:last-child {
  border-bottom: none;
}

.commit-main {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.commit-message {
  color: var(--text);
  font-weight: bold;
  font-size: 0.9rem;
}

.commit-sub {
  font-size: 0.75rem;
  color: #888;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .75rem;
}

.commit-hash {
  font-family: var(--font);
  font-size: 0.75rem;
  color: var(--link);
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

.commit-hash a {
  color: var(--link);
}

/* ── Git: Branch list ── */
.branch-list {
  display: flex;
  flex-direction: column;
}

.branch-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px dashed #ddd;
  font-size: 0.875rem;
}

.branch-row:last-child {
  border-bottom: none;
}

.branch-name {
  color: var(--accent);
  font-weight: bold;
}

.branch-default-badge {
  font-size: 0.7rem;
  border: 1px solid var(--accent);
  padding: 0 .3rem;
  color: var(--accent);
}

.branch-updated {
  margin-left: auto;
  font-size: 0.75rem;
  color: #aaa;
}

/* ── Git: Release list ── */
.release-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.release-row {
  border: 1px solid #ddd;
  padding: .75rem 1rem;
}

.release-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-bottom: .5rem;
  padding-bottom: .5rem;
  border-bottom: 1px dashed #eee;
}

.release-name {
  font-weight: bold;
  font-size: 1rem;
  color: var(--accent);
}

.release-tag {
  font-size: 0.75rem;
  color: #888;
  border: 1px solid #ccc;
  padding: .05rem .35rem;
}

.release-date {
  margin-left: auto;
  font-size: 0.75rem;
  color: #aaa;
}

.release-prerelease-badge {
  font-size: 0.7rem;
  border: 1px solid #e67e22;
  padding: 0 .3rem;
  color: #e67e22;
}

.release-body {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: .75rem;
  white-space: pre-wrap;
}

.release-assets {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.release-assets-title {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .2rem;
}

.release-asset {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .15rem .5rem;
  border: 1px solid #888;
  box-shadow: 2px 2px #ccc;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
  width: fit-content;
}

.release-asset:hover {
  background: black;
  color: white;
  text-decoration: none;
  box-shadow: none;
}

.release-asset-size {
  color: #aaa;
  font-size: 0.75rem;
}

/* ── Dim mode ── */
html.dim {
  background: #1c1c1c;
  --bg: #1c1c1c;
  --bg-box: #242424;
  --text: #a8a4a0;
  --link: #ff7733;
  --link-hover: #ffcc99;
  --accent: #6a9a6a;
}

html.dim .site-box,
html.dim .dim-toggle {
  border-color: #3a3a3a;
  box-shadow: 2px 2px #111;
}

html.dim header nav a {
  border-color: #3a3a3a;
  box-shadow: 2px 2px #111;
}

html.dim header nav a:hover,
html.dim .dim-toggle:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

html.dim header nav a.nav-active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

html.dim .search-input {
  border-color: #3a3a3a;
  box-shadow: 2px 2px #111;
}

html.dim .search-input:focus {
  border-color: var(--accent);
  box-shadow: none;
}

html.dim .repo-row,
html.dim .commit-row,
html.dim .branch-row {
  border-bottom-color: #333;
}

html.dim .file-tree,
html.dim .file-viewer,
html.dim .release-row {
  border-color: #3a3a3a;
}

html.dim .file-row {
  border-bottom-color: #2a2a2a;
}

html.dim .file-row:hover {
  background: #2a2a2a;
}

html.dim .file-viewer-header {
  background: #1e1e1e;
  border-bottom-color: #3a3a3a;
}

html.dim .line-num {
  border-right-color: #2a2a2a;
  color: #555;
}

html.dim .code-line:hover .line-num,
html.dim .code-line:hover .line-text {
  background: #2a2a2a;
}

html.dim .git-tabs {
  border-bottom-color: #333;
}

html.dim .git-tab {
  border-color: #3a3a3a;
  box-shadow: 2px 2px #111;
}

html.dim .git-tab:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

html.dim .git-tab.active {
  background: var(--accent);
}

html.dim .git-branch-select {
  border-color: #3a3a3a;
  box-shadow: 2px 2px #111;
}

html.dim .git-branch-select:focus {
  border-color: var(--accent);
  box-shadow: none;
}

html.dim .git-repo-header {
  border-bottom-color: #333;
}

html.dim .git-clone-url {
  background: #1e1e1e;
  border-color: #3a3a3a;
}

html.dim .release-header {
  border-bottom-color: #333;
}

html.dim .release-asset {
  border-color: #3a3a3a;
  box-shadow: 2px 2px #111;
}

html.dim .release-asset:hover {
  background: var(--accent);
  box-shadow: none;
}

html.dim .file-action-btn {
  border-color: #3a3a3a;
  box-shadow: 1px 1px #111;
}

html.dim .file-action-btn:hover {
  background: var(--accent);
  box-shadow: none;
}

html.dim .repo-fork-badge,
html.dim .repo-private-badge,
html.dim .release-tag,
html.dim .branch-default-badge {
  border-color: #3a3a3a;
}

html.dim .branch-default-badge {
  border-color: var(--accent);
}

/* ── Clone URL copy button ── */
.git-clone-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.git-clone-label {
  font-size: 0.75rem;
  color: #888;
  white-space: nowrap;
}

.git-clone-copy {
  font-family: var(--font);
  font-size: 0.8rem;
  padding: .1rem .5rem;
  border: 1px solid #888;
  box-shadow: 2px 2px #ccc;
  background: var(--bg-box);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: 20rem;
}

.git-clone-copy:hover {
  border-color: var(--accent);
  box-shadow: none;
}

.git-clone-copy.copied {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: none;
}

.git-clone-url-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.git-clone-icon {
  flex-shrink: 0;
  font-size: 0.7rem;
}

/* ── Archive download buttons ── */
.git-archive-links {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px dashed #ddd;
}

/* ── README section ── */
.git-readme {
  margin-top: 1.5rem;
  border: 1px solid #ddd;
}

.git-readme-header {
  padding: .4rem .6rem;
  background: #f9f9f9;
  border-bottom: 1px solid #ddd;
  font-size: 0.8rem;
  color: #888;
  font-weight: bold;
}

.git-readme-body {
  padding: 1.25rem 1.5rem;
  line-height: 1.75;
  font-size: 0.95rem;
}

.git-readme-body h1, .git-readme-body h2, .git-readme-body h3,
.git-readme-body h4, .git-readme-body h5, .git-readme-body h6 {
  color: var(--accent);
  margin: 1.25rem 0 .4rem;
}

.git-readme-body h2 {
  padding-top: .75rem;
  border-top: 1px dashed var(--accent);
}

.git-readme-body p { margin-bottom: .85rem; }

.git-readme-body pre {
  background: #f4f4f0;
  border: 1px solid #ddd;
  padding: .75rem 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.git-readme-body code {
  font-family: var(--font);
  font-size: 0.88em;
  background: #f4f4f0;
  border: 1px solid #ddd;
  padding: .05em .35em;
}

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

.git-readme-body ul, .git-readme-body ol { margin: 0 0 1rem 1.5rem; }
.git-readme-body li { margin-bottom: .2rem; }

.git-readme-body blockquote {
  border-left: 3px solid var(--accent);
  padding: .25rem 0 .25rem 1rem;
  color: #666;
  margin: 1rem 0;
  font-style: italic;
}

.git-readme-body table { border-collapse: collapse; width: 100%; margin-bottom: 1rem; font-size: 0.9rem; }
.git-readme-body th { border: 1px solid #ddd; padding: .4rem .75rem; background: #f4f4f0; text-align: left; color: var(--accent); }
.git-readme-body td { border: 1px solid #ddd; padding: .4rem .75rem; }
.git-readme-body tr:nth-child(even) td { background: #fafafa; }
.git-readme-body img { max-width: 100%; border: 1px solid #ddd; display: block; }
.git-readme-body a { color: var(--link); }
.git-readme-body a:hover { color: var(--link-hover); }
.git-readme-body hr { border: none; border-top: 1px dashed var(--accent); margin: 1.5rem 0; }

/* dim overrides */
html.dim .git-clone-copy {
  border-color: #3a3a3a;
  box-shadow: 2px 2px #111;
}

html.dim .git-clone-copy:hover,
html.dim .git-clone-copy.copied {
  border-color: var(--accent);
  box-shadow: none;
}

html.dim .git-readme,
html.dim .git-archive-links .file-action-btn {
  border-color: #3a3a3a;
}

html.dim .git-readme-header {
  background: #1e1e1e;
  border-bottom-color: #2a2a2a;
}

html.dim .git-archive-links {
  border-top-color: #333;
}

html.dim .git-readme-body pre,
html.dim .git-readme-body code {
  background: #1e1e1e;
  border-color: #333;
}

html.dim .git-readme-body pre code { background: none; border: none; }
html.dim .git-readme-body th { background: #1e1e1e; border-color: #333; }
html.dim .git-readme-body td { border-color: #333; }
html.dim .git-readme-body tr:nth-child(even) td { background: #1a1a1a; }
html.dim .git-readme-body blockquote { color: #777; }
html.dim .git-readme-body img { border-color: #333; }

/* ── File viewer page ── */
.fv-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  padding: .5rem .6rem;
  border: 1px solid #ddd;
  border-bottom: none;
  background: #f9f9f9;
}

.fv-filename {
  font-weight: bold;
  color: var(--accent);
  font-size: 0.9rem;
}

.fv-meta {
  font-size: 0.8rem;
  color: #888;
}

.fv-actions {
  display: flex;
  gap: .4rem;
  margin-left: auto;
}

/* Code view */
.fv-code-outer {
  border: 1px solid #ddd;
  overflow-x: auto;
}

.fv-code-wrap {
  display: flex;
  min-width: max-content;
}

.fv-gutter {
  display: flex;
  flex-direction: column;
  padding: .75rem .6rem;
  text-align: right;
  color: #bbb;
  font-size: 0.85rem;
  line-height: 1.6;
  user-select: none;
  border-right: 1px solid #eee;
  flex-shrink: 0;
  background: #fafafa;
  font-family: var(--font);
}

.fv-linenum {
  display: block;
}

.fv-pre {
  margin: 0;
  padding: .75rem .75rem;
  overflow: visible;
  font-size: 0.85rem;
  line-height: 1.6;
  flex: 1;
  background: transparent;
  border: none;
}

.fv-pre code.hljs {
  padding: 0;
  background: transparent;
  font-size: inherit;
  line-height: inherit;
  font-family: var(--font);
}

/* Markdown view */
.fv-markdown {
  border: 1px solid #ddd;
  padding: 1.25rem 1.5rem;
  line-height: 1.75;
  font-size: 0.95rem;
}

.fv-markdown h1, .fv-markdown h2, .fv-markdown h3,
.fv-markdown h4, .fv-markdown h5, .fv-markdown h6 {
  color: var(--accent);
  margin: 1.5rem 0 .5rem;
}

.fv-markdown h2 {
  padding-top: 1rem;
  border-top: 1px dashed var(--accent);
}

.fv-markdown p { margin-bottom: 1rem; }

.fv-markdown pre {
  background: #f4f4f0;
  border: 1px solid #ddd;
  padding: .75rem 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.fv-markdown code {
  font-family: var(--font);
  font-size: 0.88em;
  background: #f4f4f0;
  border: 1px solid #ddd;
  padding: .05em .35em;
}

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

.fv-markdown ul, .fv-markdown ol {
  margin: 0 0 1rem 1.5rem;
}

.fv-markdown li { margin-bottom: .25rem; }

.fv-markdown blockquote {
  border-left: 3px solid var(--accent);
  padding: .25rem 0 .25rem 1rem;
  color: #666;
  margin: 1rem 0;
  font-style: italic;
}

.fv-markdown table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.fv-markdown th {
  border: 1px solid #ddd;
  padding: .4rem .75rem;
  background: #f4f4f0;
  text-align: left;
  color: var(--accent);
}

.fv-markdown td {
  border: 1px solid #ddd;
  padding: .4rem .75rem;
}

.fv-markdown tr:nth-child(even) td { background: #fafafa; }

.fv-markdown img {
  max-width: 100%;
  border: 1px solid #ddd;
  display: block;
}

.fv-markdown a { color: var(--link); }
.fv-markdown a:hover { color: var(--link-hover); }
.fv-markdown hr {
  border: none;
  border-top: 1px dashed var(--accent);
  margin: 2rem 0;
}

/* dim overrides for fv */
html.dim .fv-header,
html.dim .fv-code-outer {
  border-color: #3a3a3a;
}

html.dim .fv-header {
  background: #1e1e1e;
}

html.dim .fv-gutter {
  background: #1e1e1e;
  border-right-color: #2a2a2a;
  color: #555;
}

html.dim .fv-markdown {
  border-color: #3a3a3a;
}

html.dim .fv-markdown pre,
html.dim .fv-markdown code {
  background: #1e1e1e;
  border-color: #333;
}

html.dim .fv-markdown pre code {
  background: none;
  border: none;
}

html.dim .fv-markdown th {
  background: #1e1e1e;
  border-color: #333;
}

html.dim .fv-markdown td { border-color: #333; }
html.dim .fv-markdown tr:nth-child(even) td { background: #1a1a1a; }
html.dim .fv-markdown blockquote { color: #777; }
html.dim .fv-markdown img { border-color: #333; }

/* ── Binary viewers ── */
.fv-image-wrap {
  border: 1px solid #ddd;
  border-top: none;
  padding: 1rem;
  background: repeating-linear-gradient(-45deg, #f2f2f2, #f2f2f2 2px, #e8e8e8 2px, #e8e8e8 9px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.fv-image {
  max-width: 100%;
  display: block;
  image-rendering: auto;
}

.fv-pdf {
  width: 100%;
  height: 75vh;
  border: 1px solid #ddd;
  border-top: none;
  display: block;
}

.fv-audio-wrap {
  border: 1px solid #ddd;
  border-top: none;
  padding: 1.5rem 1rem;
}

.fv-audio {
  width: 100%;
  display: block;
}

.fv-video-wrap {
  border: 1px solid #ddd;
  border-top: none;
  background: #111;
}

.fv-video {
  width: 100%;
  max-height: 70vh;
  display: block;
}

.fv-binary-info {
  border: 1px solid #ddd;
  border-top: none;
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  text-align: center;
}

.fv-binary-icon {
  font-size: 2.5rem;
  color: #bbb;
}

.fv-binary-type {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .1em;
}

html.dim .fv-image-wrap {
  background: repeating-linear-gradient(-45deg, #2a2a2a, #2a2a2a 2px, #222 2px, #222 9px);
}

html.dim .fv-pdf,
html.dim .fv-audio-wrap,
html.dim .fv-video-wrap,
html.dim .fv-binary-info {
  border-color: #3a3a3a;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  html {
    margin-right: 0;
  }

  body {
    font-size: 15px;
  }

  .site-wrapper {
    margin: 0;
  }

  .site-box {
    min-height: 100vh;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .repo-row {
    grid-template-columns: 1fr;
  }

  .repo-row-stats {
    flex-direction: row;
    align-items: center;
  }

  .commit-row {
    grid-template-columns: 1fr;
  }

  .commit-hash {
    text-align: left;
  }

  .repo-page-layout {
    grid-template-columns: 1fr;
  }

  .repo-sidebar {
    border-top: 1px dashed var(--accent);
    padding-top: 1rem;
  }

  .profile-header {
    flex-direction: column;
    gap: .75rem;
  }

  .file-row {
    grid-template-columns: 1.2rem 1fr;
  }

  .file-commit-msg {
    display: none;
  }
}
