/* Appearance panel + light/dark theme tokens */

:root {
	--header-bg: rgba(255, 255, 255, 0.95);
	--surface: #ffffff;
	--surface-muted: #f8fafc;
	--font-size-base: 16px;
}

[data-theme="dark"] {
	--text: #e2e8f0;
	--text-muted: #94a3b8;
	--bg: #0b1220;
	--bg-soft: #111827;
	--bg-hero: linear-gradient(135deg, #0b1220 0%, #1e293b 48%, #0f172a 100%);
	--border: #334155;
	--shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
	--shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
	--brand: #60a5fa;
	--brand-light: #38bdf8;
	--brand-dark: #1e40af;
	--header-bg: rgba(11, 18, 32, 0.92);
	--surface: #1e293b;
	--surface-muted: #0f172a;
	--surface-card: #1e293b;
	--heading-color: #f1f5f9;
	--section-gradient: linear-gradient(180deg, #0b1220 0%, #1e293b 50%, #0b1220 100%);
	--page-hero-colorful: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #0f172a 100%);
	--workflow-detail-bg: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
	--workflow-detail-border: #334155;
	--workflow-inactive-node: linear-gradient(135deg, #475569, #334155);
	--workflow-arrow: #475569;
	--accordion-surface: #1e293b;
	--accordion-trigger-end: #1e293b;
	--salient-sovereignty-bg: linear-gradient(135deg, #064e3b 0%, #1e293b 100%);
	--control-bg: #1e293b;
	--control-bg-hover: #334155;
	--control-border-hover: #475569;
	--nav-drawer-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
	--nav-link-hover-bg: #334155;
	--nav-link-active-bg: linear-gradient(90deg, #1e3a5f, #1e293b);
	--nav-link-active-border: #3b82f6;
	--badge-bg: #1e293b;
	--feature-tag-bg: #1e3a5f;
	--pdf-modal-header: linear-gradient(90deg, #1e3a5f, #1e293b);
	--card-icon-mix: #0f172a;
	color-scheme: dark;
}

[data-theme="dark"] .site-header {
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

[data-theme="dark"] .site-nav {
	border-top-color: var(--border);
}

[data-theme="dark"] .site-nav__links a:hover,
[data-theme="dark"] .nav-toggle:hover {
	background: var(--nav-link-hover-bg);
	border-color: var(--control-border-hover);
}

[data-theme="dark"] .site-nav__links a.is-active {
	background: var(--nav-link-active-bg);
	border-color: var(--nav-link-active-border);
}

[data-theme="dark"] .nav-toggle {
	background: var(--control-bg);
}

[data-theme="dark"] .feature-card,
[data-theme="dark"] .salient-card,
[data-theme="dark"] .portal-card,
[data-theme="dark"] .feature-checklist__col {
	--card-shadow: 0 1px 2px rgba(0, 0, 0, 0.2),
		0 6px 16px rgba(0, 0, 0, 0.25),
		0 16px 32px color-mix(in srgb, var(--card-accent, var(--brand)) 15%, transparent);
	--card-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.22),
		0 10px 24px rgba(0, 0, 0, 0.32),
		0 24px 48px color-mix(in srgb, var(--card-accent, var(--brand)) 22%, transparent);
	background: linear-gradient(
		165deg,
		color-mix(in srgb, var(--surface) 88%, #ffffff 4%) 0%,
		var(--surface) 45%,
		color-mix(in srgb, var(--surface) 94%, var(--card-accent, var(--brand)) 6%) 100%
	);
	border-color: color-mix(in srgb, var(--border) 75%, var(--card-accent, var(--brand)) 25%);
}

[data-theme="dark"] .salient-card--sovereignty {
	background: linear-gradient(
		165deg,
		color-mix(in srgb, #064e3b 35%, var(--surface) 65%) 0%,
		var(--surface) 50%,
		color-mix(in srgb, var(--surface) 94%, #10b981 6%) 100%
	);
}

[data-theme="dark"] .feature-card::before,
[data-theme="dark"] .salient-card::before,
[data-theme="dark"] .portal-card::before,
[data-theme="dark"] .feature-checklist__col::before {
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 42%);
	opacity: 1;
}

[data-theme="dark"] .testimonial,
[data-theme="dark"] .pricing-card,
[data-theme="dark"] .mock-dashboard,
[data-theme="dark"] .accordion-item {
	background: var(--surface);
	border-color: var(--border);
}

[data-theme="dark"] .feature-card__icon {
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.12),
		inset 0 -2px 6px rgba(0, 0, 0, 0.35),
		0 4px 12px color-mix(in srgb, var(--card-accent, var(--brand)) 28%, transparent);
}

[data-theme="dark"] a {
	color: var(--brand-light);
}

[data-theme="dark"] a:hover {
	color: #7dd3fc;
}

[data-theme="dark"] .site-nav__links a {
	color: var(--text-muted);
}

[data-theme="dark"] .site-nav__links a:hover,
[data-theme="dark"] .site-nav__links a.is-active {
	color: var(--brand-light);
}

[data-theme="dark"] .feature-highlight {
	background: var(--surface);
	border-color: var(--border);
	color: var(--text);
}

[data-theme="dark"] .feature-highlight:nth-child(6n+1) { border-color: #3b82f6; color: #93c5fd; background: #1e3a5f; }
[data-theme="dark"] .feature-highlight:nth-child(6n+2) { border-color: #8b5cf6; color: #c4b5fd; background: #2e1065; }
[data-theme="dark"] .feature-highlight:nth-child(6n+3) { border-color: #06b6d4; color: #67e8f9; background: #164e63; }
[data-theme="dark"] .feature-highlight:nth-child(6n+4) { border-color: #f59e0b; color: #fcd34d; background: #422006; }
[data-theme="dark"] .feature-highlight:nth-child(6n+5) { border-color: #ec4899; color: #f9a8d4; background: #500724; }
[data-theme="dark"] .feature-highlight:nth-child(6n+6) { border-color: #10b981; color: #6ee7b7; background: #064e3b; }

[data-theme="dark"] .page-hero--colorful::before {
	background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.08), transparent 50%),
	            radial-gradient(circle at 80% 30%, rgba(139, 92, 246, 0.06), transparent 45%);
}

[data-theme="dark"] .accordion-trigger {
	background: linear-gradient(90deg, color-mix(in srgb, var(--acc-color, var(--brand)) 22%, var(--surface)), var(--surface) 65%);
}

[data-theme="dark"] .accordion-trigger:hover {
	filter: none;
	background: linear-gradient(90deg, color-mix(in srgb, var(--acc-color, var(--brand)) 30%, var(--surface)), var(--surface-muted) 65%);
}

[data-theme="dark"] .accordion-chevron {
	background: rgba(255, 255, 255, 0.08);
	color: var(--text-muted);
}

[data-theme="dark"] .workflow-step__label {
	color: var(--text-muted);
}

[data-theme="dark"] .workflow-step.is-active .workflow-step__label,
[data-theme="dark"] .workflow-step:hover .workflow-step__label {
	color: var(--brand-light);
}

[data-theme="dark"] .workflow-detail {
	color: var(--text);
}

[data-theme="dark"] .feature-detail__tag {
	background: var(--feature-tag-bg);
	color: var(--brand-light);
}

[data-theme="dark"] .pdf-modal__close:hover {
	background: #450a0a;
	color: #fca5a5;
	border-color: #7f1d1d;
}

[data-theme="dark"] .mock-stat {
	background: var(--surface-muted);
}

[data-theme="dark"] .btn-outline {
	color: var(--brand-light);
	border-color: var(--brand-light);
}

[data-theme="dark"] .btn-outline:hover {
	background: var(--brand);
	color: #fff;
}

[data-theme="dark"] .site-logo img {
	filter: brightness(0) invert(1);
	opacity: 0.95;
}

[data-theme="dark"] .cta-band {
	background: linear-gradient(135deg, #020617, #1e3a5f);
}

[data-theme="dark"] .tabs__btn {
	background: var(--surface);
	border-color: var(--border);
	color: var(--text-muted);
}

[data-theme="dark"] .tabs__btn.is-active,
[data-theme="dark"] .tabs__btn:hover {
	background: var(--brand);
	color: #fff;
}

[data-theme="dark"] .hero h1,
[data-theme="dark"] .page-hero h1,
[data-theme="dark"] .section__header h2,
[data-theme="dark"] .tab-content__text h3,
[data-theme="dark"] .feature-card h3,
[data-theme="dark"] .salient-card h3,
[data-theme="dark"] .portal-card h3,
[data-theme="dark"] .feature-detail h2,
[data-theme="dark"] .faq-item h3,
[data-theme="dark"] .pricing-card h3 {
	color: var(--heading-color);
}

html {
	font-size: var(--font-size-base);
}

/* Fixed right-edge appearance tab (IX Directory style) */
.appearance-tab {
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: 118;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 0.85rem;
	width: 38px;
	min-height: 148px;
	padding: 1.1rem 0 1.25rem;
	border: none;
	border-radius: 15px 0 0 15px;
	background: #2b65e2;
	box-shadow: -3px 0 14px rgba(43, 101, 226, 0.28);
	color: #0a1628;
	cursor: pointer;
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.appearance-tab:hover {
	background: #2558c8;
}

.appearance-tab.is-panel-open {
	transform: translateY(-50%) translateX(110%);
	opacity: 0;
	pointer-events: none;
}

.appearance-tab__icon-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}

.appearance-tab__icon-wrap svg {
	display: block;
	width: 22px;
	height: 22px;
}

.appearance-tab__label {
	display: block;
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.11em;
	line-height: 1;
	color: #0a1628;
	text-transform: uppercase;
	user-select: none;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	white-space: nowrap;
	margin-top: 0.15rem;
}

/* Overlay + panel */
.appearance-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	backdrop-filter: blur(2px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
	z-index: 119;
	pointer-events: none;
}

.appearance-overlay.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.appearance-panel {
	position: fixed;
	top: 0;
	right: 0;
	width: min(380px, 100vw);
	height: 100vh;
	height: 100dvh;
	background: var(--surface);
	border-left: 1px solid var(--border);
	box-shadow: -16px 0 48px rgba(15, 23, 42, 0.18);
	transform: translateX(100%);
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
	z-index: 120;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.appearance-panel.is-open {
	transform: translateX(0);
}

.appearance-panel__header {
	padding: 1.25rem 1.25rem 1rem;
	border-bottom: 1px solid var(--border);
	background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
	flex-shrink: 0;
}

.appearance-panel__header-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
}

.appearance-panel__header h2 {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--text);
}

.appearance-panel__header p {
	margin: 0.25rem 0 0;
	font-size: 0.82rem;
	color: var(--text-muted);
}

.appearance-panel__close {
	width: 36px;
	height: 36px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface-muted);
	color: var(--text-muted);
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
}

.appearance-panel__close:hover {
	color: var(--text);
	border-color: var(--brand-light);
}

.appearance-panel__body {
	flex: 1;
	overflow-y: auto;
	padding: 1.15rem 1.25rem 1.5rem;
}

.appearance-section {
	margin-bottom: 1.35rem;
}

.appearance-section__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.65rem;
}

.appearance-section__title {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.appearance-section__title--theme { color: #0ea5e9; }
.appearance-section__title--font { color: #8b5cf6; }
.appearance-section__title--scale { color: #14b8a6; }

.appearance-pill {
	font-size: 0.68rem;
	font-weight: 700;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: var(--surface-muted);
	border: 1px solid var(--border);
	color: var(--text-muted);
}

.appearance-pill--theme { color: #b45309; background: #fffbeb; border-color: #fcd34d; }
.appearance-pill--font { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.appearance-pill--scale { color: #0f766e; background: #ecfdf5; border-color: #99f6e4; }

[data-theme="dark"] .appearance-pill--theme { background: #422006; border-color: #92400e; color: #fcd34d; }
[data-theme="dark"] .appearance-pill--font { background: #2e1065; border-color: #6d28d9; color: #ddd6fe; }
[data-theme="dark"] .appearance-pill--scale { background: #042f2e; border-color: #0f766e; color: #5eead4; }

.appearance-theme-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.65rem;
}

.appearance-theme-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
	padding: 0.85rem;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface-muted);
	cursor: pointer;
	text-align: left;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.appearance-theme-card:hover {
	border-color: #93c5fd;
}

.appearance-theme-card.is-active {
	border-color: #3b82f6;
	box-shadow: 0 0 0 1px #3b82f6;
}

.appearance-theme-card__icon {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
}

.appearance-theme-card__icon--dark {
	background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.appearance-theme-card__icon--light {
	background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.appearance-theme-card strong {
	font-size: 0.88rem;
	color: var(--text);
}

.appearance-theme-card span {
	font-size: 0.72rem;
	color: var(--text-muted);
	line-height: 1.35;
}

.appearance-select {
	width: 100%;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface-muted);
	color: var(--text);
	font-size: 0.88rem;
	font-family: inherit;
}

.appearance-scale-slider {
	width: 100%;
	margin: 0.5rem 0 0.35rem;
	accent-color: #14b8a6;
}

.appearance-scale-marks {
	display: flex;
	justify-content: space-between;
	font-size: 0.68rem;
	color: var(--text-muted);
	margin-bottom: 0.65rem;
}

.appearance-scale-actions {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 0.5rem;
}

.appearance-scale-btn {
	padding: 0.55rem 0.5rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
}

.appearance-scale-btn:hover {
	border-color: #14b8a6;
	color: #0f766e;
}

.appearance-preview {
	margin-top: 0.25rem;
	padding: 1rem;
	border-radius: 12px;
	background: linear-gradient(135deg, #1e293b, #0f172a);
	border: 1px solid #334155;
}

.appearance-preview__label {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #64748b;
	margin-bottom: 0.5rem;
}

.appearance-preview__text {
	margin: 0;
	font-size: 1rem;
	line-height: 1.5;
	color: #e2e8f0;
}

.appearance-panel__footer {
	padding: 1rem 1.25rem 1.25rem;
	border-top: 1px solid var(--border);
	background: var(--surface-muted);
	flex-shrink: 0;
}

.appearance-panel__footer .btn {
	width: 100%;
	justify-content: center;
}

body.appearance-open {
	overflow: hidden;
}

@media (max-width: 991px) {
	.appearance-tab {
		top: auto;
		bottom: 5.5rem;
		right: 0;
		transform: none;
		width: auto;
		min-height: auto;
		flex-direction: row;
		align-items: center;
		padding: 0.55rem 0.7rem;
		gap: 0.45rem;
		border-radius: 12px 0 0 12px;
		z-index: 110;
	}

	.appearance-tab__label {
		writing-mode: horizontal-tb;
		transform: none;
		font-size: 0.58rem;
		letter-spacing: 0.08em;
		margin-top: 0;
	}
}

@media (max-width: 480px) {
	.appearance-tab {
		bottom: 4.75rem;
		padding: 0.5rem 0.6rem;
	}

	.appearance-tab__label {
		font-size: 0.54rem;
	}
}
