:root {
	color-scheme: light;
	--bg: #f4f6f9;
	--surface: #ffffff;
	--surface-2: #eef1f6;
	--border: #e2e7ef;
	--border-soft: #edf1f6;
	--text: #223041;
	--muted: #67758a;
	--accent: #3f6ea6;
	--accent-strong: #35608f;
	--accent-soft: #e7eff8;
	--danger: #b23a32;
	--danger-soft: #f9e9e7;
	--open-bg: #f9e9e7;
	--open-fg: #b23a32;
	--resolved-bg: #e3f2e7;
	--resolved-fg: #2c7a4b;
	--code-bg: #eef1f6;
	--tok-key: #0550ae;
	--tok-str: #0a3069;
	--tok-num: #953800;
	--tok-bool: #8250df;
	--tok-null: #57606a;
	--tok-ex: #cf222e;
	--tok-fn: #8250df;
	--tok-loc: #57606a;
	--chart-line: #2e6be6;
	--chart-fill: #dfe9fb;
	--shadow: 0 1px 2px rgba(34, 48, 65, 0.05), 0 4px 16px rgba(34, 48, 65, 0.06);
	--radius: 12px;
	--radius-sm: 8px;
}
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #10141b;
	--surface: #171d27;
	--surface-2: #1e2532;
	--border: #2b3444;
	--border-soft: #232b39;
	--text: #dbe2ec;
	--muted: #8d99ad;
	--accent: #7ba3d4;
	--accent-strong: #93b6dd;
	--accent-soft: #1f2c40;
	--danger: #e57d75;
	--danger-soft: #332024;
	--open-bg: #332024;
	--open-fg: #e89a93;
	--resolved-bg: #17332a;
	--resolved-fg: #6fd3a0;
	--code-bg: #0d1117;
	--tok-key: #79c0ff;
	--tok-str: #a5d6ff;
	--tok-num: #ffa657;
	--tok-bool: #d2a8ff;
	--tok-null: #8b949e;
	--tok-ex: #ff7b72;
	--tok-fn: #d2a8ff;
	--tok-loc: #8b949e;
	--chart-line: #7ba3d4;
	--chart-fill: #1f2c40;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.28);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--bg: #10141b;
		--surface: #171d27;
		--surface-2: #1e2532;
		--border: #2b3444;
		--border-soft: #232b39;
		--text: #dbe2ec;
		--muted: #8d99ad;
		--accent: #7ba3d4;
		--accent-strong: #93b6dd;
		--accent-soft: #1f2c40;
		--danger: #e57d75;
		--danger-soft: #332024;
		--open-bg: #332024;
		--open-fg: #e89a93;
		--resolved-bg: #17332a;
		--resolved-fg: #6fd3a0;
	--code-bg: #0d1117;
	--tok-key: #79c0ff;
	--tok-str: #a5d6ff;
	--tok-num: #ffa657;
	--tok-bool: #d2a8ff;
	--tok-null: #8b949e;
	--tok-ex: #ff7b72;
	--tok-fn: #d2a8ff;
	--tok-loc: #8b949e;
	--chart-line: #7ba3d4;
	--chart-fill: #1f2c40;
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.28);
	}
}
* { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 15px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}
.topbar {
	position: sticky;
	top: 0;
	z-index: 10;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
}
.topbar-inner {
	display: flex;
	align-items: center;
	gap: 28px;
	max-width: 1120px;
	margin: 0 auto;
	padding: 12px 24px;
}
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
	color: var(--muted);
	font-weight: 550;
	font-size: 14.5px;
	padding: 7px 12px;
	border-radius: var(--radius-sm);
}
.topbar nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.topbar .brand {
	font-weight: 700;
	font-size: 17px;
	letter-spacing: -0.01em;
	color: var(--text);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-actions form { margin: 0; }
.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--muted);
	cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .icon-sun { display: block; }
	:root:not([data-theme="light"]) .icon-moon { display: none; }
}
.btn-ghost {
	background: transparent;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 6px 13px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 550;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.container { max-width: 1120px; margin: 32px auto 64px; padding: 0 24px; }
.page-head { margin: 8px 0 20px; }
.page-head h1 { margin: 0; }
.page-sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
h1 { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 4px; }
h2 { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 12px; }
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 20px 22px;
	margin: 18px 0;
}
.card > h2:first-child { margin-top: 0; }
.login-card { max-width: 400px; margin: 72px auto; padding: 28px 30px; }
.login-card h1 { margin-top: 0; }
.login-card input {
	width: 100%;
	background: var(--bg);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	margin: 8px 0 16px;
	font-size: 15px;
}
.login-card label { color: var(--muted); font-size: 13px; font-weight: 550; }
.login-card .btn { width: 100%; padding: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2 .card { margin: 0; }
.muted { color: var(--muted); }
.stat { display: inline-block; margin: 4px 28px 4px 0; }
.stat b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; display: block; line-height: 1.2; }
.stat span { font-size: 13px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.table tr:last-child th, .table tr:last-child td { border-bottom: 0; }
.table th {
	color: var(--muted);
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	white-space: nowrap;
}
.table tbody tr:hover td { background: var(--surface-2); }
.pre {
	white-space: pre-wrap;
	word-break: break-word;
	background: var(--code-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 14px 16px;
	font: 13px/1.55 ui-monospace, "Cascadia Mono", "SF Mono", Menlo, monospace;
	max-height: 480px;
	overflow: auto;
}
.tz-local { color: var(--muted); white-space: nowrap; }
.raw-details summary {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	list-style: none;
}
.raw-details summary::-webkit-details-marker { display: none; }
.raw-details .summary-title {
	font-size: 16.5px;
	font-weight: 650;
	letter-spacing: -0.01em;
}
.raw-details .details-arrow::before {
	content: "▸";
	color: var(--muted);
	font-size: 14px;
	transition: transform 0.15s ease;
	display: inline-block;
}
.raw-details[open] .details-arrow::before { transform: rotate(90deg); }
.raw-details .pre { margin-top: 12px; }
.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-bool { color: var(--tok-bool); }
.tok-null { color: var(--tok-null); }
.tok-ex { color: var(--tok-ex); font-weight: 600; }
.tok-frame { color: var(--muted); }
.tok-fn { color: var(--tok-fn); }
.tok-loc { color: var(--tok-loc); }
.btn {
	background: var(--accent);
	color: #fff;
	border: 0;
	border-radius: var(--radius-sm);
	padding: 8px 16px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
}
:root[data-theme="dark"] .btn { color: #0e141d; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .btn { color: #0e141d; }
}
.btn:hover { filter: brightness(1.07); }
.btn-danger { background: var(--danger); }
:root[data-theme="dark"] .btn-danger { color: #1c0f12; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .btn-danger { color: #1c0f12; }
}
.badge {
	display: inline-block;
	padding: 3px 11px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 650;
	letter-spacing: 0.01em;
}
.badge-open { background: var(--open-bg); color: var(--open-fg); }
.badge-resolved { background: var(--resolved-bg); color: var(--resolved-fg); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 14px 0; font-size: 14.5px; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-ok { background: var(--resolved-bg); color: var(--resolved-fg); border: 1px solid color-mix(in srgb, var(--resolved-fg) 30%, transparent); }
.filterbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 4px 0; }
.filterbar label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; }
.filterbar input, .filterbar select {
	background: var(--bg);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: var(--radius-sm);
	padding: 7px 10px;
	font-size: 14px;
}
.filterbar input:focus, .filterbar select:focus { border-color: var(--accent); outline: none; }
.pagination { display: flex; gap: 6px; margin: 18px 0; align-items: center; }
.pagination a {
	min-width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--muted);
	font-size: 14px;
	padding: 0 10px;
}
.pagination a:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.pagination span b {
	min-width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--accent-soft);
	color: var(--accent-strong);
	border-radius: var(--radius-sm);
	padding: 0 10px;
}
.pagination .ellipsis { color: var(--muted); padding: 0 4px; }
.key-display {
	font: 13px ui-monospace, "SF Mono", monospace;
	background: var(--code-bg);
	border: 1px dashed var(--accent);
	padding: 12px 14px;
	border-radius: var(--radius-sm);
	word-break: break-all;
	margin-bottom: 12px;
}
.chart-box { position: relative; height: 260px; }
.chart-box-sm { height: 230px; }
canvas.chartjs { max-width: 100%; }
:root, :root[data-theme="light"] {
	--c1: #3f6ea6;
	--c2: #3d9a78;
	--c3: #c08c2e;
	--c4: #8a6fc0;
	--c5: #c65f7d;
	--c6: #7b8ba1;
}
:root[data-theme="dark"] {
	--c1: #7ba3d4;
	--c2: #6fd3a0;
	--c3: #e0b45f;
	--c4: #b39fe0;
	--c5: #e08aa8;
	--c6: #93a1b5;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--c1: #7ba3d4;
		--c2: #6fd3a0;
		--c3: #e0b45f;
		--c4: #b39fe0;
		--c5: #e08aa8;
		--c6: #93a1b5;
	}
}
.chart-slice-1 { stroke: var(--c1); }
.chart-slice-2 { stroke: var(--c2); }
.chart-slice-3 { stroke: var(--c3); }
.chart-slice-4 { stroke: var(--c4); }
.chart-slice-5 { stroke: var(--c5); }
.chart-slice-6 { stroke: var(--c6); }
.chart-swatch-1 { fill: var(--c1); }
.chart-swatch-2 { fill: var(--c2); }
.chart-swatch-3 { fill: var(--c3); }
.chart-swatch-4 { fill: var(--c4); }
.chart-swatch-5 { fill: var(--c5); }
.chart-swatch-6 { fill: var(--c6); }
form.inline { display: inline; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.danger-zone form { margin-right: 10px; }
input[type="text"], input[type="password"], input[type="date"] {
	background: var(--bg);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: var(--radius-sm);
	padding: 8px 11px;
	font-size: 14.5px;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="date"]:focus {
	border-color: var(--accent);
	outline: none;
}
.footer {
	max-width: 1120px;
	margin: 0 auto;
	padding: 20px 24px 40px;
	color: var(--muted);
	font-size: 13px;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
@media (max-width: 720px) {
	.container { margin-top: 20px; padding: 0 16px; }
	.topbar-inner { padding: 10px 16px; gap: 16px; }
	.topbar nav a { padding: 7px 8px; }
	.grid2 { grid-template-columns: 1fr; }
	.stat { margin-right: 20px; }
	.card { padding: 16px; }
	h1 { font-size: 23px; }
}
