/* ===== BASE.CSS ===== */

/* Base CSS - Reset, Variables, and Foundation */

/* CSS Reset */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 16px;
	-webkit-text-size-adjust: 100%;
}

body {
	min-height: 100vh;
	line-height: 1.6;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

/* CSS Variables - Default (Light Mode) */
:root {
	/* Colors */
	--color-bg: #ffffff;
	--color-surface: #f3f3f3;
	--color-surface-hover: #e8e8e8;
	--color-text: #1a1a1a;
	--color-text-muted: #666666;
	--color-border: #e0e0e0;
	--color-border-strong: #cccccc;

	/* Accent Colors (Default Blue - Windows Phone style) */
	--color-accent: #0078d4;
	--color-accent-hover: #106ebe;
	--color-accent-text: #ffffff;

	/* Semantic Colors */
	--color-error: #d13438;
	--color-error-bg: #fdf3f4;
	--color-success: #107c10;
	--color-success-bg: #f3faf3;
	--color-warning: #ffc107;
	--color-warning-bg: #fffbf0;
	--color-info: #0078d4;
	--color-info-bg: #f0f7ff;

	/* Typography */
	--font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--font-mono: 'Cascadia Code', 'Fira Code', Consolas, Monaco, 'Courier New', monospace;

	--font-size-xs: 0.75rem;
	--font-size-sm: 0.875rem;
	--font-size-base: 1rem;
	--font-size-lg: 1.125rem;
	--font-size-xl: 1.25rem;
	--font-size-2xl: 1.5rem;
	--font-size-3xl: 1.875rem;
	--font-size-4xl: 2.25rem;

	--font-weight-normal: 400;
	--font-weight-medium: 500;
	--font-weight-semibold: 600;
	--font-weight-bold: 700;
	--font-weight-light: 300;

	--line-height-tight: 1.25;
	--line-height-normal: 1.6;
	--line-height-relaxed: 1.75;

	/* Spacing */
	--space-xs: 0.25rem;
	--space-sm: 0.5rem;
	--space-md: 1rem;
	--space-lg: 1.5rem;
	--space-xl: 2rem;
	--space-xxl: 3rem;

	/* Borders */
	--border-radius: 0;
	--border-width: 1px;

	/* Shadows (minimal for flat design) */
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

	/* Transitions */
	--transition-fast: 150ms ease;
	--transition-base: 200ms ease;
}

/* Dark Mode - Automatic */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		--color-bg: #1e1e1e;
		--color-surface: #2d2d2d;
		--color-surface-hover: #3d3d3d;
		--color-text: #e0e0e0;
		--color-text-muted: #a0a0a0;
		--color-border: #404040;
		--color-border-strong: #505050;

		--color-accent: #4fc3f7;
		--color-accent-hover: #29b6f6;
		--color-accent-text: #1a1a1a;

		--color-error-bg: #3d1f1f;
		--color-success-bg: #1f3d1f;
		--color-warning: #b8860b;
		--color-warning-bg: #3d331f;
		--color-info-bg: #1f2d3d;
	}
}

/* Light Mode Override */
:root[data-theme="light"] {
	--color-bg: #ffffff;
	--color-surface: #f3f3f3;
	--color-surface-hover: #e8e8e8;
	--color-text: #1a1a1a;
	--color-text-muted: #666666;
	--color-border: #e0e0e0;
	--color-border-strong: #cccccc;

	--color-accent: #0078d4;
	--color-accent-hover: #106ebe;
	--color-accent-text: #ffffff;

	--color-error-bg: #fdf3f4;
	--color-success-bg: #f3faf3;
	--color-warning-bg: #fffbf0;
	--color-info-bg: #f0f7ff;
}

/* Dark Mode Override */
:root[data-theme="dark"] {
	--color-bg: #1e1e1e;
	--color-surface: #2d2d2d;
	--color-surface-hover: #3d3d3d;
	--color-text: #e0e0e0;
	--color-text-muted: #a0a0a0;
	--color-border: #404040;
	--color-border-strong: #505050;

	--color-accent: #4fc3f7;
	--color-accent-hover: #29b6f6;
	--color-accent-text: #1a1a1a;

	--color-error-bg: #3d1f1f;
	--color-success-bg: #1f3d1f;
	--color-warning-bg: #3d331f;
	--color-info-bg: #1f2d3d;
}

/* Base Body Styles */
body {
	background-color: var(--color-bg);
	color: var(--color-text);
}


.accent-blue, :root.accent-blue {
	--color-accent: #0078d4;
	--color-accent-hover: #106ebe;
	--color-accent-text: #ffffff;
}

.accent-teal, :root.accent-teal {
	--color-accent: #00aba9;
	--color-accent-hover: #008988;
	--color-accent-text: #ffffff;
}

.accent-mango, :root.accent-mango {
	--color-accent: #f09609;
	--color-accent-hover: #d48208;
	--color-accent-text: #1a1a1a;
}

.accent-orange, :root.accent-orange {
	--color-accent: #f7630c;
	--color-accent-hover: #d4520b;
	--color-accent-text: #ffffff;
}

.accent-pink, :root.accent-pink {
	--color-accent: #e3008c;
	--color-accent-hover: #c4007a;
	--color-accent-text: #ffffff;
}

.accent-purple, :root.accent-purple {
	--color-accent: #a200ff;
	--color-accent-hover: #8800d9;
	--color-accent-text: #ffffff;
}

.accent-lime, :root.accent-lime {
	--color-accent: #8cbf26;
	--color-accent-hover: #7aa820;
	--color-accent-text: #1a1a1a;
}

.accent-green, :root.accent-green {
	--color-accent: #339933;
	--color-accent-hover: #2d822d;
	--color-accent-text: #ffffff;
}

.accent-red, :root.accent-red {
	--color-accent: #e51400;
	--color-accent-hover: #c41200;
	--color-accent-text: #ffffff;
}

.accent-crimson, :root.accent-crimson {
	--color-accent: #d13438;
	--color-accent-hover: #b92d31;
	--color-accent-text: #ffffff;
}


/* ===== TYPOGRAPHY.CSS ===== */

/* Typography - Headings, Text Elements, Lists */

/* Headings - Windows Phone 8 Style: Large, Typography-driven */
h1, h2, h3, h4, h5, h6 {
	font-weight: var(--font-weight-light);
	line-height: var(--line-height-tight);
	margin-bottom: var(--space-md);
	color: var(--color-text);
}

h1 {
	font-size: var(--font-size-4xl);
	font-weight: var(--font-weight-light);
	letter-spacing: -0.02em;
	margin-top: var(--space-xl);
}

h2 {
	font-size: var(--font-size-3xl);
	font-weight: var(--font-weight-light);
	margin-top: var(--space-lg);
}

