:root {
	--bg: #101010;
	--panel: #171717;
	--sidebar: #141414;
	--border: #2a2a2a;
	--text: #ececec;
	--muted: #8b8b8b;
	--accent: #3b82f6;
	--selected: #1d4ed8;
	--get: #22c55e;
	--post: #3b82f6;
	--put: #f59e0b;
	--patch: #eab308;
	--delete: #ef4444;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background: var(--bg);
	color: var(--text);
	font:
		14px / 1.4 system-ui,
		sans-serif;
}

button,
input {
	font: inherit;
	color: inherit;
}

.top {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--border);
	background: #0c0c0c;
}

.brand {
	font-weight: 700;
	letter-spacing: 0.02em;
}

.url {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.url code {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--muted);
}

button {
	background: var(--accent);
	border: 0;
	border-radius: 4px;
	padding: 6px 10px;
	cursor: pointer;
	white-space: nowrap;
	transition:
		transform 0.08s ease,
		filter 0.08s ease,
		background 0.08s ease;
}

button:hover {
	filter: brightness(1.1);
}

button:active {
	transform: scale(0.96) translateY(1px);
	filter: brightness(0.85);
}

button.ghost {
	background: transparent;
	border: 1px solid var(--border);
	padding: 4px 8px;
	font-size: 12px;
}

button.ghost:hover {
	filter: none;
	background: #222;
}

button.ghost:active {
	filter: none;
	background: #333;
}

.layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	align-items: start;
}

.sidebar {
	position: sticky;
	top: 49px;
	height: calc(100vh - 49px);
	display: flex;
	flex-direction: column;
	background: var(--sidebar);
	border-right: 1px solid var(--border);
}

.sidebar-head {
	display: flex;
	justify-content: space-between;
	padding: 12px;
	border-bottom: 1px solid var(--border);
	font-size: 12px;
	font-weight: 600;
}

.muted {
	color: var(--muted);
	font-weight: 400;
}

#list {
	list-style: none;
	margin: 0;
	padding: 0;
	overflow: auto;
}

#list li {
	display: grid;
	grid-template-columns: 8px auto 1fr;
	gap: 2px 8px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
	cursor: pointer;
}

#list li.unread {
	font-weight: 600;
}

#list li.read {
	color: var(--muted);
	font-weight: 400;
}

.dot {
	grid-row: 1 / span 2;
	align-self: center;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
}

#list li.read .dot {
	visibility: hidden;
}

#list li:hover {
	background: #1c1c1c;
}

#list li.selected {
	background: var(--selected);
	color: var(--text);
}

.meta {
	color: var(--muted);
	font-size: 12px;
}

.ip {
	grid-column: 3;
}

#list li .meta:last-child {
	grid-column: 2 / -1;
}

.main {
	min-width: 0;
}

.panel {
	display: flex;
	flex-direction: column;
	border-bottom: 1px solid var(--border);
}

.panel-title {
	padding: 10px 16px;
	border-bottom: 1px solid var(--border);
	background: var(--panel);
	font-weight: 600;
	font-size: 13px;
}

.panel-title.row {
	display: flex;
	align-items: center;
	gap: 16px;
}

.panel-title.row span:first-child {
	margin-right: auto;
}

.panel-title label {
	color: var(--muted);
	font-weight: 400;
	display: flex;
	align-items: center;
	gap: 6px;
}

.empty {
	padding: 24px 16px;
	color: var(--muted);
}

.details-grid {
	display: grid;
	grid-template-columns: minmax(280px, 1fr) 1.4fr;
	min-height: 0;
}

.info,
.headers {
	padding: 16px;
	overflow: auto;
}

.headers {
	border-left: 1px solid var(--border);
}

.kv {
	display: grid;
	grid-template-columns: 100px 1fr;
	gap: 6px 12px;
	align-items: start;
}

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

.kv dd {
	margin: 0;
	word-break: break-all;
}

.headers .kv {
	grid-template-columns: minmax(120px, 180px) 1fr;
	font-family: ui-monospace, monospace;
	font-size: 12px;
}

.headers .fox {
	color: #fb923c;
}

.method {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	background: #525252;
}

.method.GET {
	background: var(--get);
	color: #052e16;
}
.method.POST {
	background: var(--post);
}
.method.PUT {
	background: var(--put);
	color: #1c1000;
}
.method.PATCH {
	background: var(--patch);
	color: #1c1400;
}
.method.DELETE {
	background: var(--delete);
}

.content pre {
	margin: 0;
	padding: 16px;
	overflow: visible;
	font:
		13px / 1.5 ui-monospace,
		monospace;
	background: #0c0c0c;
}

.content pre.wrap {
	white-space: pre-wrap;
	word-break: break-word;
}

.key {
	color: #7dd3fc;
}
.string {
	color: #86efac;
}
.number {
	color: #f87171;
}
.boolean,
.null {
	color: #c4b5fd;
}
