/* ==========================================================================
   cgit override sheet
   ========================================================================== */

:root {
  color-scheme: light dark;

  --ink:        #182124;
  --ink-2:      #4a585c;
  --ink-3:      #7c8a8e;
  --ground:     #f5f7f6;
  --surface:    #ffffff;
  --sunken:     #eceff0;
  --rule:       #dbe1e2;
  --rule-hard:  #c2cbcd;

  --link:       #0f6b66;
  --link-hover: #0a4b47;
  --link-wash:  #e3f0ef;

  --ref-branch: #0f6b66;
  --ref-tag:    #8a6100;
  --ref-remote: #5b6770;

  --add-fg:     #1d5136;
  --add-bg:     #e6f1e9;
  --del-fg:     #7b2027;
  --del-bg:     #f8e8e8;
  --hunk-fg:    #4a585c;
  --hunk-bg:    #eceff0;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono",
          "Berkeley Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;

  --step-0: 0.875rem;
  --step-1: 1rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --gap:    1rem;
  --control-radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #ffffff;
    --ink-2:      #9aa8ac;
    --ink-3:      #6d7b7f;
    --ground:     #14191b;
    --surface:    #1a2124;
    --sunken:     #202829;
    --rule:       #2b3437;
    --rule-hard:  #3c4749;

    --link:       #5fbdb2;
    --link-hover: #8ad6cb;
    --link-wash:  #1d2c2b;

    --ref-branch: #5fbdb2;
    --ref-tag:    #d3a343;
    --ref-remote: #93a1a8;

    --add-fg:     #8fd5a8;
    --add-bg:     #172b20;
    --del-fg:     #e8a0a4;
    --del-bg:     #2e1c1e;
    --hunk-fg:    #9aa8ac;
    --hunk-bg:    #202829;
  }
  div#cgit .markdown-body h1 a.toclink, div#cgit .markdown-body h2 a.toclink, div#cgit .markdown-body h3 a.toclink, div#cgit .markdown-body h4 a.toclink, div#cgit .markdown-body h5 a.toclink, div#cgit .markdown-body h6 a.toclink {
  color: white !important;
}
}

body {
  margin: 0;
  padding: 0 var(--gap) 4rem;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-1);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body div#cgit {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  font-family: var(--sans);
  font-size: var(--step-1);
  color: var(--ink);
  background: transparent;
}

body div#cgit a { color: var(--link); text-decoration: none; }
body div#cgit a:hover { color: var(--link-hover); text-decoration: underline; }
body div#cgit a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: var(--control-radius);
}
body div#cgit ::selection { background: var(--link-wash); }

/* --- masthead ----------------------------------------------------------- */

body div#cgit table#header {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0 0;
}
body div#cgit table#header td { padding: 0; vertical-align: middle; }
body div#cgit table#header td.logo { padding-right: 1rem; width: 1%; }
body div#cgit table#header td.logo img { display: block; max-height: 44px; width: auto; }

body div#cgit table#header td.main {
  font-size: var(--step-3);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
body div#cgit table#header td.main a { color: inherit; }
body div#cgit table#header td.main a:hover { color: var(--link); text-decoration: none; }

body div#cgit table#header td.sub {
  padding-top: 0.25rem;
  font-size: var(--step-0);
  color: var(--ink-2);
  border-top: 0;
}
body div#cgit table#header td.form {
  text-align: right;
  vertical-align: bottom;
  white-space: nowrap;
}

/* --- tab bar ------------------------------------------------------------ */

body div#cgit table.tabs {
  width: 100%;
  border-collapse: collapse;
  border-bottom: 1px solid var(--rule-hard);
  margin: 1rem 0 0;
  padding: 0;
}
body div#cgit table.tabs td { padding: 0; }
body div#cgit table.tabs td a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  margin-right: 0.15rem;
  font-size: var(--step-0);
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--control-radius) var(--control-radius) 0 0;
  border-bottom: 2px solid transparent;
}
body div#cgit table.tabs td a:hover {
  color: var(--ink);
  background: var(--sunken);
  text-decoration: none;
}
body div#cgit table.tabs td a.active {
  color: var(--ink);
  background: var(--surface);
  border-bottom-color: var(--link);
}
body div#cgit table.tabs td.form { text-align: right; padding: 0 0 0.35rem; }
body div#cgit table.tabs td.form form { display: inline-flex; gap: 0.35rem; align-items: center; }