h3 {
	font-size: var(--font-size-2xl);
	font-weight: var(--font-weight-normal);
	margin-top: var(--space-lg);
}

h4 {
	font-size: var(--font-size-xl);
	font-weight: var(--font-weight-semibold);
	margin-top: var(--space-md);
}

h5 {
	font-size: var(--font-size-lg);
	font-weight: var(--font-weight-semibold);
	margin-top: var(--space-md);
}

h6 {
	font-size: var(--font-size-base);
	font-weight: var(--font-weight-bold);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: var(--space-md);
}

/* Paragraphs */
p {
	margin-bottom: var(--space-md);
	max-width: 70ch;
}

/* Links */
a {
	color: var(--color-accent);
	text-decoration: none;
	transition: color var(--transition-fast);

	&:hover {
		color: var(--color-accent-hover);
		text-decoration: underline;
	}

	&:focus-visible {
		outline: 2px solid var(--color-accent);
		outline-offset: 2px;
	}
}

/* Strong and Emphasis */
strong, b {
	font-weight: var(--font-weight-bold);
}

em, i {
	font-style: italic;
}

/* Small Text */
small {
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
}

/* Mark/Highlight - works in both light and dark modes */
mark {
	background-color: var(--color-warning);
	color: var(--color-text);
	padding: 0.125rem 0.25rem;
}

/* Deleted and Inserted Text */
del {
	text-decoration: line-through;
	color: var(--color-text-muted);
}

ins {
	text-decoration: none;
	border-bottom: 2px solid var(--color-success);
}

/* Subscript and Superscript */
sub, sup {
	font-size: var(--font-size-xs);
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}

sub {
	bottom: -0.25em;
}

sup {
	top: -0.5em;
}

/* Abbreviations */
abbr[title] {
	border-bottom: 1px dotted var(--color-text-muted);
	cursor: help;
	text-decoration: none;
}

/* Quotes */
cite {
	font-style: italic;
	color: var(--color-text-muted);
}

q {
	quotes: '"' '"' "'" "'";
}

/* Lists */
ul, ol {
	margin-bottom: var(--space-md);
	padding-left: var(--space-lg);

	li {
		margin-bottom: var(--space-xs);
	}
}

ul {
	list-style-type: disc;

	ul {
		list-style-type: circle;
		margin-top: var(--space-xs);
	}
}

ol {
	list-style-type: decimal;

	ol {
		list-style-type: lower-alpha;
		margin-top: var(--space-xs);
	}
}

/* Definition Lists */
dl {
	margin-bottom: var(--space-md);
}

dt {
	font-weight: var(--font-weight-semibold);
	margin-top: var(--space-sm);
}

dd {
	margin-left: var(--space-lg);
	margin-bottom: var(--space-sm);
	color: var(--color-text-muted);
}

/* Horizontal Rule - Strong horizontal line (WP8 style) */
hr {
	border: none;
	border-top: var(--border-width) solid var(--color-border);
	margin: var(--space-xl) 0;

	&[data-size="sm"] {
		margin: var(--space-md) 0;
	}

	&[data-size="lg"] {
		margin: var(--space-xxl) 0;
		border-top-width: 2px;
	}
}

/* Preformatted Text */
pre {
	font-family: var(--font-mono);
	font-size: var(--font-size-sm);
	line-height: var(--line-height-normal);
	background-color: var(--color-surface);
	padding: var(--space-md);
	overflow-x: auto;
	margin-bottom: var(--space-md);
}

/* Code */
code {
	font-family: var(--font-mono);
	font-size: 0.9em;
	background-color: var(--color-surface);
	padding: 0.15em 0.4em;
	border-radius: var(--border-radius);
}

pre code {
	background-color: transparent;
	padding: 0;
}

/* Keyboard Input */
kbd {
	font-family: var(--font-mono);
	font-size: var(--font-size-sm);
	background-color: var(--color-surface);
	border: 1px solid var(--color-border);
	border-bottom-width: 2px;
	padding: 0.15em 0.4em;
	border-radius: var(--border-radius);
}

/* Sample Output */
samp {
	font-family: var(--font-mono);
	font-size: var(--font-size-sm);
}

/* Address */
address {
	font-style: normal;
	margin-bottom: var(--space-md);
	color: var(--color-text-muted);
}

/* Semantic Classes for Text */
.text-muted {
	color: var(--color-text-muted);
}

.text-accent {
	color: var(--color-accent);
}

.text-error {
	color: var(--color-error);
}

.text-success {
	color: var(--color-success);
}

.text-warning {
	color: var(--color-warning);
}

.text-small {
	font-size: var(--font-size-sm);
}

.text-large {
	font-size: var(--font-size-lg);
}

.text-light {
	font-weight: var(--font-weight-light);
}

.text-bold {
	font-weight: var(--font-weight-bold);
}

.text-uppercase {
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.text-center {
	text-align: center;
}

.text-right {
	text-align: right;
}


/* ===== CONTENT.CSS ===== */

/* Content - Articles, Sections, Blockquotes, Tables, Figures */

/* Articles and Sections */
article, section {
	margin-bottom: var(--space-xl);
}

article > header,
section > header {
	margin-bottom: var(--space-lg);
	padding-bottom: var(--space-md);
	border-bottom: 1px solid var(--color-border);
}

article > footer,
section > footer {
	margin-top: var(--space-lg);
	padding-top: var(--space-md);
	border-top: 1px solid var(--color-border);
	color: var(--color-text-muted);
	font-size: var(--font-size-sm);
}

/* Aside */
aside {
	background-color: var(--color-surface);
	padding: var(--space-md);
	margin-bottom: var(--space-md);
	border-left: 3px solid var(--color-accent);
}

/* Blockquotes - Windows Phone 8 style: strong accent border */
blockquote {
	margin: var(--space-lg) 0;
	padding: var(--space-md) var(--space-lg);
	border-left: 4px solid var(--color-accent);
	background-color: var(--color-surface);
	color: var(--color-text-muted);

	p:last-child {
		margin-bottom: 0;
	}

	footer,
	cite {
		display: block;
		margin-top: var(--space-sm);
		font-size: var(--font-size-sm);
		color: var(--color-text-muted);
	}
}

/* Figures */
figure {
	margin: var(--space-lg) 0;
}

figcaption {
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
	margin-top: var(--space-sm);
}

/* Tables */
table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: var(--space-md);
	font-size: var(--font-size-sm);
}

caption {
	text-align: left;
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
	margin-bottom: var(--space-sm);
}

thead {
	border-bottom: 2px solid var(--color-border-strong);
}

tbody {
	tr {
		border-bottom: 1px solid var(--color-border);

		&:hover {
			background-color: var(--color-surface);
		}
	}
}

