:root {
	--bg: #0e1013;
	--surface: #111418;
	--surface-2: #13161b;
	--raised: #1a1e24;
	--hover: #181c22;
	--border: #23272e;
	--border-strong: #2e333b;
	--divider: #1d2127;
	--text: #e8e6e3;
	--text-strong: #f0eeeb;
	--text-2: #c9cdd2;
	--text-3: #b4b9c0;
	--muted: #9aa0a8;
	--faint: #7d848d;
	--avatar: #2a2f37;
	--accent: #e9a23b;
	--accent-hover: #f3bd6a;
	--accent-text: #f0b866;
	--on-accent: #1a1205;
	--accent-soft: #2a2113;
	--success: #5fbf8a;
	--success-text: #7fd3a5;
	--success-soft: #16281f;
	--danger: #f09a9a;
	--danger-title: #e58a8a;
	--danger-border: #6b2d33;
	--danger-soft: #2b1a1c;
	--danger-zone: #3a2326;
	--sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	color-scheme: dark;
}

@media (prefers-color-scheme: light) {
	:root {
		--bg: #f7f6f3;
		--surface: #ffffff;
		--surface-2: #fbfaf8;
		--raised: #f1efea;
		--hover: #f4f2ee;
		--border: #e2dfd8;
		--border-strong: #d3cfc6;
		--divider: #ebe8e2;
		--text: #1c1d20;
		--text-strong: #111214;
		--text-2: #33363b;
		--text-3: #4a4e55;
		--muted: #5f646c;
		--faint: #747982;
		--avatar: #e4e1da;
		--accent: #b86e0a;
		--accent-hover: #8f5506;
		--accent-text: #8f5506;
		--on-accent: #ffffff;
		--accent-soft: #f7ead6;
		--success: #2f8f5b;
		--success-text: #1f6e44;
		--success-soft: #e1f2e8;
		--danger: #b3261e;
		--danger-title: #b3261e;
		--danger-border: #e3b2ae;
		--danger-soft: #fbe7e5;
		--danger-zone: #efcfcb;
		color-scheme: light;
	}
}

* {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
	color: var(--text);
	font: 15px / 1.5 var(--sans);
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--accent);
}

a:hover {
	color: var(--accent-hover);
}

h1,
h2,
p {
	margin: 0;
}

code,
.mono {
	font-family: var(--mono);
}

.muted {
	color: var(--muted);
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.eyebrow {
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted);
}

/* Buttons */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	border-radius: 9px;
	border: 1px solid transparent;
	font: inherit;
	font-size: 14px;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
}

.button:focus-visible,
.segmented button:focus-visible,
.search:focus-within,
.row:focus-visible,
.repos a:focus-visible,
.files a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.button.small {
	height: 36px;
	padding: 0 14px;
	border-radius: 8px;
}

.button.large {
	height: 48px;
	font-size: 15px;
}

.button.primary {
	background: var(--accent);
	color: var(--on-accent);
	font-weight: 600;
}

.button.primary:hover {
	background: var(--accent-hover);
	color: var(--on-accent);
}

.button.ghost {
	background: transparent;
	border-color: var(--border-strong);
	color: var(--text);
}

.button.ghost:hover {
	background: var(--hover);
	color: var(--text);
}

.button.danger {
	align-self: flex-start;
	background: transparent;
	border-color: var(--danger-border);
	color: var(--danger);
}

.button.danger:hover {
	background: var(--danger-soft);
}

/* Top bar */

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 60px;
	padding: 0 24px;
	border-bottom: 1px solid var(--border);
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	font-weight: 600;
	font-size: 16px;
	letter-spacing: -0.01em;
	text-decoration: none;
}

.brand svg {
	color: var(--accent);
}

.brand:hover {
	color: var(--text);
}

.account,
.user {
	display: flex;
	align-items: center;
	gap: 12px;
}

.user {
	gap: 8px;
	font-size: 14px;
	color: var(--text-2);
}

.avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--avatar);
	color: var(--text);
	font-size: 12px;
	font-weight: 600;
	overflow: hidden;
}

.avatar.small {
	width: 22px;
	height: 22px;
	font-size: 11px;
}

.avatar.tiny {
	width: 20px;
	height: 20px;
	font-size: 10px;
}

/* Signed out / not a maintainer */

.gate {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: calc(100vh - 60px);
	padding: 48px 16px;
}

.gate-card {
	display: flex;
	flex-direction: column;
	gap: 28px;
	width: 100%;
	max-width: 480px;
	padding: 40px 36px;
	border: 1px solid var(--border);
	border-radius: 16px;
	background: var(--surface);
}

.gate-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: var(--accent-soft);
	color: var(--accent);
}

