@font-face { font-family: "Inter"; src: url("https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
	color-scheme: light dark;
	--canvas: oklch(98.75% 0 0);
	--base: #ffffff;
	--elevated: oklch(98% 0 0);
	--recessed: oklch(96% 0 0);
	--tint: oklch(97% 0 0);
	--hairline: oklch(93.5% 0 0);
	--line: oklch(14.5% 0 0 / 0.1);
	--focus: oklch(15% 0 0);
	--text: oklch(21% 0.006 285.885);
	--text-strong: oklch(14.5% 0 0);
	--text-subtle: oklch(55.6% 0 0);
	--text-inactive: oklch(87% 0 0);
	--link: oklch(42.4% 0.199 265.638);
	--brand: oklch(0.5772 0.2324 260);
	--brand-hover: oklch(48.8% 0.243 264.376);
	--danger: oklch(50.5% 0.213 27.518);
	--danger-solid: oklch(57.7% 0.245 27.325);
	--danger-tint: oklch(93.6% 0.032 17.7 / 0.42);
	--success: oklch(43.2% 0.095 166.913);
	--success-tint: oklch(96.2% 0.043 156.7 / 0.57);
	--shadow-edge: oklch(0% 0 0 / 0.12);
	--shadow-drop: oklch(0% 0 0 / 0.08);
	--orange: #f6821f;
	--radius: 8px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--canvas: oklch(10% 0 0);
		--base: oklch(17% 0 0);
		--elevated: oklch(12% 0 0);
		--recessed: oklch(15% 0 0);
		--tint: oklch(26.9% 0 0);
		--hairline: oklch(26.9% 0 0);
		--line: oklch(32% 0 0);
		--focus: oklch(93.5% 0 0);
		--text: oklch(97% 0 0);
		--text-strong: oklch(98.5% 0 0);
		--text-subtle: oklch(70.8% 0 0);
		--text-inactive: oklch(43.9% 0 0);
		--link: oklch(70.7% 0.165 254.624);
		--brand: color-mix(in oklch, oklch(0.5772 0.2324 260), black 10%);
		--brand-hover: oklch(48.8% 0.243 264.376);
		--danger: oklch(70.4% 0.191 22.216);
		--danger-solid: oklch(57.7% 0.245 27.325);
		--danger-tint: oklch(42.9% 0.176 28.7 / 0.17);
		--success: oklch(90.5% 0.093 164.15);
		--success-tint: oklch(39.3% 0.096 152.3 / 0.20);
		--shadow-edge: oklch(100% 0 0 / 0.1);
		--shadow-drop: oklch(0% 0 0 / 0.3);
	}
}

* { box-sizing: border-box; }
body { font-family: "Inter", ui-sans-serif, system-ui, sans-serif; font-size: 14px; line-height: 1.5; margin: 0; color: var(--text); background: var(--canvas); }
main { max-width: 1016px; margin: 0 auto; padding: 2rem 1rem; }
h1 { color: var(--text-strong); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.5rem; }
h2 { color: var(--text-strong); font-size: 1.05rem; font-weight: 600; margin: 0 0 0.75rem; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { background: var(--recessed); padding: 0.75rem; border-radius: var(--radius); overflow-x: auto; }
.hljs { background: transparent; }

.card { background: var(--base); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }

.icon { width: 16px; height: 16px; flex: none; vertical-align: -0.2em; }

button, .btn {
	font: inherit; font-weight: 500; display: inline-flex; align-items: center; gap: 0.4rem;
	background: var(--base); color: var(--text); border: 1px solid var(--line);
	border-radius: var(--radius); padding: 0.45rem 0.9rem; cursor: pointer;
	box-shadow: 0 1px 2px var(--shadow-drop); text-decoration: none;
}
button:hover, .btn:hover { background: var(--tint); text-decoration: none; }
button.primary, .btn.primary { background: var(--brand); border-color: transparent; color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--brand-hover); }
button.danger, .btn.danger { background: var(--danger-solid); border-color: transparent; color: #fff; }
button.danger:hover, .btn.danger:hover { filter: brightness(1.1); }
button:focus-visible, .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

input[type=text], input[type=password] {
	font: inherit; padding: 0.5rem 0.75rem; background: var(--base); color: var(--text);
	border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: inset 0 1px 2px var(--shadow-drop);
}
input[type=text]:focus, input[type=password]:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
::placeholder { color: var(--text-subtle); }

table { border-collapse: collapse; width: 100%; }
th { color: var(--text-subtle); font-size: 0.8rem; font-weight: 600; text-align: left; }
th, td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--hairline); text-align: left; }
tr:last-child td { border-bottom: 0; }