tfoot {
	border-top: 2px solid var(--color-border-strong);
	font-weight: var(--font-weight-semibold);
}

th, td {
	padding: var(--space-sm) var(--space-md);
	text-align: left;
}

th {
	font-weight: var(--font-weight-semibold);
	color: var(--color-text);
}

/* Striped tables via attribute */
table[data-striped] {
	tbody {
		tr:nth-child(odd) {
			background-color: var(--color-surface);
		}
	}
}

/* Compact tables */
table[data-compact] {
	th, td {
		padding: var(--space-xs) var(--space-sm);
	}
}

/* Details / Summary */
details {
	margin-bottom: var(--space-md);
	border: 1px solid var(--color-border);
	background-color: var(--color-surface);

	summary {
		padding: var(--space-md);
		cursor: pointer;
		font-weight: var(--font-weight-medium);
		list-style: none;
		display: flex;
		justify-content: space-between;
		align-items: center;

		&::after {
			content: '+';
			font-size: var(--font-size-lg);
			color: var(--color-accent);
		}

		&:hover {
			background-color: var(--color-surface-hover);
		}
	}

	&[open] {
		summary {
			&::after {
				content: '−';
			}
		}
	}

	> *:not(summary) {
		padding: 0 var(--space-md) var(--space-md) var(--space-md);
	}
}

/* Progress */
progress {
	appearance: none;
	width: 100%;
	height: 0.5rem;
	border: none;
	background-color: var(--color-surface);
	margin-bottom: var(--space-sm);

	&::-webkit-progress-bar {
		background-color: var(--color-surface);
	}

	&::-webkit-progress-value {
		background-color: var(--color-accent);
	}

	&::-moz-progress-bar {
		background-color: var(--color-accent);
	}

	&[value="100"] {
		&::-webkit-progress-value {
			background-color: var(--color-success);
		}

		&::-moz-progress-bar {
			background-color: var(--color-success);
		}
	}
}

/* Meter */
meter {
	appearance: none;
	width: 100%;
	height: 0.5rem;
	background: var(--color-surface);
	margin-bottom: var(--space-sm);

	&::-webkit-meter-bar {
		background: var(--color-surface);
		border: none;
		height: 0.5rem;
	}

	&::-webkit-meter-optimum-value {
		background: var(--color-success);
	}

	&::-webkit-meter-suboptimum-value {
		background: var(--color-warning);
	}

	&::-webkit-meter-even-less-good-value {
		background: var(--color-error);
	}
}

/* Time */
time {
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
}

/* Data */
data {
	font-weight: var(--font-weight-medium);
}


/* ===== FORMS.CSS ===== */

/* Forms - Inputs, Buttons, Labels, Fieldsets */

/* Fieldset */
fieldset {
	border: 1px solid var(--color-border);
	padding: var(--space-md);
	margin-bottom: var(--space-md);
}

legend {
	padding: 0 var(--space-sm);
	font-weight: var(--font-weight-medium);
}

/* Labels */
label {
	display: block;
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-medium);
	margin-bottom: var(--space-xs);
	color: var(--color-text);
}

/* Form Groups - Moderate spacing for visual separation */
form > div,
form > p,
form > label {
	margin-bottom: var(--space-xl);
}

/* Tighter spacing option */
form[data-compact] > div,
form[data-compact] > p,
form[data-compact] > label {
	margin-bottom: var(--space-md);
}

/* Text Inputs and Textareas */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"],
textarea,
sk-input-tag,
sk-input-filter,
select {
	appearance: none;
	width: 100%;
	padding: var(--space-sm) var(--space-md);
	font-size: var(--font-size-base);
	line-height: var(--line-height-normal);
	color: var(--color-text);
	background-color: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	transition: border-color var(--transition-fast), box-shadow var(--transition-fast);

	&:hover {
		border-color: var(--color-border-strong);
	}

	&:focus {
		outline: none;
		border-color: var(--color-accent);
		box-shadow: 0 0 0 2px rgb(from var(--color-accent) r g b / 0.2);
	}

	&:disabled {
		background-color: var(--color-surface);
		color: var(--color-text-muted);
		cursor: not-allowed;
	}

	&::placeholder {
		color: var(--color-text-muted);
	}
}

/* Textarea specific */
textarea {
	min-height: 6rem;
	resize: vertical;
}

/* Select */
select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right var(--space-md) center;
	padding-right: var(--space-xl);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) select {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	}
}

:root[data-theme="dark"] select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* Checkboxes and Radio Buttons */
input[type="checkbox"],
input[type="radio"] {
	appearance: none;
	width: 1.25rem;
	height: 1.25rem;
	border: 1px solid var(--color-border-strong);
	background-color: var(--color-bg);
	display: inline-grid;
	place-content: center;
	cursor: pointer;
	vertical-align: middle;
	margin-right: var(--space-xs);

	&:checked {
		background-color: var(--color-accent);
		border-color: var(--color-accent);
	}

	&:focus-visible {
		outline: 2px solid var(--color-accent);
		outline-offset: 2px;
	}

	&:disabled {
		background-color: var(--color-surface);
		cursor: not-allowed;
	}
}

input[type="checkbox"] {
	border-radius: var(--border-radius);

	&::before {
		content: '';
		width: 0.65rem;
		height: 0.65rem;
		transform: scale(0);
		transition: transform var(--transition-fast);
		box-shadow: inset 1em 1em var(--color-accent-text);
		transform-origin: center;
		clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
	}

	&:checked::before {
		transform: scale(1);
	}
}

input[type="radio"] {
	border-radius: 50%;

	&::before {
		content: '';
		width: 0.65rem;
		height: 0.65rem;
		border-radius: 50%;
		transform: scale(0);
		transition: transform var(--transition-fast);
		background-color: var(--color-accent-text);
	}

	&:checked::before {
		transform: scale(1);
	}
}

/* Toggle Switch - Windows Phone 7 style */
input[type="checkbox"].toggle {
	width: 3.5rem;
	height: 1.25rem;
	border-radius: 0;
	border: 2px solid var(--color-text);
	background-color: transparent;
	display: inline-block;
	place-content: unset;
	position: relative;
	overflow: visible;
	outline: none;

	&::before {
		content: '';
		position: absolute;
		top: -0.3rem;
		left: 0;
		width: 30%;
		height: 1.7rem;
		background-color: var(--color-text);
		transform: scale(1);
		transform-origin: unset;
		clip-path: none;
		box-shadow: none;
		transition: left var(--transition-base), right var(--transition-base);
		z-index: 1;
	}

	&:checked {
		background: linear-gradient(to right, var(--color-accent) 70%, transparent 60%);

		&::before {
			left: auto;
			right: 0;
		}
	}

	&:disabled {
		border-color: var(--color-border);
		cursor: not-allowed;

		&::before {
			background-color: var(--color-border);
		}
	}
}