.gate-icon.danger {
	background: var(--danger-soft);
	color: var(--danger);
}

.gate-text {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.gate-text h1 {
	font-size: 26px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.25;
}

.gate-text p {
	color: var(--text-3);
	line-height: 1.6;
}

.gate-text code {
	color: var(--text);
	font-size: 14px;
}

.fine {
	font-size: 13px;
	color: var(--muted);
	line-height: 1.6;
}

.steps {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px 18px;
	border-radius: 10px;
	background: var(--raised);
}

.steps ol {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding-left: 20px;
	color: var(--text-2);
	font-size: 14px;
	line-height: 1.55;
}

.steps li::marker {
	font-family: var(--mono);
	color: var(--muted);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* Session list */

.layout {
	display: flex;
	flex-wrap: wrap;
	gap: 40px;
	max-width: 1240px;
	margin: 0 auto;
	padding: 32px 24px 64px;
}

.repos {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 220px;
	max-width: 260px;
}

.repos .eyebrow {
	padding: 0 12px 8px;
}

.repos ul {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.repos a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 44px;
	padding: 6px 12px;
	border-radius: 8px;
	color: var(--text-2);
	text-decoration: none;
}

.repos a:hover {
	background: var(--hover);
	color: var(--text-2);
}

.repos a[aria-current="true"] {
	background: var(--raised);
	color: var(--text);
	font-weight: 500;
}

.repo-name {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.25;
}

.repo-name small {
	font-size: 12px;
	color: var(--muted);
	font-weight: 400;
}

.repo-name span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.count {
	font-family: var(--mono);
	font-size: 12px;
	color: var(--muted);
}

.content {
	display: flex;
	flex-direction: column;
	gap: 28px;
	flex: 999 1 560px;
	min-width: 0;
}

.page-head {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.page-head h1 {
	font-size: 28px;
	font-weight: 600;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}

.toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.search {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 280px;
	height: 44px;
	padding: 0 14px;
	border: 1px solid var(--border-strong);
	border-radius: 10px;
	background: var(--surface-2);
	color: var(--muted);
}

.search input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
}

.search input::placeholder {
	color: var(--faint);
}

.segmented {
	display: flex;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--border-strong);
	border-radius: 10px;
	background: var(--surface-2);
}

.segmented button {
	height: 34px;
	padding: 0 14px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.segmented button:hover {
	color: var(--text);
}

.segmented button[aria-pressed="true"] {
	background: var(--raised);
	color: var(--text);
}

.groups {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.group {
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: hidden;
	background: var(--surface);
}

.group-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--border);
	background: var(--surface-2);
}

.group-head h2 {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 8px;
	min-width: 0;
	font-size: 15px;
	font-weight: 500;
	overflow-wrap: anywhere;
}

.group-head h2 svg {
	flex: none;
	color: var(--muted);
}

.group-head .owner {
	white-space: nowrap;
	color: var(--muted);
	font-weight: 400;
}

.group-head .count {
	font-family: var(--sans);
	font-size: 13px;
	white-space: nowrap;
}

.cols,
.row {
	display: flex;
	align-items: center;
	gap: 8px 16px;
	padding: 0 18px;
}

.cols {
	padding-top: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--divider);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--faint);
}

.row {
	flex-wrap: wrap;
	min-height: 64px;
	padding-top: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--divider);
	color: var(--text);
	text-decoration: none;
	transition: background 0.12s;
}

.row:last-child {
	border-bottom: 0;
}

.row:hover {
	background: var(--hover);
	color: var(--text);
}

.c-pr {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 220px;
	min-width: 0;
}

.c-pr .num {
	min-width: 40px;
	font-family: var(--mono);
	font-weight: 500;
}

.c-pr .user {
	min-width: 0;
}

.c-pr .user span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.c-commit {
	flex: 0 0 96px;
	font-family: var(--mono);
	font-size: 13px;
	color: var(--muted);
}

.c-answered {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 180px;
}

.c-answered .bar {
	flex: 1;
}

.c-answered .tally {
	min-width: 44px;
	font-family: var(--mono);
	font-size: 13px;
	text-align: right;
	color: var(--accent-text);
}

.c-answered .tally.done {
	color: var(--success-text);
}

.c-started {
	flex: 0 0 140px;
	font-size: 13px;
	color: var(--muted);
}

.c-go {
	flex: 0 0 16px;
	color: var(--faint);
}

.bar {
	display: block;
	height: 6px;
	border-radius: 3px;
	background: var(--border);
	overflow: hidden;
}

.bar > span {
	display: block;
	height: 100%;
	border-radius: 3px;
	background: var(--accent);
}

.bar.done > span {
	background: var(--success);
}