body div#cgit input,
body div#cgit select,
body div#cgit button {
  font-family: var(--sans);
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-hard);
  border-radius: var(--control-radius);
  padding: 0.25rem 0.4rem;
  line-height: 1.4;
}
body div#cgit input:focus-visible,
body div#cgit select:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 1px;
  border-color: var(--link);
}
body div#cgit a.button {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: var(--step-0);
  border: 1px solid var(--rule-hard);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--ink-2);
}
body div#cgit a.button:hover { color: var(--ink); background: var(--sunken); text-decoration: none; }

/* --- content shell ------------------------------------------------------ */

body div#cgit div.content {
  border: 1px solid var(--rule);
  border-top: 0;
  background: var(--surface);
  padding: 1rem;
  margin: 0;
  overflow-x: auto;
}
body div#cgit div.content > p,
body div#cgit div.content > div.cgit-panel,
body div#cgit div.notes-body { max-width: 74ch; }

body div#cgit div.error {
  border: 1px solid var(--del-fg);
  background: var(--del-bg);
  color: var(--del-fg);
  padding: 0.6rem 0.8rem;
  border-radius: var(--control-radius);
  font-family: var(--sans);
}

/* --- listing tables ----------------------------------------------------- */

body div#cgit table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-0);
}
body div#cgit table.list th {
  padding: 0.35rem 0.6rem;
  text-align: left;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--sunken);
  border-bottom: 1px solid var(--rule-hard);
  white-space: nowrap;
}
body div#cgit table.list th a { color: inherit; }
body div#cgit table.list td {
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}
body div#cgit table.list tr:last-child td { border-bottom: 0; }
body div#cgit table.list tr:hover td { background: var(--sunken); }
body div#cgit table.list tr.nohover:hover td,
body div#cgit table.list tr.nohover-highlight:hover td { background: transparent; }

body div#cgit table.list td.reposection {
  padding-top: 1.1rem;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border-bottom: 1px solid var(--rule-hard);
}
body div#cgit table.list td.sublevel-repo { padding-left: 1.5rem; }
body div#cgit table.list td.logsubject { font-weight: 500; }
body div#cgit table.list td.logsubject a { color: var(--ink); }
body div#cgit table.list td.logsubject a:hover { color: var(--link); }
body div#cgit table.list td.logmsg {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
  background: var(--sunken);
  padding: 0.5rem 0.8rem;
  white-space: pre-wrap;
}
body div#cgit table.list td.commitgraph { font-family: var(--mono); }

body div#cgit a.ls-dir { font-weight: 600; }
body div#cgit a.ls-dir,
body div#cgit a.ls-blob,
body div#cgit a.ls-mod { font-family: var(--mono); }
body div#cgit a.ls-mod { color: var(--ink-2); }

/* --- ref decorations ---------------------------------------------------- */

body div#cgit a.branch-deco,
body div#cgit a.tag-deco,
body div#cgit a.remote-deco,
body div#cgit a.deco {
  display: inline-block;
  margin: 0 0.2rem;
  padding: 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  border-radius: var(--control-radius);
  border: 1px solid currentColor;
  background: transparent;
}
body div#cgit a.branch-deco { color: var(--ref-branch); }
body div#cgit a.tag-deco    { color: var(--ref-tag); }
body div#cgit a.remote-deco { color: var(--ref-remote); }
body div#cgit a.deco        { color: var(--ink-3); }

/* --- age shading (recent reads stronger, stale fades) -------------------- */

body div#cgit span.age-mins,
body div#cgit span.age-hours  { color: var(--link); font-weight: 600; }
body div#cgit span.age-days,
body div#cgit span.age-weeks  { color: var(--ink); }
body div#cgit span.age-months { color: var(--ink-2); }
body div#cgit span.age-years  { color: var(--ink-3); }

/* --- commit view -------------------------------------------------------- */

body div#cgit table.commit-info {
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: var(--step-0);
  margin-bottom: 0.75rem;
}
body div#cgit table.commit-info th {
  text-align: left;
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink-2);
  padding: 0.15rem 0.9rem 0.15rem 0;
  white-space: nowrap;
  vertical-align: top;
}
body div#cgit table.commit-info td { padding: 0.15rem 0; vertical-align: top; }

