
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f6f8fa;
  --surface-hover: #f3f4f6;
  --text: #1f2328;
  --muted: #656d76;
  --subtle: #8c959f;
  --border: #d0d7de;
  --border-muted: #d8dee4;
  --blue: #0969da;
  --blue-hover: #0550ae;
  --green: #1a7f37;
  --red: #cf222e;
  --code-bg: #f6f8fa;
  --brand: #0d1117;
  --brand-mark-ink: #ffffff;
  --control-hover: #eef1f4;
  --error-bg: #ffebe9;
  --error-border: #ff818266;
  --diff-hunk-text: #8250df;
  --diff-hunk-bg: #ddf4ff;
  --diff-add-bg: #dafbe1;
  --diff-del-bg: #ffebe9;
  --syntax-comment: #6e7781;
  --syntax-string: #0a3069;
  --syntax-keyword: #cf222e;
  --syntax-name: #0550ae;
  --focus-ring: rgba(9, 105, 218, 0.13);
  --radius: 8px;
  --shadow-control: 0 1px 0 rgba(31, 35, 40, 0.04);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }

#cgit { min-height: 100vh; display: flex; flex-direction: column; }
.site-header { height: 64px; border-bottom: 1px solid var(--border); background: var(--bg); }

.site-header-inner,
.repo-header,
.tabs-inner,
.repo-tools,
.path-wrap,
.content {
  width: 100%;
  max-width: 1248px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-header-inner { height: 100%; display: flex; align-items: center; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--brand);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--brand); text-decoration: none; }
.brand-mark { width: 27px; height: 27px; flex: none; }
.brand-mark path { stroke: var(--brand-mark-ink); }
.brand-mark circle { fill: var(--brand-mark-ink); }
.repo-header { padding-top: 28px; padding-bottom: 19px; }
.repo-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.repo-header h1 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.repo-header h1 span { color: var(--blue); font-weight: 600; }
.repo-header h1 b { color: var(--muted); font-weight: 400; }
.repo-header h1 a { color: var(--text); }
.repo-header h1 a:hover { color: var(--blue); }
.repo-header p { max-width: 720px; margin: 7px 0 0; color: var(--muted); font-size: 14px; }

.tabs { border-bottom: 1px solid var(--border); background: var(--bg); }
.tabs-inner { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tabs a { position: relative; flex: none; padding: 12px 13px 11px; color: var(--muted); font-size: 13px; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); font-weight: 600; }
.tabs a.active::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--blue);
}