/* File Input */
input[type="file"] {
	padding: var(--space-sm);
	font-size: var(--font-size-sm);

	&::file-selector-button {
		padding: var(--space-sm) var(--space-md);
		border: none;
		background-color: var(--color-surface);
		color: var(--color-text);
		font-weight: var(--font-weight-medium);
		cursor: pointer;
		margin-right: var(--space-md);
		transition: background-color var(--transition-fast);

		&:hover {
			background-color: var(--color-surface-hover);
		}
	}
}

/* Range Input */
input[type="range"] {
	appearance: none;
	width: 100%;
	height: 0.5rem;
	background-color: var(--color-surface);
	border-radius: var(--border-radius);
	outline: none;
	margin: var(--space-sm) 0;

	&::-webkit-slider-thumb {
		appearance: none;
		width: 1.25rem;
		height: 1.25rem;
		background-color: var(--color-accent);
		cursor: pointer;
		border-radius: 50%;
		transition: background-color var(--transition-fast);

		&:hover {
			background-color: var(--color-accent-hover);
		}
	}

	&::-moz-range-thumb {
		width: 1.25rem;
		height: 1.25rem;
		background-color: var(--color-accent);
		cursor: pointer;
		border-radius: 50%;
		border: none;
		transition: background-color var(--transition-fast);

		&:hover {
			background-color: var(--color-accent-hover);
		}
	}
}



/* Color Input */
input[type="color"] {
	width: 3rem;
	height: 2.5rem;
	padding: var(--space-xs);
	cursor: pointer;
	border: 1px solid var(--color-border);
}

/* Buttons - Windows Phone 8 Style: Flat, Full Width on Mobile */
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-sm) var(--space-md);
	font-size: var(--font-size-base);
	font-weight: var(--font-weight-medium);
	line-height: var(--line-height-tight);
	color: var(--color-text);
	background-color: var(--color-surface);
	border: none;
	cursor: pointer;
	transition: background-color var(--transition-fast), color var(--transition-fast);

	&:hover {
		background-color: var(--color-surface-hover);
	}

	&:focus-visible {
		outline: 2px solid var(--color-accent);
		outline-offset: 2px;
	}

	&:active {
		transform: translateY(1px);
	}

	&:disabled {
		opacity: 0.5;
		cursor: not-allowed;

		&:hover {
			background-color: var(--color-surface);
		}
	}
}

/* Button Variants */
button.primary,
input[type="submit"].primary,
input[type="button"].primary {
	background-color: var(--color-accent);
	color: var(--color-accent-text);

	&:hover {
		background-color: var(--color-accent-hover);
	}
}

button.danger,
input[type="submit"].danger,
input[type="button"].danger {
	background-color: var(--color-error);
	color: #ffffff;

	&:hover {
		background-color: color-mix(in srgb, var(--color-error) 80%, black);
	}
}

button.success,
input[type="submit"].success,
input[type="button"].success {
	background-color: var(--color-success);
	color: #ffffff;

	&:hover {
		background-color: color-mix(in srgb, var(--color-success) 80%, black);
	}
}

button.ghost,
input[type="submit"].ghost,
input[type="button"].ghost {
	background-color: transparent;
	border: 1px solid var(--color-border);

	&:hover {
		background-color: var(--color-surface);
	}
}

/* Form Validation Styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
	border-color: var(--color-error);

	&:focus {
		box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-error) 20%, transparent);
	}
}

/* Helper text */
.form-help {
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
	margin-top: var(--space-xs);
}

/* Error message */
.form-error {
	font-size: var(--font-size-sm);
	color: var(--color-error);
	margin-top: var(--space-xs);
}

/* Inline form layout */
form[data-layout="inline"] {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-md);
	align-items: flex-end;

	> div,
	> p {
		flex: 1;
		min-width: 200px;
		margin-bottom: 0;
	}
}

/* Horizontal form layout */
form[data-layout="horizontal"] {
	> div,
	> p {
		display: flex;
		gap: var(--space-md);
		align-items: center;

		label {
			width: 120px;
			margin-bottom: 0;
			flex-shrink: 0;
		}

		input,
		textarea,
		select {
			flex: 1;
		}
	}
}


/* ===== INTERACTIVE.CSS ===== */

/* Interactive - Tooltips, Badges, Alerts, Messages */

/* Badges - Minimal, Accent colored */
[data-badge] {
	display: inline-flex;
	align-items: center;
	padding: var(--space-xs) var(--space-sm);
	font-size: var(--font-size-xs);
	font-weight: var(--font-weight-medium);
	background-color: var(--color-accent);
	color: var(--color-accent-text);
	line-height: 1;

	&[data-variant="secondary"] {
		background-color: var(--color-surface);
		color: var(--color-text);
	}

	&[data-variant="outline"] {
		background-color: transparent;
		border: 1px solid var(--color-border);
		color: var(--color-text);
	}

	&[data-variant="error"] {
		background-color: var(--color-error);
		color: #ffffff;
	}

	&[data-variant="success"] {
		background-color: var(--color-success);
		color: #ffffff;
	}

	&[data-variant="warning"] {
		background-color: var(--color-warning);
		color: var(--color-text);
	}
}

/* Tooltips - Simple, clean */
[title] {
	position: relative;
}

[data-tooltip] {
	position: relative;
	cursor: help;

	&::before {
		content: attr(data-tooltip);
		position: absolute;
		bottom: 100%;
		left: 50%;
		transform: translateX(-50%) translateY(-4px);
		padding: var(--space-xs) var(--space-sm);
		background-color: var(--color-text);
		color: var(--color-bg);
		font-size: var(--font-size-xs);
		white-space: nowrap;
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--transition-fast), visibility var(--transition-fast);
		z-index: 1000;
	}

	&:hover::before {
		opacity: 1;
		visibility: visible;
	}
}

/* Alerts/Messages - Windows Phone style with accent border */
[role="alert"],
.alert {
	padding: var(--space-md);
	margin-bottom: var(--space-md);
	background-color: var(--color-info-bg);
	border-left: 4px solid var(--color-info);

	p:last-child {
		margin-bottom: 0;
	}
}

[role="alert"][data-variant="error"],
.alert.error {
	background-color: var(--color-error-bg);
	border-left-color: var(--color-error);
}

[role="alert"][data-variant="success"],
.alert.success {
	background-color: var(--color-success-bg);
	border-left-color: var(--color-success);
}

[role="alert"][data-variant="warning"],
.alert.warning {
	background-color: var(--color-warning-bg);
	border-left-color: var(--color-warning);
}