body div#cgit div.commit-subject {
  font-family: var(--sans);
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  max-width: 74ch;
  margin: 0 0 0.5rem;
}
body div#cgit div.commit-msg {
  font-family: var(--mono);
  font-size: var(--step-0);
  color: var(--ink-2);
  white-space: pre-wrap;
  max-width: 80ch;
  margin: 0 0 1rem;
}

body div#cgit div.notes {
  border-left: 2px solid var(--rule-hard);
  padding-left: 0.8rem;
  margin: 1rem 0;
}
body div#cgit div.notes-header { font-weight: 600; color: var(--ink-2); }
body div#cgit div.notes-footer { color: var(--ink-3); font-size: var(--step-0); }

/* --- diffstat ----------------------------------------------------------- */

body div#cgit div.diffstat-header {
  font-weight: 600;
  color: var(--ink-2);
  padding: 0.6rem 0 0.4rem;
  border-top: 1px solid var(--rule);
}
body div#cgit table.diffstat {
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: var(--step-0);
  width: 100%;
}
body div#cgit table.diffstat td { padding: 0.15rem 0.5rem 0.15rem 0; border: 0; }
body div#cgit table.diffstat td.mode { color: var(--ink-3); }
body div#cgit table.diffstat td.add  { color: var(--add-fg); }
body div#cgit table.diffstat td.del  { color: var(--del-fg); }
body div#cgit table.diffstat td.upd  { color: var(--ink-2); }
body div#cgit table.diffstat td.graph { width: 500px; }
body div#cgit table.diffstat td.graph table { border-collapse: collapse; }
body div#cgit table.diffstat td.graph td.add { background: var(--add-fg); }
body div#cgit table.diffstat td.graph td.rem { background: var(--del-fg); }
body div#cgit div.diffstat-summary { color: var(--ink-3); padding-top: 0.4rem; font-size: var(--step-0); }

/* --- blob / source ------------------------------------------------------ */

body div#cgit table.blob,
body div#cgit table.blame {
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  tab-size: 4;
  width: 100%;
}
body div#cgit table.blob td.linenumbers,
body div#cgit table.blame td.linenumbers {
  border-right: 1px solid var(--rule);
  padding-right: 0.6rem;
  background: var(--sunken);
  width: 1%;
  vertical-align: top;
}
body div#cgit table.blob td.linenumbers a,
body div#cgit table.blame td.linenumbers a {
  color: var(--ink-3);
  text-decoration: none;
}
body div#cgit table.blob td.linenumbers a:hover { color: var(--link); }
body div#cgit table.blob td.linenumbers a:target {
  color: var(--ink);
  background: var(--link-wash);
  font-weight: 600;
}
body div#cgit table.blob td.lines,
body div#cgit table.blame td.lines { padding-left: 0.8rem; vertical-align: top; }
body div#cgit table.blob td.lines pre,
body div#cgit table.blame td.lines pre { margin: 0; font-family: inherit; }
body div#cgit table.blame td.oid { color: var(--ink-3); padding-right: 0.6rem; vertical-align: top; }
body div#cgit table.bin-blob {
  font-family: var(--mono);
  font-size: 0.8125rem;
  border-collapse: collapse;
}
body div#cgit table.bin-blob td { padding: 0 0.5rem; }

/* --- unified diff ------------------------------------------------------- */

body div#cgit table.diff {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  tab-size: 4;
}
body div#cgit table.diff td { padding: 0; }
body div#cgit table.diff td div.head {
  font-weight: 600;
  color: var(--ink);
  background: var(--sunken);
  border-top: 1px solid var(--rule-hard);
  padding: 0.4rem 0.6rem;
  margin-top: 1rem;
  white-space: pre-wrap;
}
body div#cgit table.diff td div.hunk {
  color: var(--hunk-fg);
  background: var(--hunk-bg);
  padding: 0.1rem 0.6rem;
}
body div#cgit table.diff td div.add {
  color: var(--add-fg);
  background: var(--add-bg);
  padding: 0 0.6rem;
}
body div#cgit table.diff td div.del {
  color: var(--del-fg);
  background: var(--del-bg);
  padding: 0 0.6rem;
}
body div#cgit table.diff td div.ctx { padding: 0 0.6rem; color: var(--ink-2); }

/* --- side-by-side diff -------------------------------------------------- */

