/* Curriculum LMS — front-end styles
 * Minimal, mobile-first. Gold accent matches the CCM design language.
 */
:root {
	--am-gold: #d4af37;
	--am-ink: #1a1a1a;
	--am-muted: #6b6b6b;
	--am-line: #e4e0d6;
	--am-bg-card: #ffffff;
}

.am-dashboard,
.am-catalogue,
.am-course-outline {
	max-width: 820px;
	margin: 0 auto;
}

.am-dash-title {
	margin-bottom: 1.2rem;
}

/* Buttons */
.am-btn {
	display: inline-block;
	padding: 0.6rem 1.3rem;
	border: 1px solid var(--am-line);
	border-radius: 4px;
	background: #fff;
	color: var(--am-ink);
	text-decoration: none;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.08s ease, box-shadow 0.15s ease;
}

.am-btn:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
	transform: translateY(-1px);
}

.am-btn-gold {
	background: var(--am-gold);
	border-color: var(--am-gold);
	color: var(--am-ink);
}

.am-btn.is-loading {
	opacity: 0.6;
	cursor: progress;
}

/* Course cards (dashboard) */
.am-course-card,
.am-catalogue-card {
	background: var(--am-bg-card);
	border: 1px solid var(--am-line);
	border-radius: 8px;
	padding: 1.4rem 1.6rem;
	margin-bottom: 1.2rem;
}

.am-progress-bar {
	height: 10px;
	background: var(--am-line);
	border-radius: 6px;
	overflow: hidden;
	margin: 0.6rem 0 0.3rem;
}

.am-progress-bar span {
	display: block;
	height: 100%;
	background: var(--am-gold);
	transition: width 0.3s ease;
}

.am-progress-label {
	font-size: var(--cb-t1);
	color: var(--am-muted);
	margin: 0 0 1rem;
}

/* Course outline (lesson list) */
.am-module-title {
	border-bottom: 2px solid var(--am-gold);
	padding-bottom: 0.3rem;
	margin-top: 1.6rem;
}

.am-lesson-list {
	list-style: none;
	margin: 0.6rem 0;
	padding: 0;
}

.am-lesson-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--am-line);
}

.am-lesson-status {
	color: var(--am-gold);
	font-weight: 700;
	width: 1.2em;
	text-align: center;
}

.am-lesson-item.is-complete a {
	color: var(--am-muted);
}

.am-lesson-dur {
	margin-left: auto;
	font-size: var(--cb-t1);
	color: var(--am-muted);
}

/* Catalogue */
.am-catalogue {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.2rem;
}

.am-cat-price {
	font-weight: 700;
	color: var(--am-gold);
}

/* Lesson UI */
.am-webapp-slot {
	margin: 2rem 0;
}

.am-webapp-frame {
	min-height: 420px;
}

.am-complete-lesson {
	margin: 2.4rem 0;
	text-align: center;
}

.am-done-badge {
	display: inline-block;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	background: #eef7ee;
	color: #1f7a1f;
	font-weight: 600;
}

.am-locked-notice {
	background: #fff8e6;
	border: 1px solid var(--am-gold);
	border-radius: 6px;
	padding: 0.9rem 1.2rem;
	margin-bottom: 1.4rem;
	font-weight: 600;
}

.am-empty {
	color: var(--am-muted);
	font-style: italic;
}

