:root {
	--bg: #0b0f14;
	--surface: #141b24;
	--surface-hover: #1a2430;
	--border: #243044;
	--text: #e8eef5;
	--muted: #8fa3b8;
	--accent: #f7931a;
	--accent-soft: rgba(247, 147, 26, 0.12);
	--link: #5eb3ff;
	--radius: 12px;
	--max-width: 1200px;
	--fs-xs: 0.8125rem;
	--fs-sm: 0.9375rem;
	--fs-md: 1.0625rem;
	--fs-lg: 1.1875rem;
	--fs-xl: 1.3125rem;
	--fs-2xl: 1.5rem;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-family:
		'Segoe UI',
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		sans-serif;
	font-size: 17px;
	background: var(--bg);
	color: var(--text);
	line-height: 1.65;
}

body {
	margin: 0;
	min-height: 100vh;
}

a {
	color: var(--link);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

main {
	width: min(100% - 2rem, var(--max-width));
	margin: 0 auto;
	padding: 2rem 0 4rem;
}

.badge {
	display: inline-block;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	font-size: var(--fs-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: var(--accent-soft);
	color: var(--accent);
}

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

.site-header {
	border-bottom: 1px solid var(--border);
	background: var(--surface);
}

.inner {
	width: min(100% - 2rem, var(--max-width));
	margin: 0 auto;
	padding: 1.25rem 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--text);
	font-size: var(--fs-xl);
	font-weight: 700;
	text-decoration: none;
}

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

.mark {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 8px;
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 800;
	font-size: var(--fs-lg);
}

.nav {
	font-size: var(--fs-sm);
}

.site-footer {
	border-top: 1px solid var(--border);
	margin-top: 2rem;
}

.site-footer .inner {
	display: block;
}

.site-footer p {
	margin: 0;
	font-size: var(--fs-sm);
}

.hero {
	margin-bottom: 2rem;
}

.hero h1 {
	margin: 0.75rem 0 0.35rem;
	font-size: clamp(2.25rem, 5vw, 3rem);
	line-height: 1.1;
}

.lede {
	margin: 0;
	font-size: var(--fs-md);
}

.feed {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: 1.25rem;
}

.card {
	container-type: inline-size;
	padding: 1.25rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.card:hover {
	border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
	background: var(--surface-hover);
}

.card-title {
	--title-font: 1.3rem;
	--title-lh: 1.35;
	--title-lines: 3;
	--title-height: calc(var(--title-font) * var(--title-lh) * var(--title-lines));
	margin: 0 0 0.85rem;
	height: var(--title-height);
	overflow: hidden;
}

.card-title a {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: break-word;
	height: var(--title-height);
	max-height: var(--title-height);
	font-size: var(--title-font);
	line-height: var(--title-lh);
	font-weight: 700;
	color: var(--text);
	text-decoration: none;
}

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

.card-row {
	display: grid;
	grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
	gap: 0.85rem;
	align-items: start;
}

.card-thumb {
	display: block;
	overflow: hidden;
	border-radius: 6px;
	background: var(--bg);
	border: 1px solid var(--border);
}

.card-thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.card:hover .card-thumb img {
	transform: scale(1.03);
}

.card-excerpt .summary {
	margin: 0;
	font-size: var(--fs-md);
	line-height: 1.55;
	color: var(--muted);
}

.card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin: 0.65rem 0 0;
	font-size: var(--fs-sm);
}

@container (max-width: 300px) {
	.card-row {
		grid-template-columns: 1fr;
		gap: 0.65rem;
	}

	.card-title {
		--title-font: 1.2rem;
	}

	.card-excerpt .summary {
		font-size: var(--fs-sm);
	}
}

.read-more {
	font-weight: 600;
}

.article .back,
.prices-page .back,
.upload .back {
	margin: 0 0 1.5rem;
	font-size: var(--fs-sm);
}

.article .meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.article h1 {
	margin: 0 0 0.5rem;
	font-size: clamp(1.9rem, 4vw, 2.75rem);
	line-height: 1.15;
}

.article-thumb {
	margin: 0 0 1.5rem;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--border);
}

