.eg-theme-provider {
	min-height: 100vh;
	width: 100%;
	background-color: var(--eg-palette-background);
	color: var(--eg-palette-text-primary);
}

/* ── Layout ── */

.eg-layout {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	background-color: var(--eg-palette-background);
}

.eg-main-content {
	flex: 1;
	padding: 0;
	padding-bottom: calc(
		var(--eg-bottom-nav-height) +
		var(--eg-safe-area-bottom)
	);
	-webkit-overflow-scrolling: touch;
}

/* ── Container ── */

.eg-container {
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
	width: 100%;
}

/* ── Stack ── */

.eg-stack {
	display: flex;
}

.eg-stack-column {
	flex-direction: column;
}

.eg-stack-row {
	flex-direction: row;
}

/* ── Text ── */

.eg-text {
	display: inline;
	line-height: 1.5;
}

.eg-typo-h1 {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.2;
}
.eg-typo-h2 {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.3;
}
.eg-typo-h3 {
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.4;
}
.eg-typo-h4 {
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.4;
}
.eg-typo-h5 {
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
}
.eg-typo-h6 {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.5;
}
.eg-typo-subtitle1 {
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.375;
}
.eg-typo-subtitle2 {
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.57;
}
.eg-typo-body1 {
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
}
.eg-typo-body2 {
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.43;
}
.eg-typo-caption {
	font-size: 0.75rem;
	font-weight: 400;
	line-height: 1.66;
}
.eg-typo-button {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.75;
	text-transform: uppercase;
	letter-spacing: 0.02857em;
}
.eg-typo-overline {
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 2.66;
	text-transform: uppercase;
	letter-spacing: 0.16667em;
}

/* ── Card ── */

.eg-card {
	background-color: var(--eg-palette-surface);
	border-radius: var(--eg-radius-lg);
	overflow: hidden;
	transition:
		transform var(--eg-transition-fast),
		box-shadow var(--eg-transition-fast);
}

.eg-elevation-0 {
	box-shadow: none;
	border: 1px solid var(--eg-palette-divider);
}
.eg-elevation-1 {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.eg-elevation-2 {
	box-shadow: var(--eg-shadow-card);
}
.eg-elevation-3 {
	box-shadow: var(--eg-shadow-elevated);
}

.eg-card-content {
	padding: 16px;
}

/* ── Button ── */

.eg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 1px solid transparent;
	border-radius: var(--eg-radius-pill);
	cursor: pointer;
	text-decoration: none;
	font-family: inherit;
	transition:
		background-color var(--eg-transition-fast),
		box-shadow var(--eg-transition-fast),
		transform var(--eg-transition-fast);
	font-weight: 600;
	letter-spacing: 0.02857em;
	outline: none;
}

.eg-btn:hover {
	filter: brightness(1.1);
}

.eg-btn:active {
	transform: scale(0.97);
}

.eg-btn-small {
	min-height: 32px;
	padding: 0 12px;
	font-size: 0.8125rem;
}
.eg-btn-medium {
	min-height: 40px;
	padding: 0 16px;
	font-size: 0.875rem;
}
.eg-btn-large {
	min-height: 48px;
	padding: 0 24px;
	font-size: 1rem;
}

.eg-btn-fullwidth {
	width: 100%;
}

.eg-btn-filled.eg-btn-large {
	height: 56px;
}

.eg-btn-icon {
	font-size: 1.25em;
	line-height: 1;
}

/* ── Icon ── */

.eg-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	vertical-align: middle;
}

.eg-icon-small {
	font-size: 1.25rem;
	width: 1.25rem;
	height: 1.25rem;
}
.eg-icon-medium {
	font-size: 1.5rem;
	width: 1.5rem;
	height: 1.5rem;
}
.eg-icon-large {
	font-size: 2.25rem;
	width: 2.25rem;
	height: 2.25rem;
}

/* ── Icon Button ── */

.eg-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	padding: 8px;
	color: inherit;
	transition: background-color var(--eg-transition-fast);
}

.eg-icon-btn:hover {
	background-color: rgba(255, 255, 255, 0.08);
}

.eg-icon-btn-small {
	width: 32px;
	height: 32px;
}
.eg-icon-btn-medium {
	width: 40px;
	height: 40px;
}
.eg-icon-btn-large {
	width: 48px;
	height: 48px;
}