/* Empty State - For lists, content areas */
[data-empty] {
	text-align: center;
	padding: var(--space-xl);
	color: var(--color-text-muted);

	&::before {
		content: attr(data-empty);
		display: block;
		font-size: var(--font-size-2xl);
		margin-bottom: var(--space-md);
		opacity: 0.5;
	}
}

/* Loading State */
[data-loading] {
	position: relative;
	pointer-events: none;
	opacity: 0.7;

	&::after {
		content: '';
		position: absolute;
		top: 50%;
		left: 50%;
		width: 1.5rem;
		height: 1.5rem;
		margin: -0.75rem 0 0 -0.75rem;
		border: 2px solid var(--color-border);
		border-top-color: var(--color-accent);
		border-radius: 50%;
		animation: spin 1s linear infinite;
	}
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Skeleton Loading */
.skeleton {
	background: linear-gradient(
		90deg,
		var(--color-surface) 25%,
		var(--color-surface-hover) 50%,
		var(--color-surface) 75%
	);
	background-size: 200% 100%;
	animation: shimmer 1.5s infinite;
	color: transparent;
	pointer-events: none;
}

@keyframes shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

/* Toggle Switch */
[data-toggle] {
	appearance: none;
	width: 3rem;
	height: 1.5rem;
	background-color: var(--color-surface);
	border-radius: 9999px;
	position: relative;
	cursor: pointer;
	transition: background-color var(--transition-fast);

	&::before {
		content: '';
		position: absolute;
		top: 0.25rem;
		left: 0.25rem;
		width: 1rem;
		height: 1rem;
		background-color: var(--color-text);
		border-radius: 50%;
		transition: transform var(--transition-fast);
	}

	&:checked {
		background-color: var(--color-accent);

		&::before {
			transform: translateX(1.5rem);
			background-color: var(--color-accent-text);
		}
	}

	&:focus-visible {
		outline: 2px solid var(--color-accent);
		outline-offset: 2px;
	}
}

/* Breadcrumbs */
nav[aria-label="breadcrumb"] {
	ol {
		display: flex;
		flex-wrap: wrap;
		list-style: none;
		padding: 0;
		margin: 0;
	}

	li {
		display: flex;
		align-items: center;

		&:not(:last-child)::after {
			content: '/';
			margin: 0 var(--space-sm);
			color: var(--color-text-muted);
		}
	}

	a {
		color: var(--color-text-muted);

		&:hover {
			color: var(--color-accent);
		}
	}

	li:last-child {
		color: var(--color-text);
		font-weight: var(--font-weight-medium);
	}
}

/* Pagination */
nav[aria-label="pagination"] {
	display: flex;
	gap: var(--space-xs);
	margin: var(--space-lg) 0;

	a, button, span {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 2.5rem;
		height: 2.5rem;
		padding: 0 var(--space-sm);
		font-size: var(--font-size-sm);
		background-color: var(--color-surface);
		color: var(--color-text);
		text-decoration: none;
		transition: background-color var(--transition-fast);

		&:hover:not([aria-current]) {
			background-color: var(--color-surface-hover);
		}
	}

	[aria-current="page"] {
		background-color: var(--color-accent);
		color: var(--color-accent-text);
		font-weight: var(--font-weight-medium);
	}
}

.tabs {
	display: grid;
	grid-template-rows: auto auto;
	border-bottom: 2px solid var(--color-border);
	margin-bottom: var(--space-md);

	

	& > *:has(label) {
		display: contents;

		& > * {
			display: none;
		}

		&:has(input[type="radio"]:checked) {
			& > *:not(label) {
				grid-row: 2;
				grid-column: 1 / -1;
				display: block;
				width: 100%;
				padding: var(--space-md) 0;
			}
		}
	}

	& > label, & > * > label {
		display: block;
		grid-row: 1;
		padding: var(--space-sm) var(--space-md);
		background: none;
		border: none;
		border-bottom: 2px solid transparent;
		margin-bottom: -2px;
		color: var(--color-text-muted);
		cursor: pointer;
		transition: color var(--transition-fast), border-color var(--transition-fast);
		font-weight: var(--font-weight-normal);
		position: relative;

		&:hover {
			color: var(--color-text);
		}

		&:has(input[type="radio"]:checked) {
			color: var(--color-accent);
			border-bottom-color: var(--color-accent);
			font-weight: var(--font-weight-medium);
		}

		input[type="radio"] {
			position: absolute;
			opacity: 0;
			width: 0;
			height: 0;
		}
	}
}

/* Dialog/Modal */
dialog {
	padding: 0;
	border: none;
	background: var(--color-bg);
	max-width: 90vw;
	max-height: 90vh;
	margin: auto;
}

dialog::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

dialog[open] {
	
}

dialog header {
	padding: var(--space-md) var(--space-lg);
	border-bottom: 1px solid var(--color-border);
}

dialog header h3 {
	margin: 0;
}

dialog > div {
	padding: var(--space-lg);
}

dialog footer {
	padding: var(--space-md) var(--space-lg);
	border-top: 1px solid var(--color-border);
	display: flex;
	gap: var(--space-sm);
	justify-content: flex-end;
}


/* ===== APP.CSS ===== */

/* App - Web App Specific Components */

/* App Container */
.app {
	display: grid;
	grid-template-rows: auto 1fr auto;
	height: 100dvh;
	
	& > nav, & > sk-topbar {
		grid-row: 1;
	}
	
	& > main {
		grid-row: 2;
		overflow-y: auto;
		min-height: 0;
		width: 100%;
		max-width: 1200px;
		margin-left: auto;
		margin-right: auto;
		padding-left: var(--space-md);
		padding-right: var(--space-md);

		display: block flex;
		flex-direction: column;
		gap: var(--space-lg);
	}

	& > sk-hub {
		grid-row: 2;
		overflow-y: auto;
		min-height: 0;
		width: 100%;
		display: block;
	}
	
	& > sk-appbar {
		grid-row: -1;
	}
}


/* Cards - Windows Phone 8 Panorama style */
.card {
	background-color: var(--color-surface);
	border: 1px solid var(--color-border);
	padding: var(--space-lg);
	margin-bottom: var(--space-md);
	transition: border-color var(--transition-fast);

	&:hover {
		border-color: var(--color-accent);
	}

	> header {
		display: flex;
		justify-content: space-between;
		align-items: flex-start;
		margin-bottom: var(--space-md);
		padding-bottom: var(--space-sm);
		border-bottom: 1px solid var(--color-border);

		h1, h2, h3, h4, h5, h6 {
			margin: 0;
			font-size: var(--font-size-lg);
			font-weight: var(--font-weight-semibold);
		}
	}

	> footer {
		display: flex;
		gap: var(--space-sm);
		margin-top: var(--space-md);
		padding-top: var(--space-md);
		border-top: 1px solid var(--color-border);
	}
}

/* List Items - Metro-style list */
.list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.list-item {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	padding: var(--space-md);
	border-bottom: 1px solid var(--color-border);
	transition: background-color var(--transition-fast);

	&:hover {
		background-color: var(--color-surface);
	}

	&:last-child {
		border-bottom: none;
	}

	.thumbnail {
		width: 3rem;
		height: 3rem;
		background-color: var(--color-surface);
		display: flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
	}

	.content {
		flex: 1;
		min-width: 0;

		h4 {
			margin: 0 0 var(--space-xs) 0;
			font-size: var(--font-size-base);
			font-weight: var(--font-weight-medium);
		}

		p {
			margin: 0;
			font-size: var(--font-size-sm);
			color: var(--color-text-muted);
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
	}

	.meta {
		font-size: var(--font-size-sm);
		color: var(--color-text-muted);
		flex-shrink: 0;
	}
}

/* Metro List - Single class, convention-based styling */
.metro-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.metro-list li,
.metro-list a {
	display: flex;
	align-items: flex-start;
	gap: var(--space-md);
	padding: var(--space-sm) var(--space-md);
	transition: background-color var(--transition-fast);
	text-decoration: none;
	color: inherit;
}

.metro-list li:hover,
.metro-list a:hover {
	background-color: var(--color-surface);
}

/* Square image/thumbnail - first child convention */
.metro-list li > img:first-child,
.metro-list li > .icon:first-child,
.metro-list a > img:first-child,
.metro-list a > .icon:first-child {
	width: 3.5rem;
	height: 3.5rem;
	object-fit: cover;
	flex-shrink: 0;
	border-radius: 0;
	margin-top: 0.25rem;
}

/* Icon placeholder alternative */
.metro-list li > .icon,
.metro-list a > .icon {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--font-size-2xl);
	background-color: var(--color-surface);
}

/* Content area - div between image and time */
.metro-list li > div,
.metro-list a > div {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	padding-top: 0.25rem;
}

/* First span = title */
.metro-list li > div > span:first-child,
.metro-list a > div > span:first-child {
	display: block;
	font-size: var(--font-size-xl);
	font-weight: var(--font-weight-normal);
	color: var(--color-text);
	line-height: 1.3;
}

/* Second span = subtitle in accent color */
.metro-list li > div > span:nth-child(2),
.metro-list a > div > span:nth-child(2) {
	display: block;
	font-size: var(--font-size-base);
	color: var(--color-accent);
	font-weight: var(--font-weight-normal);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	line-height: 1.3;
}

/* Time element - right side */
.metro-list li > time,
.metro-list li > .time,
.metro-list a > time,
.metro-list a > .time {
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
	flex-shrink: 0;
	align-self: flex-start;
	padding-top: 0.5rem;
	min-width: 3rem;
	text-align: right;
}

/* Count badge - far right */
.metro-list li > data,
.metro-list li > .count,
.metro-list li > [data-count],
.metro-list a > data,
.metro-list a > .count,
.metro-list a > [data-count] {
	font-size: var(--font-size-lg);
	font-weight: var(--font-weight-light);
	color: var(--color-accent);
	flex-shrink: 0;
	align-self: flex-start;
	padding-top: 0.25rem;
	min-width: 1.5rem;
	text-align: right;
}

/* Loading Animations - Running Dots */
.dots {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 6rem;
	height: 1rem;
	position: relative;
	padding: var(--space-md);
	overflow: hidden;
}

.dots span {
	position: absolute;
	width: 0.4rem;
	height: 0.4rem;
	background-color: var(--color-accent);
	border-radius: 50%;
	opacity: 0;
	animation: dots 2s ease-in-out infinite;
}

.dots span:nth-child(1) { animation-delay: 0s; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
.dots span:nth-child(4) { animation-delay: 0.6s; }
.dots span:nth-child(5) { animation-delay: 0.8s; }

@keyframes dots {
	0% {
		transform: translateX(-2.5rem);
		opacity: 0;
	}
	10% {
		opacity: 1;
	}
	25% {
		transform: translateX(-0.5rem);
	}
	50% {
		transform: translateX(0);
	}
	65% {
		transform: translateX(2rem);
		opacity: 1;
	}
	80%, 100% {
		transform: translateX(2.5rem);
		opacity: 0;
	}
}

.spinner {
	width: 2.5rem;
	height: 2.5rem;
	border: 3px solid transparent;
	border-top-color: var(--color-accent);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.ring {
	width: 3rem;
	height: 3rem;
	border: 3px solid var(--color-surface);
	border-top-color: var(--color-accent);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

/* Media Object */
.media {
	display: flex;
	gap: var(--space-md);

	.media-figure {
		flex-shrink: 0;
	}

	.media-content {
		flex: 1;
		min-width: 0;
	}
}

/* Stats/Metrics */
.stat {
	text-align: center;
	padding: var(--space-md);

	.stat-value {
		display: block;
		font-size: var(--font-size-3xl);
		font-weight: var(--font-weight-light);
		color: var(--color-accent);
		line-height: 1;
	}

	.stat-label {
		display: block;
		font-size: var(--font-size-sm);
		color: var(--color-text-muted);
		text-transform: uppercase;
		letter-spacing: 0.05em;
		margin-top: var(--space-xs);
	}
}

/* Data Display */
.data-pair {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: var(--space-sm) 0;
	border-bottom: 1px solid var(--color-border);

	&:last-child {
		border-bottom: none;
	}

	dt {
		font-weight: var(--font-weight-medium);
		color: var(--color-text-muted);
	}

	dd {
		font-weight: var(--font-weight-semibold);
		margin: 0;
	}
}

/* Status indicators */
.status {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-medium);

	&::before {
		content: '';
		width: 0.5rem;
		height: 0.5rem;
		border-radius: 50%;
		background-color: var(--color-text-muted);
	}

	&.active::before {
		background-color: var(--color-success);
	}

	&.pending::before {
		background-color: var(--color-warning);
	}

	&.error::before {
		background-color: var(--color-error);
	}

	&.inactive::before {
		background-color: var(--color-text-muted);
	}
}

/* Avatar */
.avatar {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background-color: var(--color-accent);
	color: var(--color-accent-text);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: var(--font-weight-medium);
	font-size: var(--font-size-sm);
	flex-shrink: 0;

	&[data-size="sm"] {
		width: 1.75rem;
		height: 1.75rem;
		font-size: var(--font-size-xs);
	}

	&[data-size="lg"] {
		width: 3.5rem;
		height: 3.5rem;
		font-size: var(--font-size-lg);
	}

	&[data-size="xl"] {
		width: 5rem;
		height: 5rem;
		font-size: var(--font-size-2xl);
	}
}

/* Tiles - Windows Phone style */
.tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: var(--space-sm);
}

/* All immediate children become tiles by convention */
.tiles > * {
	aspect-ratio: 1;
	background-color: var(--color-accent);
	color: var(--color-accent-text);
	padding: var(--space-sm);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	position: relative;
	overflow: hidden;
	min-height: 100px;
	text-decoration: none;
}

/* Size variants via data attributes on children */
.tiles > [data-wide] {
	grid-column: span 2;
	aspect-ratio: 2 / 1;
}

.tiles > [data-large] {
	grid-column: span 2;
	grid-row: span 2;
	min-height: 200px;
}

.tiles > [data-small] {
	aspect-ratio: 1;
	min-height: 70px;
}

/* Tile content elements */
.tile-title {
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-semibold);
	line-height: 1.2;
}

.tile-count {
	position: absolute;
	top: var(--space-sm);
	right: var(--space-sm);
	font-size: var(--font-size-2xl);
	font-weight: var(--font-weight-light);
	opacity: 0.5;
}

/* Legacy: Keep .tile-grid and .tile for backward compatibility */
.tile-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: var(--space-sm);
}

