:root {
	--bg: #f4f7fb;
	--surface: #ffffff;
	--surface-soft: #f8fafc;
	--line: #d7dee8;
	--text: #182133;
	--muted: #627089;
	--brand: #12a594;
	--brand-strong: #087a70;
	--blue: #2e6de6;
	--amber: #b46a00;
	--red: #c43d4b;
	--shadow: 0 14px 34px rgba(27, 39, 65, 0.1);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	color: var(--text);
	background: var(--bg);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	letter-spacing: 0;
}

button,
input,
select,
textarea {
	font: inherit;
}

button,
a {
	-webkit-tap-highlight-color: transparent;
}

a {
	color: inherit;
	text-decoration: none;
}

.app-shell {
	width: min(1440px, calc(100% - 28px));
	margin: 0 auto;
	padding: 22px 0 34px;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 4px 0 18px;
}

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

.brand-mark {
	display: grid;
	width: 42px;
	height: 42px;
	flex: 0 0 auto;
	place-items: center;
	border-radius: 8px;
	color: #ffffff;
	background: var(--brand);
	font-size: 20px;
	font-weight: 800;
}

.brand h1,
.panel-header h2,
.section-heading h2 {
	margin: 0;
}

.brand h1 {
	font-size: 21px;
	line-height: 1.25;
}

.brand p,
.path-preview,
.eyebrow,
.section-heading span {
	color: var(--muted);
}

.brand p {
	margin: 3px 0 0;
	font-size: 13px;
}

.nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.nav a,
button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	border: 1px solid var(--line);
	border-radius: 7px;
	padding: 0 12px;
	color: var(--text);
	background: var(--surface);
	font-weight: 650;
	cursor: pointer;
}

button.primary {
	border-color: var(--brand);
	color: #ffffff;
	background: var(--brand);
}

button:disabled {
	cursor: not-allowed;
	opacity: 0.58;
}

.workspace {
	display: grid;
	grid-template-columns: minmax(260px, 330px) minmax(380px, 1fr) minmax(360px, 0.95fr);
	gap: 16px;
	align-items: start;
}

.sidebar,
.request-panel,
.result-panel > div {
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.sidebar {
	overflow: hidden;
}

.filters {
	padding: 14px;
	border-bottom: 1px solid var(--line);
	background: var(--surface-soft);
}

.filter-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 10px;
}

.field {
	display: grid;
	gap: 6px;
}

.field span {
	color: var(--muted);
	font-size: 12px;
	font-weight: 700;
}

input,
select,
textarea {
	width: 100%;
	min-width: 0;
	border: 1px solid var(--line);
	border-radius: 7px;
	padding: 10px 11px;
	color: var(--text);
	background: #ffffff;
	outline: none;
}

textarea {
	resize: vertical;
	min-height: 160px;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
	font-size: 13px;
	line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(18, 165, 148, 0.16);
}

.endpoint-list {
	max-height: calc(100vh - 170px);
	overflow: auto;
	padding: 8px;
}

.endpoint-item {
	width: 100%;
	justify-content: flex-start;
	min-height: 58px;
	margin: 0 0 6px;
	border-color: transparent;
	background: transparent;
	text-align: left;
}

.endpoint-item[aria-selected='true'] {
	border-color: rgba(18, 165, 148, 0.35);
	background: rgba(18, 165, 148, 0.1);
}

.endpoint-title {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.endpoint-name {
	overflow: hidden;
	font-weight: 750;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.endpoint-path {
	display: block;
	margin-top: 4px;
	overflow: hidden;
	color: var(--muted);
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
	font-size: 12px;
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.method-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 52px;
	height: 28px;
	border-radius: 999px;
	padding: 0 10px;
	color: #ffffff;
	background: var(--blue);
	font-size: 12px;
	font-weight: 800;
}

.method-pill[data-method='POST'] {
	background: var(--amber);
}

.method-pill[data-method='DELETE'] {
	background: var(--red);
}

.request-panel,
.response-box,
.log-box {
	padding: 16px;
}

.panel-header {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--line);
}

.panel-header h2 {
	font-size: 22px;
}

.eyebrow {
	margin: 0 0 5px;
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
}

.path-preview {
	margin: 6px 0 0;
	overflow-wrap: anywhere;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
	font-size: 13px;
}

.request-form {
	display: grid;
	gap: 14px;
	padding-top: 16px;
}

.param-section {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.param-section:empty {
	display: none;
}

.param-title {
	grid-column: 1 / -1;
	margin: 2px 0 -4px;
	color: var(--text);
	font-size: 13px;
	font-weight: 800;
}

.required {
	color: var(--red);
}

.body-editor.hidden {
	display: none;
}

.url-box {
	min-height: 44px;
	border: 1px solid var(--line);
	border-radius: 7px;
	padding: 11px 12px;
	overflow-wrap: anywhere;
	background: var(--surface-soft);
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
	font-size: 13px;
}

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

.result-panel {
	display: grid;
	gap: 16px;
}

.section-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.section-heading h2 {
	font-size: 18px;
}

#response-output {
	min-height: 280px;
	max-height: 52vh;
	margin: 0;
	overflow: auto;
	border-radius: 7px;
	padding: 12px;
	color: #d9f1e8;
	background: #122026;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
	font-size: 13px;
	line-height: 1.55;
	white-space: pre-wrap;
}

.request-logs {
	display: grid;
	gap: 8px;
	max-height: 260px;
	overflow: auto;
}

.log-item {
	border: 1px solid var(--line);
	border-radius: 7px;
	padding: 9px 10px;
	background: var(--surface-soft);
}

.log-item strong {
	display: block;
	overflow-wrap: anywhere;
}

.log-item span {
	display: block;
	margin-top: 3px;
	color: var(--muted);
	font-size: 12px;
}

.empty-state {
	margin: 0;
	color: var(--muted);
	font-size: 14px;
}

@media (max-width: 1180px) {
	.workspace {
		grid-template-columns: 300px minmax(0, 1fr);
	}

	.result-panel {
		grid-column: 1 / -1;
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 820px) {
	.app-shell {
		width: min(100% - 20px, 760px);
	}

	.topbar,
	.panel-header,
	.section-heading {
		align-items: flex-start;
		flex-direction: column;
	}

	.workspace,
	.result-panel {
		grid-template-columns: 1fr;
	}

	.endpoint-list {
		max-height: 360px;
	}

	.param-section,
	.filter-grid {
		grid-template-columns: 1fr;
	}
}