.article-thumb img {
	display: block;
	width: 100%;
	max-height: 420px;
	object-fit: cover;
}

.manage-thumb-cell {
	width: 4.5rem;
}

.manage-thumb {
	width: 3.5rem;
	height: 3.5rem;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--border);
}

.article .byline {
	margin: 0 0 1.5rem;
	font-size: var(--fs-sm);
}

.article .summary {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	border-left: 3px solid var(--accent);
	background: var(--surface);
	border-radius: 0 var(--radius) var(--radius) 0;
	font-size: var(--fs-lg);
	color: var(--muted);
}

.article .body p,
.article .body li {
	font-size: var(--fs-md);
}

.article .body p {
	margin: 0 0 1rem;
}

.article .body h2 {
	margin: 1.75rem 0 0.75rem;
	font-size: var(--fs-xl);
	line-height: 1.25;
}

.article .body h3 {
	margin: 1.25rem 0 0.5rem;
	font-size: var(--fs-lg);
	line-height: 1.3;
}

.article .body blockquote {
	margin: 1rem 0;
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--accent);
	background: var(--surface);
	color: var(--muted);
}

.article .body ul {
	margin: 0 0 1rem;
	padding-left: 1.25rem;
}

.article .body code {
	padding: 0.1rem 0.35rem;
	border-radius: 4px;
	background: var(--surface);
	font-size: 0.9em;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 2rem 0 0;
	padding: 0;
	list-style: none;
}

.tags li {
	padding: 0.25rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: var(--fs-xs);
	color: var(--muted);
}

.empty {
	text-align: center;
	padding: 2rem;
	font-size: var(--fs-md);
}

.nav a {
	font-weight: 600;
}

.upload h1,
.manage h1 {
	margin: 0 0 0.5rem;
	font-size: clamp(1.9rem, 4vw, 2.5rem);
}

.article-form {
	display: grid;
	gap: 1.25rem;
	margin-top: 1.5rem;
	padding: 1.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.article-form label {
	display: grid;
	gap: 0.4rem;
	font-size: var(--fs-sm);
	font-weight: 600;
}

.article-form label em {
	color: var(--accent);
	font-style: normal;
}

.article-form input,
.article-form textarea {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg);
	color: var(--text);
	font: inherit;
	line-height: 1.5;
}

.article-form input:focus,
.article-form textarea:focus {
	outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
	border-color: var(--accent);
}

.article-form textarea {
	resize: vertical;
	min-height: 6rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: var(--fs-sm);
}

.form-row {
	display: grid;
	gap: 1.25rem;
}

@media (min-width: 640px) {
	.form-row {
		grid-template-columns: 1fr 1fr;
	}
}

.btn-primary {
	justify-self: start;
	padding: 0.7rem 1.25rem;
	border: none;
	border-radius: 8px;
	background: var(--accent);
	color: #1a1000;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.btn-primary:hover {
	filter: brightness(1.08);
}

.form-error {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	background: rgba(255, 90, 90, 0.12);
	color: #ff8a8a;
	font-size: var(--fs-sm);
}

.prices-page h1 {
	margin: 0.75rem 0 0.35rem;
	font-size: clamp(2.25rem, 5vw, 2.85rem);
}

.price-grid {
	display: grid;
	gap: 1.25rem;
	margin: 1.5rem 0;
}