.tile {
	aspect-ratio: 1;
	background-color: var(--color-accent);
	color: var(--color-accent-text);
	padding: var(--space-sm);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	position: relative;
	overflow: hidden;
	min-height: 100px;
	text-decoration: none;
}

.tile.wide {
	grid-column: span 2;
	aspect-ratio: 2 / 1;
}

.tile.large {
	grid-column: span 2;
	grid-row: span 2;
	min-height: 200px;
}

.tile.small {
	aspect-ratio: 1;
	min-height: 70px;
}

/* Command Bar - Action buttons at top */
.command-bar {
	display: flex;
	gap: var(--space-sm);
	padding: var(--space-md) 0;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: var(--space-lg);

	&.sticky {
		position: sticky;
		top: 0;
		background-color: var(--color-bg);
		z-index: 50;
	}

	.primary-actions {
		display: flex;
		gap: var(--space-sm);
	}

	.secondary-actions {
		display: flex;
		gap: var(--space-sm);
		margin-left: auto;
	}
}

/* Split View (Master-Detail) */
.split-view {
	display: grid;
	grid-template-columns: 300px 1fr;
	gap: var(--space-lg);
	min-height: 0;

	.master {
		border-right: 1px solid var(--color-border);
		overflow-y: auto;
	}

	.detail {
		overflow-y: auto;
	}
}

