@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* ── Reset / Base ───────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: #020617; /* slate-950 */
	color: #e2e8f0;      /* slate-200 */
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	min-height: 100vh;
}

/* ── Outer wrapper ──────────────────────────────────────────────────────── */

div#cgit {
	padding: 0;
	margin: 0 auto;
	max-width: 1100px;
	padding: 1.5rem 1.5rem 4rem;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 14px;
	color: #e2e8f0;
	background: transparent;
}

/* ── Links ──────────────────────────────────────────────────────────────── */

div#cgit a {
	color: #cbd5e1; /* slate-300 */
	text-decoration: none;
	transition: color 0.15s;
}

div#cgit a:hover {
	color: #ffffff;
	text-decoration: none;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

div#cgit table#header {
	width: 100%;
	margin-bottom: 0;
	border-collapse: collapse;
}

div#cgit table#header td.logo {
	width: 48px;
	vertical-align: middle;
	padding-right: 0.75rem;
}

div#cgit table#header td.logo img {
	width: 32px;
	height: 32px;
	opacity: 0.6;
	filter: invert(1);
}

div#cgit table#header td.main {
	font-size: 1.5rem;
	font-weight: 300;
	letter-spacing: -0.025em;
	color: #ffffff;
	padding-left: 0;
	white-space: nowrap;
}

div#cgit table#header td.main a {
	color: #ffffff;
}

div#cgit table#header td.sub {
	color: #64748b; /* slate-500 */
	border-top: 1px solid rgba(255,255,255,0.06);
	padding-left: 0;
	padding-top: 0.2rem;
	font-size: 0.8rem;
	font-weight: 300;
}

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

/* ── Search input ───────────────────────────────────────────────────────── */

div#cgit input[type=search],
div#cgit input[type=text] {
	background: rgba(0,0,0,0.4);
	border: 1px solid rgba(255,255,255,0.15);
	border-radius: 6px;
	color: #e2e8f0;
	padding: 0.25rem 0.6rem;
	font-size: 0.8rem;
	font-family: inherit;
	outline: none;
	transition: border-color 0.15s;
}

div#cgit input[type=search]:focus,
div#cgit input[type=text]:focus {
	border-color: rgba(255,255,255,0.3);
}

div#cgit input[type=submit],
div#cgit select {
	background: rgba(255,255,255,0.08);
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 6px;
	color: #cbd5e1;
	padding: 0.25rem 0.6rem;
	font-size: 0.8rem;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.15s;
}

div#cgit input[type=submit]:hover,
div#cgit select:hover {
	background: rgba(255,255,255,0.12);
}

div#cgit select option {
	background: #0f172a;
	color: #e2e8f0;
}

/* ── Tabs ───────────────────────────────────────────────────────────────── */

div#cgit table.tabs {
	border-bottom: 1px solid rgba(255,255,255,0.08);
	border-collapse: collapse;
	margin-top: 1.5rem;
	margin-bottom: 0;
	width: 100%;
}

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

div#cgit table.tabs td a {
	display: inline-block;
	padding: 0.35rem 0.75rem;
	color: rgba(255,255,255,0.5);
	font-size: 0.85rem;
	font-weight: 400;
	border-radius: 6px 6px 0 0;
	transition: color 0.15s, background 0.15s;
}

div#cgit table.tabs td a:hover {
	color: rgba(255,255,255,0.85);
	background: rgba(255,255,255,0.06);
}

div#cgit table.tabs td a.active {
	color: #ffffff;
	background: rgba(255,255,255,0.12);
}

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

div#cgit table.tabs td.form form {
	padding-bottom: 4px;
	font-size: 90%;
	white-space: nowrap;
}

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

/* ── Path breadcrumb ────────────────────────────────────────────────────── */

div#cgit div.path {
	margin: 0;
	padding: 0.5rem 1rem;
	color: #94a3b8;
	background: rgba(255,255,255,0.03);
	border-bottom: 1px solid rgba(255,255,255,0.06);
	font-size: 0.8rem;
}

/* ── Content area ───────────────────────────────────────────────────────── */

div#cgit div.content {
	margin: 0;
	padding: 1.5rem 0;
	border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ── Repo list / log tables ─────────────────────────────────────────────── */

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

