:root {
  --bg:   #000000;
  --text: #d0d0d0;
  --dim:  #666;
  --border: #333;
  --hover: #111;
  --link: #d0d0d0;
  --add:  #5a5;
  --del:  #a55;
  --hunk: #55a;
}

html {
  color-scheme: dark;
}

html, body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Courier Prime', Courier, monospace;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: 'Courier Prime';
  src: url('/CourierPrime.ttf') format('truetype');
}

div#cgit {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  font-family: 'Courier Prime', Courier, monospace;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
}

div#cgit a,
div#cgit a:link,
div#cgit a:visited,
div#cgit a:hover,
div#cgit a:active {
  color: var(--link);
}

div#cgit a:hover {
  text-decoration: underline;
}

div#cgit table {
  border-collapse: collapse;
}

div#cgit table#header {
  width: 100%;
  margin-bottom: 1rem;
}

div#cgit table#header td.logo {
  display: none;
}

div#cgit table#header td.main {
  font-size: 2rem;
  font-weight: bold;
  white-space: nowrap;
}

div#cgit table#header td.main a {
  color: var(--text);
}

div#cgit table#header td.sub {
  color: var(--dim);
  border-top: 1px solid var(--border);
  padding-top: 0.25rem;
}

div#cgit table#header td.form {
  text-align: right;
  vertical-align: bottom;
  white-space: nowrap;
}

div#cgit table#header td.form input,
div#cgit table#header td.form select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-family: 'Courier Prime', Courier, monospace;
  font-size: 0.9rem;
  padding: 0.2em 0.4em;
}

div#cgit table.tabs {
  border-bottom: 1px solid var(--border);
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 0;
}

div#cgit table.tabs td {
  padding: 0 1em;
  vertical-align: bottom;
}

div#cgit table.tabs td a {
  color: var(--dim);
  font-size: 1rem;
  padding: 0.2em 0.5em;
}

div#cgit table.tabs td a.active {
  color: var(--text);
  font-weight: bold;
  background: none;
}

div#cgit table.tabs td.form {
  text-align: right;
}

div#cgit table.tabs td.form form {
  font-size: 0.9rem;
  white-space: nowrap;
}

div#cgit table.tabs td.form input,
div#cgit table.tabs td.form select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-family: 'Courier Prime', Courier, monospace;
  font-size: 0.9rem;
  padding: 0.2em 0.4em;
}

div#cgit table.tabs a[href^="http://"]:after,
div#cgit table.tabs a[href^="https://"]:after {
  content: none;
}

div#cgit div.path {
  margin: 0;
  padding: 0.5em 0;
  color: var(--text);
  background: none;
}

div#cgit div.content {
  margin: 0;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

div#cgit table.list {
  width: 100%;
  border: none;
}

div#cgit table.list tr {
  background: var(--bg);
}

div#cgit table.list tr:nth-child(even) {
  background: var(--bg);
}

div#cgit table.list tr:nth-child(odd) {
  background: var(--bg);
}

div#cgit table.list tr:hover {
  background: var(--hover);
}

div#cgit table.list tr.nohover,
div#cgit table.list tr.nohover:hover {
  background: var(--bg);
}

div#cgit table.list tr.nohover-highlight:hover:nth-child(even),
div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) {
  background: var(--bg);
}

div#cgit table.list th {
  font-weight: bold;
  color: var(--dim);
  padding: 0.25em 0.5em;
  vertical-align: baseline;
}

div#cgit table.list td {
  border: none;
  padding: 0.25em 0.5em;
}

div#cgit table.list td a {
  color: var(--text);
}

div#cgit table.list td a:hover {
  color: var(--text);
  text-decoration: underline;
}

div#cgit table.list td a.ls-dir {
  font-weight: bold;
  color: var(--text);
}

div#cgit table.list td.commitgraph {
  font-family: monospace;
  white-space: pre;
}

div#cgit table.list td.logsubject {
  font-weight: bold;
}

div#cgit table.list td.logmsg {
  white-space: pre;
  padding: 0 0.5em;
}