.repo-tools { display: flex; align-items: center; padding-top: 20px; }
.branch-switcher {
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  box-shadow: var(--shadow-control);
  overflow: hidden;
  max-width: 100%;
}
.branch-icon { display: grid; width: 32px; height: 100%; place-items: center; color: var(--text); }
.branch-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--bg);
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.branch-switcher select {
  width: 120px;
  min-width: 120px;
  height: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
}
.branch-switcher button {
  height: 100%;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.branch-switcher button:hover { background: var(--control-hover); }

.path-wrap { padding-top: 14px; }
.path {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.content { flex: 1; padding-top: 28px; padding-bottom: 56px; }
.footer {
  width: 100%;
  padding: 20px 24px 28px;
  border-top: 1px solid var(--border-muted);
  color: var(--subtle);
  text-align: center;
  font-size: 12px;
}

.page-heading { margin-bottom: 28px; }
.page-heading h1 { margin: 0; font-size: 27px; line-height: 1.25; letter-spacing: -0.025em; }
.repo-filter { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.filter-field { position: relative; flex: 1; }
.filter-field svg {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.repo-filter input[type='search'] {
  width: 100%;
  height: 38px;
  padding: 0 13px 0 37px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: 0;
  color: var(--text);
  background: var(--bg);
  box-shadow: var(--shadow-control);
}
.repo-filter input[type='search']:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--focus-ring); }
.panel,
table.list,
table.commit-info,
table.stats,
.md { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 13px;
  font-weight: 600;
}
.panel-header a { font-weight: 500; }
table { border-collapse: separate; border-spacing: 0; }
table.list { width: 100%; overflow: hidden; }
table.list th,
table.list td { padding: 11px 14px; border: 0; border-bottom: 1px solid var(--border-muted); text-align: left; vertical-align: middle; }
table.list th { color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 600; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:not(.nohover):hover td { background: var(--surface-hover); }
table.list tr.nohover:hover td { background: inherit; }
table.list td a { font-weight: 500; }
table.list td.logsubject { font-family: inherit; font-weight: 600; }
table.list td.logmsg,
table.list td.commitgraph { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
table.list td.ls-mode,
table.list td.ls-size {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}
table.list td.ls-size { text-align: right; }
table.list a.ls-dir { font-weight: 650; }

.index-list .repo-cell { min-width: 420px; }
.repo-cell-inner { display: flex; align-items: flex-start; gap: 12px; }
.repo-cell-inner svg { width: 17px; height: 17px; margin-top: 2px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.repo-cell-inner strong { display: block; font-size: 15px; }
.repo-cell-inner p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.empty-row td { padding: 28px 16px !important; color: var(--muted); text-align: center !important; }

.summary-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.summary-main { min-width: 0; }
.summary-main .panel { margin-bottom: 24px; overflow: hidden; }
.summary-main table.list { border: 0; border-radius: 0; }
.summary-main table.list th:first-child,
.summary-main table.list td:first-child { padding-left: 16px; }
.commit-oid { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.repo-sidebar section { padding: 0 0 21px; margin-bottom: 21px; border-bottom: 1px solid var(--border); }
.repo-sidebar section:last-child { border-bottom: 0; }
.repo-sidebar h2 { margin: 0 0 10px; font-size: 15px; }
.repo-sidebar p { margin: 0; color: var(--muted); }
.repo-sidebar ul { margin: 0; padding: 0; list-style: none; }
.repo-sidebar li { padding: 4px 0; }
.clone-url {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  user-select: all;
}

span.age-mins,
span.age-hours,
span.age-days,
span.age-weeks,
span.age-months,
span.age-years { color: var(--muted); white-space: nowrap; }
.sha1 { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.left { text-align: left !important; }
.right { text-align: right !important; }
a.branch-deco,
a.tag-deco,
a.deco {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 500;
  vertical-align: 1px;
}
.error { padding: 13px 15px; border: 1px solid var(--error-border); border-radius: 6px; color: var(--red); background: var(--error-bg); font-weight: 600; }

form:not(.branch-switcher):not(.repo-filter) { margin-bottom: 18px; }
form select,
form input[type='text'] { height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--bg); font-size: 13px; }
form input[type='submit'] { height: 34px; padding: 0 13px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; }

table.commit-info { width: 100%; margin-bottom: 24px; overflow: hidden; }
table.commit-info th,
table.commit-info td { padding: 9px 13px; border-bottom: 1px solid var(--border-muted); text-align: left; vertical-align: top; }
table.commit-info tr:last-child th,
table.commit-info tr:last-child td { border-bottom: 0; }
table.commit-info th { width: 112px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 600; }
.commit-subject { margin: 26px 0 8px; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.commit-msg { margin-bottom: 24px; white-space: pre-wrap; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.diffstat-header { margin: 28px 0 10px; font-size: 15px; font-weight: 650; }
table.diffstat { min-width: 420px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
table.diffstat td { padding: 7px 10px; border-bottom: 1px solid var(--border-muted); }
table.diffstat tr:last-child td { border-bottom: 0; }
table.diffstat td.add { color: var(--green); }
table.diffstat td.del { color: var(--red); }
.diffstat-summary { margin: 9px 0 20px; color: var(--muted); font-size: 12px; }
table.diff { width: 100%; border-collapse: collapse; }
table.diff td { padding: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; }
table.diff .head { margin-top: 20px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px 6px 0 0; background: var(--surface); color: var(--text); font-weight: 600; }
table.diff .hunk { padding: 4px 10px; color: var(--diff-hunk-text); background: var(--diff-hunk-bg); }
table.diff .add { padding: 0 10px; color: var(--text); background: var(--diff-add-bg); }
table.diff .del { padding: 0 10px; color: var(--text); background: var(--diff-del-bg); }

table.blob {
  display: block;
  width: 100%;
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg);
}
table.blob tbody { display: table; min-width: 100%; }
table.blob td { vertical-align: top; }
table.blob td.linenumbers { padding: 12px 10px; border-right: 1px solid var(--border); background: var(--surface); text-align: right; user-select: none; }
table.blob td.linenumbers a { color: var(--subtle); }
table.blob td.lines { padding: 12px 14px; }
table.blob pre { margin: 0; }
table.blob pre,
table.blob code,
table.blame td { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; }
table.blame td.sha1 { padding: 12px; border-right: 1px solid var(--border); white-space: nowrap; }
table.blame tr:hover td { background: var(--surface-hover); }

.md { padding: 28px 32px; overflow-wrap: break-word; }
.panel .md { border: 0; border-radius: 0; }
.md > :first-child { margin-top: 0 !important; }
.md > :last-child { margin-bottom: 0 !important; }
.md h1,
.md h2 { margin: 24px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border-muted); line-height: 1.25; }
.md h1 { font-size: 25px; }
.md h2 { font-size: 20px; }
.md h3 { font-size: 17px; }
.md p,
.md ul,
.md ol { margin-top: 0; margin-bottom: 16px; }
.md pre.md-code { padding: 14px 16px; overflow-x: auto; border-radius: 6px; background: var(--code-bg); }
.md pre.mermaid {
  margin: 16px 0;
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--border-muted);
  border-radius: 6px;
  background: var(--surface);
  text-align: center;
}
.md pre.mermaid svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.md code { padding: 0.15em 0.35em; border-radius: 4px; background: var(--code-bg); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 85%; }
.md pre code { padding: 0; background: transparent; font-size: 12px; }
.md blockquote { margin: 0 0 16px; padding: 0 1em; border-left: 3px solid var(--border); color: var(--muted); }
.md img { max-width: 100%; }
.md table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.md table th,
.md table td { padding: 6px 13px; border: 1px solid var(--border); }
.md table th { background: var(--surface); }
.md li.task { margin-left: -1.2em; list-style: none; }
.md li.task input { margin-right: 0.45em; }

span.hl-c { color: var(--syntax-comment); font-style: italic; }
span.hl-s { color: var(--syntax-string); }
span.hl-k { color: var(--syntax-keyword); }
span.hl-n { color: var(--syntax-name); }

table.stats { width: 100%; margin-top: 16px; overflow: hidden; }
table.stats th,
table.stats td { padding: 9px 11px; border-bottom: 1px solid var(--border-muted); text-align: right; }
table.stats th { color: var(--muted); background: var(--surface); font-size: 12px; }
table.stats .name { text-align: left; }
table.stats tr:last-child td { border-bottom: 0; }
.snapshots a { margin-right: 8px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #121212;
    --surface-hover: #181818;
    --text: #ededed;
    --muted: #9b9b9b;
    --subtle: #747474;
    --border: #303030;
    --border-muted: #242424;
    --blue: #d4d4d4;
    --blue-hover: #ffffff;
    --green: #c7c7c7;
    --red: #b8b8b8;
    --code-bg: #151515;
    --brand: #f5f5f5;
    --brand-mark-ink: #0a0a0a;
    --control-hover: #1b1b1b;
    --error-bg: #141414;
    --error-border: #454545;
    --diff-hunk-text: #d0d0d0;
    --diff-hunk-bg: #181818;
    --diff-add-bg: #1c1c1c;
    --diff-del-bg: #111111;
    --syntax-comment: #777777;
    --syntax-string: #d0d0d0;
    --syntax-keyword: #f0f0f0;
    --syntax-name: #b8b8b8;
    --focus-ring: rgba(255, 255, 255, 0.14);
    --shadow-control: 0 1px 0 rgba(255, 255, 255, 0.04);
  }
}

@media (max-width: 820px) {
  .site-header-inner,
  .repo-header,
  .tabs-inner,
  .repo-tools,
  .path-wrap,
  .content { padding-left: 16px; padding-right: 16px; }
  .summary-grid { grid-template-columns: 1fr; }
  .repo-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .repo-sidebar section { margin: 0; }
  .index-list .repo-cell { min-width: 300px; }
}

@media (max-width: 620px) {
  .site-header { height: 56px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 24px; height: 24px; }
  .repo-header { padding-top: 22px; padding-bottom: 15px; }
  .repo-header h1 { gap: 6px; font-size: 19px; }
  .tabs a { padding-left: 10px; padding-right: 10px; }
  .content { padding-top: 22px; padding-bottom: 40px; }
  .page-heading { margin-bottom: 21px; }
  .page-heading h1 { font-size: 24px; }
  .repo-filter { flex-direction: column; }
  .filter-field { width: 100%; }
  table.list,
  table.commit-info,
  table.stats,
  table.diffstat { display: block; max-width: 100%; overflow-x: auto; }
  table.list tbody,
  table.commit-info tbody,
  table.stats tbody { min-width: 620px; display: table; width: 100%; }
  .index-list tbody { min-width: 560px !important; }
  .repo-sidebar { grid-template-columns: 1fr; gap: 0; }
  .repo-sidebar section { margin-bottom: 20px; }
  table.index-list { display: table; width: 100%; }
  .index-list tbody { display: table-row-group; min-width: 0 !important; }
  .index-list th:nth-child(n+2),
  .index-list td:nth-child(n+2) { display: none; }
  .md { padding: 22px 18px; }
  .footer { padding-bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
