/*!
 * Mayterial Me Swift (v1.0)
 * Created by Maylan @ frizzy-cmd on GitHub
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Keep this header and attribution intact when copying or modifying.
 */

:root {
	--bg: #16181d;
	--surface: #1e2128;
	--surface-2: #252932;
	--text: #b8beca;
	--muted: #7c8494;
	--heading: #e4e8f0;
	--border: #2e333e;
	--link: #6ab0f3;
	--visited: #b57edc;
	--ok: #58c78a;
	--warn: #e5b55c;
	--bad: #e56b6b;
	--max-w: 68ch;
	--fs: 18px;
	--lh: 1.65;
	--pad: 20px;
	--gap: 14px;
}

body.high-contrast {
	--bg: #0c0d10;
	--surface: #14161b;
	--surface-2: #1c2028;
	--text: #f2f4f8;
	--muted: #b0b7c6;
	--heading: #ffffff;
	--border: #565e70;
	--link: #82c7ff;
	--visited: #d49eff;
}

body.inverted {
	filter: invert(1) hue-rotate(180deg);
}

body.wide-layout {
	--max-w: 960px;
}

body.compact-ui {
	--fs: 16px;
	--lh: 1.45;
	--pad: 14px;
	--gap: 10px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 32px 18px 56px;
	background: var(--bg);
	color: var(--text);
	font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: var(--fs);
	line-height: var(--lh);
}

.wrap {
	max-width: var(--max-w);
	margin: 0 auto;
	transition: max-width 0.15s ease;
}

h1, h2, h3 {
	color: var(--heading);
	line-height: 1.25;
	margin-top: 0;
}

h1 {
	font-size: 2rem;
	margin-bottom: 10px;
}

h2 {
	font-size: 1.3rem;
	margin-bottom: 12px;
}

h3 {
	font-size: 1.05rem;
	margin-bottom: 8px;
}

p {
	margin-top: 0;
	margin-bottom: var(--gap);
}

.lead {
	color: var(--muted);
	margin-top: 0;
}

a {
	color: var(--link);
	text-decoration-thickness: 1.5px;
	text-underline-offset: 3px;
}

a:visited {
	color: var(--visited);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
	outline: 2px solid var(--link);
	outline-offset: 2px;
}

.controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0 24px;
}

button {
	background: var(--surface);
	color: var(--heading);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 8px 14px;
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
}

button:hover:not(:disabled) {
	border-color: var(--link);
}

button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

button.is-on {
	border-color: var(--link);
	background: rgba(106, 176, 243, 0.14);
}

button.primary {
	background: rgba(106, 176, 243, 0.18);
	border-color: var(--link);
	color: var(--heading);
}

button.danger {
	border-color: var(--bad);
	color: var(--bad);
}

.panel,
.sample {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: var(--pad);
	margin-bottom: 20px;
}

.sliders,
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--gap);
}

.sliders label,
.field label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.9rem;
}

.field-hint {
	color: var(--muted);
	font-size: 0.82rem;
	margin-top: 4px;
}

.field-error {
	color: var(--bad);
	font-size: 0.82rem;
	margin-top: 4px;
}

.text-input,
.select-input {
	width: 100%;
	background: var(--bg);
	color: var(--heading);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 8px 10px;
	font: inherit;
	font-size: 0.9rem;
}

.text-input:hover:not(:disabled),
.select-input:hover:not(:disabled) {
	border-color: var(--link);
}

.text-input:disabled,
.select-input:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.text-input.is-error,
.select-input.is-error {
	border-color: var(--bad);
}

.check-row {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: var(--gap);
	font-size: 0.9rem;
}

.check-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}

.check-item input {
	accent-color: var(--link);
}

input[type="range"] {
	width: 100%;
	accent-color: var(--link);
}

.card {
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 5px;
	padding: var(--pad);
}

.badge {
	display: inline-block;
	font-size: 0.8rem;
	padding: 2px 8px;
	border-radius: 4px;
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--heading);
}

.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.bad { color: var(--bad); }

.notice {
	border-left: 3px solid var(--link);
	background: var(--bg);
	border-top: 1px solid var(--border);
	border-right: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	border-radius: 4px;
	padding: 10px 14px;
	margin: var(--gap) 0;
	font-size: 0.92rem;
}

.tablist {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	border-bottom: 1px solid var(--border);
	padding-bottom: 10px;
	margin-bottom: var(--gap);
}

.tab-btn[aria-selected="true"] {
	border-color: var(--link);
	background: rgba(106, 176, 243, 0.16);
}

.tabpanel {
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 5px;
	padding: var(--pad);
}

dialog.modal {
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: var(--pad);
	max-width: 460px;
	width: calc(100% - 32px);
}

dialog.modal::backdrop {
	background: rgba(0, 0, 0, 0.65);
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: var(--gap);
}

.table-wrap {
	overflow-x: auto;
	margin: var(--gap) 0;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

th, td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid var(--border);
}

th {
	color: var(--heading);
	font-weight: 600;
}

.ant-text {
	font-size: 8px;
	color: var(--muted);
}

blockquote {
	margin: 18px 0;
	padding: 6px 0 6px 16px;
	border-left: 3px solid var(--border);
	color: var(--muted);
	font-style: italic;
}

code,
pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 4px;
}

code {
	padding: 1px 5px;
	font-size: 0.88em;
}

pre {
	padding: 12px;
	font-size: 0.85rem;
	overflow-x: auto;
	margin: 16px 0 0;
	color: var(--muted);
}

.foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: var(--muted);
	font-size: 0.85rem;
	padding-top: 8px;
}

.foot-theme {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.foot-theme select {
	background: var(--surface);
	color: var(--heading);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 4px 8px;
	font: inherit;
	font-size: 0.85rem;
}