/* Hide cgit's chrome — replaced by header.html and footer.html */
table#header { display: none !important; }
div.footer    { display: none !important; }

/* ── base ── */
body {
  font-family: monospace;
  margin: 0 auto;
  max-width: 50em;
  padding: 0 1em;
}

a:link    { color: #1e88e5; }
a:visited { color: #7e57c2; }

/* ── nav tabs ── */
table.tabs {
  border: none;
  width: 100%;
  margin: 0.5em 0 1em;
  border-collapse: collapse;
}
table.tabs td { padding: 0; vertical-align: middle; border: none; }
table.tabs td:first-child { width: 100%; }
table.tabs a { margin-right: 0.75em; text-decoration: none; }
table.tabs a:hover { text-decoration: underline; }
table.tabs a.active { font-weight: bold; }
table.tabs input.txt { font-family: monospace; width: 8em; }
table.tabs input[type=submit] { font-family: monospace; }

/* ── listing tables ── */
table.list {
  width: 100%;
  border-collapse: collapse;
}
table.list tr.nohover th {
  text-align: left;
  border-bottom: 1px solid currentColor;
  padding: 0.1em 0.5em 0.25em 0;
  font-weight: normal;
}
table.list th.left  { text-align: left; }
table.list th.right { text-align: right; }
table.list td {
  padding: 0.15em 0.5em 0.15em 0;
  vertical-align: top;
}

/* tree view */
td.ls-mode    { white-space: nowrap; opacity: 0.5; }
td.ls-size    { text-align: right; white-space: nowrap; opacity: 0.7; }
td.toplevel-repo { white-space: nowrap; }

/* log view */
span.age-mins,
span.age-hours,
span.age-days { white-space: nowrap; opacity: 0.8; }

span.decoration { font-size: 0.85em; margin-left: 0.5em; opacity: 0.8; }

/* ── commit view ── */
table.commit-info {
  border-collapse: collapse;
  margin-bottom: 1em;
}
table.commit-info td {
  padding: 0.1em 0.5em 0.1em 0;
  vertical-align: top;
  border: none;
}
table.commit-info td:first-child { white-space: nowrap; opacity: 0.6; }

div.commit-subject { font-weight: bold; margin: 0.75em 0 0.25em; }
div.commit-msg { white-space: pre-wrap; margin: 0.25em 0 1em; }

/* ── buttons (summary/log/tree/plain) ── */
a.button {
  font-size: 0.85em;
  margin-left: 0.3em;
  opacity: 0.7;
  text-decoration: none;
  white-space: nowrap;
}
a.button:hover { opacity: 1; text-decoration: underline; }

/* ── blob/source view ── */
table.blob {
  width: 100%;
  border-collapse: collapse;
}
table.blob td {
  padding: 0 0.5em;
  vertical-align: top;
  white-space: pre;
}
td.linenumbers {
  text-align: right;
  user-select: none;
  opacity: 0.4;
  padding-right: 1em;
}

/* ── diff view ── */
table.diff {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}
table.diff td { padding: 0 0.5em; white-space: pre; }
table.diff td.linenumbers { width: 3em; }

/* ── about/README ── */
div.content img { max-width: 100%; }

/* ── search ── */
div.search { margin: 0.5em 0; }

/* ── pager ── */
div.pager { margin: 1em 0; }

/* ── qed footer (injected via footer.html) ── */
#qed { text-align: center; font-size: 125%; }
#qed a { text-decoration: none; }

/* ── light mode ── */
@media (prefers-color-scheme: light) {
  body { color: #263238; background-color: #eceff1; }
  table.list tr:not(.nohover):hover { background-color: #cfd8dc; }
  a.deco        { color: #263238; }
  a.branch-deco { color: #263238; }
  td.add  { background-color: #c8e6c9; }
  td.del  { background-color: #ffcdd2; }
  td.hunk { background-color: #e3f2fd; color: #1565c0; }
  #qed a  { color: #263238; }
}

/* ── dark mode ── */
@media (prefers-color-scheme: dark) {
  body { color: #eceff1; background-color: #263238; }
  table.list tr:not(.nohover):hover { background-color: #37474f; }
  a.deco        { color: #eceff1; }
  a.branch-deco { color: #eceff1; }
  td.add  { background-color: #1b5e20; }
  td.del  { background-color: #b71c1c; }
  td.hunk { background-color: #0d47a1; color: #e3f2fd; }
  #qed a  { color: #eceff1; }
}