div#cgit table.list tr {
	background: transparent;
	border-bottom: 1px solid rgba(255,255,255,0.04);
	transition: background 0.1s;
}

div#cgit table.list tr.logheader {
	background: rgba(255,255,255,0.04);
}

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

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

div#cgit table.list tr:hover {
	background: rgba(255,255,255,0.05);
}

div#cgit table.list tr.nohover,
div#cgit table.list tr.nohover:hover {
	background: transparent;
	border-bottom: 1px solid rgba(255,255,255,0.08);
}

div#cgit table.list th {
	font-weight: 500;
	color: #94a3b8;
	padding: 0.4rem 0.75rem 0.4rem 0.5rem;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	vertical-align: baseline;
	border-bottom: 1px solid rgba(255,255,255,0.08);
}

div#cgit table.list td {
	border: none;
	padding: 0.45rem 0.75rem 0.45rem 0.5rem;
	color: #e2e8f0;
}

div#cgit table.list td a {
	color: #cbd5e1;
}

div#cgit table.list td a:hover {
	color: #ffffff;
}

div#cgit table.list td a.ls-dir {
	font-weight: 500;
	color: #93c5fd; /* blue-300 */
}

div#cgit table.list td a.ls-dir:hover {
	color: #bfdbfe;
}

div#cgit table.list td.logsubject {
	font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
	font-weight: 400;
}

div#cgit table.list td.logmsg {
	font-family: ui-monospace, monospace;
	font-size: 0.8rem;
	white-space: pre;
	color: #94a3b8;
	padding: 0 0.5rem;
}

div#cgit table.list td.reposection {
	font-style: italic;
	color: #64748b;
	font-size: 0.8rem;
}

/* ── Commit graph colors (dark-friendly) ────────────────────────────────── */

div#cgit table.list td.commitgraph { font-family: monospace; white-space: pre; }
div#cgit table.list td.commitgraph .column1 { color: #f87171; }
div#cgit table.list td.commitgraph .column2 { color: #4ade80; }
div#cgit table.list td.commitgraph .column3 { color: #facc15; }
div#cgit table.list td.commitgraph .column4 { color: #60a5fa; }
div#cgit table.list td.commitgraph .column5 { color: #c084fc; }
div#cgit table.list td.commitgraph .column6 { color: #34d399; }

/* ── Commit detail ──────────────────────────────────────────────────────── */

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

div#cgit table.commit-info th {
	text-align: left;
	font-weight: 400;
	color: #64748b;
	padding: 0.15rem 1.5rem 0.15rem 0;
	vertical-align: top;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

div#cgit table.commit-info td {
	font-weight: 400;
	padding: 0.15rem 1rem 0.15rem 0;
	color: #e2e8f0;
}

div#cgit div.commit-subject {
	font-weight: 500;
	font-size: 1.1rem;
	margin: 1.5rem 0 0.5rem;
	color: #ffffff;
}

div#cgit div.commit-msg {
	white-space: pre;
	font-family: ui-monospace, monospace;
	font-size: 0.85rem;
	color: #94a3b8;
}

/* ── Summary / about panel ──────────────────────────────────────────────── */

div#cgit div#summary {
	margin-bottom: 1.5rem;
}

div#cgit div.cgit-panel {
	float: right;
	margin-top: 1.5rem;
}

div#cgit div.cgit-panel table {
	border-collapse: collapse;
	border: 1px solid rgba(255,255,255,0.1);
	background: rgba(15,23,42,0.8);
	border-radius: 8px;
}

div#cgit div.cgit-panel th {
	text-align: center;
	color: #94a3b8;
	font-weight: 500;
	font-size: 0.75rem;
	padding: 0.4rem 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

div#cgit div.cgit-panel td {
	padding: 0.25rem 0.75rem;
	color: #e2e8f0;
}

/* ── Blob / source view ─────────────────────────────────────────────────── */

div#cgit div#blob {
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 8px;
	overflow: hidden;
}

div#cgit table.blob {
	margin-top: 0;
	border-top: none;
	width: 100%;
}