body div#cgit table.ssdiff {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.8125rem;
  tab-size: 4;
}
body div#cgit table.ssdiff td { padding: 0 0.4rem; vertical-align: top; }
body div#cgit table.ssdiff td.lineno {
  color: var(--ink-3);
  background: var(--sunken);
  text-align: right;
  width: 1%;
  user-select: none;
}
body div#cgit table.ssdiff td.hunk {
  color: var(--hunk-fg);
  background: var(--hunk-bg);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
body div#cgit table.ssdiff td.add     { color: var(--add-fg); background: var(--add-bg); }
body div#cgit table.ssdiff td.add_dark{ color: var(--add-fg); background: var(--add-bg); font-weight: 600; }
body div#cgit table.ssdiff td.del     { color: var(--del-fg); background: var(--del-bg); }
body div#cgit table.ssdiff td.del_dark{ color: var(--del-fg); background: var(--del-bg); font-weight: 600; }
body div#cgit table.ssdiff td.changed { background: var(--sunken); }
body div#cgit table.ssdiff td.space   { background: transparent; width: 1rem; }
body div#cgit table.ssdiff td.head {
  font-weight: 600;
  background: var(--sunken);
  border-top: 1px solid var(--rule-hard);
  padding: 0.4rem 0.6rem;
}

/* --- pager and footer --------------------------------------------------- */

body div#cgit div.pager,
body div#cgit ul.pager {
  list-style: none;
  padding: 0.8rem 0 0;
  margin: 0;
  text-align: center;
  font-size: var(--step-0);
  color: var(--ink-3);
}
body div#cgit ul.pager li { display: inline-block; }
body div#cgit div.pager a,
body div#cgit ul.pager a {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  margin: 0 0.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--control-radius);
}
body div#cgit div.pager a:hover,
body div#cgit ul.pager a:hover { background: var(--sunken); text-decoration: none; }
body div#cgit ul.pager .current {
  padding: 0.2rem 0.55rem;
  color: var(--ink);
  font-weight: 600;
}

body div#cgit div.footer {
  margin: 0.75rem 0 0;
  padding: 0;
  text-align: right;
  font-size: 0.75rem;
  color: var(--ink-3);
  border: 0;
}
body div#cgit div.footer a { color: var(--ink-3); }

/* --- small screens ------------------------------------------------------ */

@media (max-width: 700px) {
  body { padding: 0 0.5rem 3rem; }
  body div#cgit table#header td.main { font-size: var(--step-2); }
  body div#cgit table#header td.logo { display: none; }
  body div#cgit table.tabs td.form { display: none; }
  body div#cgit div.content { padding: 0.6rem; }
  body div#cgit table.list td.logmsg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body div#cgit * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Rendered README / about content
   cgit's own markup carries classes on everything, so `:not([class])` is a
   reliable discriminator for filter-generated markdown HTML in div.content.
   If your cgit wraps the readme in div#summary and you want a tighter scope,
   replace `div.content` with `div#summary` throughout this section.
   ========================================================================== */

body div#cgit div.content h1,
body div#cgit div.content h2,
body div#cgit div.content h3,
body div#cgit div.content h4,
body div#cgit div.content h5,
body div#cgit div.content h6 {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 1.75em 0 0.6em;
  scroll-margin-top: 1rem;
  max-width: 40ch;
}
body div#cgit div.content h1:first-child,
body div#cgit div.content h2:first-child,
body div#cgit div.content h3:first-child { margin-top: 0.25em; }

body div#cgit div.content h1 {
  font-size: 1.75rem;
  font-weight: 650;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--rule-hard);
  max-width: none;
}
body div#cgit div.content h2 {
  font-size: 1.375rem;
  font-weight: 600;
  padding-bottom: 0.25em;
  border-bottom: 1px solid var(--rule);
  max-width: none;
}
body div#cgit div.content h3 { font-size: 1.125rem; font-weight: 600; }
body div#cgit div.content h4 { font-size: 1rem;     font-weight: 650; }
body div#cgit div.content h5 { font-size: 0.9375rem; font-weight: 650; color: var(--ink-2); }
body div#cgit div.content h6 { font-size: 0.875rem;  font-weight: 650; color: var(--ink-3); }

body div#cgit div.content h1:target,
body div#cgit div.content h2:target,
body div#cgit div.content h3:target,
body div#cgit div.content h4:target { background: var(--link-wash); }

