:root {
	--bg: oklch(0.985 0.002 250);
	--panel: oklch(1 0 0);
	--side: oklch(0.965 0.004 250);
	--line: oklch(0.91 0.005 250);
	--text: oklch(0.22 0.02 260);
	--muted: oklch(0.52 0.015 260);
	--accent: oklch(0.52 0.13 195);
	--accent-soft: oklch(0.95 0.03 195);
	--good: oklch(0.55 0.13 150);
	--bad: oklch(0.56 0.18 25);
	--warn: oklch(0.68 0.14 75);
	--radius: 8px;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: oklch(0.17 0.01 260);
		--panel: oklch(0.21 0.012 260);
		--side: oklch(0.19 0.012 260);
		--line: oklch(0.3 0.012 260);
		--text: oklch(0.93 0.005 260);
		--muted: oklch(0.68 0.012 260);
		--accent: oklch(0.74 0.12 195);
		--accent-soft: oklch(0.3 0.05 195);
		--good: oklch(0.74 0.14 150);
		--bad: oklch(0.72 0.16 25);
		--warn: oklch(0.8 0.13 75);
		color-scheme: dark;
	}
}
* {
	box-sizing: border-box;
}
html,
body {
	height: 100%;
	margin: 0;
}
body {
	background: var(--bg);
	color: var(--text);
	font: 13px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	font-variant-numeric: tabular-nums;
}
a {
	color: inherit;
	text-decoration: none;
}
button,
textarea,
select {
	font: inherit;
	color: inherit;
}
#app {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	height: 100%;
}
#side {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 8px;
	background: var(--side);
	border-right: 1px solid var(--line);
	min-height: 0;
	overflow-y: auto;
}
.brand {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 8px 12px;
}
.mark {
	width: 18px;
	height: 18px;
	border-radius: 5px;
	background: var(--accent);
}
#nav {
	display: flex;
	flex-direction: column;
	gap: 1px;
	flex: 1;
}
.nav-label {
	padding: 14px 8px 4px;
	font-size: 11px;
	color: var(--muted);
	font-weight: 600;
}
.nav-item {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 28px;
	padding: 0 8px;
	border-radius: 6px;
	font-weight: 500;
}
.nav-item:hover {
	background: color-mix(in oklch, var(--text) 6%, transparent);
}
.nav-item[aria-current="page"] {
	background: var(--panel);
	box-shadow: 0 0 0 1px var(--line);
}
.nav-item .count {
	margin-left: auto;
	font-size: 11px;
	font-weight: 600;
	color: var(--accent);
}
.dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--muted);
	flex: none;
}
.dot.ok {
	background: var(--good);
}
.dot.late {
	background: var(--warn);
}
.dot.down {
	background: var(--bad);
}
#who {
	padding: 8px;
	color: var(--muted);
	font-size: 11px;
	overflow: hidden;
	text-overflow: ellipsis;
}
#main {
	min-height: 0;
	overflow-y: auto;
	outline: none;
}
.page {
	max-width: 1280px;
	margin: 0 auto;
	padding: 20px 24px 48px;
}
h1 {
	margin: 0;
	font-size: 18px;
	font-weight: 650;
}
h2 {
	margin: 24px 0 8px;
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 14px;
	margin-bottom: 14px;
}
.sub {
	color: var(--muted);
}
.tabs {
	display: flex;
	gap: 2px;
	border-bottom: 1px solid var(--line);
	margin-bottom: 14px;
}
.tab {
	padding: 7px 10px;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	color: var(--muted);
	font-weight: 500;
}
.tab[aria-current="page"] {
	color: var(--text);
	border-color: var(--accent);
}
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 12px;
}
.card {
	display: block;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 14px;
}
a.card:hover {
	border-color: var(--accent);
}
.card h3 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	font-size: 14px;
}
.kv {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 12px;
	margin: 0;
}
.kv dt {
	color: var(--muted);
}
.kv dd {
	margin: 0;
	text-align: right;
}
.tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 8px;
}
.tile {
	display: grid;
	gap: 2px;
	text-align: left;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 9px 10px 6px;
	cursor: pointer;
	min-width: 0;
}
.tile:hover,
.tile[aria-pressed="true"] {
	border-color: var(--accent);
}
.tile .label {
	color: var(--muted);
	font-size: 11.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.tile .value {
	font-size: 19px;
	font-weight: 650;
	letter-spacing: -0.01em;
}
.tile .row {
	display: flex;
	align-items: baseline;
	gap: 6px;
}
.delta {
	font-size: 11px;
	color: var(--muted);
}
.delta.up {
	color: var(--good);
}
.delta.down {
	color: var(--bad);
}
.spark {
	display: block;
	width: 100%;
	height: 26px;
	color: var(--accent);
}
.detail {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 14px;
	margin: 0 0 14px;
}
.detail-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}
.detail-head b {
	font-size: 14px;
}
.detail-head code {
	color: var(--muted);
	font-size: 11px;
}
.seg {
	display: inline-flex;
	margin-left: auto;
	border: 1px solid var(--line);
	border-radius: 6px;
	overflow: hidden;
}
.seg button {
	border: 0;
	background: transparent;
	padding: 3px 9px;
	cursor: pointer;
}
.seg button[aria-pressed="true"] {
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 600;
}
.chart {
	display: block;
	width: 100%;
	height: 220px;
	color: var(--accent);
}
.chart text {
	fill: var(--muted);
	font-size: 10px;
}
.chart .grid {
	stroke: var(--line);
}
.btn {
	border: 1px solid var(--line);
	background: var(--panel);
	border-radius: 6px;
	padding: 4px 10px;
	cursor: pointer;
	font-weight: 500;
}
.btn:hover {
	border-color: var(--accent);
}
.btn.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--panel);
}
.btn[aria-pressed="true"] {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--accent);
}
input[type="search"],
textarea,
select {
	border: 1px solid var(--line);
	background: var(--panel);
	border-radius: 6px;
	padding: 5px 8px;
}
input[type="search"] {
	font: inherit;
	color: inherit;
	width: 220px;
}
textarea {
	width: 100%;
	min-height: 70px;
	resize: vertical;
}
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
}
.split {
	display: grid;
	grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
	gap: 14px;
	align-items: start;
}
.list {
	display: grid;
	gap: 6px;
}
.item {
	display: grid;
	gap: 3px;
	text-align: left;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 9px 10px;
	cursor: pointer;
}
.item[aria-pressed="true"] {
	border-color: var(--accent);
	box-shadow: inset 3px 0 0 var(--accent);
}
.item .meta {
	display: flex;
	gap: 8px;
	align-items: center;
	color: var(--muted);
	font-size: 11.5px;
}
.item .text {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.pill {
	display: inline-block;
	padding: 0 7px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	background: color-mix(in oklch, var(--muted) 16%, transparent);
	color: var(--muted);
}
.pill.open {
	background: color-mix(in oklch, var(--warn) 22%, transparent);
	color: color-mix(in oklch, var(--warn) 70%, var(--text));
}
.pill.working {
	background: var(--accent-soft);
	color: var(--accent);
}
.pill.done {
	background: color-mix(in oklch, var(--good) 18%, transparent);
	color: var(--good);
}
.comment {
	font-size: 15px;
	white-space: pre-wrap;
	margin: 8px 0 12px;
}
.shot {
	display: block;
	max-width: 100%;
	border: 1px solid var(--line);
	border-radius: 6px;
	margin-top: 10px;
}
pre.code {
	margin: 6px 0 0;
	padding: 8px;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: 6px;
	font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
	white-space: pre-wrap;
	word-break: break-word;
	max-height: 180px;
	overflow: auto;
}
.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0;
}
.entry {
	padding: 10px 0;
	border-bottom: 1px solid var(--line);
}
.entry b {
	font-size: 14px;
}
.entry p {
	margin: 4px 0 0;
	white-space: pre-wrap;
}
.empty {
	padding: 40px 0;
	text-align: center;
	color: var(--muted);
}
.error {
	color: var(--bad);
}
.toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-bottom: 10px;
}
@media (max-width: 820px) {
	#app {
		grid-template-columns: 1fr;
		grid-template-rows: auto minmax(0, 1fr);
	}
	#side {
		border-right: 0;
		border-bottom: 1px solid var(--line);
	}
	#nav {
		flex-direction: row;
		flex-wrap: wrap;
	}
	.nav-label,
	#who {
		display: none;
	}
	.page {
		padding: 14px 16px 40px;
	}
	.split {
		grid-template-columns: 1fr;
	}
}

/* Sign-in and first setup: one centred form, no sidebar. */
body.gated #app {
	grid-template-columns: 1fr;
}
body.gated #side {
	display: none;
}
.gate {
	display: grid;
	gap: 12px;
	width: min(360px, calc(100vw - 32px));
	margin: 12vh auto 0;
	padding: 24px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 12px;
}
.field {
	display: grid;
	gap: 4px;
	font-weight: 500;
}
.field input {
	font: inherit;
	color: inherit;
	border: 1px solid var(--line);
	background: var(--bg);
	border-radius: 6px;
	padding: 7px 9px;
	width: 100%;
}
.field input[readonly] {
	color: var(--muted);
}
.form {
	display: grid;
	gap: 10px;
	max-width: 560px;
}
.error:empty {
	display: none;
}
.error {
	margin: 0;
}
.btn:disabled {
	opacity: 0.6;
}
button.link {
	display: block;
	border: 0;
	background: none;
	padding: 4px 0 0;
	color: var(--accent);
	cursor: pointer;
	font-size: 11px;
}