div#cgit table.blob td.linenumbers {
	padding: 0 0.75rem 0 0.5rem;
	vertical-align: top;
	text-align: right;
	border-right: 1px solid rgba(255,255,255,0.08);
	color: #475569;
	font-family: ui-monospace, monospace;
	font-size: 0.8rem;
	user-select: none;
	background: rgba(0,0,0,0.2);
}

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

div#cgit table.blob td.linenumbers a:hover,
div#cgit table.ssdiff td.lineno a:hover {
	color: #94a3b8;
}

div#cgit table.blob td.lines,
div#cgit table.blob td.hashes {
	padding: 0 0 0 0.75rem;
	vertical-align: top;
	color: #e2e8f0;
	font-family: ui-monospace, monospace;
	font-size: 0.8rem;
}

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

/* ── Syntax highlighting (dark) ─────────────────────────────────────────── */

div#cgit table.blob .num { color: #f59e0b; }
div#cgit table.blob .esc { color: #c084fc; }
div#cgit table.blob .str { color: #86efac; }
div#cgit table.blob .pps { color: #fbbf24; }
div#cgit table.blob .slc { color: #64748b; font-style: italic; }
div#cgit table.blob .com { color: #64748b; font-style: italic; }
div#cgit table.blob .ppc { color: #93c5fd; }
div#cgit table.blob .opt { color: #e2e8f0; }
div#cgit table.blob .lin { color: #64748b; }
div#cgit table.blob .kwa { color: #f472b6; font-weight: 600; }
div#cgit table.blob .kwb { color: #60a5fa; }
div#cgit table.blob .kwc { color: #f472b6; font-weight: 600; }
div#cgit table.blob .kwd { color: #a5b4fc; }

/* ── Diff view ──────────────────────────────────────────────────────────── */

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

div#cgit table.diff td {
	font-family: ui-monospace, monospace;
	font-size: 0.8rem;
	white-space: pre;
	color: #e2e8f0;
}

div#cgit table.diff td div.head {
	font-weight: 600;
	margin-top: 1rem;
	color: #94a3b8;
}

div#cgit table.diff td div.hunk {
	color: #60a5fa;
}

div#cgit table.diff td div.add {
	color: #4ade80;
}

div#cgit table.diff td div.del {
	color: #f87171;
}

/* ── Side-by-side diff ──────────────────────────────────────────────────── */

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

div#cgit table.ssdiff td {
	font-size: 0.78rem;
	font-family: ui-monospace, monospace;
	white-space: pre;
	padding: 1px 6px;
	border-left: 1px solid rgba(255,255,255,0.06);
	border-right: 1px solid rgba(255,255,255,0.06);
	color: #e2e8f0;
}

div#cgit table.ssdiff td.add      { background: rgba(74,222,128,0.1); color: #e2e8f0; min-width: 50%; }
div#cgit table.ssdiff td.add_dark { background: rgba(74,222,128,0.18); color: #e2e8f0; min-width: 50%; }
div#cgit table.ssdiff span.add    { background: rgba(74,222,128,0.3); font-weight: 600; }
div#cgit table.ssdiff td.del      { background: rgba(248,113,113,0.1); color: #e2e8f0; min-width: 50%; }
div#cgit table.ssdiff td.del_dark { background: rgba(248,113,113,0.18); color: #e2e8f0; min-width: 50%; }
div#cgit table.ssdiff span.del    { background: rgba(248,113,113,0.3); font-weight: 600; }
div#cgit table.ssdiff td.changed  { background: rgba(250,204,21,0.1); color: #e2e8f0; min-width: 50%; }
div#cgit table.ssdiff td.changed_dark { background: rgba(250,204,21,0.18); color: #e2e8f0; min-width: 50%; }
div#cgit table.ssdiff td.lineno   { background: rgba(0,0,0,0.3); color: #475569; text-align: right; width: 3em; min-width: 3em; }
div#cgit table.ssdiff td.hunk     { background: rgba(96,165,250,0.1); color: #93c5fd; border-top: 1px solid rgba(96,165,250,0.2); border-bottom: 1px solid rgba(96,165,250,0.2); }
div#cgit table.ssdiff td.head     { border-top: 1px solid rgba(255,255,255,0.08); border-bottom: 1px solid rgba(255,255,255,0.08); }
div#cgit table.ssdiff td.head div.head { font-weight: 600; color: #94a3b8; }
div#cgit table.ssdiff td.foot     { border-top: 1px solid rgba(255,255,255,0.06); 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; }