@media (min-width: 768px) {
	.price-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.price-panel {
	padding: 1.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.price-panel.wide {
	margin-top: 0.25rem;
}

.price-panel h2 {
	margin: 0 0 0.35rem;
	font-size: var(--fs-xl);
}

.panel-source {
	margin: 0 0 1rem;
	font-size: var(--fs-sm);
}

.price-hero {
	display: grid;
	gap: 1rem;
}

@media (min-width: 480px) {
	.price-hero {
		grid-template-columns: 1fr 1fr;
	}
}

.price-hero .label,
.oil-item .muted {
	display: block;
	font-size: var(--fs-xs);
	color: var(--muted);
	margin-bottom: 0.25rem;
}

.price-hero .value,
.oil-quote strong {
	font-size: var(--fs-2xl);
}

.change {
	display: inline-block;
	margin-top: 0.35rem;
	font-size: var(--fs-sm);
	font-weight: 600;
}

.change.up {
	color: #6ee7a0;
}

.change.down {
	color: #ff8a8a;
}

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

.unit {
	margin: 0.75rem 0 0;
	font-size: var(--fs-xs);
}

.oil-list {
	display: grid;
	gap: 0.85rem;
}

.oil-item,
.oil-quote {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.table-wrap {
	overflow-x: auto;
}

.price-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-md);
}

.price-table th,
.price-table td {
	padding: 0.75rem 0.5rem;
	border-bottom: 1px solid var(--border);
	text-align: left;
}

.price-table th:not(:first-child),
.price-table td:not(:first-child) {
	text-align: right;
	white-space: nowrap;
}

.price-table thead th {
	font-size: var(--fs-xs);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
}

.fx-converter {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--border);
}

.fx-converter h3 {
	margin: 0 0 0.85rem;
	font-size: var(--fs-md);
}

.fx-row {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 0.75rem;
	align-items: end;
}

.fx-row label {
	display: grid;
	gap: 0.35rem;
	font-size: var(--fs-sm);
	font-weight: 600;
}

.fx-row input {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg);
	color: var(--text);
	font: inherit;
}

.fx-row input:focus {
	outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
	border-color: var(--accent);
}

.fx-swap {
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--bg);
	color: var(--accent);
	font-size: 1.1rem;
	cursor: pointer;
}

.fx-swap:hover {
	border-color: var(--accent);
	background: var(--accent-soft);
}

.fx-summary {
	margin: 0.75rem 0 0;
	font-size: var(--fs-sm);
}

.upload-gate {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: rgba(11, 15, 20, 0.82);
	backdrop-filter: blur(4px);
}

.upload-gate-card {
	width: min(100%, 22rem);
	display: grid;
	gap: 0.85rem;
	padding: 1.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.upload-gate-card h2 {
	margin: 0;
	font-size: var(--fs-xl);
}

.upload-gate-card label {
	display: grid;
	gap: 0.4rem;
	font-size: var(--fs-sm);
	font-weight: 600;
}

.upload-gate-card input {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg);
	color: var(--text);
	font: inherit;
}

.upload-locked {
	visibility: hidden;
	height: 0;
	overflow: hidden;
}

.upload-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.upload-toolbar h1 {
	margin: 0 0 0.35rem;
}

.btn-secondary {
	display: inline-flex;
	align-items: center;
	padding: 0.65rem 1rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.btn-secondary:hover {
	border-color: var(--accent);
	color: var(--accent);
	text-decoration: none;
}

.manage-table .manage-slug {
	display: block;
	font-size: var(--fs-xs);
	margin-top: 0.2rem;
}

.manage-table .nowrap {
	white-space: nowrap;
}

.manage-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	justify-content: flex-end;
}

.manage-actions form {
	margin: 0;
}

.badge-on {
	background: rgba(110, 231, 160, 0.15);
	color: #6ee7a0;
}

.badge-off {
	background: rgba(255, 138, 138, 0.12);
	color: #ff8a8a;
}

.api-docs h1 {
	margin: 0.5rem 0 0.75rem;
	font-size: clamp(1.75rem, 3vw, 2.35rem);
}

.api-docs .lede {
	color: var(--muted);
	max-width: 72ch;
	margin-bottom: 1.5rem;
}

.api-toc {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin-bottom: 2rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	font-size: var(--fs-sm);
}

.api-curl {
	overflow-x: auto;
	padding: 1rem 1.1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: #0a0e13;
	font-size: var(--fs-sm);
	line-height: 1.5;
}

