:root {
	--bg: #f9f6f0;
	--ink: #111;
	--muted: #555;
	--accent: #c7a17a;
	--line: #e5e0d5;
	--panel: #f0ebdf;
	--correct: #5e8c6a;
	--wrong: #b5544a;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 8px 24px rgba(17, 17, 17, 0.05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
	font-family: 'DM Sans', sans-serif;
	background: var(--bg);
	color: var(--ink);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif { font-family: 'Cormorant Garamond', serif; font-weight: 400; }
h1 { font-size: 2.6rem; line-height: 1.1; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }
a { color: inherit; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Header + logo (from dashboard.html) */
header { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; background: var(--bg); position: sticky; top: 0; z-index: 30; }
.logo { display: flex; align-items: center; gap: 1rem; width: max-content; color: inherit; text-decoration: none; }
.logo .mark { width: 48px; overflow: visible; }
.logo .word { display: flex; flex-direction: column; gap: 0.2em; }
.logo .name { font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; line-height: 0.95; }
.logo .sub { font-size: 0.52rem; font-weight: 500; letter-spacing: 0.22em; color: var(--accent); white-space: nowrap; }
.orbit { transition: stroke-width 0.8s; }
.nuc { transform-box: fill-box; transform-origin: center; transition: transform 0.9s; }
.hot .orbit-a { stroke-width: 2.1; }
.hot .orbit-b { stroke-width: 1.5; }
.hot .nuc { transform: scale(1.08); }
.header-stats { margin-left: auto; display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; color: var(--muted); }
.header-stats strong { color: var(--ink); font-weight: 500; }

/* Layout + nav */
.layout { flex: 1; display: flex; align-items: stretch; }
nav { width: 220px; padding: 1.25rem 1rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.15rem; flex-shrink: 0; }
nav a { color: var(--muted); text-decoration: none; padding: 0.75rem 0.75rem; border-radius: 8px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; min-height: 44px; display: flex; align-items: center; }
nav a:hover, nav a:focus-visible { color: var(--ink); background: var(--panel); }
nav a.active { color: var(--ink); border-left: 2px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--panel); }
main { flex: 1; padding: 1.5rem 1.25rem 4rem; max-width: 980px; }
@media (max-width: 700px) {
	.layout { flex-direction: column; }
	nav { width: 100%; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 0.5rem 0.75rem; gap: 0.1rem; }
	nav a { min-height: 40px; padding: 0.5rem 0.6rem; font-size: 0.75rem; }
	main { padding: 1.25rem 1rem 4rem; }
	h1 { font-size: 2.1rem; }
}

/* Buttons + forms */
.btn {
	font: inherit;
	cursor: pointer;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--ink);
	border-radius: 999px;
	padding: 0.8rem 1.4rem;
	min-height: 48px;
	transition: background 0.15s, border-color 0.15s, transform 0.05s;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}