.badge {
	display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 500;
	padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid var(--hairline); color: var(--text-subtle);
}
.badge.success { background: var(--success-tint); color: var(--success); border-color: transparent; }
.badge.danger { background: var(--danger-tint); color: var(--danger); border-color: transparent; }

.error { color: var(--danger); }
.muted { color: var(--text-subtle); font-size: 0.875rem; }

/* Chrome — top bar + footer */
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; width: 100%; }
.topbar { background: var(--base); border-bottom: 1px solid var(--hairline); }
.topbar-inner { max-width: 1016px; margin: 0 auto; padding: 0 1rem; height: 52px; display: flex; align-items: center; gap: 0.55rem; }
.glyph { width: 24px; height: auto; flex: none; }
.wordmark { font-weight: 600; font-size: 0.95rem; color: var(--text-strong); letter-spacing: -0.01em; }
.site-footer { display: flex; align-items: center; justify-content: center; gap: 0.45rem; color: var(--text-subtle); font-size: 0.8rem; padding: 2rem 1rem; }
.site-footer .glyph { width: 18px; }

/* Centered variant (PIN gate) */
main.center { max-width: 400px; display: flex; flex-direction: column; justify-content: center; }
main.center > .card { width: 100%; }

.banner { padding: 0.6rem 0.8rem; border-radius: var(--radius); font-size: 0.875rem; margin-bottom: 0.75rem; }
.banner.danger { background: var(--danger-tint); color: var(--danger); }

.pin-card form { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.pin-card input { width: 100%; text-align: center; letter-spacing: 0.35em; font-size: 1rem; padding: 0.6rem 0.75rem; }
.pin-card button { justify-content: center; width: 100%; }

/* Repo header (explorer) */
.repo-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.repo-title { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.repo-title h1 { margin: 0; font-size: 1.25rem; }
.repo-desc { margin: 0.35rem 0 0; }
.repo-clone { flex: none; }

/* Breadcrumbs */
.breadcrumbs { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; font-size: 0.875rem; min-width: 0; }
.crumb-root { font-weight: 600; }
.crumb-sep { color: var(--text-subtle); }
.crumb-current { font-weight: 600; color: var(--text-strong); }

/* Flush cards (file list, README, code) */
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--hairline); background: var(--elevated); font-weight: 500; color: var(--text-strong); font-size: 0.875rem; }
.card-head .icon { color: var(--text-subtle); }

/* File list */
.file-list table { border-collapse: collapse; }
.file-list td { padding: 0.45rem 0.9rem; }
.file-list tbody tr:hover, .file-list tr:hover { background: var(--tint); }
.file-row .icon { color: var(--text-subtle); margin-right: 0.45rem; }
.file-row a { color: var(--text); }
.file-row a:hover { color: var(--link); }

/* README card */
.readme-body { padding: 0.5rem 1.5rem 1.5rem; }
.readme-body > :first-child { margin-top: 0.75rem; }
.readme-body img { max-width: 100%; }
.readme-body h1, .readme-body h2 { padding-bottom: 0.3rem; border-bottom: 1px solid var(--hairline); }

/* Empty / error states */
.empty-state { text-align: center; padding: 3rem 1.25rem; }
.empty-state p { margin: 0; }

/* File view */
.file-head { justify-content: space-between; flex-wrap: wrap; row-gap: 0.5rem; }
.file-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
button.btn-sm, .btn.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8125rem; box-shadow: none; }

.code-wrap { display: flex; align-items: stretch; overflow-x: auto; font-size: 0.8125rem; line-height: 1.5; }
.code-wrap pre { margin: 0; border-radius: 0; white-space: pre; tab-size: 4; background: var(--base); }
.code-gutter { padding: 0.75rem 0.6rem 0.75rem 0.9rem; text-align: right; color: var(--text-subtle); background: var(--elevated) !important; border-right: 1px solid var(--hairline); user-select: none; position: sticky; left: 0; }
.code-body { padding: 0.75rem 0.9rem; flex: 1; }
.code-card .hljs { background: transparent; }

/* Clone page */
.clone-cmd { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.75rem 0; }
.clone-cmd pre { flex: 1; margin: 0; white-space: pre-wrap; word-break: break-all; }
.clone-cmd .btn { flex: none; }
.back-link { margin: 0.5rem 0 0; }

/* Admin */
.auth-card input { width: 100%; max-width: 460px; margin: 0.25rem 0 0.75rem; }
#app .card p { margin: 0 0 0.6rem; }
#app input[type=text] { width: 100%; max-width: 460px; }
#created { margin: 0.75rem 0 0; }
td.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
