div#cgit {
  padding: 0em;
  margin: 0em;
  font-family: sans-serif;
  font-size: 10pt;
  color: #333;
  background: white;
  padding: 4px;

  a {
    color: blue;
    text-decoration: none;
  }

  a:hover {
    text-decoration: underline;
  }

  table {
    border-collapse: collapse;

    &#header {
      width: 100%;
      margin-bottom: 1em;

      td.logo {
        width: 96px;
        vertical-align: top;
      }

      td.main {
        font-size: 250%;
        padding-left: 10px;
        white-space: nowrap;

        a {
          color: #000;
        }
      }

      td.form {
        text-align: right;
        vertical-align: bottom;
        padding-right: 1em;
        padding-bottom: 2px;
        white-space: nowrap;

        form,
        input,
        select {
          font-size: 90%;
        }
      }

      td.sub {
        color: #777;
        border-top: solid 1px #ccc;
        padding-left: 10px;
      }
    }

    &.tabs {
      border-bottom: solid 3px #ccc;
      border-collapse: collapse;
      margin-top: 2em;
      margin-bottom: 0px;
      width: 100%;

      td {
        padding: 0px 1em;
        vertical-align: bottom;

        a {
          padding: 2px 0.25em;
          color: #777;
          font-size: 110%;

          &.active {
            color: #000;
            background-color: #ccc;
          }
        }
      }

      a[href^="http://"]:after, a[href^="https://"]:after {
        content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfgAhcJDQY+gm2TAAAAHWlUWHRDb21tZW50AAAAAABDcmVhdGVkIHdpdGggR0lNUGQuZQcAAABbSURBVAhbY2BABs4MU4CwhYHBh2Erww4wrGFQZHjI8B8IgUIscJWyDHcggltQhI4zGDCcRwhChPggHIggP1QoAVmQkSETrGoHsiAEsACtBYN0oDAMbgU6EBcAAL2eHUt4XUU4AAAAAElFTkSuQmCC);
        opacity: 0.5;
        margin: 0 0 0 5px;
      }

      &.form {
        text-align: right;

        form {
          padding-bottom: 2px;
          font-size: 90%;
          white-space: nowrap;
        }

        input, select {
          font-size: 90%;
        }
      }
    }
  }

  div.path {
    margin: 0px;
    padding: 5px 2em 2px 2em;
    color: #000;
    background-color: #eee;
  }

  div.content {
    margin: 0px;
    padding: 2em;
    border-bottom: solid 3px #ccc;
  }


  table.list {
    width: 100%;
    border: none;
    border-collapse: collapse;

    tr {
      background: white;

      &.logheader {
        background: #eee;
      }

      &:nth-child(even) {
        background: #f7f7f7;
      }

      &:nth-child(odd) {
        background: white;
      }

      &:hover {
        background: #eee;
      }

      &.nohover {
        background: white;
      }

      &.nohover:hover {
        background: white;
      }

      &.nohover-highlight:hover:nth-child(even) {
        background: #f7f7f7;
      }

      &.nohover-highlight:hover:nth-child(odd) {
        background: white;
      }
    }

    th {
      font-weight: bold;
      /* color: #888;
      border-top: dashed 1px #888;
      border-bottom: dashed 1px #888;
      */
      padding: 0.1em 0.5em 0.05em 0.5em;
      vertical-align: baseline;
    }

    td {
      border: none;
      padding: 0.1em 0.5em 0.1em 0.5em;

      &.commitgraph {
        font-family: monospace;
        white-space: pre-wrap;

        .column1 { color: #a00; }
        .column2 { color: #0a0; }
        .column3 { color: #aa0; }
        .column4 { color: #00a; }
        .column5 { color: #a0a; }
        .column6 { color: #0aa; }
      }

      &.logsubject {
        font-family: monospace;
        font-weight: bold;
      }

      &.logmsg {
        font-family: monospace;
        white-space: pre-wrap;
        padding: 0 0.5em;
      }

      a {
        color: black;

        &.ls-dir {
          font-weight: bold;
          color: #00f;
        }

        &:hover {
          color: #00f;
        }
      }
    }
  }

  img {
    border: none;
  }

  input#switch-btn {
    margin: 2px 0px 0px 0px;
  }

  td#sidebar input.txt {
    width: 100%;
    margin: 2px 0px 0px 0px;
  }

  table#grid {
    margin: 0px;
  }

  td#content {
    vertical-align: top;
    padding: 1em 2em 1em 1em;
    border: none;
  }

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

  table#downloads {
    float: right;
    border-collapse: collapse;
    border: solid 1px #777;
    margin-left: 0.5em;
    margin-bottom: 0.5em;

    th {
      background-color: #ccc;
    }
  }

  div#blob {
    border: solid 1px black;
  }

  div.error {
    color: red;
    font-weight: bold;
    margin: 1em 2em;
  }

  a.ls-blob, a.ls-dir, .ls-mod {
    font-family: monospace;
  }

  td.ls-size {
    text-align: right;
    font-family: monospace;
    width: 10em;
  }

  td.ls-mode {
    font-family: monospace;
    width: 10em;
  }

  table.blob {
    margin-top: 0.5em;
    border-top: solid 1px black;

    td.hashes, td.lines {
      margin: 0; padding: 0 0 0 0.5em;
      vertical-align: top;
      color: black;
    }

    td.linenumbers {
      margin: 0; padding: 0 0.5em 0 0.5em;
      vertical-align: top;
      text-align: right;
      border-right: 1px solid gray;
    }

    pre {
      padding: 0;
      margin: 0;

      white-space: pre-wrap;
    }
  }

  table.blob td.linenumbers a,
  table.ssdiff td.lineno a {
    color: gray;
    text-align: right;
    text-decoration: none;
  }

  table.blob td.linenumbers a:hover,
  table.ssdiff td.lineno a:hover {
    color: black;
  }

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

    td.hashes div.alt,
    td.lines div.alt {
      padding: 0 0.5em 0 0.5em;
    }

    td.linenumbers div.alt {
      padding: 0 0.5em 0 0;
    }

    div.alt:nth-child(even) {
      background: #eee;
    }

    div.alt:nth-child(odd) {
      background: white;
    }

    td.lines > div {
      position: relative;

      & > pre {
        padding: 0 0 0 0.5em;
        position: absolute;
        top: 0;

        white-space: pre-wrap;
      }
    }

    .oid {
      font-size: 100%;
    }
  }

  table.blob td.lines > pre,
  table.blame td.lines > div > pre, {
    word-break: normal;
    line-height: 1.1;
    text-indent: 1em hanging;

    white-space: pre-wrap;
  }

  table.bin-blob {
    margin-top: 0.5em;
    border: solid 1px black;

    th {
      font-family: monospace;
      white-space: pre-wrap;
      border: solid 1px #777;
      padding: 0.5em 1em;
    }

    td {
      font-family: monospace;
      white-space: pre-wrap;
      border-left: solid 1px #777;
      padding: 0em 1em;
    }
  }

  table.nowrap td {
    /* Contrary to the name, we do in fact want to word-wrap... Most pages
     * have a <table class="list nowrap">, so be sure to check all of them
     * when changing this.
     */
    text-indent: 1em hanging;
  }

  table.commit-info {
    border-collapse: collapse;
    margin-top: 1.5em;

    th {
      text-align: left;
      font-weight: normal;
      padding: 0.1em 1em 0.1em 0.1em;
      vertical-align: top;
    }

    td {
      font-weight: normal;
      padding: 0.1em 1em 0.1em 0.1em;
    }
  }

  div.cgit-panel {
    float: right;
    margin-top: 1.5em;

    table {
      border-collapse: collapse;
      border: solid 1px #aaa;
      background-color: #eee;
    }

    th {
      text-align: center;
    }

    td {
      padding: 0.25em 0.5em;

      &.label {
        padding-right: 0.5em;
      }

      &.ctrl {
        padding-left: 0.5em;
      }
    }
  }

  div.commit-subject {
    font-weight: bold;
    font-size: 125%;
    margin: 1.5em 0em 0.5em 0em;
    padding: 0em;
  }

  div.notes-header {
    font-weight: bold;
    padding-top: 1.5em;
  }

  div.notes {
    white-space: pre-wrap;
    font-family: monospace;
    border: solid 1px #ee9;
    background-color: #ffd;
    padding: 0.3em 2em 0.3em 1em;
    float: left;
  }

  div.notes-footer {
    clear: left;
  }

  div.diffstat-header {
    font-weight: bold;
    padding-top: 1.5em;
  }

  table.diffstat {
    border-collapse: collapse;
    border: solid 1px #aaa;
    background-color: #eee;

    th {
      font-weight: normal;
      text-align: left;
      text-decoration: underline;
      padding: 0.1em 1em 0.1em 0.1em;
      font-size: 100%;
    }

    td {
      padding: 0.2em 0.2em 0.1em 0.1em;
      font-size: 100%;
      border: none;

      &.mode {
        white-space: nowrap;
      }

      span.modechange {
        padding-left: 1em;
        color: red;
      }

      &.add a { color: green; }
      &.del a { color: red; }
      &.upd a { color: blue; }

      &.graph {
        width: 500px;
        vertical-align: middle;

        table {
          border: none;
        }

        td {
          padding: 0px;
          border: 0px;
          height: 7pt;

          &.add { background-color: #5c5; }
          &.rem { background-color: #c55; }
        }
      }
    }
  }

  div.diffstat-summary {
    color: #888;
    padding-top: 0.5em;
  }

  table.diff {
    width: 100%;

    td {
      & > pre {
        white-space: pre-wrap;
      }

      span.head {
        font-weight: bold;
        color: black;
      }

      span.hunk { color: #009; }
      span.add { color: green; }
      span.del { color: red; }
    }
  }

  .oid {
    font-family: monospace;
    font-size: 90%;
  }

  .left {
    text-align: left;
  }

  .right {
    text-align: right;
  }

  table.list td.reposection {
    font-style: italic;
    color: #888;
    padding-top: 0.5em;
  }

  a.button {
    font-size: 80%;
  }

  a.primary {
    font-size: 100%;
  }

  a.secondary {
    font-size: 90%;
  }

  td.toplevel-repo { }

  table.list td.sublevel-repo {
    padding-left: 1.5em;
    vertical-align: top;
    min-width: 8em;
  }

  table.list td.toplevel-repo + td,
  table.list td.sublevel-repo + td {
    line-height: 1.1;
    padding-bottom: 1em;
    text-indent: 0;
  }

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

    li {
      display: inline-block;
      margin: 0.25em 0.5em;
    }

    a {
      color: #777;
    }

    .current {
      font-weight: bold;
    }
  }

  span.age-mins { font-weight: bold; color: #080; }
  span.age-hours { color: #080; }
  span.age-days { color: #040; }
  span.age-weeks { color: #444; }
  span.age-months { color: #888; }
  span.age-years { color: #bbb; }

  span.insertions { color: #080; }
  span.deletions { color: #800; }

  div.footer {
    margin-top: 0.5em;
    text-align: center;
    font-size: 80%;
    color: #ccc;

    a {
      color: #ccc;
      text-decoration: none;

      &:hover {
        text-decoration: underline;
      }
    }
  }

  a.branch-deco {
    color: #000;
    padding: 0px 0.25em;
    background-color: #88ff88;
    border: solid 1px #007700;
  }

  a.tag-deco {
    color: #000;
    padding: 0px 0.25em;
    background-color: #ffff88;
    border: solid 1px #777700;
  }

  a.tag-annotated-deco {
    color: #000;
    padding: 0px 0.25em;
    background-color: #ffcc88;
    border: solid 1px #777700;
  }

  a.remote-deco {
    color: #000;
    padding: 0px 0.25em;
    background-color: #ccccff;
    border: solid 1px #000077;
  }

  a.deco {
    color: #000;
    padding: 0px 0.25em;
    background-color: #ff8888;
    border: solid 1px #770000;
  }

  div.commit-subject a.branch-deco,
  div.commit-subject a.tag-deco,
  div.commit-subject a.tag-annotated-deco,
  div.commit-subject a.remote-deco,
  div.commit-subject a.deco {
    font-size: 75%;
  }

  table.stats {
    border: solid 1px black;
    border-collapse: collapse;

    th {
      text-align: left;
      padding: 1px 0.5em;
      background-color: #eee;
      border: solid 1px black;
    }

    td {
      text-align: right;
      padding: 1px 0.5em;
      border: solid 1px black;

      &.total {
        font-weight: bold;
        text-align: left;
      }

      &.sum {
        color: #c00;
        font-weight: bold;
        /*  background-color: #eee; */
      }

      &.left {
        text-align: left;
      }
    }
  }

  table.vgraph {
    border-collapse: separate;
    border: solid 1px black;
    height: 200px;

    th {
      background-color: #eee;
      font-weight: bold;
      border: solid 1px white;
      padding: 1px 0.5em;
    }

    td {
      vertical-align: bottom;
      padding: 0px 10px;
    }

    div.bar {
      background-color: #eee;
    }
  }

  table.hgraph {
    border: solid 1px black;
    width: 800px;

    th {
      background-color: #eee;
      font-weight: bold;
      border: solid 1px black;
      padding: 1px 0.5em;
    }

    td {
      vertical-align: middle;
      padding: 2px 2px;
    }

    div.bar {
      background-color: #eee;
      height: 1em;
    }
  }

  table.ssdiff {
    width: 100%;

    td {
      font-size: 75%;
      font-family: monospace;
      white-space: pre-wrap;
      padding: 1px 4px 1px 4px;
      border-left: solid 1px #aaa;
      border-right: solid 1px #aaa;

    }

    td.add {
      color: black;
      background: #cfc;
      min-width: 50%;
    }

    td.add_dark {
      color: black;
      background: #aca;
      min-width: 50%;
    }

    span.add {
      background: #cfc;
      font-weight: bold;
    }

    td.del {
      color: black;
      background: #fcc;
      min-width: 50%;
    }

    td.del_dark {
      color: black;
      background: #caa;
      min-width: 50%;
    }

    span.del {
      background: #fcc;
      font-weight: bold;
    }

    td.changed {
      color: black;
      background: #ffc;
      min-width: 50%;
    }

    td.changed_dark {
      color: black;
      background: #cca;
      min-width: 50%;
    }

    td.lineno {
      color: black;
      background: #eee;
      text-align: right;
      width: 3em;
      min-width: 3em;
    }

    td.hunk {
      color: black;
      background: #ccf;
      border-top: solid 1px #aaa;
      border-bottom: solid 1px #aaa;
    }

    td.head {
      border-top: solid 1px #aaa;
      border-bottom: solid 1px #aaa;

      div.head {
        font-weight: bold;
        color: black;
      }
    }

    td.foot {
      border-top: solid 1px #aaa;
      border-left: none;
      border-right: none;
      border-bottom: none;
    }

    td.space {
      border: none;
    }

    td.space div {
      min-height: 3em;
    }
  }
}