/* ── Diffstat ───────────────────────────────────────────────────────────── */

div#cgit div.diffstat-header {
	font-weight: 500;
	padding-top: 1.5rem;
	color: #94a3b8;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

div#cgit table.diffstat {
	border-collapse: collapse;
	border: 1px solid rgba(255,255,255,0.08);
	background: rgba(15,23,42,0.6);
	border-radius: 6px;
	overflow: hidden;
}

div#cgit table.diffstat th {
	font-weight: 400;
	text-align: left;
	color: #94a3b8;
	padding: 0.3rem 0.75rem;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-bottom: 1px solid rgba(255,255,255,0.08);
}

div#cgit table.diffstat td {
	padding: 0.25rem 0.5rem;
	font-size: 0.85rem;
	border: none;
	color: #e2e8f0;
}

div#cgit table.diffstat td.add a { color: #4ade80; }
div#cgit table.diffstat td.del a { color: #f87171; }
div#cgit table.diffstat td.upd a { color: #60a5fa; }
div#cgit table.diffstat td.mode  { white-space: nowrap; }
div#cgit table.diffstat td span.modechange { padding-left: 1em; color: #f87171; }

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: #4ade80; }
div#cgit table.diffstat td.graph td.rem { background: #f87171; }

div#cgit div.diffstat-summary {
	color: #64748b;
	padding-top: 0.5rem;
	font-size: 0.8rem;
}

/* ── Branch / tag / ref decorators ─────────────────────────────────────── */

div#cgit a.branch-deco {
	color: #e2e8f0;
	margin: 0 0.4rem;
	padding: 0.1em 0.4em;
	background: rgba(74,222,128,0.15);
	border: 1px solid rgba(74,222,128,0.35);
	border-radius: 4px;
	font-size: 0.75rem;
}

div#cgit a.tag-deco {
	color: #e2e8f0;
	margin: 0 0.4rem;
	padding: 0.1em 0.4em;
	background: rgba(250,204,21,0.15);
	border: 1px solid rgba(250,204,21,0.35);
	border-radius: 4px;
	font-size: 0.75rem;
}

div#cgit a.tag-annotated-deco {
	color: #e2e8f0;
	margin: 0 0.4rem;
	padding: 0.1em 0.4em;
	background: rgba(251,146,60,0.15);
	border: 1px solid rgba(251,146,60,0.35);
	border-radius: 4px;
	font-size: 0.75rem;
}

div#cgit a.remote-deco {
	color: #e2e8f0;
	margin: 0 0.4rem;
	padding: 0.1em 0.4em;
	background: rgba(96,165,250,0.15);
	border: 1px solid rgba(96,165,250,0.35);
	border-radius: 4px;
	font-size: 0.75rem;
}

div#cgit a.deco {
	color: #e2e8f0;
	margin: 0 0.4rem;
	padding: 0.1em 0.4em;
	background: rgba(248,113,113,0.15);
	border: 1px solid rgba(248,113,113,0.35);
	border-radius: 4px;
	font-size: 0.75rem;
}

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: 0.75rem;
	font-size: 0.7rem;
}

/* ── Age / insertion / deletion spans ──────────────────────────────────── */

div#cgit span.age-mins   { color: #4ade80; font-weight: 500; }
div#cgit span.age-hours  { color: #4ade80; }
div#cgit span.age-days   { color: #86efac; }
div#cgit span.age-weeks  { color: #94a3b8; }
div#cgit span.age-months { color: #64748b; }
div#cgit span.age-years  { color: #475569; }

div#cgit span.insertions { color: #4ade80; }
div#cgit span.deletions  { color: #f87171; }

/* ── Buttons / secondary links ──────────────────────────────────────────── */

div#cgit a.button {
	font-size: 0.75rem;
	padding: 0.15em 0.5em;
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 4px;
	color: #94a3b8;
	transition: background 0.15s;
}

div#cgit a.button:hover {
	background: rgba(255,255,255,0.1);
	color: #e2e8f0;
}