/* anchor links some filters inject next to headings */
body div#cgit div.content h1 > a.anchor,
body div#cgit div.content h2 > a.anchor,
body div#cgit div.content h3 > a.anchor,
body div#cgit div.content h4 > a.anchor { color: var(--ink-3); text-decoration: none; }

body div#cgit div.content p {
  max-width: 74ch;
  margin: 0 0 1em;
  line-height: 1.6;
}
body div#cgit div.content p a,
body div#cgit div.content li a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

body div#cgit div.content ul:not([class]),
body div#cgit div.content ol:not([class]) {
  max-width: 74ch;
  margin: 0 0 1em;
  padding-left: 1.4em;
  line-height: 1.6;
}
body div#cgit div.content ul:not([class]) ul,
body div#cgit div.content ol:not([class]) ol,
body div#cgit div.content ul:not([class]) ol,
body div#cgit div.content ol:not([class]) ul { margin-bottom: 0.2em; }
body div#cgit div.content li::marker { color: var(--ink-3); }
body div#cgit div.content li > input[type="checkbox"] { margin-right: 0.4em; }

body div#cgit div.content dl { max-width: 74ch; }
body div#cgit div.content dt { font-weight: 650; margin-top: 0.8em; }
body div#cgit div.content dd { margin: 0.2em 0 0 1.4em; color: var(--ink-2); }

body div#cgit div.content blockquote {
  max-width: 74ch;
  margin: 0 0 1em;
  padding: 0.1em 0 0.1em 1em;
  border-left: 3px solid var(--rule-hard);
  color: var(--ink-2);
}
body div#cgit div.content blockquote > :last-child { margin-bottom: 0; }

body div#cgit div.content code,
body div#cgit div.content kbd,
body div#cgit div.content samp {
  font-family: var(--mono);
  font-size: 0.875em;
}
body div#cgit div.content p > code,
body div#cgit div.content li > code,
body div#cgit div.content dd > code,
body div#cgit div.content td > code,
body div#cgit div.content h1 > code,
body div#cgit div.content h2 > code,
body div#cgit div.content h3 > code,
body div#cgit div.content h4 > code {
  background: var(--sunken);
  border: 1px solid var(--rule);
  padding: 0.05em 0.3em;
  border-radius: var(--control-radius);
}
body div#cgit div.content kbd {
  background: var(--surface);
  border: 1px solid var(--rule-hard);
  border-bottom-width: 2px;
  border-radius: var(--control-radius);
  padding: 0.05em 0.35em;
  color: var(--ink-2);
}
body div#cgit div.content pre {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  tab-size: 4;
  background: var(--sunken);
  border: 1px solid var(--rule);
  padding: 0.7rem 0.85rem;
  margin: 0 0 1em;
  overflow-x: auto;
  white-space: pre;
}
body div#cgit div.content pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

body div#cgit div.content table:not([class]) {
  border-collapse: collapse;
  font-size: var(--step-0);
  margin: 0 0 1em;
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}
body div#cgit div.content table:not([class]) th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--sunken);
  border: 1px solid var(--rule-hard);
  padding: 0.3rem 0.6rem;
}
body div#cgit div.content table:not([class]) td {
  border: 1px solid var(--rule);
  padding: 0.3rem 0.6rem;
  vertical-align: top;
}

/* keep the diffstat bar graph out of the markdown table rules above */
body div#cgit table.diffstat td.graph table,
body div#cgit table.diffstat td.graph table td {
  border: 0;
  padding: 0;
}
body div#cgit table.diffstat td.graph table td.add { background: var(--add-fg); }
body div#cgit table.diffstat td.graph table td.rem { background: var(--del-fg); }
body div#cgit table.diffstat td.graph table td.none { background: transparent; }

body div#cgit div.content hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2em 0;
}
body div#cgit div.content img { max-width: 100%; height: auto; }
body div#cgit div.content details {
  margin: 0 0 1em;
  max-width: 74ch;
  border: 1px solid var(--rule);
  padding: 0.5rem 0.8rem;
}
body div#cgit div.content summary { cursor: pointer; font-weight: 600; }
body div#cgit div.content mark { background: var(--link-wash); color: inherit; }

@media (max-width: 700px) {
  body div#cgit div.content h1 { font-size: 1.4rem; }
  body div#cgit div.content h2 { font-size: 1.2rem; }
  body div#cgit div.content h3 { font-size: 1.05rem; }
}