div#cgit table.list td.sublevel-repo {
  padding-left: 1.5em;
}

div#cgit table.list td.reposection {
  font-style: italic;
  color: var(--dim);
}

div#cgit table.nowrap td {
  white-space: nowrap;
}

div#cgit img {
  border: none;
}

div#cgit div#summary {
  vertical-align: top;
  margin-bottom: 1em;
}

div#cgit table.commit-info {
  border-collapse: collapse;
  margin-top: 1em;
}

div#cgit table.commit-info th {
  text-align: left;
  font-weight: normal;
  color: var(--dim);
  padding: 0.1em 1em 0.1em 0;
  vertical-align: top;
}

div#cgit table.commit-info td {
  padding: 0.1em 1em 0.1em 0;
}

div#cgit div.commit-subject {
  font-weight: bold;
  font-size: 1.25rem;
  margin: 1em 0 0.5em 0;
}

div#cgit div.commit-msg {
  white-space: pre;
}

div#cgit div.notes-header {
  font-weight: bold;
  padding-top: 1em;
}

div#cgit div.notes {
  white-space: pre;
  border: 1px solid var(--border);
  background: var(--hover);
  padding: 0.5em 1em;
  float: left;
}

div#cgit div.notes-footer {
  clear: left;
}

div#cgit div.diffstat-header {
  font-weight: bold;
  padding-top: 1em;
}

div#cgit table.diffstat {
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: var(--bg);
}

div#cgit table.diffstat th {
  font-weight: normal;
  text-align: left;
  text-decoration: underline;
  padding: 0.1em 1em 0.1em 0.1em;
}

div#cgit table.diffstat td {
  padding: 0.2em;
  border: none;
}

div#cgit table.diffstat td.mode {
  white-space: nowrap;
}

div#cgit table.diffstat td span.modechange {
  padding-left: 1em;
  color: var(--del);
}

div#cgit table.diffstat td.add a { color: var(--add); }
div#cgit table.diffstat td.del a { color: var(--del); }
div#cgit table.diffstat td.upd a { color: var(--hunk); }

div#cgit table.diffstat td.graph { width: 500px; vertical-align: middle; }
div#cgit table.diffstat td.graph table { border: none; }
div#cgit table.diffstat td.graph td { padding: 0; border: 0; height: 7pt; }
div#cgit table.diffstat td.graph td.add { background-color: var(--add); }
div#cgit table.diffstat td.graph td.rem { background-color: var(--del); }

div#cgit div.diffstat-summary {
  color: var(--dim);
  padding-top: 0.5em;
}

div#cgit table.diff { width: 100%; }

div#cgit table.diff td {
  white-space: pre;
}

div#cgit table.diff td div.head { font-weight: bold; color: var(--text); margin-top: 1em; }
div#cgit table.diff td div.hunk { color: var(--hunk); }
div#cgit table.diff td div.add { color: var(--add); }
div#cgit table.diff td div.del { color: var(--del); }

div#cgit div#blob {
  border: 1px solid var(--border);
}

div#cgit table.blob {
  margin-top: 0.5em;
  border-top: 1px solid var(--border);
}

div#cgit table.blob td.hashes,
div#cgit table.blob td.lines {
  margin: 0;
  padding: 0 0 0 0.5em;
  vertical-align: top;
  color: var(--text);
}

div#cgit table.blob td.linenumbers {
  margin: 0;
  padding: 0 0.5em;
  vertical-align: top;
  text-align: right;
  border-right: 1px solid var(--border);
}

div#cgit table.blob pre { padding: 0; margin: 0; }

div#cgit table.blob td.linenumbers a,
div#cgit table.ssdiff td.lineno a {
  color: var(--dim);
  text-decoration: none;
}

div#cgit table.blob td.linenumbers a:hover,
div#cgit table.ssdiff td.lineno a:hover {
  color: var(--text);
}

div#cgit table.blob td.linenumbers a:target:before {
  color: var(--del);
  content: "\2BA9";
}

div#cgit table.blame td.hashes,
div#cgit table.blame td.lines,
div#cgit table.blame td.linenumbers {
  padding: 0;
}