div#cgit a.primary   { font-size: 1rem; }
div#cgit a.secondary { font-size: 0.85rem; color: #64748b; }
div#cgit .oid        { font-family: ui-monospace, monospace; font-size: 0.8rem; color: #64748b; }

/* ── Pager ──────────────────────────────────────────────────────────────── */

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

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

div#cgit ul.pager a {
	color: #64748b;
}

div#cgit ul.pager a:hover {
	color: #e2e8f0;
}

div#cgit ul.pager .current {
	font-weight: 600;
	color: #e2e8f0;
}

/* ── Error ──────────────────────────────────────────────────────────────── */

div#cgit div.error {
	color: #f87171;
	font-weight: 500;
	margin: 1rem 0;
	padding: 0.75rem 1rem;
	background: rgba(248,113,113,0.1);
	border: 1px solid rgba(248,113,113,0.2);
	border-radius: 6px;
}

/* ── Notes ──────────────────────────────────────────────────────────────── */

div#cgit div.notes {
	white-space: pre;
	font-family: ui-monospace, monospace;
	font-size: 0.8rem;
	border: 1px solid rgba(250,204,21,0.25);
	background: rgba(250,204,21,0.08);
	color: #fef3c7;
	padding: 0.5rem 1.5rem 0.5rem 0.75rem;
	border-radius: 6px;
	float: left;
}

div#cgit div.notes-header {
	font-weight: 500;
	padding-top: 1.5rem;
	color: #fbbf24;
}

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

/* ── Footer ─────────────────────────────────────────────────────────────── */

div#cgit div.footer {
	margin-top: 2rem;
	text-align: center;
	font-size: 0.75rem;
	color: #334155;
}

div#cgit div.footer a {
	color: #334155;
}

div#cgit div.footer a:hover {
	color: #64748b;
}

/* ── Stats tables ───────────────────────────────────────────────────────── */

div#cgit table.stats {
	border: 1px solid rgba(255,255,255,0.08);
	border-collapse: collapse;
	background: rgba(15,23,42,0.6);
}

div#cgit table.stats th {
	text-align: left;
	padding: 0.3rem 0.75rem;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.08);
	color: #94a3b8;
	font-weight: 500;
	font-size: 0.75rem;
}

div#cgit table.stats td {
	text-align: right;
	padding: 0.25rem 0.75rem;
	border: 1px solid rgba(255,255,255,0.06);
	color: #e2e8f0;
}

div#cgit table.stats td.total { font-weight: 600; text-align: left; }
div#cgit table.stats td.sum   { color: #f87171; font-weight: 600; }
div#cgit table.stats td.left  { text-align: left; }

/* ── Blame ──────────────────────────────────────────────────────────────── */

div#cgit table.blame td.hashes div.alt,
div#cgit table.blame td.lines div.alt { padding: 0 0.5rem; }
div#cgit table.blame td.linenumbers div.alt { padding: 0 0.5rem 0 0; }
div#cgit table.blame div.alt:nth-child(even) { background: rgba(255,255,255,0.03); }
div#cgit table.blame div.alt:nth-child(odd)  { background: transparent; }

/* ── Misc ───────────────────────────────────────────────────────────────── */

div#cgit img { border: none; }

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

div#cgit a.ls-blob,
div#cgit a.ls-dir,
div#cgit .ls-mod { font-family: ui-monospace, monospace; }

div#cgit td.ls-size {
	text-align: right;
	font-family: ui-monospace, monospace;
	width: 7em;
	color: #64748b;
}

div#cgit td.ls-mode {
	font-family: ui-monospace, monospace;
	width: 8em;
	color: #64748b;
}

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

div#cgit table#downloads {
	float: right;
	border: 1px solid rgba(255,255,255,0.1);
	border-collapse: collapse;
	background: rgba(15,23,42,0.8);
	border-radius: 6px;
	margin-left: 0.75rem;
	margin-bottom: 0.5rem;
}

div#cgit table#downloads th {
	background: rgba(255,255,255,0.04);
	color: #94a3b8;
	font-weight: 500;
	font-size: 0.75rem;
	padding: 0.3rem 0.75rem;
}