@media (max-width: 768px) {
	.split-view {
		grid-template-columns: 1fr;

		.master {
			border-right: none;
			border-bottom: 1px solid var(--color-border);
		}
	}
}

/* Pivot Navigation - Windows Phone 8 Metro style */
.pivot {
	display: flex;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	border-bottom: 2px solid var(--color-border);
	margin-bottom: var(--space-lg);
	gap: var(--space-xl);
}

.pivot::-webkit-scrollbar {
	display: none;
}

.pivot a,
.pivot button {
	flex-shrink: 0;
	padding: var(--space-sm) 0;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	color: var(--color-text-muted);
	text-decoration: none;
	font-size: var(--font-size-2xl);
	font-weight: var(--font-weight-light);
	line-height: 1.2;
	transition: color var(--transition-fast), border-color var(--transition-fast);
	cursor: pointer;
	white-space: nowrap;
}

.pivot a:hover,
.pivot button:hover {
	color: var(--color-text);
}

.pivot a[aria-current="page"],
.pivot button[aria-current="page"],
.pivot a.active,
.pivot button.active {
	color: var(--color-accent);
	border-bottom-color: var(--color-accent);
	font-weight: var(--font-weight-normal);
}

/* Compact pivot variant */
.pivot[data-compact] a,
.pivot[data-compact] button {
	font-size: var(--font-size-lg);
	padding: var(--space-xs) 0;
}


/* ===== LAYOUT.CSS ===== */

/* Layout - Grid, Stack, Container Utilities */

/* Container - Constrain max width */
.container {
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--space-md);
	padding-right: var(--space-md);
}

.container-narrow {
	max-width: 800px;
}

.container-wide {
	max-width: 1400px;
}

.container-full {
	max-width: none;
	padding-left: var(--space-lg);
	padding-right: var(--space-lg);
}

/* Grid - Multi-column layouts */
.grid {
	display: grid;
	gap: var(--space-md);
}

.grid-cols-2 {
	grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
	grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
	grid-template-columns: repeat(4, 1fr);
}

.grid-cols-auto {
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@media (max-width: 768px) {
	.grid-cols-2,
	.grid-cols-3,
	.grid-cols-4 {
		grid-template-columns: 1fr;
	}

	.grid-cols-auto {
		grid-template-columns: 1fr;
	}
}

/* Flex Utilities */
.flex {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);

	&.horizontal {
		flex-direction: row;
		align-items: center;
	}
	
	&.vertical {
		flex-direction: column;
	}
	
	&.wrap {
		flex-wrap: wrap;
	}

	.items-center {
		align-items: center;
	}

	.items-start {
		align-items: flex-start;
	}

	.items-end {
		align-items: flex-end;
	}

	.justify-center {
		justify-content: center;
	}

	.justify-between {
		justify-content: space-between;
	}

	.justify-end {
		justify-content: flex-end;
	}

	& > .shrink {
		flex-shrink: 1;
	}
	
	& > .grow {
		flex-grow: 1;
	}
}


/* Width Utilities */
.w-full {
	width: 100%;
}

.w-auto {
	width: auto;
}

.w-fit {
	width: fit-content;
}

.max-w-full {
	max-width: 100%;
}

/* Height Utilities */
.h-full {
	height: 100%;
}

.min-h-screen {
	min-height: 100vh;
}

/* Gap Utilities */
.gap-sm {
	gap: var(--space-sm);
}

.gap-md {
	gap: var(--space-md);
}

.gap-lg {
	gap: var(--space-lg);
}


/* ===== UTILITIES.CSS ===== */

/* Utilities - Color, Visibility, Display Helpers */

/* Display Utilities */
.hidden {
	display: none !important;
}

.block {
	display: block;
}

.inline {
	display: inline;
}

.inline-block {
	display: inline-block;
}

/* Visibility - Screen Reader Only */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Print Visibility */
@media print {
	.no-print {
		display: none !important;
	}

	.only-print {
		display: block !important;
	}
}

/* Screen Visibility */
@media screen {
	.only-print {
		display: none !important;
	}
}

/* Responsive Visibility */
@media (max-width: 768px) {
	.hide-mobile {
		display: none !important;
	}
}

@media (min-width: 769px) {
	.hide-desktop {
		display: none !important;
	}
}

/* Background Colors */
.bg-surface {
	background-color: var(--color-surface);
}