div#cgit table.blame td.hashes div.alt,
div#cgit table.blame td.lines div.alt {
  padding: 0 0.5em;
}

div#cgit table.blame td.linenumbers div.alt {
  padding: 0 0.5em 0 0;
}

div#cgit table.blame div.alt:nth-child(even) { background: var(--hover); }
div#cgit table.blame div.alt:nth-child(odd) { background: var(--bg); }

div#cgit table.blame td.lines > div { position: relative; }
div#cgit table.blame td.lines > div > pre { padding: 0 0 0 0.5em; position: absolute; top: 0; }
div#cgit table.blame .oid { font-size: 100%; }

div#cgit table.bin-blob {
  margin-top: 0.5em;
  border: 1px solid var(--border);
}

div#cgit table.bin-blob th {
  white-space: pre;
  border: 1px solid var(--border);
  padding: 0.5em 1em;
}

div#cgit table.bin-blob td {
  white-space: pre;
  border-left: 1px solid var(--border);
  padding: 0 1em;
}

div#cgit .oid {
  font-size: 90%;
}

div#cgit .left { text-align: left; }
div#cgit .right { text-align: right; }

div#cgit a.button {
  font-size: 80%;
  padding: 0 0.5em;
}

div#cgit a.primary { font-size: 100%; }
div#cgit a.secondary { font-size: 90%; }

div#cgit ul.pager {
  list-style-type: none;
  text-align: center;
  margin: 1em 0 0 0;
  padding: 0;
}

div#cgit ul.pager li {
  display: inline-block;
  margin: 0.25em 0.5em;
}

div#cgit ul.pager a { color: var(--dim); }
div#cgit ul.pager .current { font-weight: bold; }

div#cgit span.age-mins   { font-weight: bold; color: var(--text); }
div#cgit span.age-hours  { color: var(--text); }
div#cgit span.age-days   { color: #aaa; }
div#cgit span.age-weeks  { color: #888; }
div#cgit span.age-months { color: #666; }
div#cgit span.age-years  { color: #444; }

div#cgit span.insertions { color: var(--add); }
div#cgit span.deletions  { color: var(--del); }

div#cgit div.footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.4;
}

div#cgit div.footer a {
  color: var(--text);
  text-decoration: none;
}

div#cgit div.footer a:hover {
  text-decoration: underline;
}

div#cgit a.branch-deco {
  color: var(--bg);
  margin: 0 0.5em;
  padding: 0 0.25em;
  background-color: var(--add);
  border: none;
  border-radius: 2px;
}

div#cgit a.tag-deco,
div#cgit a.tag-annotated-deco {
  color: var(--bg);
  margin: 0 0.5em;
  padding: 0 0.25em;
  background-color: #aa5;
  border: none;
  border-radius: 2px;
}

div#cgit a.remote-deco {
  color: var(--bg);
  margin: 0 0.5em;
  padding: 0 0.25em;
  background-color: #55a;
  border: none;
  border-radius: 2px;
}

div#cgit a.deco {
  color: var(--bg);
  margin: 0 0.5em;
  padding: 0 0.25em;
  background-color: var(--del);
  border: none;
  border-radius: 2px;
}

div#cgit div.commit-subject a.branch-deco,
div#cgit div.commit-subject a.tag-deco,
div#cgit div.commit-subject a.tag-annotated-deco,
div#cgit div.commit-subject a.remote-deco,
div#cgit div.commit-subject a.deco {
  margin-left: 1em;
  font-size: 75%;
}

div#cgit div.cgit-panel {
  float: right;
  margin-top: 1em;
}

div#cgit div.cgit-panel table {
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: var(--bg);
}

div#cgit div.cgit-panel th { text-align: center; }
div#cgit div.cgit-panel td { padding: 0.25em 0.5em; }
div#cgit div.cgit-panel td.label { padding-right: 0.5em; }
div#cgit div.cgit-panel td.ctrl { padding-left: 0.5em; }