/* ============================================================
 * `color-scheme` FOLLOWS THE READER SWITCH, NOT THE THEME'S.
 * Reader-chrome ride-along, 5 Aug 2026. Closes the divergence the
 * Two-Switches Reconciliation named and deliberately left open
 * (TWO-SWITCHES-HANDOFF §6, MASTER §4a).
 *
 * The estate has two scheme switches. `html[data-theme]` governs the theme,
 * and `theme/cognition-theme/style.css` declares `color-scheme: dark` there.
 * `body.cb-dark` / `body.cb-light` governs the LMS reader surfaces, and inside
 * `.am-focus` the two-switches card made it the ONLY authority — `data-theme`
 * was made inert for colour there.
 *
 * `color-scheme` was never moved with it. So a reader could be authoritatively
 * dark (`body.cb-dark`) while the UA was still rendering every form control,
 * every scrollbar and every default control metric for the LIGHT scheme,
 * because `<html>` said `data-theme="light"` — a mismatch the student sees as
 * a light scrollbar down a dark lesson and a control that measures a pixel or
 * two differently from the same control on the other scheme.
 *
 * `color-scheme` is inherited, and these declarations sit on `body`, which is
 * a descendant of the `<html>` rule — so no specificity contest arises: the
 * nearer declaration simply wins for the body subtree, and everything outside
 * an LMS page (where neither class exists) is untouched.
 *
 * THIS FILE, not focus.css or design.css, because `body.cb-*` comes from TWO
 * independent sources — `AM_Focus_Mode::body_class` (focus lessons + shell
 * routes) and `AM_Design::body_class` (LMS shell routes) — and neither of
 * their stylesheets covers both. `frontend.css` is the dependency of both and
 * is therefore the one stylesheet guaranteed present wherever these classes
 * are. The selectors are scoped to the classes, so breadth of enqueue costs
 * nothing.
 * ============================================================ */
body.cb-dark { color-scheme: dark; }
body.cb-light { color-scheme: light; }

/* ============================================================
 * THE WORK-STORE REFUSAL — 14 Sep 2026.
 *
 * 🔴 WHAT THIS STYLES, AND WHY IT IS ALLOWED TO BE LOUD. Until today, a save
 * that crossed the store's cap deleted the student's OLDEST answer and
 * returned `200 {success:true}`. The store now refuses instead, and this is
 * the only thing on the page that tells them. It sits directly under the
 * control they were typing in.
 *
 * It is deliberately not a "toast" and not a top-of-page banner: a lesson can
 * be several screens long and the student is looking at ONE box.
 *
 * `currentColor`-free, both schemes handled explicitly, because `body.cb-dark`
 * and `body.cb-light` are set by two independent sources and this file is the
 * one stylesheet guaranteed present wherever they are (see the block above).
 * ============================================================ */
.am-work-refused {
	margin: 0.5rem 0 0;
	padding: 0.6rem 0.75rem;
	border-left: 3px solid #b42318;
	background: #fef3f2;
	color: #7a271a;
	/* 🔴 TOKENS, NOT NUMBERS — and `test-type-system.mjs` caught me writing
	   numbers. The first cut of this rule carried `font-size: 0.9375rem` and
	   `line-height: 1.45`, and three of that suite's censuses went red at once:
	   a hard-coded size, a hard-coded line-height, and — the one that matters —
	   "declared sizes under the 16px floor", whose own message is Kevin's
	   ruling: *"There should be no fine print. This is a course."* A message
	   telling a student their work did not save is the last text on the page
	   that should be set smaller than the prose around it. */
	font-size: var(--cb-t1);
	line-height: var(--cb-lh-block);
	border-radius: 0 3px 3px 0;
}
.am-work-refused--page {
	margin-top: 1.5rem;
}
body.cb-dark .am-work-refused {
	background: #2d1513;
	color: #fda29b;
	border-left-color: #f04438;
}
/* LIGHT1: follows the LIGHT/DARK toggle on <html>, never the OS. */
html[data-theme="dark"] body:not(.cb-light) .am-work-refused {
	background: #2d1513;
	color: #fda29b;
	border-left-color: #f04438;
}

/* BONUS1 — an optional («Bonus») module in the course outline. */
.am-module .am-optional-tag {
	display: inline-block;
	margin-left: 0.5em;
	padding: 0 0.45em;
	border: 1px solid currentColor;
	border-radius: 999px;
	opacity: 0.75;
	vertical-align: middle;
}
