/* EP Updates — Internal Documentation */

/* Dark theme (default) */
:root, [data-theme="dark"] {
	--bg: #0f1117;
	--surface: #1a1d27;
	--surface-alt: #222633;
	--border: #2d3145;
	--text: #c9cdd8;
	--text-muted: #7e8494;
	--heading: #e4e7ef;
	--accent: #6c8aff;
	--accent-hover: #8aa3ff;
	--code-bg: #161922;
	--success: #4caf8b;
	--warning: #e0a050;
	--danger: #d45656;
	--foundation: #4caf8b;
	--business: #6c8aff;
	--commerce: #b06cff;
	--professional: #e0a050;
}

/* Light theme */
[data-theme="light"] {
	--bg: #f5f6f8;
	--surface: #ffffff;
	--surface-alt: #eef0f4;
	--border: #d5d8e0;
	--text: #333840;
	--text-muted: #6b7280;
	--heading: #1a1d27;
	--accent: #4a6adf;
	--accent-hover: #3a56c4;
	--code-bg: #ebedf2;
	--success: #2d8a64;
	--warning: #b07828;
	--danger: #c03030;
	--foundation: #2d8a64;
	--business: #4a6adf;
	--commerce: #8a4abf;
	--professional: #b07828;
}

/* Theme toggle */
.theme-toggle {
	position: fixed;
	top: 1rem;
	right: 1rem;
	width: 2.4rem;
	height: 2.4rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
	line-height: 1;
	transition: border-color 0.2s, background 0.2s;
	z-index: 100;
	padding: 0;
	color: var(--text-muted);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--heading); }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.7;
	padding: 2rem 1rem;
}
.container { max-width: 860px; margin: 0 auto; }
h1, h2, h3, h4 { color: var(--heading); font-weight: 600; }
h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 1rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.15rem; margin: 1.8rem 0 0.6rem; }
h4 { font-size: 1rem; margin: 1.2rem 0 0.4rem; }
p { margin-bottom: 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
.subtitle { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 2rem; }

/* Navigation */
nav.breadcrumb { margin-bottom: 1.5rem; font-size: 0.9rem; color: var(--text-muted); }
nav.breadcrumb a { color: var(--text-muted); }
nav.breadcrumb a:hover { color: var(--accent); }

/* TOC cards */
.toc-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin: 1.5rem 0;
}
.toc-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1.2rem 1.5rem;
	transition: border-color 0.2s;
}
.toc-card:hover { border-color: var(--accent); }
.toc-card h3 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.toc-card h3 a { color: var(--heading); }
.toc-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* Tables */
table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0 1.5rem;
	font-size: 0.9rem;
}
th, td {
	padding: 0.6rem 0.8rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
}
th { color: var(--heading); background: var(--surface); font-weight: 600; }
tr:hover td { background: var(--surface); }

/* Code */
code {
	font-family: "SF Mono", "Fira Code", Consolas, monospace;
	font-size: 0.85em;
	background: var(--code-bg);
	padding: 0.15em 0.4em;
	border-radius: 3px;
	color: var(--accent);
}
pre {
	background: var(--code-bg);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 1rem 1.2rem;
	overflow-x: auto;
	margin: 1rem 0 1.5rem;
	font-size: 0.85rem;
	line-height: 1.6;
	position: relative;
}
pre code { background: none; padding: 0; color: var(--text); }

/* Copy button */
.copy-btn {
	position: absolute;
	top: 0.4rem;
	right: 0.4rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text-muted);
	font-size: 0.7rem;
	padding: 0.2rem 0.5rem;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s, color 0.2s, border-color 0.2s;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.4;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--heading); border-color: var(--accent); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

/* Callout boxes */
.callout {
	border-left: 3px solid var(--accent);
	background: var(--surface);
	padding: 0.8rem 1.2rem;
	margin: 1rem 0 1.5rem;
	border-radius: 0 6px 6px 0;
	font-size: 0.9rem;
}
.callout.warning { border-left-color: var(--warning); }
.callout.danger { border-left-color: var(--danger); }
.callout.success { border-left-color: var(--success); }
.callout strong { color: var(--heading); }

/* Tier badges */
.tier {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.15em 0.5em;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.tier.foundation { background: rgba(76,175,139,0.15); color: var(--foundation); }
.tier.business { background: rgba(108,138,255,0.15); color: var(--business); }
.tier.commerce { background: rgba(176,108,255,0.15); color: var(--commerce); }
.tier.professional { background: rgba(224,160,80,0.15); color: var(--professional); }

/* Lists */
ul, ol { margin: 0.5rem 0 1rem 1.5rem; }
li { margin-bottom: 0.3rem; }
li > ul, li > ol { margin: 0.2rem 0 0.2rem 1.5rem; }

/* Horizontal rule */
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* Step boxes */
.step {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1.2rem 1.5rem;
	margin: 1rem 0;
	position: relative;
	padding-left: 3.5rem;
}
.step-number {
	position: absolute;
	left: 1rem;
	top: 1.2rem;
	width: 1.8rem;
	height: 1.8rem;
	background: var(--accent);
	color: var(--bg);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.85rem;
}

/* Flow diagram */
.flow {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin: 1rem 0 1.5rem;
	font-size: 0.9rem;
}
.flow-box {
	background: var(--surface);
	border: 1px solid var(--border);
	padding: 0.4rem 0.8rem;
	border-radius: 6px;
}
.flow-arrow { color: var(--text-muted); }

/* Footer */
footer {
	margin-top: 3rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
	font-size: 0.8rem;
	color: var(--text-muted);
}

@media (min-width: 640px) {
	body { padding: 3rem 2rem; }
	.toc-grid { grid-template-columns: 1fr 1fr; }
}