.api-curl code {
	font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, monospace;
	white-space: pre;
}

.api-table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0 2rem;
	font-size: var(--fs-md);
}

.api-table th,
.api-table td {
	border: 1px solid var(--border);
	padding: 0.55rem 0.75rem;
	text-align: left;
	vertical-align: top;
}

.api-table th {
	background: var(--surface);
}

.api-table code {
	font-size: 0.85em;
}

.api-rules {
	max-width: 72ch;
	padding-left: 1.25rem;
}

.api-rules li {
	margin-bottom: 0.65rem;
}

.api-docs h2 {
	margin-top: 2.25rem;
	font-size: var(--fs-lg);
}

.api-foot {
	margin-top: 2.5rem;
}

.view-count {
	margin: 0.35rem 0 0;
	font-size: var(--fs-sm);
}

.comments {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--border);
}

.comments-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.comments-header h2 {
	margin: 0.5rem 0 0.25rem;
	font-size: var(--fs-xl);
}

.comments-lede {
	margin: 0;
	font-size: var(--fs-sm);
}

.comment-count {
	display: grid;
	place-items: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.5rem;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: var(--fs-sm);
	font-weight: 700;
}

.comment-list {
	margin: 0 0 1.75rem;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.85rem;
}

.comment-item {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.85rem;
	padding: 1rem 1.1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.comment-avatar {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: var(--fs-sm);
	font-weight: 800;
	flex-shrink: 0;
}

.comment-main {
	min-width: 0;
}

.comment-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.65rem;
	margin-bottom: 0.4rem;
}

.comment-author {
	font-size: var(--fs-sm);
	color: var(--text);
}

.comment-head time {
	font-size: var(--fs-xs);
}

.comment-body {
	margin: 0;
	font-size: var(--fs-md);
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-word;
}

.comment-empty {
	margin: 0 0 1.75rem;
	padding: 1.25rem 1.5rem;
	border: 1px dashed var(--border);
	border-radius: var(--radius);
	background: color-mix(in srgb, var(--surface) 80%, transparent);
	text-align: center;
}

.comment-empty p {
	margin: 0;
}

.comment-empty p + p {
	margin-top: 0.35rem;
	font-size: var(--fs-sm);
}

.comment-compose {
	padding: 1.35rem 1.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 70%, var(--bg)) 100%);
}

.comment-compose h3 {
	margin: 0 0 1rem;
	font-size: var(--fs-md);
	font-weight: 700;
}

.comment-form {
	display: block;
}

.comment-fields {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
}

.comment-field {
	display: grid;
	gap: 0.45rem;
	font-size: var(--fs-sm);
	font-weight: 600;
}

.comment-field span {
	color: var(--muted);
}

.comment-field input,
.comment-field textarea {
	width: 100%;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--bg);
	color: var(--text);
	font-family: inherit;
	font-size: var(--fs-md);
	line-height: 1.55;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comment-field input {
	max-width: 18rem;
}

.comment-field textarea {
	resize: vertical;
	min-height: 7.5rem;
}

.comment-field input::placeholder,
.comment-field textarea::placeholder {
	color: color-mix(in srgb, var(--muted) 75%, transparent);
}

.comment-field input:focus,
.comment-field textarea:focus {
	outline: none;
	border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.comment-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin-top: 1.1rem;
	padding-top: 1.1rem;
	border-top: 1px solid var(--border);
}

.btn-comment {
	padding: 0.65rem 1.15rem;
	border: none;
	border-radius: 8px;
	background: var(--accent);
	color: #1a1000;
	font: inherit;
	font-size: var(--fs-sm);
	font-weight: 700;
	cursor: pointer;
}

.btn-comment:hover {
	filter: brightness(1.08);
}

.comment-hint {
	margin: 0;
	font-size: var(--fs-xs);
}

.comment-form .form-error {
	margin: 0 0 1rem;
}