.empty {
	padding: 48px 16px;
	border: 1px dashed var(--border-strong);
	border-radius: 12px;
	text-align: center;
	color: var(--muted);
}

.more {
	display: flex;
	justify-content: center;
}

.more .button {
	height: 44px;
}

/* One session */

.detail {
	display: flex;
	flex-direction: column;
	gap: 28px;
	max-width: 1240px;
	margin: 0 auto;
	padding: 28px 24px 64px;
}

.breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--muted);
}

.breadcrumb a {
	color: var(--muted);
	text-decoration: none;
}

.breadcrumb a:hover {
	color: var(--text);
}

.breadcrumb [aria-current] {
	color: var(--text);
}

.detail-head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--border);
}

.detail-title {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

.title-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.title-row h1 {
	font-size: 30px;
	font-weight: 600;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}

.title-row h1 .mono {
	font-weight: 500;
}

.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 26px;
	padding: 0 10px;
	border-radius: 13px;
	background: var(--accent-soft);
	color: var(--accent-text);
	font-size: 13px;
	font-weight: 500;
}

.badge.done {
	background: var(--success-soft);
	color: var(--success-text);
}

.meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	font-size: 14px;
	color: var(--muted);
}

.meta-row .value {
	color: var(--text-2);
}

.meta-row .mono {
	font-size: 13px;
}

.detail-body {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 40px;
}

.questions {
	display: flex;
	flex-direction: column;
	gap: 16px;
	flex: 999 1 560px;
	min-width: 0;
}

.question {
	display: flex;
	gap: 16px;
	padding: 22px 22px 22px 18px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	scroll-margin-top: 16px;
}

.question.follow-up {
	margin-left: 52px;
}

.question.flash {
	border-color: var(--accent);
}

.q-num {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 36px;
	height: 28px;
	border-radius: 7px;
	background: var(--raised);
	color: var(--text-2);
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 500;
}

.q-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
	min-width: 0;
}

.q-parent {
	font-size: 13px;
	color: var(--muted);
}

.q-text {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 74ch;
	overflow-wrap: anywhere;
}

.q-lead {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.45;
	color: var(--text-strong);
}

.q-rest {
	line-height: 1.6;
	color: var(--text-3);
}

.file-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	max-width: 100%;
	min-height: 26px;
	padding: 2px 10px;
	border: 1px solid var(--border-strong);
	border-radius: 6px;
	background: var(--hover);
	color: var(--text-2);
	font-family: var(--mono);
	font-size: 12px;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.file-chip:hover {
	border-color: var(--accent);
	color: var(--text);
}

.file-chip svg {
	flex: none;
}

.answer {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
	padding: 14px 16px;
	border-radius: 10px;
	background: var(--raised);
}

.answer.pending {
	background: transparent;
	border: 1px dashed var(--border-strong);
}

.answer-by {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--muted);
}

.answer-text {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	line-height: 1.6;
}

.answer.pending .answer-text {
	color: var(--muted);
}

.side {
	display: flex;
	flex-direction: column;
	gap: 20px;
	flex: 1 1 280px;
	max-width: 340px;
}

.panel {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
}

.big-count {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.big-count .mono {
	font-size: 28px;
	font-weight: 600;
}

.files {
	gap: 6px;
	padding: 20px 12px 12px;
}

.files h2 {
	margin: 0 8px 6px;
}

.files ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.files a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: 40px;
	padding: 0 8px;
	border-radius: 7px;
	color: var(--text-2);
	font-family: var(--mono);
	font-size: 13px;
	text-decoration: none;
}

.files a:hover {
	background: var(--hover);
	color: var(--text);
}

.files a span:first-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.files .count {
	font-size: 13px;
}

.danger-zone {
	gap: 10px;
	background: transparent;
	border-color: var(--danger-zone);
}

.danger-zone .eyebrow {
	color: var(--danger-title);
}

.danger-zone p {
	font-size: 14px;
	color: var(--muted);
}

.error {
	max-width: 1240px;
	margin: 0 auto 32px;
	padding: 0 24px;
	color: var(--danger);
}

@media (max-width: 760px) {
	.topbar,
	.layout,
	.detail {
		padding-left: 16px;
		padding-right: 16px;
	}

	.layout {
		gap: 24px;
	}

	.repos {
		max-width: none;
	}

	.cols,
	.c-commit,
	.c-started {
		display: none;
	}

	.c-answered {
		flex: 1 1 100%;
	}

	.c-go {
		display: none;
	}

	.side {
		max-width: none;
	}

	.question {
		padding: 18px 16px 18px 14px;
		gap: 12px;
	}

	.question.follow-up {
		margin-left: 24px;
	}

	.gate-card {
		padding: 32px 24px;
	}

	.user #login {
		display: none;
	}
}