div#cgit input#switch-btn {
  margin: 2px 0 0 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-family: 'Courier Prime', Courier, monospace;
  cursor: pointer;
}

div#cgit div.error {
  color: var(--del);
  font-weight: bold;
  margin: 1em 0;
}

div#cgit table#downloads {
  float: right;
  border-collapse: collapse;
  border: 1px solid var(--border);
  margin-left: 0.5em;
  margin-bottom: 0.5em;
}

div#cgit table#downloads th {
  background-color: var(--hover);
}

div#cgit table.ssdiff { width: 100%; }

div#cgit table.ssdiff td {
  font-size: 0.85rem;
  white-space: pre;
  padding: 1px 4px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

div#cgit table.ssdiff td.add      { color: var(--text); background: #1a2e1a; min-width: 50%; }
div#cgit table.ssdiff td.add_dark { color: var(--text); background: #0d1f0d; min-width: 50%; }
div#cgit table.ssdiff span.add    { background: #2a4a2a; font-weight: bold; }

div#cgit table.ssdiff td.del      { color: var(--text); background: #2e1a1a; min-width: 50%; }
div#cgit table.ssdiff td.del_dark { color: var(--text); background: #1f0d0d; min-width: 50%; }
div#cgit table.ssdiff span.del    { background: #4a2a2a; font-weight: bold; }

div#cgit table.ssdiff td.changed      { color: var(--text); background: #2e2e1a; min-width: 50%; }
div#cgit table.ssdiff td.changed_dark { color: var(--text); background: #1f1f0d; min-width: 50%; }

div#cgit table.ssdiff td.lineno { color: var(--dim); background: var(--hover); text-align: right; width: 3em; min-width: 3em; }
div#cgit table.ssdiff td.hunk   { color: var(--hunk); background: #111122; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
div#cgit table.ssdiff td.head   { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
div#cgit table.ssdiff td.head div.head { font-weight: bold; color: var(--text); }
div#cgit table.ssdiff td.foot   { border-top: 1px solid var(--border); border-left: none; border-right: none; border-bottom: none; }
div#cgit table.ssdiff td.space  { border: none; }
div#cgit table.ssdiff td.space div { min-height: 3em; }

div#cgit table.stats       { border: 1px solid var(--border); border-collapse: collapse; }
div#cgit table.stats th    { text-align: left; padding: 1px 0.5em; background-color: var(--hover); border: 1px solid var(--border); }
div#cgit table.stats td    { text-align: right; padding: 1px 0.5em; border: 1px solid var(--border); }
div#cgit table.stats td.total { font-weight: bold; text-align: left; }
div#cgit table.stats td.sum   { color: var(--del); font-weight: bold; }
div#cgit table.stats td.left  { text-align: left; }

div#cgit table.vgraph    { border-collapse: separate; border: 1px solid var(--border); height: 200px; }
div#cgit table.vgraph th { background-color: var(--hover); font-weight: bold; border: 1px solid var(--border); padding: 1px 0.5em; }
div#cgit table.vgraph td { vertical-align: bottom; padding: 0 10px; }
div#cgit table.vgraph div.bar { background-color: var(--hover); }

div#cgit table.hgraph    { border: 1px solid var(--border); width: 800px; }
div#cgit table.hgraph th { background-color: var(--hover); font-weight: bold; border: 1px solid var(--border); padding: 1px 0.5em; }
div#cgit table.hgraph td { vertical-align: middle; padding: 2px; }
div#cgit table.hgraph div.bar { background-color: var(--hover); height: 1em; }

div#cgit a.ls-blob, div#cgit a.ls-dir, div#cgit .ls-mod { font-family: 'Courier Prime', Courier, monospace; }
div#cgit td.ls-size { text-align: right; width: 10em; }
div#cgit td.ls-mode { width: 10em; }
div#cgit td#sidebar input.txt { width: 100%; margin: 2px 0 0 0; }
div#cgit table#grid { margin: 0; }
div#cgit td#content { vertical-align: top; padding: 1em 2em 1em 1em; border: none; }

::selection {
  background: var(--text);
  color: var(--bg);
}