.bg-accent {
	background-color: var(--color-accent);
	color: var(--color-accent-text);
}

.bg-error {
	background-color: var(--color-error);
	color: #ffffff;
}

.bg-success {
	background-color: var(--color-success);
	color: #ffffff;
}

.bg-warning {
	background-color: var(--color-warning);
	color: var(--color-text);
}

/* Text Colors */
.text-primary {
	color: var(--color-text);
}

/* Border Utilities */
.border {
	border: 1px solid var(--color-border);
}

.border-b {
	border-bottom: 1px solid var(--color-border);
}

.border-t {
	border-top: 1px solid var(--color-border);
}

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

.border-r {
	border-right: 1px solid var(--color-border);
}

.border-accent {
	border-color: var(--color-accent);
}

.border-error {
	border-color: var(--color-error);
}

/* Overflow Utilities */
.overflow-hidden {
	overflow: hidden;
}

.overflow-auto {
	overflow: auto;
}

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

.overflow-y-auto {
	overflow-y: auto;
}

/* Position Utilities */
.relative {
	position: relative;
}

.absolute {
	position: absolute;
}

.fixed {
	position: fixed;
}

.sticky {
	position: sticky;
}

/* Z-Index Utilities */
.z-10 {
	z-index: 10;
}

.z-50 {
	z-index: 50;
}

.z-100 {
	z-index: 100;
}

/* Cursor Utilities */
.cursor-pointer {
	cursor: pointer;
}

.cursor-not-allowed {
	cursor: not-allowed;
}

/* Object Fit */
.object-cover {
	object-fit: cover;
}

.object-contain {
	object-fit: contain;
}

/* Rounded Corners (minimal for WP8 style) */
.rounded {
	border-radius: 0.25rem;
}

/* Shadow Utilities */
.shadow-sm {
	box-shadow: var(--shadow-sm);
}

.shadow-md {
	box-shadow: var(--shadow-md);
}

.shadow-lg {
	box-shadow: var(--shadow-lg);
}

/* No Shadow (default flat style) */
.shadow-none {
	box-shadow: none;
}

/* List Reset */
.list-none {
	list-style: none;
	padding-left: 0;
}

/* Truncate Text */
.truncate {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Break Words */
.break-words {
	overflow-wrap: break-word;
}

/* No Wrap */
.whitespace-nowrap {
	white-space: nowrap;
}

/* Scroll Behavior */
.scroll-smooth {
	scroll-behavior: smooth;
}

/* Selection Color */
::selection {
	background-color: var(--color-accent);
	color: var(--color-accent-text);
}

/* Print Styles */
@media print {
	/* Hide interactive elements */
	.no-print,
	nav,
	.demo-nav,
	.demo-sidebar,
	button[data-close],
	[role="tablist"],
	code-preview,
	.wp-dots,
	.wp-spinner,
	.wp-ring {
		display: none !important;
	}

	/* Force light theme colors for print */
	:root {
		--color-bg: #ffffff !important;
		--color-surface: #f5f5f5 !important;
		--color-text: #000000 !important;
		--color-text-muted: #666666 !important;
		--color-border: #cccccc !important;
		--color-accent: #0066cc !important;
	}

	body {
		background: white !important;
		color: black !important;
		font-size: 12pt;
		line-height: 1.5;
	}

	/* Links - show URL after link text */
	a[href]::after {
		content: " (" attr(href) ")";
		font-size: 90%;
		color: var(--color-text-muted);
	}

	a[href^="#"]::after,
	a[href^="javascript:"]::after {
		content: "";
	}

	/* Page breaks */
	section,
	article {
		page-break-inside: avoid;
	}

	h1, h2, h3 {
		page-break-after: avoid;
	}

	/* Tables */
	table {
		page-break-inside: auto;
	}

	tr {
		page-break-inside: avoid;
	}

	/* Ensure images don't break across pages */
	img, figure {
		page-break-inside: avoid;
		max-width: 100% !important;
	}

	/* Form elements - show values but styled for print */
	input, textarea, select {
		border: 1px solid #ccc !important;
		background: transparent !important;
	}

	/* Cards and containers */
	.card, aside, blockquote {
		border: 1px solid #ccc !important;
		box-shadow: none !important;
	}

	/* Adjust font sizes for print */
	h1 { font-size: 24pt; }
	h2 { font-size: 20pt; }
	h3 { font-size: 16pt; }
	h4 { font-size: 14pt; }

	/* Remove backgrounds that waste ink */
	* {
		background: transparent !important;
	}

	.card,
	aside,
	tbody tr:hover,
	.list-item:hover {
		background-color: transparent !important;
	}
}


/* ===== APPBAR.CSS ===== */

.appbar, sk-appbar {
	&.fixed {
		position: fixed;
	}

	width: 100%;
	height: min-content;
	bottom: 0;
	left: 0;
	box-sizing: border-box;
	min-height: fit-content;
	margin: 0.4rem 0;
	display: block flex;
	flex-direction: row;
	gap: var(--space-sm, 0.6rem);
	justify-content: flex-end;
	background-color: var(--color-bg);

	&:has(input[type="checkbox"]:checked) > *::after {
		content: attr(title);
		display: block;
		width: 100%;
		text-align: center;
		cursor: pointer;
		color: inherit !important;
		text-decoration: none;
		font-size: x-small;
	}

	& > * {
		display: block flex !important;
		flex-direction: column;
		justify-content: center !important;
		align-content: center !important;
		align-items: center !important;
		gap: var(--gap-tiny, 0.2rem);
		color: inherit;
		cursor: pointer;
		fill: currentColor !important;

		& > svg, & > i > svg {
			width: 2.4rem !important;
			height: 2.4rem !important;
			min-width: 2.4rem !important;
			min-height: 2.4rem !important;
			max-width: 2.4rem !important;
			max-height: 2.4rem !important;
			display: block;
			overflow: visible;
			padding: 0.4em;
			box-sizing: border-box;
			border-radius: 50%;
			border: 0.15rem solid var(--color-surface);

			&:hover {
				background: rgba(0, 0, 0, 0.219);
				border-color: var(--color-surface-hover);
			}
		}
	}

	& > input[type="checkbox"] {
		appearance: none;
		-webkit-appearance: none;
		width: 2.4rem;
		height: 2.4rem;
		border-radius: 50%;
		border: 0.15rem solid transparent;
		background: transparent;
		cursor: pointer;
		position: relative;
		transition: all 0.3s ease;

		&::before {
			content: "·\A·\A·";
			white-space: pre;
			line-height: 0.4;
			display: inline-block;
			text-align: center;
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			color: currentColor;
			font-weight: bold;
			clip-path: none;
			box-shadow: none;
			transition: none;
			width: auto !important;
			height: min-content !important;
		}
	}
}