.btn:hover, .btn:focus-visible { background: var(--panel); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { background: #000; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel); color: var(--ink); }
.btn.wide { width: 100%; }
.btn.small { padding: 0.45rem 0.9rem; min-height: 38px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.hero { font-size: 1.25rem; padding: 1.2rem 2rem; min-height: 64px; font-family: 'Cormorant Garamond', serif; }

input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 0.9rem; min-height: 48px; width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0.9rem 0 0.35rem; }
.field-error { color: var(--wrong); font-size: 0.85rem; margin-top: 0.5rem; min-height: 1.2em; }

/* Cards + layout utilities */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: 1fr; }
.grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.section-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 1.75rem 0 0.75rem; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
.pill { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.75rem; font-size: 0.85rem; background: #fff; }
.pill.correct { color: var(--correct); border-color: color-mix(in srgb, var(--correct) 45%, var(--line)); }
.pill.wrong { color: var(--wrong); border-color: color-mix(in srgb, var(--wrong) 45%, var(--line)); }

/* Hero / dashboard */
.hero-card { background: linear-gradient(180deg, #fff, #fdfbf7); }
.goal-ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.goal-ring svg { transform: rotate(-90deg); }
.goal-ring .pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--accent); display: inline-block; }
.dots i.on { background: var(--accent); }
.ring-wrap { display: flex; align-items: center; gap: 0.75rem; }
.ring { position: relative; width: 54px; height: 54px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: var(--muted); }

/* Learn path */
.unit-card { margin-bottom: 1rem; }
.skill-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 0.25rem; border-top: 1px solid var(--line); text-decoration: none; color: inherit; border-radius: 8px; }
.skill-row:hover { background: #fdfbf7; }
.skill-row .skill-name { flex: 1; min-width: 0; }
.skill-row .skill-name b { display: block; font-weight: 500; }
.skill-row.next { background: #fdf7ef; box-shadow: inset 3px 0 0 var(--accent); }
.skill-row .chev { color: var(--muted); }
.tag { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.5rem; }
.tag.senior { color: var(--accent); border-color: var(--accent); }

/* Session runner */
.runner { position: fixed; inset: 0; background: var(--bg); z-index: 60; display: flex; flex-direction: column; overflow-y: auto; }
.runner-head { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.seg-bar { display: flex; gap: 5px; flex: 1; }
.seg-bar span { flex: 1; height: 7px; border-radius: 999px; background: var(--line); }
.seg-bar span.done { background: var(--accent); }
.seg-bar span.now { background: var(--ink); }
.icon-btn { border: 0; background: transparent; font-size: 1.3rem; cursor: pointer; min-width: 48px; min-height: 48px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--panel); color: var(--ink); }
.runner-body { width: 100%; max-width: 640px; margin: 0 auto; padding: 1.25rem 1.25rem 8rem; flex: 1; }
.q-prompt { font-size: 1.15rem; line-height: 1.7; margin: 0.5rem 0 1rem; }
.q-prompt .katex-display { margin: 0.6em 0; overflow-x: auto; overflow-y: hidden; }
.diagram svg { max-width: 100%; height: auto; }
.answer-row { display: flex; gap: 0.5rem; align-items: stretch; }
.answer-row input { font-size: 1.2rem; }
.choice-list { display: flex; flex-direction: column; gap: 0.6rem; }
.choice { text-align: left; justify-content: flex-start; font-size: 1.05rem; }
.choice.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.helper-row { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }
.helper-row button { font: inherit; min-width: 48px; min-height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 9px; cursor: pointer; }
.helper-row button:hover { background: var(--panel); }
.exact-note { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.hint-box { background: #fbf7ef; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 0.85rem 1rem; margin-top: 0.75rem; }
.hint-box .small { color: var(--muted); }
.feedback { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; border-top: 1px solid var(--line); background: #fff; padding: 1rem 1.25rem 1.25rem; box-shadow: 0 -8px 30px rgba(17, 17, 17, 0.08); animation: slideUp 0.25s ease; max-height: 80vh; overflow-y: auto; }
.feedback .inner { max-width: 640px; margin: 0 auto; }
.feedback.good { border-top: 3px solid var(--correct); }
.feedback.bad { border-top: 3px solid var(--wrong); }
.feedback h3 { font-size: 1.35rem; }
.feedback.good h3 { color: var(--correct); }
.feedback.bad h3 { color: var(--wrong); }
.solution { margin-top: 0.6rem; }
.solution .step { padding: 0.3rem 0; }
.chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.runner-footer { position: fixed; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 1rem 1.25rem 1.25rem; z-index: 5; }
.runner-footer .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 0.75rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 500; }
.timer.low { color: var(--wrong); }

/* Progress page */
.strip { display: flex; gap: 3px; align-items: flex-end; height: 64px; }
.strip span { flex: 1; background: var(--line); border-radius: 3px 3px 0 0; min-width: 4px; }
.strip span.on { background: var(--accent); }
.bars { display: flex; gap: 3px; align-items: flex-end; height: 90px; }
.bars span { flex: 1; background: var(--panel); border-radius: 3px 3px 0 0; min-width: 4px; position: relative; }
.bars span b { position: absolute; top: -1.2em; font-size: 0.6rem; font-weight: 400; color: var(--muted); }

/* Moves page */
.move-card .move-title { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; }
.move-card.locked { opacity: 0.55; }
.trap { border-left: 3px solid var(--wrong); padding-left: 0.75rem; color: var(--muted); }
.example { background: #fdfbf7; border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem 1rem; }

/* Login */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.login-card { width: 100%; max-width: 420px; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 0.5rem; }
.tabs button { font: inherit; flex: 1; border: 0; background: transparent; padding: 0.75rem; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; min-height: 48px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 0.75rem 1.25rem; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 100; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--wrong); }

.hidden { display: none !important; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