.eg-icon-btn .material-icons {
	font-size: 1.5rem;
}

/* ── Divider ── */

.eg-divider {
	border: 0;
	border-top: 1px solid var(--eg-palette-divider);
	margin: 0;
	width: 100%;
}

/* ── Progress ── */

.eg-progress {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.eg-progress-ring {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 3px solid currentColor;
	border-top-color: transparent;
	animation: eg-spin 0.8s linear infinite;
}

.eg-progress-small {
	width: 20px;
	height: 20px;
}
.eg-progress-medium {
	width: 32px;
	height: 32px;
}
.eg-progress-large {
	width: 48px;
	height: 48px;
}

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

/* ── Tabs ── */

.eg-tabs-toolbar {
	display: flex;
	background-color: var(--eg-palette-surface);
	border-radius: var(--eg-radius-lg);
	padding: 4px;
	gap: 4px;
}

.eg-tab {
	flex: 1;
	background: transparent;
	border: none;
	border-radius: var(--eg-radius-lg);
	padding: 8px 12px;
	color: var(--eg-palette-text-secondary);
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition:
		background-color var(--eg-transition-fast),
		color var(--eg-transition-fast);
	white-space: nowrap;
}

.eg-tab:hover {
	color: var(--eg-palette-text-primary);
}

.eg-tab-active {
	background-color: rgba(255, 107, 53, 0.12);
	color: var(--eg-palette-primary) !important;
}

.eg-tabs-body {
	margin-top: 8px;
}

/* ── Chip ── */

.eg-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border-radius: var(--eg-radius-pill);
	white-space: nowrap;
	font-weight: 500;
}

.eg-chip-small {
	height: 24px;
	padding: 0 10px;
	font-size: 0.75rem;
}
.eg-chip-medium {
	height: 32px;
	padding: 0 12px;
	font-size: 0.8125rem;
}
.eg-chip-outlined {
	border: 1px solid;
}

/* ── Expansion Panels ── */

.eg-expansion-panels {
	border-radius: var(--eg-radius-lg);
	overflow: hidden;
	border: 1px solid var(--eg-palette-divider);
}

.eg-expansion-panel {
	background-color: var(--eg-palette-surface);
	border-bottom: 1px solid var(--eg-palette-divider);
	transition: background-color var(--eg-transition-fast);
}

.eg-expansion-panel:last-child {
	border-bottom: none;
}

.eg-expansion-panel-header {
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.eg-expansion-panel-expanded .expand-icon {
	transform: rotate(180deg);
}

.eg-expansion-panel-content {
	animation: eg-fade-in 200ms ease;
}

@keyframes eg-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* ── Snackbar ── */

.eg-snackbar-provider {
	position: fixed;
	bottom: calc(var(--eg-bottom-nav-height) + 8px + var(--eg-safe-area-bottom));
	left: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	z-index: 5000;
	pointer-events: none;
}

.eg-snackbar {
	pointer-events: auto;
	display: flex;
	align-items: center;
	gap: 12px;
	background-color: var(--eg-palette-surface-accent);
	color: var(--eg-palette-text-primary);
	border-radius: var(--eg-radius-lg);
	padding: 12px 16px;
	box-shadow: var(--eg-shadow-elevated);
	min-width: 280px;
	max-width: 90vw;
	animation: eg-snackbar-in 200ms ease;
}

.eg-snackbar-error {
	border-left: 4px solid var(--eg-palette-error);
}
.eg-snackbar-success {
	border-left: 4px solid var(--eg-palette-success);
}
.eg-snackbar-warning {
	border-left: 4px solid var(--eg-palette-warning);
}
.eg-snackbar-info {
	border-left: 4px solid var(--eg-palette-info);
}

.eg-snackbar-message {
	flex: 1;
	font-size: 0.875rem;
}

.eg-snackbar-action {
	background: transparent;
	border: none;
	color: var(--eg-palette-primary);
	font-weight: 600;
	cursor: pointer;
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.05em;
}

.eg-snackbar-close {
	background: transparent;
	border: none;
	color: var(--eg-palette-text-secondary);
	cursor: pointer;
	display: inline-flex;
	padding: 2px;
}

.eg-snackbar-close .material-icons {
	font-size: 1.125rem;
}

@keyframes eg-snackbar-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
